Skip to content
Honor
Technology & Weapons

The Enigma: How the Cipher Worked — and How It Was Broken

Operate a working Enigma simulator, follow each letter through rotors and plugboard, and learn how Polish and British codebreakers broke the cipher.

6 min read Technology & Weapons
A three-rotor Enigma machine of the German Army and Luftwaffe in its wooden case, with keyboard, lampboard and plugboard, on display at Bletchley Park
Image: Vintage Fan 5678, CC BY 4.0

The Enigma was an electro-mechanical cipher machine about the size of a typewriter. From the late 1920s the German armed forces trusted it with almost all of their radio traffic: troop movements, U-boat positions, weather reports, orders for mass shootings behind the Eastern Front. They believed it was unbreakable. It was not. Breaking it is one of the great intellectual achievements of the twentieth century, and it began in Poland, not in England.

Try it yourself#

The simulator models an Enigma I with rotors I–VIII, reflectors B and C, ring settings, plugboard and the historical “double step” of the middle rotor.

  1. Choose three rotors, their ring settings (Ringstellung) and the plugboard pairs (Steckerverbindungen).
  2. Set the start position of the rotors (the letters in the windows).
  3. Type. Every key press first turns the right rotor and then sends current through the machine, and one lamp lights up: that is the cipher letter.
  4. To decrypt, reset the machine to the same start position and type the cipher text. Enigma is reciprocal: the same settings turn plain text into cipher text and back again.

The preset Operation Barbarossa message reproduces a real German army radio message from 7 July 1941. Typing its cipher text yields: AUFKL X ABTEILUNG X VON X KURTINOWA … (“Reconnaissance detachment from Kurtinowa…”).

Interactive Enigma I simulator

How a key press becomes a cipher letter#

Each time a key is pressed, current takes a long path through the machine:[1]

  1. Rotors step. Before any current flows, the right-hand rotor turns one position. At a fixed point, the notch, it also carries the middle rotor along, and the middle rotor in turn carries the left rotor. Because of the way the pawls worked, the middle rotor steps twice in a row once it reaches its own notch. This is the famous double step.
  2. Plugboard (Steckerbrett). Cables swap pairs of letters before the signal enters the rotors. Army procedure usually used ten cables.
  3. Three rotors, right to left. Each rotor is a wired disc that substitutes one letter for another. Because the rotors turn, the substitution changes with every key press.
  4. Reflector (Umkehrwalze). It sends the current back through the rotors along a different path.
  5. Rotors again, left to right, then the plugboard again, and finally to a lamp.

The interactive above shows this path letter by letter under Signal path.

Why the reflector was a gift to the codebreakers#

The reflector made the machine reciprocal, so the same setting enciphered and deciphered and operators needed no separate mode. But it also meant that no letter could ever be enciphered as itself. An A never becomes an A. That sounds harmless, but it allowed codebreakers to slide a guessed word, a crib such as WETTERVORHERSAGE (weather forecast), along the cipher text and rule out every position where a letter would have matched itself.[2]

How many settings?#

The Germans’ confidence came from the sheer number of possible settings. For the army’s three-rotor machine with five rotors to choose from and ten plugboard cables:

60

rotor orders (choose 3 of 5, order matters)

17,576

rotor start positions (26 × 26 × 26)

150,738,274,937,250

plugboard combinations with 10 cables

Multiplied together, that is 158,962,555,217,826,360,000 settings, about 1.6 × 10²⁰. Ring settings add more. Trying them all was impossible, even with machines. Enigma was broken by exploiting procedure and mathematics, not by brute force.

Poland, 1932: the first break#

In late 1932 the Polish Cipher Bureau gave the young mathematician Marian Rejewski the problem of the army Enigma. Working with permutation theory, he exploited the German habit of sending the three-letter message key twice at the start of each message. With operating documents supplied by French intelligence, obtained from the German informant Hans-Thilo Schmidt, he reconstructed the wiring of the rotors. He had never seen a military Enigma.[3]

Together with Jerzy Różycki and Henryk Zygalski, Rejewski developed methods and machines to recover the daily keys: the cyclometer, Zygalski sheets and the electro-mechanical bomba (1938). When the Germans increased the number of rotors and plugboard cables in 1938–39, the Polish resources were no longer enough.

On 25–26 July 1939, five weeks before Germany invaded Poland, the Poles met British and French codebreakers in the Pyry forest near Warsaw. They gave them everything: their methods, and replicas of the Enigma.[4]

Bletchley Park and the bombe#

At Bletchley Park, the Government Code and Cypher School’s wartime home north of London, Alan Turing designed a new machine on the Polish idea. It did not depend on the doubled message key, which the Germans dropped in 1940. Turing’s bombe tested a crib against every rotor order and start position, and used the logic of the plugboard to throw out impossible settings at high speed.[6] Welchman’s diagonal board made it far more efficient. By the end of the war more than 200 bombes were running in Britain, and the US Navy built its own.

The intelligence gained was classified ULTRA and passed only to a small circle of commanders.

The naval Enigma and the Battle of the Atlantic#

The Kriegsmarine guarded its Enigma more carefully, with eight rotors instead of five and stricter procedures. From February 1942 the U-boats switched to the four-rotor M4 (“Triton”, known as “Shark” at Bletchley). For about ten months the Allies were almost blind to the U-boat wolfpacks, and sinkings in the Atlantic rose steeply.[7]

Captured material broke the blackout. In October 1942 sailors from HMS Petard recovered code books from the sinking U-559. Lieutenant Anthony Fasson and Able Seaman Colin Grazier drowned getting them out. From December 1942 “Shark” could be read again, often within hours. The intelligence helped to route convoys around the wolfpacks and to hunt the U-boats.[7]

What did breaking Enigma achieve?#

Historians agree that ULTRA was one of the decisive Allied advantages in the Battle of the Atlantic, in North Africa and in the run-up to D-Day. F. H. Hinsley, the official historian of British intelligence, estimated that it shortened the war by perhaps two years.[5] That figure is an estimate and remains debated. What is not debated is that ULTRA did not “win the war” on its own. It was useful only to forces able to act on it.

Bletchley’s secret was kept for nearly 30 years. Most of those involved never spoke about their work until the 1970s. Some, including Turing, who died in 1954 after he was prosecuted for homosexuality, did not live to see their achievement recognised.

Sources

  1. David Kahn (1991). Seizing the Enigma: The Race to Break the German U-Boat Codes, 1939–1943. Houghton Mifflin, Boston.
  2. Marian Rejewski (1981). How Polish Mathematicians Deciphered the Enigma. Annals of the History of Computing 3 (3), pp. 213–234.
  3. F. H. Hinsley, Alan Stripp (eds.) (1993). Codebreakers: The Inside Story of Bletchley Park. Oxford University Press.
  4. Gordon Welchman (1982). The Hut Six Story: Breaking the Enigma Codes. McGraw-Hill, New York.
  5. Bletchley Park Trust. Bletchley Park — History.
  6. Crypto Museum (Paul Reuvers, Marc Simons). Enigma cipher machines — technical description, wiring and history.
  7. Wikipedia (de). Enigma (Maschine) — section „Authentischer Funkspruch“ (Barbarossa message, 1941). Starting point; the message and settings were documented by Frode Weierud.
  8. B. Jack Copeland (ed.) (2004). The Essential Turing. Clarendon Press, Oxford.