Friday, August 10, 2007

Enigma Simulation

I don't remember the details of how the Enigma machine worked, but wikipedia has a detailed article on it. It was used by the Nazi's to code their messages and famously the code was broken by the allies. I've seen one in the National Cryptologic Museum. And now thanks to the web, here's "the definitive Macromedia Flash simulation of the three-rotor ENIGMA". It's very cool.

"A brief example: Open the machine window, click on the "Input:" textbox and enter "c" on the keyboard. The plugboard leaves C as C while highlighting the specific wire in red. The electrical current then moves to the rightmost rotor, that is, to its letter A. A is then connected to B. The current enters the middle rotor, that connects G with R. The third (leftmost) rotor maps V to I. In the next step, the reflecor maps B to R. Then the current moves way back along the green wires through the rotors back to the plugboard, where Q leads to Q. As a result, we have the encryption of C to Q.

If you now enter "c" again, you see that in this case it yields G! This is because the rightmost rotor moves one step to the left before a letter is entered. Special case: whenever the right rotor moves from V to W, the second rotor is also changing its position by one step. This holds true for the middle rotor accordingly. All in all, the rotors behave like an odometer."

No comments: