THE ENIGMA MACHINE
Editor's Note: Rob V. ('17) explains the historical context of the Enigma Machine.
The Enigma Machine was a device created after World War I by a German engineer Arthur Scherbius to protect sensitive information that was transferred through non protected forms of communication. The device below would allow you to encrypt any message by typing your message into the keyboard and recording the output that is displayed on the lampboard. You can then send the output that you recorded on the lampboard over non secure forms of communication, without worry that your message could be interpreted if it were intercepted. If the message was intercepted, the information gained would be gibberish to anyone without an enigma machine that was set up with the specific settings that the message was typed on. The way that your recipient would translate the gibberish into the original message would be to type the gibberish into the enigma and record the output that is displayed on the lampboard. The output on the lampboard is the original message.
The reason that the enigma machine was one of the most powerful and complex encryption machines of its time was due to the complexity of how many different ways it could be set up. The enigma machine has 3 rotors inside of it (as seen below), that can be ordered in 6 different ways within the machine (3P3, three slots for 3 rotors). To add to the complexity of the setup of the machine, the rotors can be configured 26 to the 3rd power (263) amount of ways. The significance of the rotors is that there are 26 contacts on each rotor which correspond to a different letter in the alphabet. So the 26 letters from the keyboard connect to the contacts of the first rotor. The first rotor then connects to the second rotor and the second rotor connect to the third rotor.
These rotors are the devices that determine the “randomness” aspect to what letter is displayed as output when a letter is inputted. The connection from the keyboard to the first rotor does not have to correspond to the correct letter: wire A aligns with contact E on rotor 1, wire B aligns with contact F on rotor 1, etc. Then the contacts of rotor 1 do not have to align with the same contacts from rotor 1: contact A on rotor 1 aligns with contact L on rotor 2, etc. This is also the case with the third rotor. This is where the number 26 to the third power (263) comes from.
So now here is how the machine encrypts the message in such a way that it cannot be decrypted without the duplicate set up of an Enigma machine. When a letter such as the letter P is typed on an Enigma machine, let's say the letter M is outputted on the lampboard. If you were to type the letter P again you would not get the letter M. If you were to type it a third time you would still not get the letter M. This is because when a key is clicked on the board, the first rotor moves 1/26th of a rotation. What this is doing to the output is that the contacts are being shifted so that you are not going to get the same output for any letter or phrase. Basically after the first rotor does a full rotation 26/26, it then moves the second rotor 1/26. Once the second rotor does a full rotation, 26/26, the third rotor moves 1/26 of a rotation. This process keeps repeating for the entire process of encrypting a message.
The first rotor in this process is moving the most because it is moving 1/26 of a rotation with every push of a key. The second rotor is moving 1/26 for every rotation the first rotor does, so it is rotating a lot less. The third rotor moves at an even slower rate because it is only moving 1/26 after the second rotor does a full rotation. To put this into perspective, for every rotation the third rotor does (the last and “slowest rotor), the second rotor does 26 rotations and the first one rotates 676 times. This is a key factor into the security behind the machines encryption because the rotors continuous shifting of the contacts which are continuously changing the output, it is almost impossible to decipher any message without having the identical setup of the Enigma machine in which the message was typed on.
This process also gets a lot more complex because in an Enigma machine, you are able to configure the first rotor (any previous rotor) to shift the second rotor (any immediate next rotor) on a specific contact rather than on a full rotation. This means that if I wanted the first rotor to move the second rotor when the first rotor reaches the contact that corresponds to the letter F, you add even more difficulty to cracking the encryption because we could have started the first rotor on the letter E or on the letter G. Basically, the ability to decide when one rotor moves another rotor can change an entire potential output and this expands the amount of ways the Enigma machine can create different encrypted messages.
In this paragraph I am going to do the mathematical representation of how complex this machine is. So we are going to start out with the setup of the rotors. That is 3P3 which is equivalent to 6. Then we have to take into account the rotors configuration inside the machine (how the contacts are aligned) which is 26 to the power of 3. Then we have to factor in the ability to set a certain rotor to move another rotor at a specific contact; this is 262 because it is a multiple of 26 for the second rotor and a multiple of 26 for the third rotor. This leaves us with this equation: 6* 263 * 262 or 6 * 265. This comes out to be 71,288,256. But then there is another number that has to be put into this equation. I did not realize this until checking over my math but this number, 71,288,256, accounts for the amount of possibilities in which a machine can be set up without considering the plugboard (look at first picture to see the plug board). Basically the plugboard’s purpose is to provide the ability to change the path of any given key. So to describe the plugboard there are 26 holes, one corresponding to each letter in the alphabet. Then there are 20 cables; what these cables do is that you can make one letter take the path of another letter. What I mean by path is electrical wiring so when we were talking about the wires connecting to the rotors we were talking about the path of each key. But when you start to think about the ability to change that path of a letter, that adds even more complexity and possibilities to how a given Enigma machine can be set up. I may be wrong but I believe it is 26P20. So if we account for 26P20 in our original equation 6*265, we would get approximately 3.99 x 1031 ways in which the Enigma machine can be set up. So a takeaway from this would be that the level of security behind the encryption does not lie in the algorithm, in this case the algorithm would be considered the machine, it would lie in the ability to set up the machine in so many ways that it is nearly impossible to figure out which settings were being used at a given time since the Germans switched the settings every day.
The reason that the enigma machine was one of the most powerful and complex encryption machines of its time was due to the complexity of how many different ways it could be set up. The enigma machine has 3 rotors inside of it (as seen below), that can be ordered in 6 different ways within the machine (3P3, three slots for 3 rotors). To add to the complexity of the setup of the machine, the rotors can be configured 26 to the 3rd power (263) amount of ways. The significance of the rotors is that there are 26 contacts on each rotor which correspond to a different letter in the alphabet. So the 26 letters from the keyboard connect to the contacts of the first rotor. The first rotor then connects to the second rotor and the second rotor connect to the third rotor.
These rotors are the devices that determine the “randomness” aspect to what letter is displayed as output when a letter is inputted. The connection from the keyboard to the first rotor does not have to correspond to the correct letter: wire A aligns with contact E on rotor 1, wire B aligns with contact F on rotor 1, etc. Then the contacts of rotor 1 do not have to align with the same contacts from rotor 1: contact A on rotor 1 aligns with contact L on rotor 2, etc. This is also the case with the third rotor. This is where the number 26 to the third power (263) comes from.
So now here is how the machine encrypts the message in such a way that it cannot be decrypted without the duplicate set up of an Enigma machine. When a letter such as the letter P is typed on an Enigma machine, let's say the letter M is outputted on the lampboard. If you were to type the letter P again you would not get the letter M. If you were to type it a third time you would still not get the letter M. This is because when a key is clicked on the board, the first rotor moves 1/26th of a rotation. What this is doing to the output is that the contacts are being shifted so that you are not going to get the same output for any letter or phrase. Basically after the first rotor does a full rotation 26/26, it then moves the second rotor 1/26. Once the second rotor does a full rotation, 26/26, the third rotor moves 1/26 of a rotation. This process keeps repeating for the entire process of encrypting a message.
The first rotor in this process is moving the most because it is moving 1/26 of a rotation with every push of a key. The second rotor is moving 1/26 for every rotation the first rotor does, so it is rotating a lot less. The third rotor moves at an even slower rate because it is only moving 1/26 after the second rotor does a full rotation. To put this into perspective, for every rotation the third rotor does (the last and “slowest rotor), the second rotor does 26 rotations and the first one rotates 676 times. This is a key factor into the security behind the machines encryption because the rotors continuous shifting of the contacts which are continuously changing the output, it is almost impossible to decipher any message without having the identical setup of the Enigma machine in which the message was typed on.
This process also gets a lot more complex because in an Enigma machine, you are able to configure the first rotor (any previous rotor) to shift the second rotor (any immediate next rotor) on a specific contact rather than on a full rotation. This means that if I wanted the first rotor to move the second rotor when the first rotor reaches the contact that corresponds to the letter F, you add even more difficulty to cracking the encryption because we could have started the first rotor on the letter E or on the letter G. Basically, the ability to decide when one rotor moves another rotor can change an entire potential output and this expands the amount of ways the Enigma machine can create different encrypted messages.
In this paragraph I am going to do the mathematical representation of how complex this machine is. So we are going to start out with the setup of the rotors. That is 3P3 which is equivalent to 6. Then we have to take into account the rotors configuration inside the machine (how the contacts are aligned) which is 26 to the power of 3. Then we have to factor in the ability to set a certain rotor to move another rotor at a specific contact; this is 262 because it is a multiple of 26 for the second rotor and a multiple of 26 for the third rotor. This leaves us with this equation: 6* 263 * 262 or 6 * 265. This comes out to be 71,288,256. But then there is another number that has to be put into this equation. I did not realize this until checking over my math but this number, 71,288,256, accounts for the amount of possibilities in which a machine can be set up without considering the plugboard (look at first picture to see the plug board). Basically the plugboard’s purpose is to provide the ability to change the path of any given key. So to describe the plugboard there are 26 holes, one corresponding to each letter in the alphabet. Then there are 20 cables; what these cables do is that you can make one letter take the path of another letter. What I mean by path is electrical wiring so when we were talking about the wires connecting to the rotors we were talking about the path of each key. But when you start to think about the ability to change that path of a letter, that adds even more complexity and possibilities to how a given Enigma machine can be set up. I may be wrong but I believe it is 26P20. So if we account for 26P20 in our original equation 6*265, we would get approximately 3.99 x 1031 ways in which the Enigma machine can be set up. So a takeaway from this would be that the level of security behind the encryption does not lie in the algorithm, in this case the algorithm would be considered the machine, it would lie in the ability to set up the machine in so many ways that it is nearly impossible to figure out which settings were being used at a given time since the Germans switched the settings every day.