About the Enigma Machine
A working copy of the Enigma I, the machine of the German army and air force. Set it up from the daily key on the left: which three of the five rotors go in and in what order, the reflector, the ring settings and the plugboard cables. Turn the rotors to the starting letters with their thumb wheels (click above or below, scroll, or drag). Then type, on your keyboard or the machine's: each key lights a lamp, and the lit letters are the cipher text, collected on the message pad in groups of five as the radio operator would have sent them.
To read a message back, set the same key, press RESET (the rotors go back to the start) and type the cipher text: the lamps spell out the original. Enigma is its own reverse. TYPE IT IN types a whole pasted message at once; Backspace takes back the last letter. Click two letters on the plugboard to join them with a cable, and click a plug to pull it out. COPY LINK shares the key; MESSAGE LINK shares only the cipher text, so whoever opens it needs the key from you, as it should be.
THE STORY
The German engineer Arthur Scherbius applied for a patent on a rotor cipher machine in 1918 and sold the Enigma to businesses in the 1920s. The German navy took it up in 1926 and the army in 1928. The military machines added the plugboard, which multiplied the number of settings enormously. In December 1938 two more rotors, IV and V, were issued, so the operator chose three from five.
The first to break it were Polish. At the Cipher Bureau in Warsaw, the mathematician Marian Rejewski worked out the wiring of the rotors at the end of 1932, using the mathematics of permutations together with documents the French secret service had bought from a German spy, Hans-Thilo Schmidt. With his colleagues Jerzy Różycki and Henryk Zygalski he read German messages for years, with Różycki's "clock" method, Zygalski's perforated sheets and Rejewski's machine, the bomba (1938). In July 1939, weeks before Germany invaded Poland, they showed British and French codebreakers everything at Pyry, near Warsaw, and gave each a replica Enigma.
At Bletchley Park Alan Turing designed the British bombe, and Gordon Welchman improved it with his "diagonal board". The first bombe went to work in 1940. A bombe did not need the message key: it tested a guessed piece of plain text, a "crib" such as WETTERBERICHT (weather report), against every rotor order and position, throwing out the settings that contradicted it.
WHY A LETTER NEVER BECOMES ITSELF
The current goes in through the rotors, hits the reflector at the far end, and comes back by a different route. The reflector joins letters in 13 pairs, never a letter to itself, so the way back can never end where it started: A can become any letter except A. It is what makes the machine its own reverse, and it was a gift to the codebreakers. Slide a crib along the cipher text: anywhere a letter of the crib sits over the same letter, that position is impossible.
HOW IT WORKS
Each key press first steps the rotors, then the current flows: plugboard, entry wheel, right, middle and left rotors, reflector, back through the left, middle and right rotors, the plugboard again, and a lamp. The diagram on the right draws that path for the last key: amber going in, blue coming back. Each rotor scrambles the alphabet with 26 wires; because the rotors move, the scramble changes with every letter.
The right rotor steps on every key. When it passes its turnover letter (I: Q, II: E, III: V, IV: J, V: Z; the red mark by a window shows a rotor at its turnover) it pushes the middle rotor on one, and the middle rotor pushes the left one in the same way. But the pawl that pushes the left rotor pushes on the middle rotor's own notch, so the middle rotor moves too: whenever it reaches its turnover letter it steps again on the very next key. This is the double step. With rotors I, II, III starting at ADU, three keys give ADV, AEW, BFX: the middle rotor moved on two keys running (try the Double step example). So the rotors repeat after 26 × 25 × 26 = 16,900 letters, not 17,576.
The ring setting turns the wiring inside a rotor against its lettered ring (on the army machine the rings were numbered 01 to 26; here the window shows the letter with its number under it). The turnover notch is fixed to the ring, so it always happens at the same window letter. Three rotors from five in any order (60 ways), 17,576 starting positions and ten plugboard cables (150,738,274,937,250 ways) give 158,962,555,217,826,360,000 settings before the rings are counted.
The settings for each day came from a printed key sheet, issued a month at a time. For each message the operator also picked his own starting position, the message key, and sent it enciphered at the start; the procedure changed several times during the war. The 1930 manual example uses reflector A, which B replaced in 1937; a rarer reflector C appeared later in the war. Both historic examples here decipher letter for letter. In the key sheet drawer, The message key, sent twice walks through the pre-1940 way on the machine: the key typed twice at the day's start, the rotors turned to it, the message typed, and the receiver doing the same in reverse. It then gathers a day's indicators to show the pattern the doubled key gave Marian Rejewski: letters 1 and 4 of every indicator are linked by a fixed shuffle for the day, whose loops don't depend on the cables. In the German texts X stands for a full stop or space and Q for CH, as the operators wrote them.
THE KEY SHEETS
The KEY SHEET tab on the right edge (or Shift+K) opens real German Army key sheets. Click a day and the machine sets itself from that line, or choose SET IT MYSELF and set it by hand while the sheet ticks off the rotors, rings and cables. Esc or the × closes it.
OKH-Maschinenschlüssel A Nr. 39 (Army High Command machine key A, sheet 39, copy 00014) and Heeres-Stabs-Maschinenschlüssel Süd Nr. 70 (an army staff key) are typed out here from photographs of the original printed sheets shown in Veritasium's video above; the pictures themselves are not used. Neither shows its month or year. Every line of sheet 39 that is in the photograph is given (days 31 to 3). Sheet 70's photograph is blurred, so only its six sharpest lines, days 31 to 26, are given, and two of their Kenngruppen that could not be read for certain are left blank. Every line here was checked: three different rotors, rings 01 to 26, ten cables with no letter used twice.
1941: real traffic is not a printed sheet. Olaf Ostwald and Frode Weierud recovered these German Army daily keys from real message forms of 1941 by computer codebreaking ("Modern breaking of Enigma ciphertexts", Cryptologia, 2017), and published the messages with their keys at Weierud's CryptoCellar; the 8 July 1941 indicator example is from the same site's 1941 key list. All three messages decipher here letter for letter to the published German.
FURTHER WATCHING AND READING
- Veritasium: The Insane Real Engineering of the Nazi Enigma Machine, 48 min. How the machine is built, part by part, and how Bletchley Park broke it.
- Numberphile: 158,962,555,217,826,360,000 (Enigma Machine), 12 min. James Grime opens a real Enigma and counts its settings.
- Numberphile: Flaw in the Enigma Code, 11 min. The weakness that let Bletchley Park in: no letter ever becomes itself.
- Crypto Museum: Enigma I. The exact machine this app models, with photographs and wiring.
- Bletchley Park: Enigma. How the codebreakers read it.
- CryptoCellar: Modern breaking of Enigma ciphertexts. The 1941 messages in the key sheet, with their keys and scans of the message forms.