Skip to content
Adrien Hubert

Enigma, one keypress at a time.

A working model of the three-rotor Enigma I used by the German army and air force. Type on your keyboard or on the keys below. The diagram shows the path the current took for the last letter: in through the plugboard, right to left across three rotors, back from the reflector, and out to a lamp.

Reflector
Left
A
Middle
A
Right
A
QWERTZUIO
ASDFGHJK
PYXCVBNML
Output
letters
0
last step
none
double steps
0
letters that became themselves
0

Test vector: rotors I II III, UKW-B, rings and start at AAA, no cables. AAAAA must come out as BDZGO.

Note

The reflector is what makes the machine easy to use. It sends the current back through the rotors on a different wire, so the same settings encrypt and decrypt. Press "Feed output back in" and the plaintext returns. The cost is visible in the last counter. A wire cannot reflect onto itself, so no letter ever encrypts to itself. Bletchley Park used that to place guessed phrases against ciphertext: any alignment where a letter matched its own position was ruled out at once.

The rotors do not count like an odometer. A pawl that pushes the left rotor has to engage the notch of the middle one, and in doing so it pushes the middle rotor too. So the middle rotor steps on two keypresses in a row. Set rotor II in the middle to D, rotor III on the right to U, and press three keys. The windows go ADU, ADV, AEW, BFX. Because of this, the three-rotor cycle is 26 × 25 × 26 = 16,900 keypresses long, not 17,576.

The ring setting moves the wiring relative to the letters on the rotor and to its notch. With ten plugboard cables, the usual figure for the key space is 60 rotor orders × 17,576 start positions × 150,738,274,937,250 cable layouts, which comes to about 1.59 × 1020. Most of that number is the plugboard. It is also the part the Bombe could ignore, since the plugboard swaps letters without changing how the rotors move.

Sources

  • Crypto Museum. Enigma wiring: rotor and reflector tables for the Enigma I. cryptomuseum.com/crypto/enigma/wiring.htm
  • Hamer, D. (1997). Enigma: Actions Involved in the "Double Stepping" of the Middle Rotor. Cryptologia 21(1), pages 47-50.
  • Sale, T. The Enigma rotors and their wiring. codesandciphers.org.uk/enigma/