Enigma, 1932–1939
The cables that did not matter
The Germans fitted Enigma with a panel of cables that multiplied the number of keys by more than a hundred billion. A 27-year-old Polish mathematician, Marian Rejewski, found a measurement the cables could not change. Below are a working Enigma, a real German message from 1941 and Rejewski's attack, run on your own device.
A machine that rewires itself at every letter
Enigma looks like a typewriter with lamps instead of paper. You press one letter and another lights up. Between key and lamp, the current passes through the plugboard, through three rotors with 26 contacts on each face, turns back in a reflector and returns by a different route. With every key press the right-hand rotor moves on one position, so the same letter typed twice usually comes out differently.
The reflector has two consequences. The machine works both ways: anyone who starts from the same position and types the ciphertext gets the plain text back. And no letter can ever be enciphered as itself. Try it: AAAAA with rotors I, II, III, reflector B and everything at A gives BDZGO.
A real machine had one copy of each rotor. Choose three different rotors.
You typed
Lit up
The rotors were the factory's secret. The cables were the day's secret. With six pairs of letters connected, as the German army used in the early 1930s, the plugboard could be wired in 100,391,791,500 ways. With ten pairs, the number reached by 1939, in 150,738,274,937,250 ways. For anyone trying every key in turn, the cables were the wall.

A message from 7 July 1941
The machine above is not an approximation. On 7 July 1941, two weeks after the invasion of the Soviet Union, a German unit on the eastern front sent a message in two parts. The day's key was recovered and published by Geoff Sullivan and Frode Weierud: rotors II, IV, V, rings 02 21 12, reflector B and ten cables. Press the button and your machine decrypts it letter by letter.
What the radio picked up
What lights up (X means a space)
In English
Reconnaissance battalion from Kurtinowa, north-west of Sebezh, on the Fliegerstraße road towards Dubrowki and Opochka. Moved off at 18:30. The attack of Infantry Regiment 3 is advancing slowly but surely. At 17:06, 1st Battalion of Infantry Regiment 3 was on the Fliegerstraße, its start 16 km east of Kamenec.
That was the easy part: with the key in hand, anyone could read it. Rejewski's question, nine years earlier, was how to find the key when you do not have it.
The slip: a key typed twice
Rejewski joined the Polish army's Cipher Bureau on 1 September 1932, with two other mathematicians, Jerzy Różycki and Henryk Zygalski. By the end of the year he had reconstructed the internal wiring of the three rotors and the reflector, helped by documents sold to the French by Hans-Thilo Schmidt, a German official: among them, the daily keys for September and October 1932. With a copy of the machine, Poland still needed each day's key.
The German procedure of the time had a weakness. All operators on a network started from the same position for the day. Each chose three letters for his own message, say KYG, and typed them twice, KYGKYG, to make sure they survived radio interference. The six enciphered letters that came out, such as QZKBLX, went at the start of the message. The operator then turned his rotors to KYG and enciphered the text.
The first and fourth letters of the indicator hide the same plain letter. So do the second and fifth, and the third and sixth. Each intercepted message therefore links one letter to another, and a single case says nothing. Dozens of messages from the same day, all enciphered from the same position, fill in a whole table. Below is a day of traffic invented here, with a key chosen at random and hidden until the end.
The fingerprint the cables cannot touch
Rejewski followed the links like a route. From the day's table: if one indicator has A first and D fourth, and another begins with D and has Q fourth, the chain runs from A to D, then to Q, until it comes back to A. All 26 letters split into such loops. The same is done with places 2 and 5, then 3 and 6. Loops of equal length always come in pairs: a consequence of the reflector.
Then he noticed what mattered. The cables only rename letters, on the way in and on the way out. Renaming changes which letters sit in a loop, not how many there are. The lengths of the loops depend only on the rotor order and their position. The hundred billion possible wirings drop out of the problem. You need not take my word for it: press “Other cables”.
In mathematical language: a product of two permutations, conjugated by the cable permutation, keeps its cycle structure. Rejewski set out the argument in his 1980 paper in Applicationes Mathematicae.
A year's work, a few seconds on your phone
If the fingerprint depends only on the rotors, a list can be made in advance: for each of the 6 rotor orders and each of the 17,576 positions, the lengths of the loops. In all, 105,456 rows. The Poles built a device for it, the cyclometer: two sets of rotors wired together that lit up the loops of a position. They went through every position by hand. The job took more than a year. Once the catalogue was ready, around 1935, finding a day's key took 12–20 minutes.

The catalogue did not hand over the key. I computed all 105,456 rows, with the reflector used until 1937. They give only 21,225 distinct fingerprints. Only 11,578 settings, 11%, have a fingerprint of their own. On a typical day the answer sits in a list of about 20 candidates, and the most common fingerprint is shared by 1,728 settings. The rest was settled by trying the candidates on the day's messages. The method had one more limit: on roughly one day in four, the middle rotor moved during the six letters and the fingerprint no longer matched the catalogue. The day above is chosen from the other three.
The Germans knew none of this, but they kept changing the procedure. On 1 November 1937 they replaced the reflector, and the whole catalogue had to be recalculated from scratch. On 15 September 1938 they changed how the message key was enciphered, and the fingerprint could no longer be measured. Within two months Rejewski's bomba was ready, six linked Enigmas that found the key in about two hours; six existed by mid-November 1938. Zygalski's perforated sheets came more slowly and were never completed. On 15 December 1938 rotors IV and V arrived, and the possible orders rose from 6 to 60. On 1 January 1939 the cables rose to 7–10 pairs.
In late July 1939, at Pyry near Warsaw, the Poles showed the British and the French everything they had: the methods, the sheets, the bomba. Each delegation then received a copy of the Polish-built machine. Five weeks later the war began.
Through Romania to Paris
The Cipher Bureau was evacuated from Warsaw in early September 1939. On 17 September, the day the Red Army entered Poland from the east, the staff were ordered to cross into Romania, Poland's ally. At the border a Romanian officer confiscated their vehicle and separated the military from the civilians.
Rejewski, Różycki and Zygalski feared internment: they knew German intelligence had informers in the Romanian security police. They left on their own, on the first train south, and after a dozen or so hours reached Bucharest. At the British embassy they were told to come back in a few days. At the French embassy they introduced themselves as “friends of Bolek”, the code name of Gustave Bertrand, head of French radio intelligence. A French colonel arranged their departure. By 20 October 1939 they were at work at PC Bruno, a secret station near Paris; there, on 17 January 1940, they found the first Enigma key broken in France, the one for 28 October 1939.
So three men who knew how to read Enigma passed through Bucharest in the autumn of 1939, in a country where, they believed, Germany had ears. Had they been stopped, Germany would have learned what they had learned.

Różycki died on 9 January 1942, when the French ship bringing him back from Algeria sank. Rejewski and Zygalski crossed the Pyrenees in January 1943, were arrested in Spain and reached England in August 1943. By then Enigma had become an exclusively British and American matter; they were kept out of it and set to work on SS hand ciphers. Rejewski returned to Poland in November 1946. For two decades he said nothing about his work, to avoid the attention of the communist government. He died in Warsaw on 13 February 1980.
Sources and method
The machine on the page is an Enigma I built here from the published wiring. It decrypts both parts of the 1941 message letter for letter and gives BDZGO for AAAAA; both checks run on every release, together with a comparison against a second, independent implementation.
The catalogue was computed in full: 6 orders × 17,576 positions, reflector A, only the right rotor moving, as in the cyclometer's model. The fingerprint numbers (21,225 distinct fingerprints, 11,578 unique settings, the median candidate list) come from this computation, not from historical sources. The share of days on which the method works (20/26 × 25/26, about 74%) comes from the same computation.
Sources differ on the date of the Pyry meeting: 25 July 1939 in Kozaczuk, 26–27 July in Erskine. The page says “late July”.
- Marian Rejewski, “An application of the theory of permutations in breaking the Enigma cipher”, Applicationes Mathematicae 16 (4), 1980, pp. 543–559. eudml.org/doc/264403
- Wikipedia, “Marian Rejewski” (after Kozaczuk 1984 and Rejewski 1981/1984): joining the Cipher Bureau, the catalogue, the 1937–46 timeline. en.wikipedia.org/wiki/Marian_Rejewski
- Wikipedia, “Cryptanalysis of the Enigma”: the doubled-key procedure, the crossing into Romania and Bucharest. en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma
- Wikipedia, “Enigma machine”: Pyry and the machine copies for the delegations (after Kozaczuk 1984, pp. 59–60). en.wikipedia.org/wiki/Enigma_machine
- Wikipedia, “Enigma rotor details”: rotor and reflector wiring, the BDZGO test vector. en.wikipedia.org/wiki/Enigma_rotor_details
- Franklin Heath, “Enigma/Sample Messages” and “Sample Decrypts”: the 7 July 1941 message, published by Geoff Sullivan and Frode Weierud, with translation. wiki.franklinheath.co.uk/index.php/Enigma/Sample_Messages
- Enigma Cipher Centre, Poznań: the route to the border in September 1939. csenigma.pl/en/enigma/escaping-the-bombs-september-1939-in-henry
Images
- An Enigma I machine: Alessandro Nassiri, Wikimedia Commons, CC BY-SA 4.0
- The plugboard on the front of the machine: Bob Lord, Wikimedia Commons, CC BY-SA 3.0
- A reconstruction of Rejewski's cyclometer: Szymon Pilecki, Szymon Dąbrowski, Wikimedia Commons, CC BY-SA 4.0
- Marian Rejewski in Polish Army uniform, 1943–44: photographer unknown, Wikimedia Commons, public domain