Skip to content
Trapdoor·Lab
1Object

Rotors, reflector and plugboard

Arthur Scherbius patented a cipher machine with rotors in 1918 (Crypto Museum, History of the Enigma). The military Enigma I with a plugboard entered the Reichswehr in 1930 (Crypto Museum, Enigma I; Marks, Weierud 2000, p. 1). The replica shows this machine: rotors I–III and reflector A, as until 1937.

Pressing a key closes a circuit. The current runs through the plugboard, the three rotors from right to left, the reflector, and back through the rotors and the plugboard to a lamp (Christensen 2007, pp. 249–251). Before each letter the right rotor steps one place, so every key press encrypts with another permutation of the alphabet, that is, another pairing of letters. The keyboard and the lamps are laid out in QWERTZ order in three rows (Crypto Museum, Enigma I).

The right rotor takes the middle one along when it leaves its turnover letter: rotor I at Q, II at E, III at V (Crypto Museum, Enigma wiring). The middle rotor takes the left one along in the same way. Because of how the mechanism is built, it can then turn on two key presses in a row — the double step (Christensen 2007, p. 251). The rings (Ringstellung) shift the wiring against the letter in the window; the 1930 instruction gives them as numbers 01–26 (Weierud 2008).

The plugboard swaps pairs of letters before and after the rotors; in 1932 six pairs were plugged, which gives 100,391,791,500 possible connections (Christensen 2007, pp. 252, 254). The reflector pairs letters, so encryption is an involution, an operation that undoes itself: the same setting encrypts and decrypts. For the same reason no letter ever becomes itself (ibid., pp. 255–256). The path of the current in the replica shows why: the current comes back another way.

The default setting is the test message of the 1930 instruction: rotors II I III, rings 24 13 22, plugboard A/M F/I N/V P/S T/U W/Z, position FOL. The operator encrypted the message key ABL twice and sent PKPJXI (Weierud 2008). “Replay the indicator from the instruction” types PKPJXI and lights ABLABL; the page’s test also reads all 90 letters of that message. The wiring of the rotors comes from Crypto Museum, that of reflector A from Marks, Weierud 2000, pp. 9–10.

Enigma I (1930–1938)

Arrow keys move between the keys. While the focus is on the keyboard, a letter on your computer keyboard presses that key.

Setting of the 1930 instruction, windows F O L. Press a key.

FIIOILIIIQWERTZUIOASDFGHJKPYXCVBNML

Path of the current

KPIIIIIIR

Columns from the left: key and lamp (K), plugboard (P), right, middle and left rotor, reflector (R). Solid line on the way in, dashed on the way back.

PTyped —

CResult —

The replica has rotors I–III and reflector A, like the Enigma I until 1937. Rotors IV and V were added on 15 December 1938.

2Break it

The method of characteristics

Until 15 September 1938 all operators of a network began the day from the same ground setting (Grundstellung). An operator chose three letters as the message key, encrypted them twice and sent these six letters at the head of the message as the indicator. Then he set the rotors to the message key and encrypted the text (Christensen 2007, pp. 257–258; Marks, Weierud 2000, p. 2 and n. 5; Rijmenants 2010, p. 331).

The six letters of the indicator are six successive positions of the machine, that is six permutations: A, B, C, D, E, F. Letters 1 and 4 encrypt the same key letter, so letter 1 determines letter 4 by a fixed transformation AD: first A, then D. In the same way BE links letters 2 and 5, and CF letters 3 and 6. With about 80 messages a day all three transformations were known in full (ibid., pp. 257–258).

Following AD from letter to letter, you come back to the start at last: that is a cycle. Cycles always come in pairs of equal length, because A and D swap letters in pairs and leave none in place (they are involutions without fixed points). The plugboard changes the letters in the cycles, not their lengths. The set of lengths — the characteristic of the day — therefore depends only on the wheel order and the rotor positions: 6 × 17,576 = 105,456 possibilities (ibid., pp. 257–259).

The Poles built a catalogue of the characteristics of all these settings with the cyclometer. The work took over a year; after that, finding the daily key usually took 10–20 minutes (Rejewski, after Christensen 2007, pp. 260–261). A characteristic does not always point to one setting. In the replica’s model, 105,456 settings give 21,225 different characteristics, one setting is pointed to on only 11.0% of days, and the median is 20 candidates — our own measurement; Kuhl 2007 counts 21,230 structures in a slightly different model.

The page draws a day from a pool of 100 days whose characteristic points to 1 to 5 settings; it draws the plugboard and 40 message keys afresh every time. The catalogue was computed when the page was built, with the same simulator that reads the 1930 message. We give you the plugboard: the Poles found it only once they had the setting, by comparing the letters in the cycles (Rejewski, after Christensen 2007, p. 261). The right setting reads every indicator as a key typed twice.

Once broken, you see the message keys. In the replica 14 of 40 operators choose a predictable key: one letter three times or three neighbouring keys. Real operators often used initials or patterns in rows and diagonals of the keyboard, and Rejewski exploited his knowledge of these habits (Christensen 2007, p. 265). He uses a key of three equal letters (jjj) as an example of such a habit (Rejewski 1980, part I § 4).

Rejewski’s method of characteristics

You are in the Polish Cipher Bureau with the indicators of one day’s messages. You do not know the wheel order, the rotor positions or the plugboard.

Indicators of 40 messages of one day

Indicators intercepted. Link letters 1 and 4.

  1. Messages of one day

    simplificationRings 01 01 01 and no turn of the middle rotor during the six letters of the indicator — Rejewski’s catalogue left them out too.

    simplificationA real day had about 80 messages; here there are 40 — enough for every letter to stand in every position.

    Every message starts with its message key encrypted twice. Letters 1 and 4 come from the same key letter.

3Context

What we know about breaking Enigma

On 8 November 1931 Hans-Thilo Schmidt of the Reichswehr cipher office gave French intelligence two Enigma instructions from 1930: Gebrauchsanleitung für die Chiffriermaschine Enigma and Schlüsselanleitung zur Chiffriermaschine Enigma I (Weierud 2008). The second holds the test message the replica replays. It decrypts without errors with rotors I–III and reflector A:

Feindliche Infanteriekolonne beobachtet. Anfang Südausgang Bärwalde. Ende 3 km ostwärts Neustadt.

Hostile column of infantry observed. Extends from the south exit of Bear Woods to position 3 kilometers east of Neustadt. (English translation as given by F. Weierud, CryptoCellar 2008)

Schlüsselanleitung zur Chiffriermaschine Enigma I, 1930, test message — plaintext in full words as written by F. Weierud, 2008 · CryptoCellar

In the summer of 1932 Marian Rejewski, Jerzy Różycki and Henryk Zygalski moved from the Poznań branch to the Cipher Bureau in Warsaw (Christensen 2007, p. 252).

Rejewski set up a system of permutation equations from the doubled message keys. On 9 December 1932 he received photocopies of the daily key tables for September and October 1932, which let him solve it (Rejewski, after Christensen 2007, p. 266). French intelligence had bought these tables, with other information about Enigma, from Schmidt (ibid.). Schmidt’s documents held instructions and key tables, not the wiring: Rejewski worked out the wiring of the rotors. He knew it by December 1932, and from mid-January 1933 the Bureau read messages (ibid., p. 268). According to Marks and Weierud, Rejewski would have recovered the wiring of reflector A in the same work (Marks, Weierud 2000, p. 1).

The catalogue of characteristics was built with the cyclometer. The work took over a year; after that, finding the daily key usually took 10–20 minutes (Rejewski, after Christensen 2007, pp. 260–261). The Germans changed the machine and the procedure several times. When reflector B replaced reflector A in November 1937, the catalogue had to be built again (Christensen 2007, p. 262). From 15 September 1938 operators no longer started from a common ground setting and the catalogue stopped working, and on 15 December 1938 rotors IV and V were added (Rejewski 1980, part II § 2–3; Christensen 2007, p. 268).

At the end of July 1939, at the Cipher Bureau’s site in the Kabaty Woods (Pyry) near Warsaw, the Poles handed their methods and equipment, including Zygalski’s perforated sheets and the bomba, and copies of the Enigma to the French and the British (Christensen 2007, p. 268; Rejewski 1980, part II § 3).

During the war the British codebreakers at Bletchley Park broke Enigma routinely. A tablet by one of its buildings says that the work of Rejewski, Różycki and Zygalski greatly assisted them (Christensen 2007, p. 270).

4Today

The same mistake today

Then

The doubled message key linked letters 1–4, 2–5 and 3–6 of every indicator — Rejewski’s method was built on that. Operators added predictable keys, such as letters from one row of the keyboard.

Today

A key that can be predicted protects only as much as the number of possibilities to check. A generator seeded with the clock gives only as many keys as there are seconds in the guessed window — so keys are taken from a cryptographic generator.

See it in the station: Randomness →