Enigma Machine: How It Worked and How Allies Broke It

•

 47 min video

•

 8 min read

YouTube video ID: JsBZOcqZerk

Source: YouTube video by Veritasium — Watch original video

PDF

The Enigma machine, an encryption device used by the Nazis in World War II, played a pivotal role in the conflict. While it bears a Nazi sigil, it was not invented by them but rather patented in 1918 by German inventor Arthur Scherbius for commercial use. Early Enigma machines were readily available for purchase, with various countries, including Poland, Britain, and Russia, acquiring them.

How the Enigma Machine Works

The Enigma's superiority over earlier encryption methods like the Caesar cipher lay in its ability to change the substitution rule with every letter typed. This dynamic encryption was achieved through a complex internal mechanism:

  1. Rotors: Inside the Enigma, there are three rotors, each with 26 metal contacts on either side. When a key is pressed, current flows through these rotors. The wiring within each rotor is scrambled, meaning a letter typed (e.g., 'Y') is transformed multiple times as it passes through the rotors (e.g., Y to H, H to B, B to Q).
  2. Reflector: After passing through the rotors, a component called the reflector directs the current back through the rotors via a different path, resulting in a final encrypted letter (e.g., 'E'). This letter is then illuminated on the lamp board above the keyboard.
  3. Rotor Rotation: Crucially, each time a letter is typed, the rightmost rotor rotates. This ensures that pressing the same key twice will result in a different encrypted letter. The second rotor rotates after 26 rotations of the first, and the third rotor rotates after 26 rotations of the second, making the encryption highly complex.

German Modifications and Increased Complexity

The German military significantly modified the commercial Enigma to enhance its security:

  • Revolvable Rings: They added revolvable rings that changed the relationship between the displayed letter and the rotor's internal wiring. This also altered the position where turnover occurred on adjacent rings, adding 26 squared possibilities.
  • Plugboard: A plugboard was introduced, allowing operators to swap pairs of letters before they entered the rotors. Swapping just one pair added 325 possibilities. The Nazis typically swapped around six letters, introducing 100 billion possibilities.

These modifications increased the Enigma's key space to over 7 x 10^18 possible combinations, making it incredibly difficult to decrypt without the exact settings.

The Challenge of Decryption

For a message to be decrypted, the receiving Enigma machine had to be set up in precisely the same way as the encrypting machine. This involved adjusting the rotors, ring settings, and plugboard to match one of the trillions of possible combinations. The Germans distributed daily key sheets with prearranged instructions for these settings. Each day at midnight, the settings on all Enigma machines would change, rendering previous decryption efforts useless for the next day's messages.

Bletchley Park and the Codebreakers

British intelligence, recognizing the urgency of decrypting Enigma messages, assembled a team at Bletchley Park. This secret operation, located between Oxford and Cambridge, recruited chess players, crossword fanatics, university academics (including Alan Turing), and hundreds of women from the Royal Navy. Their plan involved:

  1. Interception: Listening stations would intercept German radio messages.
  2. Analysis: Codebreakers would analyze the messages for patterns and weaknesses.
  3. Decryption: Using clues, they would guess the settings and then use their own Enigma machines to decrypt the messages.

A major hurdle was that the Nazis had changed the internal wiring of their rotors, making their Enigma machines different from the commercially available versions.

The Polish Breakthrough

Unbeknownst to the British and Germans, Polish intelligence had already made significant progress. In 1931, an employee at the German Army's cipher office sold secrets about the Enigma to French intelligence, who then shared them with the Poles. Polish mathematicians, led by Marian Rejewski, discovered a vulnerability in the German operating procedure.

German operators would choose three random letters (e.g., GEX) and transmit them twice, encrypted with the day's default settings (e.g., ASDEIW). They would then set their window settings to these three letters (GEX) and type the rest of the message. Rejewski realized that encrypting the same three letters twice created a mathematical relationship that could be exploited using permutation theory. By 1933, the Poles had reconstructed the wiring of the military Enigma and built replica machines, allowing them to read German military traffic.

Nazi Countermeasures and Polish Plea for Help

In 1939, as the Nazis prepared for invasion, they increased Enigma's security by:

  • Adding Rotors: They introduced two extra rotors, increasing the choice from three to five, which meant 60 possible rotor orders instead of six.
  • More Plugboard Swaps: They increased the number of plugboard swaps from six to ten, adding 150 trillion combinations.

These changes increased the key space by a factor of 15,000 to over 100 sextillion. Realizing they needed help, the Poles shared all their knowledge about the Enigma with British and French intelligence in July 1939, just before the German invasion of Poland. The Polish codebreakers had to abandon their decryption device, "The Bomba," leaving the British to continue the work.

Exploiting Human Error: "Cillies" and the Herivel Tip

At Bletchley Park, codebreakers exploited human tendencies to simplify the decryption process:

  • "Cillies": German operators, despite instructions to choose random letters for message indicators, often used predictable sequences like their girlfriend's name (e.g., "Cilla" becoming CIL) or common words like "Berlin" (BER) followed by "LIN." This allowed codebreakers to guess parts of the message.
  • Herivel Tip: Codebreaker John Herivel noticed that operators, when shuffling rotors from the daily key sheet settings, often only moved them by one or two positions. This led to a clustering of window settings around a particular set of three letters throughout the day, revealing the daily ring settings.

While these human errors provided valuable clues, they were not enough to consistently break the Enigma, especially for more secure networks.

Alan Turing and the Bombe

Bletchley Park needed an automated solution. Alan Turing, a brilliant mathematician, realized that if he could describe the Enigma-breaking process as a series of logical tests, he could design a machine to perform them.

Turing's key insight came from a fundamental flaw in the Enigma: a letter could never be encrypted as itself. He also exploited the fact that certain German outposts sent predictable messages, like daily weather reports. If Bletchley Park intercepted a message from Biscay at 6 a.m., they could reasonably guess that it contained "WETTERVORGERSAGEBISKAYA" (weather report Biscay). This guessed plaintext, aligned with the ciphertext, was called a "crib."

Turing's logical test involved:

  1. No Self-Encryption: Shifting the crib over the ciphertext until no letter in the crib was encrypted as itself.
  2. Looping Contradictions: Assuming a starting window setting (e.g., ZZZ) and observing how letters were wired through the rotors. He noticed that the encryption process could create "loops" where a letter, after passing through a series of Enigma machines (each representing a different rotor position), would transform back into itself. If the Enigma settings were incorrect, these loops would not form, or they would lead to contradictions (e.g., a letter being plugged into two different letters simultaneously).

Turing, with engineer Harold Keen, developed "The Bombe," named after the Polish device. The Bombe was essentially 36 Enigma machines working in parallel, designed to test millions of possible Enigma settings. It would stop when it found a combination of settings that satisfied Turing's logical tests, indicating a potential solution.

Welchman's Improvement and the Impact of the Bombe

Early Bombes were still too slow, often producing too many "false positives" that required manual checking. Gordon Welchman, another Cambridge mathematician at Bletchley Park, made a crucial modification: the "diagonal board." Welchman realized that if R was plugged to Y, then Y was also plugged to R. By connecting these wires, a single guess at the plugboard could rule out more possibilities and drastically reduce the number of false stops. This improvement made the Bombe practical.

By August 1940, the improved Bombe was ready. The intelligence gained from decrypting German Army and Luftwaffe Enigma traffic proved vital. For example, during the Battle of Britain, Enigma intelligence reinforced the Air Force commander's confidence in committing reserve squadrons. In North Africa, Enigma decrypts revealed German fuel shortages, leading to a decisive Allied victory at the Second Battle of El Alamein in 1942.

The Germans eventually added a fourth rotor to the Naval Enigma, making it even more complex. Turing had to develop new statistical methods and rely on the British Navy to capture key sheets and trick the Germans into revealing cribs.

By 1943, with over 100 Bombes in operation (including those built by the Americans), the Allies were routinely deciphering German Enigma traffic. Historians estimate that breaking the Enigma shortened the war by up to two years.

Alan Turing's Legacy

Alan Turing's life, though tragically cut short due to his sexuality (which was illegal in the UK at the time), was marked by immense contributions beyond the Enigma. After the war, he was involved in exciting technology projects, writing programs for computers that were still under development. His work on the Bombe and his theoretical contributions to computing cemented his place as a pivotal figure in history.

The Unbroken Code

Even today, a Naval Enigma message intercepted during the war remains undecrypted, its ciphertext a challenge for modern codebreakers.

The story of the Enigma and its decryption highlights the incredible intellectual feats and collaborative efforts that shaped the course of World War II. While the Enigma was a formidable encryption machine, human ingenuity, combined with the exploitation of both mechanical flaws and human error, ultimately led to its downfall.

  Takeaways

  • The Enigma was originally a commercial cipher device patented in 1918 by Arthur Scherbius, later modified by the German military with rotors, plugboard, and revolvable rings to create a key space of over 7 × 10¹⁸ combinations.
  • Its encryption changed with every keystroke because the rightmost rotor stepped each press, and the reflector sent the signal back through the rotors, ensuring that identical letters never produced the same ciphertext.
  • Polish mathematician Marian Rejewski first reconstructed the military Enigma wiring in the early 1930s by exploiting predictable indicator repeats, building the “Bomba” to automate settings recovery.
  • At Bletchley Park, Alan Turing transformed the decryption process into logical tests—using the “no‑self‑encryption” rule and cribs—to create the Bombe, an electromechanical machine that tested millions of settings in parallel.
  • Improvements such as Gordon Welchman’s diagonal board dramatically reduced false stops, allowing over a hundred Bombes to operate by 1943 and contributing to Allied victories that likely shortened World War II by up to two years.

Frequently Asked Questions

Why could the Enigma never encrypt a letter as itself?

The Enigma’s reflector wired each letter to a different partner, so after passing through the rotors and back through the reflector, the signal could not return to its original letter; this “no self‑encryption” property was a fundamental design flaw that allowed Turing to eliminate impossible settings when testing cribs.

What were “cillies” and how did they aid the Allied decryption effort?

“Cillies” were predictable three‑letter indicator groups that German operators chose from personal names or common words instead of truly random letters; because these repeats appeared in many messages, Bletchley Park analysts could guess parts of the daily settings and narrow down the Enigma’s rotor and plugboard configurations.

Who is Veritasium on YouTube?

Veritasium is a YouTube channel that publishes videos on a range of topics. Browse more summaries from this channel below.

Does this page include the full transcript of the video?

Yes, the full transcript for this video is available on this page. Click 'Show transcript' in the sidebar to read it.

How the Enigma Machine Works

The Enigma's superiority over earlier encryption methods like the Caesar cipher lay in its ability to change the substitution rule with every letter typed. This dynamic encryption was achieved through a complex internal mechanism: 1. **Rotors:** Inside the Enigma, there are three rotors, each with 26 metal contacts on either side. When a key is pressed, current flows through these rotors. The wiring within each rotor is scrambled, meaning a letter typed (e.g., 'Y') is transformed multiple times as it passes through the rotors (e.g., Y to H, H to B, B to Q). 2. **Reflector:** After passing through the rotors, a component called the reflector directs the current back through the rotors via a different path, resulting in a final encrypted letter (e.g., 'E'). This letter is then illuminated on the lamp board above the keyboard. 3. **Rotor Rotation:** Crucially, each time a letter is typed, the rightmost rotor rotates. This ensures that pressing the same key twice will result in a different encrypted letter. The second rotor rotates after 26 rotations of the first, and the third rotor rotates after 26 rotations of the second, making the encryption highly complex.

Helpful resources related to this video

If you want to practice or explore the concepts discussed in the video, these commonly used tools may help.

Links may be affiliate links. We only include resources that are genuinely relevant to the topic.

Full transcript is not shown on this page

This page focuses on the summary and original notes. For full verification, refer to the original YouTube video.

PDF