Gottfried in a Nutshell #8

Leibniz’s Enigma

In January 2021, divers made a sensational discovery at the bottom of the Baltic Sea near Schleimünde, in the Schleswig-Flensburg district: Hidden beneath mud and seaweed were six Enigma machines used in the Second World War.

The German Wehrmacht, in particular the navy, utilised these cipher machines to encode secret messages. The Enigma code (Greek for "riddle", "mystery") was considered unbreakable. Alan Turing, the genius British mathematician and cryptanalyst famous for cracking the code at Bletchley Park, probably expedited the end of the war by several years, therefore saving thousands of lives. In order to decipher the code, Turing analysed repetitive patterns of letters occurring in Nazi radio messages, such as "Wetter für die Nacht" (weather for the night) or "Heil Hitler" at the end of each message. The story is legendary.

However, undercover agents and intelligence services existed long before the 20th century. In the "République des Lettres", political espionage and plagiarism as well as the art of deceit and misinformation were quite common. In Leibniz's time, secret services in England, France or Germany known as "black chambers" (in French "cabinet noir") operated on behalf of their governments, systematically intercepting the correspondence of other diplomats. The agents opened, read and copied incoming or outbound letters, which were then resealed and returned to the postal service. As part of their everyday activities, they made use of their expertise in handling sealing wax and seals, as well as their cryptographic skills. In 1694, the first secret "black chamber" was established in the Duchy of Brunswick-Lüneburg. Leibniz was well aware that spies intercepted correspondence. "I saw first-hand what can happen to letters", he wrote, and advised his Chinese correspondent, that he should encode privileged information via alphabetic cyphers by using a keyword such as "LABYRINTHUS". He composed letters or papers that contained sensitive content and should not be traced back to him under a "nom de plume", such as "Wallendorp" or "de la Vallée". Leibniz also contemplated using numerical codes or invisible ink in order to ensure the privacy of his correspondence. He was not the only one resorting to such measures, since the royals' privacy too was occasionally at stake. In her passionate love letters to the dashing Count Philip Christoph von Königsmarck, Sophia Dorothea (married to Duke George Louis) preferred using cyphers when referring to protagonists at the Hanoverian court. However, the amorous letters were decoded and used as evidence of the forbidden affair, which ended tragically: Königsmarck was murdered, while Sophie Dorothea was exiled spending the rest of her life in the Castle of Ahlden. George Louis ascended the English throne (accompanied by his long-time mistress Ehrengard Melusine, Duchess of Schulenburg), and declared himself a widower.

Naturally, Leibniz was aware of the fact that manual encryption was quite unsafe, since monoalphabetic substitution ciphers only use one secret alphabet where each plain character is encoded via the same secret character. Leibniz had a fantastic idea: What if a machine could be used to create more complex encryptions? In notes prepared for an audience with Emperor Leopold I in 1688 in Vienna, he proposed building the world's first "Machina deciphratoria": "[It] is a smallish device that is easy to transport. With it, a great ruler can concurrently use many virtually unsolvable ciphers and correspond with many ministries. While both encipherment and decipherment is [ordinarily] quite laborious, there is [now] a facility enabling one to get at the requisite ciphers or alphabetic letters as easily as though one were playing on a clavichord or other instrument. The requisite [letters] will immediately emerge, and only need to be copied off." Just as the Enigma, Leibniz's cypher machine featured a keyboard ["claviocord"], while being easy to transport and easy to use. Moreover, it should "work in the same way" as the calculating machine invented by him. If one pursues this idea, a machine could use rotating drums (such as the stepped drum in the calculating machine) in order to encode each character in a different way, creating a polyalphabetic cipher. An ingenious approach, which was realised electromechanically in the Enigma machine. Rotatable drums are the core of this encoding mechanism. If a character is entered, the drums are twisted against each other in a certain way determined by their electric wiring, resulting in an encoded character. Since the position of the drums changes with each entry, characters such as "L" are always encoded with a different letter within the same text. Leibniz's cypher machine could have worked in a similar way. Today, a replica of the machine can be seen in the Leibniz Exhibition of Leibniz University Hannover and provides a glimpse into the beginnings of mechanical cryptography. Whether Leibniz's "machina deciphratoria" was actually used remains unclear.

Replica of Leibniz's cypher machine (Machina Deciphratoria) Replica of Leibniz's cypher machine (Machina Deciphratoria) Replica of Leibniz's cypher machine (Machina Deciphratoria) © Leibniz Universität Hannover
Leibniz’s cypher machine: Replica, Klaus Badur and Wolfgang Rottstedt, permanent loan of the Fritz Behrens Foundation in Hannover, Leibniz Exhibition, LUH. The letters of a secret message are encoded and decoded via polyalphabetic ciphers using six rows of letters each. Since the stepped drum has six axial positions with 12/10/8/6/4/0 teeth on six gear rims, the device can create 4,320 different ciphers.

But one thing is for certain - the machine was Leibniz's best kept secret, intended to be used by kings and emperors. The "black chamber" in London could certainly have used Leibniz's Enigma. It is believed that just before his death, Leibniz was in touch with one of their cryptographers. But this is top secret information!


Dr. Ariane Walsdorf
Communications and Marketing
Dr. Ariane Walsdorf
Communications and Marketing