Published ByVijay Bhaskar Reddy Maramreddy
Publishing DateJune 21, 2026
📚 TUTORIAL

Understanding the Enigma Machine

A deep dive into the electro-mechanical cipher that shaped World War II, with detailed explanations of every component.

JUMP TO:1. Overview2. Rotors3. Signal Path4. Stepping5. Plugboard6. Reciprocity7. Complexity8. Breaking Enigma
1

Overview

What is the Enigma machine?

The Enigma machine was an electro-mechanical rotor cipher device used by Nazi Germany to protect military, diplomatic, and commercial communications before and during World War II. Its apparent complexity led the Germans to believe it was unbreakable — a fatal overconfidence that ultimately contributed to the Allied victory.

⚙️
3-4
Rotors
Spinning cipher wheels
🔌
10 pairs
Plugboard
Letter swapping cables
🔄
1
Reflector
Signal bounce-back
💡
26
Lamps
Output display
How it works
When an operator presses a key, an electrical signal passes through the plugboard, through three rotors (each scrambling the signal), bounces off a reflector, passes back through the rotors in reverse, through the plugboard again, and finally lights up a lamp showing the encrypted letter.
2

Rotors

The heart of the Enigma — spinning substitution ciphers

Each rotor is a disk with 26 electrical contacts on each side, connected by internal wiring. When a signal enters at one position, it exits at a different position determined by the wiring. This creates a substitution cipher — but one that changes with every keypress as the rotors rotate.

ROTOR SUBSTITUTION EXAMPLE
INPUT
A
THROUGH ROTOR I
wiring: A→E
OUTPUT
E
Rotor I wiring: EKMFLGDQVZNTOWYHXUSPAIBRCJ
Historical Rotor Wirings
The Wehrmacht Enigma I used five rotors (labeled I through V), but only three were installed at any time. Each rotor had a unique internal wiring pattern, and the selection and order of rotors was part of the daily key settings.
ROTOR I WIRING
Input:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Output:
EKMFLGDQVZNTOWYHXUSPAIBRCJ
Turnover: Q | Notch: R
ROTOR II WIRING
Input:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Output:
AJDKSIRUXBLHWTMCQGZNPYFVOE
Turnover: E | Notch: F
ROTOR III WIRING
Input:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Output:
BDFHJLCPRTXVZNYEIWGAKMUSQO
Turnover: V | Notch: W
ROTOR IV WIRING
Input:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Output:
ESOVPZJAYQUIRHXLNFTGKDCMWB
Turnover: J | Notch: K
ROTOR V WIRING
Input:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Output:
VZBRGITYUPSDNHLXAWMJQOFECK
Turnover: Z | Notch: A
3

Complete Signal Path

Following the electricity through all components

Understanding Enigma requires tracing the complete path of the electrical signal. It passes through eleven stages — forward through the rotors, reflector bounce, then backwards through the rotors.

THE COMPLETE SIGNAL JOURNEY
1
Keyboard
Operator presses a key
2
Plugboard (in)
Letter swapping via cables
3
Right Rotor →
First substitution
4
Middle Rotor →
Second substitution
5
Left Rotor →
Third substitution
6
Reflector
Bounces signal back
7
← Left Rotor
Inverse substitution
8
← Middle Rotor
Inverse substitution
9
← Right Rotor
Inverse substitution
10
Plugboard (out)
Same swaps again
11
Lampboard
Encrypted letter lights up
4

Rotor Stepping

The odometer mechanism and its famous anomaly

Like an odometer, the rightmost rotor advances one position with every keypress. When it reaches a specific turnover position, it kicks the middle rotor forward. The middle rotor similarly advances the left rotor.

ROTOR STEPPING MECHANISM
LEFT ROTOR
A00
MIDDLE ROTOR
E04
RIGHT ROTOR
Q16
The Double-Stepping Anomaly
When the middle rotor is at its turnover position (E→F), the mechanism causes it to step twice in a single keypress — the right rotor advances it, then the left rotor's pawl catches it again. This mechanical quirk was a known flaw that codebreakers exploited.
// Stepping logic with double-step anomaly
function stepRotors(rotors) {
  const rightAtTurnover = TURNOVERS[right.id].includes(right.position);
  const middleAtTurnover = TURNOVERS[middle.id].includes(middle.position);
  
  // Right always steps
  newRight = right.position + 1;
  
  // Middle steps if: right was at turnover OR middle is at turnover
  if (rightAtTurnover || middleAtTurnover) {
    newMiddle = middle.position + 1;
  }
  
  // Left steps only if middle was at turnover
  if (middleAtTurnover) {
    newLeft = left.position + 1;
  }
}
5

Plugboard

Steckerbrett — the complexity multiplier

The plugboard sits at the front of the machine. Cables connect pairs of letters, swapping them before the signal enters the rotors AND after it exits. A typical setup used 10 pairs (20 letters swapped), leaving 6 unaffected.

PLUGBOARD EXAMPLE
A↔ZH↔EB↔YC↔XD↔W
Q
W
E
R
T
Z
U
I
O
A
S
D
F
G
H
J
K
P
Y
X
C
V
B
N
M
L
The Biggest Contributor to Security
The plugboard adds the most complexity to Enigma. With 10 pairs:

26! / (6! × 10! × 2¹⁰) = 150,738,274,937,250

That's over 150 trillion possible plugboard configurations alone — far more than rotor selection, positions, or ring settings combined.
6

Self-Reciprocal Property

The elegant flaw that enabled both encryption and breaking

The reflector ensures that if A encrypts to Z, then Z encrypts back to A (with the same settings). This made Enigma convenient — the same machine and settings could both encrypt and decrypt. But it also meant:

RECIPROCITY DEMONSTRATION
ORIGINAL
E
ENCRYPT
Enigma Machine
CIPHERTEXT
X
ENCRYPT AGAIN
Enigma Machine
RETURNS TO
E
The Fatal Flaw
A letter can never encrypt to itself. If you know the plaintext contains "WEATHER" and the ciphertext has "W" in the same position, that position cannot be where "WEATHER" starts. Bletchley Park used this property extensively to eliminate billions of possible settings.
7

Total Complexity

How 1.58 × 10²⁰ configurations are calculated

COMPLEXITY BREAKDOWN
ROTOR SELECTION
60
5 × 4 × 3 arrangements
START POSITIONS
17,576
26³ combinations
RING SETTINGS
17,576
26³ combinations
PLUGBOARD
150.7T
trillion combinations
TOTAL POSSIBLE CONFIGURATIONS
≈ 1.58 × 10²⁰
158,962,555,217,826,360,000
More than all grains of sand on Earth
THE CALCULATION
Total = Rotor Selection × Positions × Rings × Plugboard

Rotor Selection:  5 × 4 × 3 = 60 ways to choose and order 3 rotors
Rotor Positions:  26³ = 17,576 starting positions
Ring Settings:    26³ = 17,576 offset configurations  
Plugboard:        26! / (6! × 10! × 2¹⁰) = 150,738,274,937,250

Total = 60 × 17,576 × 17,576 × 150,738,274,937,250
      ≈ 1.58 × 10²⁰
Perspective
158 quintillion is approximately:
  • More than the estimated grains of sand on Earth (~10¹⁸)
  • Roughly the number of seconds since the Big Bang × 5 million
  • Testing one setting per nanosecond would take 5,000 years
Yet Bletchley Park broke messages within hours.
8

Breaking Enigma

How Bletchley Park defeated the unbreakable

The Allies didn't break Enigma by trying all combinations. They exploited weaknesses in both the machine and German operating procedures.

1. Cribs (Known Plaintext)
Germans used predictable phrases: weather reports started with "WETTER" (weather), many messages contained "KEINE BESONDEREN EREIGNISSE" (nothing to report). These "cribs" gave codebreakers known plaintext to work with.
2. No Self-Encryption
Since a letter never encrypts to itself, if a crib couldn't align without matching letters, that position was eliminated. This massively reduced the search space.
3. The Bombe
Alan Turing's electro-mechanical Bombe tested thousands of rotor settings per second, looking for self-consistent plugboard configurations. When contradictions arose, it moved to the next setting.
4. Human Error
Operators often used predictable message keys (AAA, ABC, or their girlfriend's initials). Some retransmitted messages with slight changes. Others used recognizable sign-offs. All exploitable.
5. Captured Materials
Naval captures provided codebooks with daily settings. While these expired, they revealed patterns in how settings were generated and confirmed decryption methods were working.
"The intelligence gained from breaking Enigma is estimated to have shortened the war by two to four years, saving countless lives."
— Historical consensus
Ready to try it yourself?

Use the interactive Enigma simulator to encrypt messages, watch the signal flow in real-time, and experience the machine firsthand.

→ Open Enigma Simulator
Copyright belongs to Azyntis Technologies 2026 · Hyderabad 🇮🇳 · Singapore 🇸🇬 · London 🇬🇧