Enigma Machine Simulator

The Enigma machine was an electromechanical cipher device used by Nazi Germany during World War II to encrypt military communications. With over 158 quintillion possible configurations, it was considered unbreakable until Polish and British codebreakers at Bletchley Park — led by Alan Turing — exploited its structural weaknesses. Use this free simulator with authentic Wehrmacht Enigma I rotors, reflectors, and plugboard to encrypt and decrypt messages.

Machine Configuration

Left Rotor
Rotors:
Position:
Ring Setting:
Middle Rotor
Rotors:
Position:
Ring Setting:
Right Rotor
Rotors:
Position:
Ring Setting:
Reflector:
Plugboard0/13 pairs
LeftI
Z
A
B
Q
MiddleII
Z
A
B
E
RightIII
Z
A
B
V
Encrypt
Result
0 characters
Type a character to see the signal path

Frequently Asked Questions About the Enigma Machine

What is the Enigma machine?

The Enigma machine was an electromechanical cipher device used primarily by Nazi Germany during World War II to encrypt military communications. Invented by German engineer Arthur Scherbius in 1918 and commercially available from 1923, it was adopted by the German military in 1926. The machine uses a combination of rotors, a reflector, and a plugboard to create an extremely complex substitution cipher. With over 158 quintillion possible settings, it was considered unbreakable — until Polish and British codebreakers found exploitable weaknesses in how operators used it.

How does the Enigma machine work?

When a key is pressed, the signal passes through the plugboard (which swaps some letter pairs), then through three rotors in sequence (each scrambling the alphabet differently), hits a reflector that bounces the signal back through all three rotors in reverse, passes through the plugboard again, and lights up the output lamp. Before each keypress, the rightmost rotor steps forward, and mechanical notches cause the middle and left rotors to step at specific intervals. This means each letter is encrypted with a different substitution alphabet, making frequency analysis nearly impossible.

Who broke the Enigma code?

The Enigma was first broken by Polish mathematician Marian Rejewski in 1932, along with colleagues Jerzy Rozycki and Henryk Zygalski. They shared their work with Britain and France in 1939, just before the war. At Bletchley Park in England, Alan Turing and Gordon Welchman built the Bombe machine in 1940 to automate the process of finding daily Enigma settings. Their work is estimated to have shortened World War II by at least two years, saving millions of lives.

What is double stepping in the Enigma machine?

Double stepping is a mechanical anomaly where the middle rotor advances on two consecutive keypresses. Normally, the middle rotor only steps when the right rotor reaches its notch position. However, if the middle rotor itself is at its notch position, the mechanical pawl engages and causes it to step again when the left rotor advances. This reduces the theoretical period of the machine from 26x25x26 = 16,900 to 26x25x26 = 16,900 minus a small number, and was one of the quirks that codebreakers had to account for.

What does the plugboard do on the Enigma machine?

The plugboard (Steckerbrett) is a panel on the front of the Enigma machine with 26 sockets, one for each letter. Operators could use cables to connect pairs of letters, causing them to swap before and after the rotor encryption. Up to 13 pairs could be connected simultaneously. The plugboard was the single greatest source of the Enigma's cryptographic strength, contributing a factor of over 150 trillion to the total number of possible settings.

How many possible configurations does the Enigma machine have?

The Wehrmacht Enigma I has approximately 158,962,555,217,826,360,000 (roughly 1.59 x 10^20) possible configurations. This comes from: choosing 3 rotors from 5 (60 ways), 26^3 starting positions (17,576), 26^3 ring settings (17,576), and the plugboard connections with 10 pairs (over 150 trillion combinations). Even modern computers would need significant time to brute-force all possibilities, though the machine's known weaknesses make targeted attacks feasible.

Is the Enigma machine secure by modern standards?

No. While the Enigma's key space of ~1.59 x 10^20 seems large, modern computers can search it rapidly. More importantly, the Enigma has fundamental cryptographic weaknesses: a letter can never encrypt to itself (due to the reflector), the substitution is involutory (encrypt = decrypt), and the rotors create patterns that can be exploited. Modern encryption algorithms like AES use key spaces of 2^256 (far larger) and avoid all of these structural weaknesses.

What role did Alan Turing play in breaking Enigma?

Alan Turing joined Bletchley Park's codebreaking efforts in September 1939 and designed the Bombe machine, an electromechanical device that could test thousands of possible Enigma settings per second. Turing exploited the fact that no letter can encrypt to itself (the reflector property) and used known plaintext attacks — guessing likely words in messages (called 'cribs') — to dramatically narrow down possible settings. His work, along with Gordon Welchman's improvements, made it possible to decrypt Enigma messages fast enough to be militarily useful.

What is the Bletchley Park connection to Enigma?

Bletchley Park was a Victorian mansion in Buckinghamshire, England, that served as the headquarters of Britain's Government Code and Cypher School (GC&CS) during World War II. At its peak, over 10,000 people worked there, including mathematicians, linguists, and chess champions. The codebreaking work done at Bletchley Park — particularly on Enigma and the more advanced Lorenz cipher — produced intelligence codenamed 'Ultra,' which gave the Allies advance knowledge of German military plans and is widely credited with helping shorten the war.

What is the Enigma Machine?

The Enigma machine was an electromechanical cipher device used primarily by Nazi Germany during World War II to encrypt military communications. Invented by German engineer Arthur Scherbius in 1918 and sold commercially from 1923, the machine was adopted by the German military in 1926. It combines a plugboard, three (or more) rotors, and a reflector to produce a polyalphabetic substitution cipher with approximately 158 quintillion possible configurations — making brute-force attacks practically impossible with 1940s technology.

Despite its enormous key space, the Enigma was broken through a combination of mathematical insight, operator errors, and dedicated machinery. Polish mathematician Marian Rejewski first cracked the Enigma in 1932, and his work was later extended at Bletchley Park by Alan Turing, who designed the Bombe machine to automate the search for daily settings. Their collective effort is estimated to have shortened World War II by at least two years.

How the Enigma Machine Works

Signal Path

When a key is pressed on the Enigma keyboard, the electrical signal follows this path:

  1. Plugboard (Steckerbrett) — The signal first passes through the plugboard, which swaps pairs of letters. Up to 13 cables can be connected, each swapping two letters.
  2. Entry Wheel (Eintrittswalze) — The signal enters the rotor assembly through the static entry wheel.
  3. Right Rotor — The signal passes through the rightmost rotor, which substitutes the letter according to its internal wiring and current position.
  4. Middle Rotor — The signal continues through the middle rotor.
  5. Left Rotor — The signal passes through the leftmost rotor.
  6. Reflector (Umkehrwalze) — The reflector sends the signal back through the rotors in reverse order, ensuring that no letter can encrypt to itself.
  7. Rotors (reverse) — The signal travels back through all three rotors from left to right, using the inverse wiring path.
  8. Plugboard (again) — The signal passes through the plugboard a second time before lighting the output lamp.

Rotor Stepping Mechanism

Before each letter is encrypted, the rotors step forward:

  • The right rotor advances by one position on every keypress.
  • The middle rotor advances when the right rotor reaches its notch position (a specific letter determined by the rotor type).
  • The left rotor advances when the middle rotor reaches its notch position.

This creates the double-stepping anomaly: if the middle rotor is at its own notch position, it steps again when the left rotor advances, causing it to move on two consecutive keypresses. This mechanical quirk slightly reduces the cipher's period and was an important factor for codebreakers.

The Rotors

The Wehrmacht Enigma I used five interchangeable rotors (labeled I through V), each with a different internal wiring and a single notch position:

RotorNotchTurnover
IQR
IIEF
IIIVW
IVJK
VZA

Three of these five rotors were selected and placed in any order, giving 60 possible rotor arrangements.

Ring Settings

Each rotor has a ring setting (Ringstellung) from 1 to 26 that offsets the relationship between the rotor's internal wiring and its visible position indicator. Ring settings change the mapping between the rotor position and its internal wiring without altering the wiring itself.

The Reflector

The reflector (Umkehrwalze) pairs up all 26 letters, sending the signal back through the rotors. Three reflectors were used:

  • UKW-A — Used in early models
  • UKW-B — The most commonly used reflector during the war
  • UKW-C — An alternative reflector

The reflector is what makes Enigma reciprocal (or involutory): encrypting a message with the same settings produces the original plaintext. This means encryption and decryption are the same operation.

The Plugboard

The plugboard (Steckerbrett) was the single greatest contributor to the Enigma's cryptographic strength. With 10 cable pairs (the standard operational configuration), the plugboard alone provides over 150 trillion possible configurations. Each cable swaps a pair of letters both before and after the rotor encryption.

History and Breaking of Enigma

Polish Codebreakers (1932-1939)

In 1932, mathematician Marian Rejewski at the Polish Cipher Bureau exploited a procedural weakness — operators encrypted the daily message key twice at the start of each message. Using this redundancy and mathematical group theory, Rejewski reconstructed the rotor wirings without ever seeing a physical machine.

Together with colleagues Jerzy Rozycki and Henryk Zygalski, the Polish team built Bomba machines and created Zygalski sheets to find daily settings. In July 1939, just weeks before the German invasion of Poland, they shared their complete knowledge with British and French intelligence.

Bletchley Park (1939-1945)

At Bletchley Park, Alan Turing designed an improved Bombe machine that exploited a different weakness: known plaintext (called "cribs"). Operators often began messages with predictable phrases like weather reports or "nothing to report" (NIHIL NOVI). Combined with the reflector property that no letter encrypts to itself, cribs dramatically narrowed the search space.

Gordon Welchman improved Turing's design with the "diagonal board," which exploited the plugboard's symmetry. At its peak, over 200 Bombe machines ran simultaneously at Bletchley Park and its outstations, processing thousands of possible settings per second.

The intelligence produced from decrypted Enigma messages, codenamed Ultra, gave the Allies advance knowledge of German military plans and is widely credited with shortening the war by two or more years.

Key Weaknesses of the Enigma

Despite its enormous key space, the Enigma had several exploitable weaknesses:

  1. No self-encryption — A letter can never encrypt to itself (due to the reflector). This was Turing's primary exploit.
  2. Reciprocal encryption — The same settings encrypt and decrypt, which constrains the cipher's mathematical structure.
  3. Operator errors — Repeated message keys, predictable cribs, and lazy operators who reused settings.
  4. Rotor order patterns — The mechanical stepping creates predictable mathematical relationships between consecutive letters.

Enigma vs. Modern Encryption

FeatureEnigmaAES-256
Key space~1.59 x 10^202^256 (~1.16 x 10^77)
Self-encryptionImpossiblePossible
Known-plaintext resistanceWeakStrong
Algorithm secrecyRequiredNot required (Kerckhoffs's principle)

Modern encryption algorithms avoid all of the Enigma's structural weaknesses while operating on key spaces that are incomprehensibly larger. However, the Enigma remains a landmark achievement in the history of cryptography and a compelling educational tool for understanding cipher mechanics.