Perhaps the most famous cipher of recent years is that used with the Enigma Machine. It was developed by Arthur Scherbius in 1918, but gained widespread notoriety when it was used by German Intelligence during World War II, and subsequently cracked by the team at Bletchley Park.
The Enigma machine is essentially a complicated substitution cipher machine. It consists of a plug board, a light board, a set of rotors and a reflector.
The machine came with a number of rotors, each of which rotor contained a random substitution alphabet. The user would select between 3 and 5 rotors to use at any one time, depending on the size of the machine. The plug board was another variable for the machine. Certain letters would be connected reciprocally to each other.
Each month, the German code sender (??) would receive a code book outlining the key to be used for each day. A day key might look like this:
|Plug board:||(A,I) (J,F) (E,M) (Z,X) (W,O) (S,B)|
|Rotor key setting:||KWO|
The machine itself looked like an old fashioned typewriter. When the user pressed the letter to be encoded, it would first pass through the plug board, then through the 3 rotors, the reflector, and back through the rotors in reverse. The encrypted letter would then be lit up on the display. Firstly the operator would set up the plug board as indicated, then would arrange the rotors and finally set the rotors to the day key.
The plug board randomly paired 12 letters to each other. So, if H was mapped to P, P would be mapped to H. The remaining rotors map each letter to another. The encrypted letter reaches the reflector, which unlike the rotors does not rotate, so the mappings remain the same. It then passes back through the reversed rotors.
All in all, the letter passes through a minimum of 7 re-mappings (if the letter is not connected to another on the plug board), and a maximum of 9 re-mappings (if the letter is connected to another on the plug board). Before the next letter would be encoded, the right hand rotor would rotate. The middle rotor would rotate once the right hand rotor had done a complete revolution, and likewise the left hand rotor would rotate once the middle rotor hand undertaken a complete revolution.
They decided to use different keys for each message by setting their machine to the key of the day, e.g. COU, and sending the new key, e.g. NTO encrypted twice, resulting in ZJMELF. The receiver could then decrypt the message using the key of the day and would know to set his or her machine to the new key NTO for the new message.
As they were sending hundreds of messages every day, the Germanís realised that using a single key every day could decrease the security of the system as it would give the enemy more information to work with in a single key.
The machine consists of a series of 3 rotors, each of which substitutes the original plaintext letter for another. Let us call them rotor 1, rotor 2, and rotor 3. Each rotor is set to encode a specific cipher.
Letís illustrate this by encoding a single letter, the letter ĎHí.
Rotor 1 will encode the plaintext as follows:
H → Q
Rotor 2 then takes our new letter Q and encodes this:
Q → Q
The Q is then passed through Rotor 3:
Q → I
At this stage, the encrypted letter reaches the reflector. This was also set to a predetermined encryption. This is the Reflector C:
I → E
As you can see, there are only 13 permutations in the reflector, because the letters are arragned in pairs. So,
Now the encrypted letter passes back through the rotors, this time set in the inverse position. So, rotor 3 now looks like this
E → P
Rotor 2 has also been reversed and appears like this:
P → U
Finally our encoded letter passes through the inverse rotor 3:
U → W
Even though the Enigma machine had a huge number of possibilities for each letter, it still weaknesses that were exploited by the team at Bletchley Park and eventually were its downfall..
It also guarantees that it is impossible for a letter to be encoded as itself. This was vital to the team at Bletchley Park who helped decode the Enigma.