1918 · Berlin - 1945 · Bletchley Park

DIE ENIGMA

A working replica of the German cipher machine that guarded the Wehrmacht's secrets, and the story of the mathematicians who broke the unbreakable. Type below. Every key you press turns the rotors, just like in 1940.

ENIGMA I Chiffriermaschinen A.G. · Berlin · Wehrmacht-Ausführung
Walzen rotors & reflector
Lampenfeld lampboard: the ciphered letter lights up
Tastatur keyboard: click, tap, or type
Klartext input
waiting for input…
Geheimtext output
-
tip: type on your physical keyboard
Stromweg live signal path of the last keypress
Press a key to watch the current travel: plugboard → rotors → reflector → back again.
Steckerbrett plugboard: click two letters to connect a cable
No cables connected. A real operator plugged in ten pairs.

Die Geschichte · the historyA radio problem, a Berlin engineer, and total confidence

Radio changed war before Enigma did. By 1918 every army broadcast its orders into the open air, where anyone with an antenna could copy them down. The German electrical engineer Arthur Scherbius patented his answer that year: a typewriter-sized machine that scrambled each letter through a stack of rotating, wired wheels. He called it Enigma and sold it commercially in the 1920s to banks and businesses, with modest success at best.

The military was the customer that mattered. The Reichsmarine adopted a modified Enigma in 1926, the army followed in 1928, and by the mid-1930s the rebuilt Wehrmacht had made the Enigma I (three rotors chosen from five, a reflector, and a front-panel plugboard) the standard cipher machine of a nation preparing for war. Scherbius never saw it: he died in 1929 after a carriage accident.

Why did Germany trust it so completely? Do the arithmetic and you'll sympathize. The daily key (which rotors, in what order, at which ring settings, with which ten plugboard cables) could be chosen in roughly 159 quintillion ways. Testing every setting by hand, even at one per second, would take longer than the age of the universe. German cryptographers concluded that no enemy could ever search that space, and for the entire war most of them never seriously doubted it. Their mistake was subtle: the machine's mathematics leaked patterns that made searching the whole space unnecessary.

Die Entzifferung · the breakingThree Polish mathematicians, then ten thousand people at Bletchley

The first crack came not from Britain but from Poland, a country that, squeezed between Germany and the USSR, could not afford to be blind. In 1932 the Polish Cipher Bureau handed the Enigma problem to three young mathematicians: Marian Rejewski, Jerzy Różycki, and Henryk Zygalski. Armed with permutation theory and setting sheets bought from a German spy by French intelligence, Rejewski achieved something astonishing: he reconstructed the secret internal wiring of the rotors by pure mathematics, without ever seeing a military machine. The Poles then read German traffic for most of the 1930s, inventing the Zygalski sheets and an electromechanical search machine they named the bomba.

By 1938 Germany kept adding rotors and cables, and Poland was running out of money and time. So in July 1939, weeks before the invasion, the Poles summoned French and British cryptologists to a secret meeting in the Kabaty woods near Warsaw and gave away everything: the theory, the methods, and working Enigma replicas. It is one of the great acts of intellectual generosity in history, and it saved the Allies years.

The inheritance landed at Bletchley Park, Britain's Government Code and Cypher School. There Alan Turing redesigned the Polish idea into something far more powerful: the British Bombe, a machine that exploited cribs (guessed plaintext fragments such as weather reports beginning WETTERVORHERSAGE) to reject millions of wrong rotor settings by electrical contradiction. Gordon Welchman's "diagonal board" made it vastly more efficient by wiring in the plugboard's symmetry. The first Bombe ran in 1940; some two hundred followed, tended around the clock, largely by the women of the Wrens.

The hardest theatre was the sea. Turing's Hut 8 attacked the naval Enigma that coordinated the U-boat wolfpacks, and when the Kriegsmarine introduced the four-rotor M4 in February 1942, Bletchley went dark on the Atlantic for ten agonizing months, a blackout ended partly by sailors seizing codebooks from the sinking U-559, two of whom drowned retrieving them. From then on, convoys were routed around wolfpacks the Germans believed invisible.

Germany asked: "Can the enemy try 159,000,000,000,000,000,000 keys?" The Allies asked a better question: "How few keys do we actually need to try?"

Die Wirkung · the impactThe secret that shortened the war

Decrypted Enigma traffic, codenamed Ultra, became the Allies' most precious secret. It guided convoys through the Battle of the Atlantic, exposed Rommel's supply ships in the Mediterranean, and in 1944 confirmed that the D-Day deception had worked: intercepts showed Hitler still expecting the "real" invasion at Calais while the troops waded ashore at Normandy. Eisenhower called Ultra "decisive." The official historian of British intelligence, Harry Hinsley, estimated it shortened the war in Europe by around two years, years that, at the war's rate of killing, translate into millions of lives.

The strangest part is the silence. Tens of thousands of people worked the secret and kept it for three decades; the story only surfaced in 1974. Which makes the fate of its central figure harder to bear. In 1952 Alan Turing was prosecuted for being gay, stripped of his security clearance, and sentenced to chemical castration. He died of cyanide poisoning in 1954, at 41. Britain apologized in 2009 and pardoned him in 2013, and in 2021 put his face on the £50 note.

His legacy outgrew the war entirely. The 1936 paper on "computable numbers", the Turing machine, is the founding document of computer science; the Turing test still frames how we argue about machine intelligence. The device you are reading this on is, in a real lineage, a descendant of the ideas that broke Enigma.

Der Film · the movie"The Imitation Game": what it gets right, and wrong

The 2014 film with Benedict Cumberbatch put Turing and Bletchley into popular memory, and much of its spine is true: the cribs, the race against the daily key change, the agonizing choice to not act on some intelligence so the secret would survive, and the cruelty of Turing's persecution. As drama, it earns its place. As history, treat it as a well-made legend:

Der Algorithmus · how it actually worksA substitution cipher that never repeats itself

Strip away the brass and Enigma is one idea: a substitution alphabet that changes with every single keypress. A fixed substitution ("every A becomes F") dies quickly to frequency analysis. Enigma re-scrambles the whole alphabet each time a key goes down, because the rotors physically move before the electrical contact is made.

Press a key and a battery current takes this round trip:

TASTEkey A STECKERplugboard IIIfast IImiddle Islow UKWreflector LAMPElamp Q ← the return journey, back through everything

The plugboard swaps the letter if a cable is present. Each rotor applies its own scrambled wiring, offset by its current rotation and ring setting. The reflector (Umkehrwalze) bounces the current back through all three rotors along a different path, through the plugboard again, and lights a lamp. Right rotor steps every key; at its notch it kicks the middle rotor; the middle rotor's own notch kicks the left one, with a mechanical quirk, the famous double-step, where the middle rotor advances twice in a row. Watch the Stromweg panel above: that letter chain is exactly this journey.

The fatal elegance: a letter can never encrypt to itself. The reflector pairs the 26 wires into 13 two-way streets, so the current always comes back on a different wire than it went out on. Press A, and you may get anything, except A. It sounds harmless. It was catastrophic. If you guess that a ciphertext contains the phrase WETTERBERICHT, every alignment where any letter would map to itself is provably wrong. Cribs plus this rule let the Bombe cascade contradictions and discard almost the entire keyspace without testing it.

The same elegance made it symmetric. Because every path is reversible, encryption and decryption are the same operation: set your machine to the same daily key, type the ciphertext, and the plaintext lights up. Wonderful for field operators, and it means the plugboard, reflector, and whole machine are one big self-inverse permutation, structure a mathematician like Rejewski could sink theorems into.

158,962,555,217,826,360,000
≈ 1.59 × 10²⁰ possible keys for the Wehrmacht Enigma: 60 rotor orders (3 from 5) × 17,576 rotor start positions × 150,738,274,937,250 ways to plug ten cables. The plugboard contributes almost all of it, and Welchman's diagonal board neutralized the plugboard almost entirely.

And the machine was only half the weakness. Operators chose girlfriend-initials as message keys, re-sent identical messages under old and new keys, and one bored station transmitted nothing but Ls, which, since a letter never maps to itself, told Bletchley instantly what the message wasn't. Enigma's story is the permanent security lesson: a strong algorithm, used by humans, is only as strong as its habits.

WalzeWiring (A→…)Notch
IEKMFLGDQVZNTOWYHXUSPAIBRCJQ
IIAJDKSIRUXBLHWTMCQGZNPYFVOEE
IIIBDFHJLCPRTXVZNYEIWGAKMUSQOV
IVESOVPZJAYQUIRHXLNFTGKDCMWBJ
VVZBRGITYUPSDNHLXAWMJQOFECKZ
UKW-BYRUHQSLDPXNGOKMIEBFZCWVJAT-
UKW-CFVPJIAOYEDRZXWGCTKUQSBNMHL-

These are the authentic historical wirings, the same tables running in the simulator above.