The Enigma machine was an electromechanical device built by the Germans in World War II to mechanise encryption. The device was about the size of a typewriter and had two sets of letters on a keyboard and a lampboard. The message got encrypted letter by letter.
The Enigma machine was a large circuit. It had the following components.
- Rotors 1, 2, and 3. They connected the cris-cross wires from one letter to another. But these three rotors are selected from a total of five.
- The reflector connected 26 letters into 13 pairs.
- The plugboard connected some letters into pairs, and some were left unconnected. In one version, it connected 20 letters into ten pairs and left six unpaired.
So what are the total possibilities?
1) 3 chose from 5 (and order matters) => 5!/2! = 60.
2) Three rotors with 26 letters available => 26 x 26 x 26 possibilities
3) 10 pairs from 26 possible letters => 26!/6!10!210. 210 comes because a pair AB is indistinguishable from BA, and there were 10 such combinations.
Multiply all three, and you get the possible ways to set the enigma machine! That equals 1.589626e+20.
158,962,555,217,826,360,000 (Enigma Machine): Numberphile