A polyalphabetic cipher mechanized in steel and bakelite — and the cryptanalytic effort that broke it.
MODULE IV · INTERACTIVEEnigma is a Vigenère cipher with the keyword changing on every keystroke. Three rotating wheels — chosen from a set of five, in any order — each carry a fixed but scrambled wiring. A current flows from the pressed key, through the plugboard, through the three rotors in sequence, into a reflector, back through the rotors in reverse order, through the plugboard again, and out to a lamp. The lamp that lights is the ciphertext letter.
Every keypress, the right-hand rotor steps once. After 26 steps it nudges the middle rotor, which after 26 of its own steps nudges the left rotor. The wiring relationships shift continuously. Type AAAAA and the lamps spell five different letters.
The operator's daily key is short: which rotors, in what order, with what ring settings, what plugboard pairs, and what starting positions. That five-line key choice expands into roughly 1023 possible machine states — a number the Germans believed was unbreakable. They were wrong, but for reasons they never anticipated.
Configure the rotors and plugboard, then type. The machine simulates the Wehrmacht three-rotor Enigma with the historical reflector B.
I through V each have different internal wirings and different turnover notches.1014 combinations to the key space — the bulk of Enigma's strength came from here, not the rotors.Six years before the war, three Polish mathematicians under Biuro Szyfrów reconstructed the entire internal wiring of an Enigma rotor from intercepted traffic alone — a feat the Germans believed impossible. Marian Rejewski exploited a procedural flaw: operators encrypted the per-message key twice at the start of every message, creating predictable permutations between letter 1 and letter 4, 2 and 5, 3 and 6. Rejewski turned those permutations into equations and solved them.
They built electromechanical devices called bomby to search the daily key. When Poland was about to fall, they handed everything — technique, machines, working clones — to British and French liaison officers in a forest south of Warsaw.
Alan Turing and Gordon Welchman generalized the Polish attack into a machine that did not depend on the indicator flaw — the Germans patched that in 1940. Their Bombe ran a crib: a guessed fragment of plaintext (e.g. "WETTERVORHERSAGE" — weather forecast — reliably appearing at 06:00 every day) against ciphertext, hunting for rotor positions that made the crib consistent.
The reflector guaranteed no letter mapped to itself, and Welchman's diagonal board propagated contradictions across the search tree, collapsing the run-time from impossible to hours. By 1943 Bletchley was breaking 84,000 messages a month. The intelligence — codenamed Ultra — reshaped the war in the Atlantic, in North Africa, and on D-Day.
The mathematics of Enigma were sound for its day. Its destruction came from operational mistakes: the doubled indicator; the predictable cribs (weather reports, sign-offs, propaganda phrases); the rule that no letter could encrypt to itself; the operator who used "BERLIN" as a key; the captured codebooks from sunken U-boats. Kerckhoffs's principle — assume the algorithm is public, hide only the key — was honored, but the key procedure itself leaked information every day.
Modern ciphers are designed against the threat model Enigma's designers refused to take seriously: that the adversary knows the algorithm, captures equipment, observes ciphertexts in bulk, and exploits any procedural slip. AES, the symmetric cipher we will study next, has been public since 2001 and reviewed by tens of thousands of cryptanalysts. Its key — not its mechanism — is the secret. That is the discipline Enigma forced cryptography to learn.