Cryptography / Enigma machine

Enigma machine

Follow one keypress through the rotors, the reflector and the plugboard of an Enigma machine, then see the single design flaw that let codebreakers in.

Beginner7 steps~7 min
Key — the letter the operator presses
Rotor — a wired wheel that turns as you type
Reflector — pairs letters, sends current back
Lamp — the cipher letter that lights up
// THE SHORT VERSION

In 30 seconds

The Enigma was a cipher machine: press a key and a different letter lights up. Inside, wired wheels called rotors scramble the letter, and they turn with every keypress, so the same letter comes out differently each time.

A reflector sends the signal back through the rotors and a plugboard swaps letter pairs, giving about 159 billion billion settings.

But the reflector meant a letter could never become itself. Codebreakers used that, plus guessed words called cribs, to rule settings out by machine.

Enigma machine, step by step

STEPS01 / 07

Shown: the army Enigma I with rotors I, II, III, reflector B, starting at AAA. Ring settings and the middle rotor’s double step are left out, and the count of settings ignores ring settings.

STEP 01 / 07 A typewriter that scrambles
THE MATH
key pressed: A lamp lit: B
  1. Step 1: A typewriter that scrambles. Enigma was an electro-mechanical cipher machine used by the German armed forces before and during the Second World War. Pressing a key sends current through a plugboard, three rotors and a reflector, then back again to light a lamp. The lit letter is the ciphertext.
  2. Step 2: A rotor is a wired alphabet. Each rotor is a disc with 26 contacts on each face, joined inside by 26 wires in a scrambled order. Current entering at A leaves at E, B leaves at K, and so on. On its own, one fixed rotor is just a letter-for-letter swap, which is easy to break.
  3. Step 3: The rotors step. Before each letter is enciphered, the right-hand rotor turns one place, so the wiring between keys and lamps is different for every keypress. Typing A five times gives B, D, Z, G, O. Once per turn, a notch makes the next rotor step as well, like a mileage counter.
  4. Step 4: The reflector turns it back. After the three rotors the current meets the reflector, a fixed disc that wires the letters together in 13 pairs. It arrives on F, leaves on S, and returns through the rotors by a different route to light B. So A is enciphered as B, through seven scrambles in a row.
  5. Step 5: The plugboard. A panel of sockets on the front swaps pairs of letters on the way in and on the way out. With a cable joining B and Q, the returning B becomes Q. Operators set ten cables, changed daily. There are over 150 trillion ways to do that, which is where most of the key’s size comes from.
  6. Step 6: A letter is never itself. The reflector made Enigma convenient: with the same settings, typing the ciphertext gives back the message. But each reflector wire joins two different letters, so the current can never return along the path it came in on. No letter is ever enciphered as itself. That was the flaw.
  7. Step 7: Cribs: how it was broken. Codebreakers guessed a word likely to be in a message, a crib, such as WETTERBERICHT (weather report), and slid it along the ciphertext. Wherever a crib letter met the same cipher letter, that position was impossible. The Bombe then ran through rotor settings to find one consistent with the crib.
VALUES SO FAR
keyAinput
rotor I····wiring
AAAAA····output
rotors····positions
mirror····pair
plugs····daily
settings····total
flaw····weakness
crib····guess
// BEFORE

Learn this first

Nothing. This concept starts from scratch.

Spotted a mistake on this page?