Enigma Machine
An interactive simulation of the WWII Enigma I cipher machine. Configure rotors, ring settings, and plugboard connections, then type a message to watch the electrical signal path illuminate through each component — the same polyalphabetic substitution that kept German military communications secret until the codebreakers at Bletchley Park cracked it.
How the Enigma worked
The Enigma machine used a series of electromechanical rotors to scramble messages. When an operator pressed a key, an electrical signal passed through a plugboard (which swapped pairs of letters), then through three rotors (each implementing a different substitution cipher), bounced off a reflector, and returned back through the three rotors in reverse order and through the plugboard again. The result lit up a lamp showing the encrypted letter. Crucially, a letter could never encrypt to itself — a property the codebreakers exploited.
The rotors
Each rotor contained a fixed wiring that mapped each of the 26 input contacts to a different output contact. The right rotor stepped forward one position with every keypress, like an odometer. When it reached its notch position, it would cause the middle rotor to step, and likewise the middle rotor could advance the left rotor. The ring setting offset the relationship between the visible letter and the internal wiring. With five rotors to choose from (placed in any three of the five slots), this gave 60 possible rotor orderings.
How it was broken
Polish mathematicians — Marian Rejewski, Jerzy Rozycki, and Henryk Zygalski — first broke the Enigma in the early 1930s using mathematical group theory. When the Germans increased security, the Poles shared their work with British intelligence. At Bletchley Park, Alan Turing and Gordon Welchman designed the Bombe, an electromechanical device that could test thousands of rotor settings per day. They exploited the no-self-encryption property, known cribs (guessed plaintext), and procedural errors by German operators. By 1943, most Enigma traffic was being read within hours.
Using this simulation
Select rotors, set their starting positions (the message key), configure ring settings, and add plugboard pairs. Type in the plaintext box to encrypt. To decrypt, reset the machine to the same settings and type the ciphertext. The canvas shows the signal path through each component for the most recent letter. The keyboard lights up to show input and output.