Enigma
The Enigma is perhaps one of the most well-known antique crypto-machines of today. It was used mostly by the Germans during World War II for secret military correspondence. Engineered by Arthur Scherbius in 1918, the Enigma, true to its name, was kept a well-guarded secret until 1974, when the British government decided to disclose the details of how it was deciphered. During the World Wars, the Germans were blissfully unaware of the fact the Poles and the British had actually managed to create a replica of the Enigma, let alone decipher the intercepted German messages and they continued encrypting messages using the Enigma. Many reckon this break-through shortened the Second World War by at least two years, thus saving countless human lives.
The Enigma was available in both commercial and military flavours. The Enigma A and Enigma B were commercial machines marketed by the company Chiffriermaschinen Aktien-Gesellschaft. The machine used by the German Army was called the Wehrmacht Enigma. The German Navy had their own version of the contraption called the Funkschlüssel M or M3. While the Germans were certainly the pioneers of this machine, a lesser known fact is that similar machines were used in countries like Italy and Spain. The Japanese also devised a machine which was customized for the Japanese script.The Enigma belongs to the general category of cipher machines called rotor machines which were popular during this era. A common thread running through all these machines is the use of circular discs called rotors to encipher the plaintext.
Rotors
Before, delving into the actual working, it would help to understand the concept of rotors. A rotor is a circular disc having a number of electrical contacts on either of its faces. The rotors of the Enigma had 26 electrical contacts on both sides, each contact representing a particular letter. Internally, each of the contacts on one of the faces was connected to another contact on the other face. For example, the contact corresponding to A on the right face could be connected to a contact on the left face corresponding to J. Likewise, C on the right face may be wired to I on the left face. The scheme in which each rotor was internally wired was pre-defined. During the early years of its use, the Enigma had three different rotors identified as I, II and III, which differed from each other in their wiring schemes. As years rolled on, there was a need to increase the level of encryption in the Enigma. To this end, a set of five rotors were introduced of which any three would be used at a time. The rotors are placed parallel to each other as if on an imaginary common central axis and can be made to rotate individually using a gear assembly. Further more, a 'manually configurable stator', so to say, called a plug board was placed before the rotors. In essence it was a flattened out 'rotor' which could not move (hence we call it a stator), providing the operator with the option of rewiring it to a different schema just by swapping the wires between ports. This added a new dimension to the level of security as the wiring configuration could be changed periodically easily.
The Enigma had a keyboard similar to a type-writer with 26 keys and a set of 26 bulbs corresponding to each letter of the alphabet. Enciphering a plaintext is as simple as pressing a letter on this keyboard - a particular bulb lights up and the letter it denotes is the corresponding cipher text. If the same letter is pressed again, a different letter lights up now. Thus, the Enigma performs a poly-alphabetic substitution i.e., it replaces a particular letter in the plain-text with different letters each time the letter is encountered in the plain text, as against mono-alphabetic substitution wherein a particular letter in the plain text is replaced by a fixed letter throughout. This is achieved with the help of the three rotors placed one after another. If only one rotor is used, then the encipherment would merely amount to a mono-alphabetic substitution since each 'input' letter would have another corresponding 'output' letter. Thus, in the Enigma, the 'output' of one rotor is given to the next rotor. Again, if this was the case, it would only be a series of mono-alphabetic substitutions. Hence, immediately after each letter is keyed in, the rotors are made to rotate to a new position. So pressing the same key again in succession would now produce a different cipher text corresponding to the new rotor positions. The right-most rotor rotated for every key press, the middle one rotated once for every 26 rotations of the first rotor and similarly the left-most rotor rotated once for every 26 rotations of the middle rotor. So in effect, if the same letter was keyed in several times (a trivial case), the cipher text would start repeating in a pattern only after 26x26x26 = 17576 times.
Internal Working
The Enigma is an electromechanical device. The buttons on the keyboard act as switches in an electric circuit. Pressing a button closes a circuit and causes current to flow from a battery through the depressed button, the rotor wiring, to the lamp and back to the other terminal of the battery. In the later improvised versions of the Enigma a additional reflector disk was attached after the third rotor, which, as the name implies, re-routed the current through a different path back into the rotors. For example, if the current comes out through the terminal designated as F from the third rotor, the reflector disk would be so wired that it passively re-routes the current through the terminal S of the same.
Assume that the operator decides to use the rotors designated I II and III in that order has set the initial position of the three rotors to A A Z and to easily demonstrate how the machine works, he has wired the plug board so that A is simply mapped to A itself, B is mapped to B, C is mapped to C and so on. In practice the wiring can be done in any random symmetrical order.
Now, assume I press the letter J. As soon as I punch the key down, the first rotor (the right most rotor) steps by one, so that the rotor setting is now A A A. When the key is pressed it also closes an electrical circuit, as explained earlier, and thus sets up a current. The following steps illustrate how the current flows:
1. From the battery
2. Through the depressed key J
3. Through the plug board: In our case, we have manually mapped J to J on the plug board.
4. Through the rotors: The current now enters the first rotor (the right extreme one) - rotor III through the J terminal on its right face. Now, in rotor III, terminal J is wired to terminal T*. So the current leaves the first rotor through T and enters the adjacent rotor II through terminal T. In rotor II, T is wired to N*. Thus the current flows out of rotor II through N and enters rotor I through N, where it is similarly mapped to W*. The current is made to flow back into rotor I by the reflector which simply re-routes the current from the W terminal to the V terminal* of rotor I. The current now takes a new path backwards towards rotor II, rotor III, the plug board and then to the lamp in a similar fashion. Finally the lamp corresponding to the cipher text glows.
To put all the above text in a nut-shell, the current flows in this closed path:
Battery -> Depressed Key J-> Plug board J -> rotor III J -> rotor III T -> rotor II T -> rotor II N -> rotor I N -> rotor I W -> reflector (rotor 1 W -> rotor 1 V) -> rotor I I -> rotor II I -> rotor II F -> rotor III F -> rotor III C -> plug board C -> Lamp C -> Battery
Now, when the second letter is pressed on the keyboard, the rotor III rotates to the next position. Suppose the letter pressed is J. The signal gets past the plug board, and enters rotor III at the K terminal instead of the J terminal unlike during the first keypress, since the rotor has now advanced by one position. If instead, the current were to enter rotor III through the same J terminal, then, this would result in the current taking a similar path as the previous case, resulting in the same lamp glowing. This is only a multi-stage mono-alphabetic substitution. Thus, to attain a poly-alphabetic substitution, the rotation of the wheels is essential. Now if for a third time, J was pressed, the wheel would have now rotated three positions and hence the current would now enter rotor III at the L terminal, providing a different path for the current and hence a different cipher text for the same plaintext. This is often called offsetting.
Here's a picture demonstrating the internal working of the Enigma. Here, the letter A is depressed. The red lines and arrows indicate how the current flows from the battery, through the depressed key A, through the rotors and finally to the lamp D. (A possible initial setting of the rotor could have been AAB using rotors III II and I in that order, i.e., current enters rotor III first and then travels through II and I and returns through the path - I II and III).
This 'reflection' of the signals back to the rotors is a unique feature of the Enigma and makes the Enigma a symmetrical crpyto-machine i.e., if the cipher text to a particular plain text was encrypted once again using the same initial rotor settings, the plain text would be obtained. However, this feature also provided cryptanalysts a tool to work with to decipher the cipher text.
*Wiring Table for different rotors:
Input = ABCDEFGHIJKLMNOPQRSTUVWXYZ (rotor right side)
||||||||||||||||||||||||||
I = EKMFLGDQVZNTOWYHXUSPAIBRCJ
II = AJDKSIRUXBLHWTMCQGZNPYFVOE
III = BDFHJLCPRTXVZNYEIWGAKMUSQO
IV = ESOVPZJAYQUIRHXLNFTGKDCMWB
V = VZBRGITYUPSDNHLXAWMJQOFECK
Reflectors
Contacts = ABCDEFGHIJKLMNOPQRSTUVWXYZ
||||||||||||||||||||||||||
Reflector B = YRUHQSLDPXNGOKMIEBFZCWVJAT
Reflector C = FVPJIAOYEDRZXWGCTKUQSBNMHL
Typical procedure of operations
To use the Enigma to encipher and decipher a text, the sender and recipient need to use identical initial settings, namely, the order and starting positions of the rotors, the plug-board configuration, etc. Codebooks containing all these details were distributed to all recipients. Each day, a different setting was used and it was discarded at the end of the day. At the beginning of the day, the officer in charge of setting up the machine would set the order of the rotors for the day using the codebook. He would then lock the front panel and the operator would be able to change only the plug board configuration and the rotor starting positions. To encrypt a message, the operator would choose all the necessary details from the codebook and encode the message. However, due to security concerns, this method was soon abandoned.
Operators were then instructed to use a random start position to encrypt the messages. This was called the message key. The message key itself was encoded twice using the start positions in the codebook and it was transmitted at the beginning of the message. For example, let AVT be the random key chosen. The message would be encrypted using this key. To transmit this random key to the recipient, AVT would be then enciphered twice using the start positions mentioned in the codebook. This could yield FSR HBS. This text would be attached to the beginning of the cipher text. This method had a serious security issue in it which provided cryptanalysts valuable information to decipher the message.
Later on, a new procedure was established in which the operator chose a random start position, say FHE, and a random message key, say UGS. The message key UGS was then encrypted using the random start position (FHE) and say it yields a result OFS. Then, the plain text was encrypted using the message key UGS. Now, the random start position, (FHE), the encoded message key (OFS) and the cipher text were transmitted. At the receiving end, the operator would set the start position as mentioned in the message to FHE and would first decrypt the encoded message key (OFS). He would then use this key to decrypt the remaining portion of the cipher text.
Though the Enigma was sufficiently secure during its use in the World Wars, inefficient encryption procedures and careless circulation of the codes, provided cryptanalysts like Marian Rejewski with sufficient clues to crack the enigmatic code.
Reference
- Working of the rotor machines
- http://en.wikipedia.org/wiki/Rotor_machine
- Flash Simulation of the working of the Enigma
- http://enigmaco.de/index-enigma.html
- Enigma Procedures
- http://users.telenet.be/d.rijmenants/en/enigmaproc.htm
- Photo of the Enigma wiring (GNU Free Documentation License):
- http://en.wikipedia.org/wiki/Image:Enigma_wiring_kleur.svg
- Enigma Machine Label - Image (public domain):
- http://en.wikipedia.org/wiki/Image:EnigmaMachineLabeled.jpg
- Other pictures: Copyright (c) 2005: Prof. Tom Perera Ph. D.
- http://w1tp.com/enigma/