AV BS CG DL FU HZ IN KM OW RX
Enigma in the dark
The Enigma machine was an electro‑mechanical cipher device used by Nazi Germany and its allies. The Wehrmacht "M3" model—what you are simulating here—used three rotors chosen from a set of five, plus a reflector and a plugboard. Every keypress twisted the internal wiring into a new pattern.
In this Matrix‑style version, you are staring at a ghost of that machine, wired into a digital stream. Each letter you type sinks into the green rain, re‑emerging as something altered, but perfectly reversible—if you know the exact configuration.
The horror is subtle: the machine never forgets. With the right settings, any ciphertext can be dragged back into the light.
How this simulator works
1. Alphabet and plugboard
The machine works on the 26 letters A–Z. First, the plugboard optionally swaps pairs of letters (for example, A↔V, B↔S). This is a simple substitution applied before and after the rotors.
2. Rotors
Each rotor is a scrambled mapping of A–Z. In this simulator, the wirings and notch positions are taken from historical Wehrmacht rotors I–V. The ring setting shifts the internal wiring, and the start position is what you see in the glowing rotor window.
The signal passes from the right rotor to the left rotor, hits the reflector, and returns from left to right. The same wiring is used in reverse on the way back, which is why Enigma is symmetric: encoding and decoding are the same operation.
3. Reflector
The reflector (here: Reflector B) maps each letter to another letter in a fixed pair. It sends the signal back through the rotors, ensuring that no letter can ever encrypt to itself and that the process is reversible—like a mirror in the dark.
4. Stepping and double‑stepping
On every keypress, the right rotor steps by one position. When a rotor reaches its notch, it causes the rotor to its left to step on the next keypress. The middle rotor can step twice in a row—once because it is at its own notch, and once because the right rotor reaches its notch. This simulator reproduces that double‑stepping quirk.
5. Symmetry
If you use the same rotor order, ring settings, starting positions, and plugboard pairs, then typing the ciphertext back into the machine will recover the original plaintext. There is no separate decrypt mode—only the same ritual, performed twice.
How Enigma was broken
Early Polish work
In the 1930s, Polish mathematicians—most famously Marian Rejewski—used intercepted messages, operator mistakes, and clever algebra to reconstruct the internal wiring of the Enigma rotors. They built devices called bomba kryptologiczna to search for daily keys.
Bletchley Park and the Bombe
During the Second World War, British and Allied cryptanalysts at Bletchley Park, including Alan Turing and Gordon Welchman, extended this work. They designed the electromechanical Bombe, which exploited predictable message content ("cribs") and operator habits to test possible Enigma settings at high speed.
Human mistakes
Enigma itself was not mathematically weak for its time. What made it vulnerable were procedural errors: reusing keys, sending stereotyped phrases, and failing to follow randomization rules. Those patterns were like bright green glitches in the stream.
Why it still matters
The breaking of Enigma is often credited with shortening the war and saving countless lives. It also marks a turning point in the history of computing and cryptography: the moment when mathematics, engineering, and codebreaking fused into something that looks a lot like the digital world you are staring into now.