Cabinet Noir>Learn / Enigma machine

Not sure which cipher? Identify it
A rotor machine: three wheels and a reflector reshuffle the alphabet with every keypress.
Typepolyalphabetic substitution cipher
Breaking ithard to break by hand
Era1920s — 1940s
NameInvented by Arthur Scherbius in Germany; patented 1918, adopted by the German military from 1926.
Modesencrypt · decrypt

Learn

Enigma machine

How the Enigma machine works

The idea in one sentence

The Enigma is an electromechanical Polyalphabetic machine: three Rotor wheels reshuffle the Alphabet with every keypress, and a Reflector bounces the signal back through the wheels — so the same letter almost never encrypts the same way twice.

The machine on this site

The tool models an Enigma I in a fixed configuration:

  • Rotors I, II and III, left to right, starting from the key you type (three letters, A–Z — the Grundstellung, the start positions);

  • Reflector B;

  • no plugboard and a straight entry wheel.

Be honest with yourself about the word key: on the real machine the key sheet also carried the rotor order (five rotors to choose three from), the ring settings and up to ten Plugboard pairs. The three letters here are only the start positions — the smallest slice of a real Enigma key.

The recipe

  1. Set the three rotors to the key, for example AAA.

  2. Type a letter. First the rotors step — the rightmost wheel advances one position on every keypress.

  3. The signal then runs: through the entry wheel, right-to-left through the three rotors, into the reflector, which sends it back left-to-right through the same rotors, out through the entry wheel.

  4. A lamp above the keyboard lights: that is the ciphertext letter.

A worked example

Step 1 of 5
Plaintext letter
Rotor window (I·II·III)
Result
A
AAB
B

This is the most famous sanity check in cryptology: Enigma I, rotors I-II-III, reflector B, start positions AAA, typing AAAAA gives BDZGO. Watch the middle column — the rotor window advances AAB, AAC, AAD… as you type, and every A is enciphered at a different rotor state, which is why the outputs differ.

The rolling alphabet

  • The right rotor advances on every keypress — 26 steps, then it carries into the middle rotor.

  • Each rotor has a notch: when it steps past its notch (rotor I carries after Q), the wheel to its left steps too.

  • The middle rotor has the famous double-step quirk: being at its own notch makes it step on two consecutive keypresses, so the left rotor turns sooner than a clean odometer would suggest.

Why the same machine encrypts and decrypts

The reflector maps letters in pairs (A↔Y, R↔U…) and never maps a letter to itself. Because every stage of the path is traversed forward and then backward in mirror order, the whole machine is its own inverse: set the same start positions, type the ciphertext, and the plaintext lamps light. That is why the tool has no real "decrypt mode" — the swap button is a courtesy, not a necessity.

Try it in the tool

Step-by-step guides

Encrypt your first message

  1. Type your message into the message input. Only the letters A–Z travel — spaces, digits and punctuation are dropped without comment, exactly as on the real machine, which had no space bar.

  2. Set the three-letter key in the Key field — the rotor start positions, for example AAA.

  3. Read the result in the output field. The letters roll on their own; nothing else needs adjusting.

Decrypt a message you received

  1. Paste the cryptogram into the message input. Keep it as bare letters — the tool ignores everything else.

  2. Set the same three-letter key in the Key field that the sender used. A wrong key produces pure noise, not a graceful degradation.

  3. Press the swap button the swap button — or don't. An Enigma is its own inverse, so encrypting and decrypting are the very same operation; the swap button exists only for symmetry with the other tools on this site.

Work like a codebook clerk

  1. Real traffic was broken into chunks: the sender picked a random message key, enciphered the message with it, and sent the message key (twice — that habit became fatal) at the head of the transmission.

  2. To simulate this: encipher the body with one key setting in the Key field, note the ciphertext, then start a fresh run with the message key and encipher the three-letter key itself. The receiver did the steps in reverse.

  3. Try the same message under two different keys and compare the ciphertexts — no visible relationship survives, which is exactly what the rotor motion is for.

Breaking the Enigma

The Enigma machine itself was never "broken" in the way Caesar or Vigenère fall — its mathematics, per message, was beyond anyone's paper arithmetic. What broke was the system around it: habits, procedures and cribs. This page tells that story, because it is the greatest cryptanalysis lesson of them all.

Try it in the tool

The flaw: a strong machine in leaky hands

Three procedural gifts sank Enigma:

  1. The doubled message key. Operators enciphered each message's three-letter key twice at the head of every transmission — six letters whose first and fourth, second and fifth, third and sixth letters were guaranteed relationships. Marian Rejewski exploited exactly that structure to reconstruct the rotors mathematically in 1932 — without ever touching a machine.

  2. The Crib. Routine formulae — weather reports (WETTER…), salutations, ANX headers, predictable placeholders — gave Bletchley a stretch of probable plaintext for almost any day's traffic.

  3. Keys chosen by humans. "No letters allowed" rules against AAA and QWE made operator-chosen keys weaker, and lazy keys (three consecutive keyboard rows) appeared anyway.

The bombe: contradiction machines, not key search

The British bombe (designed by Alan Turing, with Gordon Welchley's crucial improvements after the Polish bomba) did not try keys. Given a crib, it searched for rotor settings that were impossible:

  • A crib like WETTER says: plaintext letter W becomes ciphertext letter X at position 1, E→Y at position 2, and so on.

  • For each candidate setting, the bombe tested whether that mapping was consistent with the machine's wiring — many cribs produce loops (chains of letter-pair statements that circle back on themselves), and a loop makes a whole class of settings logically contradictory.

  • Every contradiction eliminated thousands of settings at once; the few survivors were tested on a real machine for intelligible German.

That is constraint logic, not brute force — the ancestor of the solving strategies used across computer science today.

Why there is no cracker in this tool

A bombe simulation needs a crib, a contradiction engine and a search over rotor orders, rings and plugboards — a project of its own, far beyond this site's key-search crackers. The demo above works the way a real radio operator's opponent would: with a captured or guessed key, the decryption is one paste; the hard part was always getting that key, and that part lives in history, not in this tool.

The verdict

Historian Harry Hinsley estimated that the Enigma intelligence (Ultra) shortened the Second World War by two to four years. No other cipher's defeat has a comparable claim. The machine that lost was not weak — the procedure around it was, and that distinction is the deepest lesson on this site: cryptography is a system, and systems break at their weakest habit.

Where to go next

  • Compare with the Vigenère page: Vigenère fell to statistics; the Enigma fell to procedures. Both attacks target the system.

  • The Polish bomba and the British bombe are two different machines with one name and one ancestor — the history page untangles them.

Glossary

Plaintext — The original readable message before encryption.
Ciphertext — The scrambled message produced by encryption.
Key — The secret that controls how the text is scrambled.
Alphabet — The set of letters the cipher works with.
Polyalphabetic — A cipher that uses several alphabets in turn instead of one.
Rotor — A wired wheel that maps letters through a fixed scrambling and rotates one step per keypress, changing the mapping as you type.
Plugboard — A panel of cable pairs swapping letters before and after the rotors; the main multiplier of Enigma's key space.
Reflector — A fixed, self-inverse wiring that bounces the signal back through the rotors; it makes Enigma reciprocal but never maps a letter to itself.
Crib — A word you guess is in the plaintext; comparing it with the ciphertext reveals key letters.