Enigma


Just a little tidbit I want to share with the world. I was researching the Turing test, then I looked up Alan Turing, universal Turing machines, Colossus (the first UTM), and the enigma code (which Colossus cracked). So now we're here.

The enigma machine is quite a nifty little device. On the outside, it has a keyboard and a matching board of lights - one for each letter. You push a key, and a light will light up. Type a letter of your message, write down the letter that lights up, and repeat.

Inside, the machine contains three or more interchangeable rotors that substitute one letter for another. For example, Rotor I may pick the letter two places after the input letter in the alphabet, Rotor II may move five places backward, and Rotor III could have a predefined algorithm with no real pattern.

When a key is pressed, an electrical signal passes from the key to the rotors. Each rotor encrypts the letter based on that rotor's pattern.

After all three (or up to six) rotors have been traversed, the signal hits a reflector. The reflector is interchangeable like the rotors, and substitutes letters like one as well. The special feature of the reflector is that once it is passed, the signal goes back through the rotors in reverse. Only once the signal has gone through the rotors twice is the letter considered properly encrypted.

The fun tidbit is just how encrypted this system is. Each of many types of rotor can be placed in each of the 3-6 slots, and the reflector can be changed out as well. So the grand total for number of possible encryption types is:


3,283,883,513,796,974,198,700,882,069,882,752,878,379,955,261,095,623,685,444,055,315,226,006,433,616,627,409,666,933,182,371,154,802,769,920,000,000,000 different encryption types.


For reference, if you took the number of atoms and multiplied it by number of grains of sand on the planet squared, you would be just two powers of ten larger than the number of encryptions.

But what's the fun of encrypting the message if you can't decrypt it? But wait - that's the cool part. To decrypt an enigma message:

  1. Confirm that your machine has the correct settings for the day. (All enigma machines used the same settings, which changed at midnight.)
  2. Put in the first encrypted letter.
  3. Record the output.
  4. Repeat steps 2-3 for the rest of the message.

That's it - the decryption process is the same as the encryption process. (Ciphers with this property are called "symmetric ciphers.")

The only way that the Allies were able to crack it was with a machine that could brute-force things faster than people could*.

I'm slightly astounded that the Allies actually won World War II. If not for Turing, America would be called New Germany right now.

So I owe my independence to Alan Turing. Thank you, Dr. Turing.


*There was more complexity to it than that. Most of the combinations could be eliminated because the primary rule of enigma was it never outputted the same letter that was inputted. However, the essence of the machine was still brute-forcing its way through the billions of possible combinations.