1. Home
  2. Numberphile

Jan 9, 2013

How the Enigma scrambled every letter differently

James Grime

11 min → 1:31

Overview

Numberphile demonstrates a genuine WWII German Enigma machine, looking inside at its rotors and plugboard to calculate the 158,962,555,217,826,360,000 possible settings that challenged the Allies.

3 things to know

Numberphile says Enigma changes letter codes with every press

Numberphile explains that rotating wheels called rotors inside the Enigma machine change the letter substitutions with every key press, so the same letter is encrypted differently throughout a message.

More

This is achieved through the rotating wheels (rotors), meaning the same letter will be encrypted differently throughout a message.

▶ Watch at 4:45

Numberphile multiplies wheel and plugboard setups for total settings

Numberphile uses principles of combinatorics to calculate the total number of possible settings by multiplying the combinations available for the rotor order, rotor starting positions, and plugboard connections.

▶ Watch at 10:45

Numberphile notes rotor choices formed key daily Enigma settings

Numberphile notes that selecting and setting the initial positions of the core scrambling rotors were key parts of the daily settings, creating a vast number of possible combinations.

More

The core scrambling units of the machine.

Also in this episode

Numberphile explains the front plugboard swapped pairs of letters

Numberphile explains that a patch panel at the front of military-grade Enigma machines let operators swap pairs of letters before and after they passed through the rotors, dramatically increasing possible key settings.

More

This feature dramatically increased the number of possible key settings.

Numberphile: Nazi Germany used Enigma for secret WWII messages

Numberphile explains that Nazi Germany used the electro-mechanical Enigma rotor cipher device to encrypt and decrypt secret communications during World War II.

▶ Watch at 0:07

Quotes

“it shows how mathematicians can save lives.”

▶ Watch at 0:07

“And this is the mistake the Germans made.”

▶ Watch at 4:45

“That is the total number of ways that you can set the Enigma machine.”

▶ Watch at 10:45

Full summary

Episode Overview

  • An introduction to a genuine WWII-era German Enigma machine, explaining its historical significance in encrypting secret messages.
  • A hands-on demonstration of how the machine encrypts the word "NUMBERPHILE," showing how each letter press results in a different coded letter lighting up.
  • A look inside the machine at its core components—the rotors and the plugboard—which create its complex, ever-changing cipher.
  • A detailed mathematical breakdown of the total number of possible settings, illustrating the immense scale of the cryptographic challenge faced by the Allies.

Key Concepts

  • Enigma Machine: An electro-mechanical rotor cipher device used by Nazi Germany to encrypt and decrypt secret communications during World War II.
  • Polyalphabetic Cipher: The Enigma machine creates a cipher where the substitution for each letter changes with every key press. This is achieved through the rotating wheels (rotors), meaning the same letter will be encrypted differently throughout a message.
  • Rotors: The core scrambling units of the machine. The selection and initial positioning of these rotors are key parts of the daily settings, creating a vast number of possible combinations.
  • Plugboard (Steckerbrett): A patch panel at the front of the military-grade Enigma machines that allowed operators to swap pairs of letters before and after they passed through the rotors. This feature dramatically increased the number of possible key settings.
  • Combinatorics: The episode uses principles of combinatorics to calculate the total number of possible settings by multiplying the combinations available for the rotor order, the rotor starting positions, and the plugboard connections.

Quotes

  • At 00:07 - "it shows how mathematicians can save lives." - Dr. James Grime introduces the Enigma story by highlighting its real-world impact and the crucial role of mathematicians in breaking the code.
  • At 04:45 - "And this is the mistake the Germans made." - Dr. Grime explains the critical design flaw of the Enigma machine: a letter could never be encrypted as itself, which provided a crucial piece of information for the codebreakers at Bletchley Park.
  • At 10:45 - "That is the total number of ways that you can set the Enigma machine." - After calculating the number of combinations for the rotors, starting positions, and plugboard, the speaker reveals the final, staggering number of possible settings.

Takeaways

  • Effective encryption relies on layered complexity. The Enigma's strength came from combining multiple variables—rotor choice, rotor order, starting positions, and plugboard settings—which multiplied together to create a massive number of possible keys.
  • Even the most complex security systems can be compromised by a single, fundamental flaw. The Enigma's inability to encrypt a letter as itself was a small but consistent weakness that codebreakers were able to exploit to dramatically reduce their workload.
  • Human behavior is often the weakest link in cryptography. German operators' predictable habits, such as using lazy key settings (e.g., "AAA") or including stereotyped phrases in messages, provided patterns that gave codebreakers a foothold to crack the daily codes.

Watch the full episode 11 min

Read along with the audio summary

Dr. James Grime opens the Enigma story by noting that it shows how mathematicians can save lives. In this episode, which came out on January 9, 2013, Dr. Grime demonstrates a genuine World War II era German Enigma machine. By the end, you will understand how its inner components generated a massive number of secret settings, and the fundamental flaws that helped Allied codebreakers crack it.

See how a single device hid Nazi Germany's secret communications. When an operator types a word like NUMBERPHILE into the machine, each key press makes a different coded letter light up.

This brings us to why typing the same letter twice produces two completely different results. The Enigma creates a polyalphabetic cipher, meaning the substitution for each letter changes every single time you press a key.

Look inside at the spinning wheels that did the scrambling. Selecting which rotors to use and setting their initial starting positions formed a key part of the daily settings, generating a vast number of possible combinations.

Military grade machines added another layer of security right at the front. Operators used a patch panel called a plugboard, or Steckerbrett, to swap pairs of letters.

Multiplying these layers together reveals the immense scale of the challenge faced by the Allies. It multiplies the rotor order combinations, the rotor starting positions, and the plugboard connections to reach a staggering final number.

The Enigma's strength came from layering multiple variables, yet even the most complex security systems can be compromised by human habits and a single fundamental flaw. Because the machine could never encrypt a letter as itself, and because German operators often used predictable phrases or lazy settings like AAA, codebreakers at Bletchley Park found the foothold they needed to crack the daily codes.

More from Numberphile

Related Episodes