Powered by Innings 2

Glossary

Select one of the keywords on the left…

6th class > > The Enigma

The Enigma

Here is a virtual Engima machine:

And here are the rotor cross-sections:

The letter shown inside each rotor indicates the rotation, and the connecting orange lines show the link between the notch on one rotor and the rotation position of the next rotor.

We now find ourselves in 1938, one year away from World War II, a war that is going to involve many countries and last until 1945. It was also going to spawn a new and highly effective way to encrypt messages. The Enigma machine!

In 1918 Arthur Scherbius and Richard Ritter formed the Scherbius and Ritter company. They made many things but one of the most famous of these is the Enigma machine.

Originally made of 3 parts (a 4th was added later) and connected by wires the Enigma combined many different elements of cryptography into a single machine.

The three parts are 1) a keyboard for entering in plain or cipher text, 2) a set of rotors for encrypting / decrypting the text, and 3) a light board for displaying the final text. Later on plugboards and a reflector were added. The machine itself looks like a typewriter. When you enter a letter by pressing a key the encoded letter lights up. Someone writes down these encoded letters and then uses this to send the message (usually through radio message) to the recipient. When the message is received on the other end the operator types in the letters and records the letters that light up, providing them with the unencoded message.

Interactive Element: an exploded image of the Enigma machine where each part is highlighted / brought out when a student clicks on the part name. Kind of like these:

In its simplest form an Enigma machine is simply a mechanical Vigenère cipher with a 26 letter keyword. An operator types a letter, an electrical signal then gets sent through a wire to encrypt that letter to a new letter and then the new letter lights up on the board. This new letter is then written down, the rotor moves forward one place, and the next letter is typed and it’s encrypted version lights up. This continues until the rotor has gone around all 26 spots and then returns to its initial position.

Interactive Element: this will be a slide show showing the following steps: The first part is the first rotor of the machine, which operates similar to a basic Caesar cipher. The students type in a letter and it shows the encrypted letter lighting up - start with a shift of 3 - and then each time it moves forward by one letter. You can use the paper template (see comment) to get an idea of what the picture would look like but it should show the path from the letter typed to the encrypted letter with each letter the student types. Students should be encouraged to type the same letter multiple times and see how each time it is encoded differently. Text to be included: With only one rotor this is no better than a simple cipher wheel and only gives 25 different starting points (26 if it maps to itself, which wouldn’t make much sense), which could easily be cracked. A second wheel is added, it only turns once more than 26 letters have been typed so there must be a minimum requirement on the input box to type more than 26 letters - or have a bunch of letters already pre-programmed into the box. The same highlighting of the path should be shown. Text to be included: So they added a second wheel, one that only turned once the first had gone all the way around (after 26 letters had been typed). By adding this second rotor there were now Input box (26 * 26 = 676) different combinations. This was better but a team of cryptographers, especially ones who had their own Enigma machines, would be able to determine the correct orientation in fairly short order. And so a third rotor was added. A third rotor added, same idea as above showing the path being followed by the letters being encrypted. A large block of text should be included though to show the first, second and third rotors moving (as the third only moves once the second has rotated 26 times). Text to be included: This gave Input box 262626 = 17,576 possible combinations. And, while much better, a dedicated team with access to a machine, could still potentially crack this. And so eventually they added a plugboard that switched 6 letters with each other. Interactive Element: an image of a plug board that students can drag the cord from one letter to another to switch them before being fed into the Enigma machine. There should be 3 such cords. The plugboard added a random element to the encryption and gave another 100,391,791,500 additional combinations. They also decided to make the rotors moveable (so they could be put in different configurations), giving another 6 options. Interactive Element: an animation showing each piece of the Enigma machine being put in with the number of combinations it adds and a running total of combinations. Text to be included: In total, a fully equipped Enigma machine had over 10 x 10^16 possible configurations making it impossible to crack through brute force attempts.

Because of the way the Enigma machine worked you couldn’t do frequency analysis on the ciphertext. Some letters were switched using the plugboards, and each letter was encrypted different from the one before it. Even in the simplest form of Enigma, with just three rotors, you would have to type 17,576 letters before repeating the encryption pattern and this would have to be done many, many times for a discernable pattern to emerge.(Pop-up” For comparison a Twitter post is a maximum of 280 characters so you’d need to post about Input box (62 or 63) tweets before your encryption pattern would start to repeat.)

One of the neatest elements of the Enigma machine was the inclusion of a reflector panel at the back of the machine. This panel would serve to link two encrypted letters together so that the machine could be used to both encrypt and decrypt text with the same rotor settings. On the rotors letters could be linked to new letters: for example P → H, H → C, C → B. But the reflector was responsible for linking the letters as pairs: so P → B and B → P. Once a rotor setting was set the reflector would make sure that the wiring for the forward and backwards processes were also linked together.

While this made it easy to use the same machine, with the same settings, to encrypt and decrypt messages, it also meant that a letter could never be linked to itself; and this made the job of code crackers much easier later on.

Interactive Element: the second portion the paper simulator from above showing the reflector panel being added and the letter being encrypted being traced through the encryption, bouncing off the reflector and travelling back to light up the encrypted letter and then the reverse process as well.

Now that we know how Enigma works, let’s try it out ourselves:

Interactive Element: an emulator similar to this where students can press a keyboard, switch a plugboard, and see the new letter light up https://www.101computing.net/enigma-machine-emulator/

Because of all these features, the German military believed that the Enigma code was impossible to crack – but they were wrong. Breaking Enigma included some of the most groundbreaking achievements during the second world war, involving some of the greatest mathematicians in history, the invention of computers, and a little bit (or a lot) of luck. Breaking it also saved thousands of lives by ending the war a few years earlier.

It all started in 1938 when rumblings had started that Germany was going to invade Poland and knowledge of a new, unbreakable, code machine to be used by them had started to spread.

Desperate to help however he could, Mariam Rejewski, a Polish cryptographer, was one of the first people to attempt to break Enigma. Just prior to WWII Rejewski received the blueprint for making a military style Enigma machine from a disgruntled German named Hans-Thilo Schmidt. But having the machine (the algorithm) wasn’t enough, he needed the key. With over 10x10^16 possible keys it was a daunting task but Rejewski realized if he could somehow separate the plugboards from the rotors he could dramatically decrease the potential number of keys. In fact, if he could separate out the plugboards he would only have 6 * 26 * 26 * 26 = Input box 105,456 potential settings to work with (note: there were an extra 6 settings in the Enigma Rejewksi was working with because in his version of the Enigma you could take the three rotors out and change their physical positions in the machine, giving another 6 configurations).

Interactive Element: a table like this that students can fill out or physical/clickable/draggable rotors that students can move around and ‘plug into’ an Enigma machine and a counter that keeps track of the different combinations.

Possible Rotor Settings 123 132 231 321 213 231

This was not a small number but, with enough effort, he realized he could do it, he just needed to get rid of those plugboards somehow. So set to work on the issue and soon he realized that, because the plugboards were fixed in their substitutions they had an effect on the messages themselves, but they didn’t have an effect on how those letters were linked to each other when encrypted. A “P” switched with a “B” would switch those letters in the final message but it wouldn’t change what “P” and “B” were encrypted as when they went through the Enigma rotors.

Image: an plugboard showing P switched with B, J switched with T, and W with R

Success! This served to simplify the problem greatly, but he was still stuck on how to break the rest of the encryption.

Rejewski’s biggest breakthrough came from the way messages were sent by the German’s. Realizing that repetition in encryption was bad, and could lead to messages being cracked, the German’s used a combination of day codes and message codes, and this became their downfall.

Day codes were the rotor and plugboard settings to be used each day by operators. These would be sent in codebooks to the operators every few weeks. However, sending millions of messages using the same key would create a lot of repetition, so instead of coding each message with the same key, the operators would use the day codes to send a special message key for each message they sent.

This three letter key (one for each rotor setting) would be encrypted at the start of the message using the day key, then the rotors would be set to the message key and the rest of the message would be written.

Let’s assume an Enigma machine’s day key for the rotors was G B K, choose your own three letter message key, and send it through the machine, write it down somewhere safe and we’ll come back to it shortly.

Interactive Element: using the tracing element from before students can set the rotors to be G B K and then enter a three letter code and see how it comes out. Need to make sure it is just the three rotors, not the plugboards.

By having different day and message codes it worked well to keep the day code from being overused, however the Germans made one fatal flaw with this method. They insisted that, in order to ensure there were no issues with receiving the message code (due to operator error or poor reception when sending/receiving the message), the code was sent twice. So if the operator chose a message key of J A T then the operator would first set their rotors to the day key, and then start the message by writing J A T J A T. They would then reset the rotors to the settings J A T and type the rest of their message.

Image/Animation: three rotors set to a code of GBK, then a message being encrypted and the rotors being reset to JAT and the rest of the message being written.

Go back to your message key (the one you wrote down) and now encrypt it twice - noting that the six letter string you get out will have six different letters (even though it’s a repeating pattern). We are now going to use that repeating pattern to crack Enigma.

The repetition of the message key using the day key allowed Rejewksi to study links and patterns in the messages, because all of these initial message keys were sent using the same day key.

He knew that the first 6 letters of any message were the message key and that the first and fourth, second and fifth, and third and sixth letters of these keys were the same letters. By intercepting multiple messages in a day he was able to build an alphabet matching the pairs of letters up and then was able to trace the number of links between letters.

To keep it simple, and make sure that we have all 26 letters properly included and mapped, we’ll assume that the message keys are each letter of the alphabet repeated: AAA, BBB, CCC, etc. In reality, operators used many different combinations of three letters for their message keys (and some lazy operators even used AAA, BBB, CCC, which made it easier for code breakers like Rejewski when they did).

Interactive Element: an illustration / animation showing the following - I think it should first be an animation showing the data and highlighting the chains and links. This could be done with the first and fourth letters and then the students could fill in the patterns for the second and fifth and third and sixth to ‘break the day code’. I’ve provided an explanation below of how it works but I would be happy to speak with the person creating it to explain in detail how it works. Or I could make a little video explaining it.

So this method seemed pretty effective for cracking most messages, however it wasn’t perfect. For instance, what would happen if two or more day keys had a similar chain and link pattern? Well, because of the way the Enigma was created, it would be almost impossible for two day codes to have the exact same chain and link profile. And even if they did, it would simply be a matter of testing the duplicated keys until a message that made sense was found. Or what if the letters chosen for the day key or message key were also the letters that had been swapped in the plugboards? In this case Rejewksi might have had to assume he had most of the key correct and then test out the various plugboard settings until he found a key that unlocked the rest of the message.

While Rejewksi’s method had some flaws it was still a revolution and a breakthrough for cracking the Enigma and helped with future efforts. However, Rejewksi’s exact method was a short lived victory as soon after creating his codebooks 2 extra, interchangeable cylinders were added to the machine which gave an extra 60 arrangements of the rotors and increased the number of possible rotor configurations to 1,054,560. To add to this they also increased the number of plugboards from 6 to 10, giving 20 possible letter swaps for a total of 1.59x10^20 possible keys. Rejewkski would have needed 10 times more bombes to create a new code book and they were too expensive for the Polish intelligence. Enigma now, once again, seemed unbreakable. Add to this the fact that Germany was about to invade Poland and so Rejewski, and Polish intelligence, gave all his work (including the blueprints for making an Enigma machine, how to set up a bombe, and his methods) to the French and British intelligence.

Bletchley Park

From: https://en.wikipedia.org/wiki/Bletchley_Park

Soon after receiving the information from Rejewski, British Intelligence realized they needed people to help break Enigma. So they hired about 200 people from various backgrounds including chess masters, puzzle experts, linguists and mathematicians to work on the problem. This small group was sent to live and work in the English countryside in what would be called Bletchley Park. Over time the number of people grew to around 7000 men and women. Some of the people who worked there were recruited through crossword puzzle contests in the newspaper, some were recruited from universities and through connections who were already part of the project. The British military had more resources and were therefore able to build more bombes and crack the codes using the methods set up by Rejewski. Furthermore they were able to look for cribs (definition: words that stand out like repeated phrases, names of people, weather reports) to help with cracking the settings. Through their efforts the people of Bletchley Park were able to crack day keys within a few hours, allowing them to read daily messages about German movements and strategies much faster.

From: http://cnet.com/uk/pictures/see-alan-turings-lost-notes-found-in-the-walls-of-bletchley-park-70-years-later/10

Pop up or box of information: some things that sped up the process - human error (operators choosing repeating message codes, or initials of people they knew), as they got to know operators they could start to guess what they called cillies. There was also a requirement by the Germans that the rotors not be set in the same position 2 days in a row, meaning when the code breakers knew the setting for one day they could eliminate various settings for the next day automatically. There were also rules about the plugboards not being able to swap adjacent letters (N couldn’t be swapped with M or O) so this reduced possibilities again.

Pop-up or Side Box: The Women of Bletchley Park

From: http://www.cnn.com/2016/11/24/europe/uk-bletchley-park-college/index.html

While most of the initial codebreakers at Bletchley Park were male, there were 3 or 4 exceptional women who started working there as well. Pamela Rose, Pat Davies, and Charlotte Webb were among the first codebreakers, mostly due to their high status families, which allowed them to go to university. However, as the war progressed more women were recruited to assist with the effort, some coming from crossword solving competition that were held across England. Joan Clarke (fiancee of Alan Turing) was one such codebreaker. Some of these women came from the Women’s Royal Naval Service and were called Wren’s, and by the end there were 1,676 of these Wren’s, along with many other incredible women, attending to the more than 200 bombes along with other decryption tasks.

It should be noted that, while the codebreakers at Bletchley Park were incredible, they were still only human and the work they were doing could only move at human pace. Even though they were assisted by a series of bombes, the work was tireless and time consuming and the codes they were cracking were only valid for one day at a time. So even if they managed to crack the day code before midnight, they’d have to start all over again the next morning. But they were making good progress and decrypting German messages that the German’s thought were unbreakable. This gave the Allied forces a HUGE advantage and saved many lives. But there was still room for improvement; enter Alan Turing.

Born in 1912 Alan Turing is considered the father of modern computing and artificial intelligence. He was a mathematician who focused on the unknowable nature of math and the idea that there will always be truths in mathematics that we can never know. He is perhaps most famous for his work at Bletchley Park and breaking codes and wrote a number of books that have become the foundation for mathematical code breaking.

Note: this is an image of an early counting machine from the 1800’s for comparison.

During his time at Bletchley Turing envisioned a machine that one could feed a paper with a question into one end and a paper with the answer would come out the other end. This was, in fact, an early version of the modern computer. More than a mechanical counting machine, which already existed, it could show when various portions of the Enigma machine lined up. To do this Turing set up a series of Enigma machines, similar to what Rejewski’s bombes were (and in fact Turing called it a Bombe out of respect). However, instead of running them mechanically Turing ran electrical wires through them. The intention was that when the rotors lined up in the correct configuration (using the chains and links discovered by Rejewkski) a light would light up showing that the circuit had been completed. This allowed Turing to automate the process, having the machines turn themselves until they hit on the correct combination, and lighting up the light.

Interactive Element: an animation showing the flow of an electrical current going through the links of letters in a guessed plaintext to known ciphertext but getting stopped at the wrong configuration; then, when it hits the correct one, a light lights up. The previous tracing element along with the chain and links developed in the charts above could be used to show the G B K configuration lighting up.

Here is what it would look like (maybe an animation of a wrong combination where the electron starts at the first point and then gets blocked so the rotor moves forward one position and tries again and then eventually the electron makes it all the way through and lights up the bulb). Text: In these images, S, S+1, S+2, S+3, etc refer to the rotor settings where S is the initial (unknown) rotor setting, S+1 is where it clicks forward one place, S+2 is two forward rotations, etc. Where a setting doesn’t produce a link in the chain it is skipped. Of important note, this version is using a crib (or known word that the code breakers were able to guess - like in a weather report) and is not using the day codes as Turing believed (rightfully) that these would soon no longer be used. But the same process could work for other pieces of information found in the text.

So this method seemed pretty effective for cracking most messages, however it wasn’t perfect. For instance, what would happen if two or more day keys had a similar chain and link pattern? Well, because of the way the Enigma was created, it would be almost impossible for two day codes to have the exact same chain and link profile. And even if they did, it would simply be a matter of testing the duplicated keys until a message that made sense was found. Or what if the letters chosen for the day key or message key were also the letters that had been swapped in the plugboards? In this case Rejewksi might have had to assume he had most of the key correct and then test out the various plugboard settings until he found a key that unlocked the rest of the message.

While Rejewksi’s method had some flaws it was still a revolution and a breakthrough for cracking the Enigma and helped with future efforts. However, Rejewksi’s exact method was a short lived victory as soon after creating his codebooks 2 extra, interchangeable cylinders were added to the machine which gave an extra 60 arrangements of the rotors and increased the number of possible rotor configurations to 1,054,560. To add to this they also increased the number of plugboards from 6 to 10, giving 20 possible letter swaps for a total of 1.59x10^20 possible keys. Rejewkski would have needed 10 times more bombes to create a new code book and they were too expensive for the Polish intelligence. Enigma now, once again, seemed unbreakable. Add to this the fact that Germany was about to invade Poland and so Rejewski, and Polish intelligence, gave all his work (including the blueprints for making an Enigma machine, how to set up a bombe, and his methods) to the French and British intelligence.

Bletchley Park

From: https://en.wikipedia.org/wiki/Bletchley_Park

Soon after receiving the information from Rejewski, British Intelligence realized they needed people to help break Enigma. So they hired about 200 people from various backgrounds including chess masters, puzzle experts, linguists and mathematicians to work on the problem. This small group was sent to live and work in the English countryside in what would be called Bletchley Park. Over time the number of people grew to around 7000 men and women. Some of the people who worked there were recruited through crossword puzzle contests in the newspaper, some were recruited from universities and through connections who were already part of the project. The British military had more resources and were therefore able to build more bombes and crack the codes using the methods set up by Rejewski. Furthermore they were able to look for cribs (definition: words that stand out like repeated phrases, names of people, weather reports) to help with cracking the settings. Through their efforts the people of Bletchley Park were able to crack day keys within a few hours, allowing them to read daily messages about German movements and strategies much faster.

From: http://cnet.com/uk/pictures/see-alan-turings-lost-notes-found-in-the-walls-of-bletchley-park-70-years-later/10

Pop up or box of information: some things that sped up the process - human error (operators choosing repeating message codes, or initials of people they knew), as they got to know operators they could start to guess what they called cillies. There was also a requirement by the Germans that the rotors not be set in the same position 2 days in a row, meaning when the code breakers knew the setting for one day they could eliminate various settings for the next day automatically. There were also rules about the plugboards not being able to swap adjacent letters (N couldn’t be swapped with M or O) so this reduced possibilities again.

Pop-up or Side Box: The Women of Bletchley Park

From: http://www.cnn.com/2016/11/24/europe/uk-bletchley-park-college/index.html

While most of the initial codebreakers at Bletchley Park were male, there were 3 or 4 exceptional women who started working there as well. Pamela Rose, Pat Davies, and Charlotte Webb were among the first codebreakers, mostly due to their high status families, which allowed them to go to university. However, as the war progressed more women were recruited to assist with the effort, some coming from crossword solving competition that were held across England. Joan Clarke (fiancee of Alan Turing) was one such codebreaker. Some of these women came from the Women’s Royal Naval Service and were called Wren’s, and by the end there were 1,676 of these Wren’s, along with many other incredible women, attending to the more than 200 bombes along with other decryption tasks.

It should be noted that, while the codebreakers at Bletchley Park were incredible, they were still only human and the work they were doing could only move at human pace. Even though they were assisted by a series of bombes, the work was tireless and time consuming and the codes they were cracking were only valid for one day at a time. So even if they managed to crack the day code before midnight, they’d have to start all over again the next morning. But they were making good progress and decrypting German messages that the German’s thought were unbreakable. This gave the Allied forces a HUGE advantage and saved many lives. But there was still room for improvement; enter Alan Turing.

Born in 1912 Alan Turing is considered the father of modern computing and artificial intelligence. He was a mathematician who focused on the unknowable nature of math and the idea that there will always be truths in mathematics that we can never know. He is perhaps most famous for his work at Bletchley Park and breaking codes and wrote a number of books that have become the foundation for mathematical code breaking.

Note: this is an image of an early counting machine from the 1800’s for comparison.

During his time at Bletchley Turing envisioned a machine that one could feed a paper with a question into one end and a paper with the answer would come out the other end. This was, in fact, an early version of the modern computer. More than a mechanical counting machine, which already existed, it could show when various portions of the Enigma machine lined up. To do this Turing set up a series of Enigma machines, similar to what Rejewski’s bombes were (and in fact Turing called it a Bombe out of respect). However, instead of running them mechanically Turing ran electrical wires through them. The intention was that when the rotors lined up in the correct configuration (using the chains and links discovered by Rejewkski) a light would light up showing that the circuit had been completed. This allowed Turing to automate the process, having the machines turn themselves until they hit on the correct combination, and lighting up the light.

Interactive Element: an animation showing the flow of an electrical current going through the links of letters in a guessed plaintext to known ciphertext but getting stopped at the wrong configuration; then, when it hits the correct one, a light lights up. The previous tracing element along with the chain and links developed in the charts above could be used to show the G B K configuration lighting up.

Here is what it would look like (maybe an animation of a wrong combination where the electron starts at the first point and then gets blocked so the rotor moves forward one position and tries again and then eventually the electron makes it all the way through and lights up the bulb). Text: In these images, S, S+1, S+2, S+3, etc refer to the rotor settings where S is the initial (unknown) rotor setting, S+1 is where it clicks forward one place, S+2 is two forward rotations, etc. Where a setting doesn’t produce a link in the chain it is skipped. Of important note, this version is using a crib (or known word that the code breakers were able to guess - like in a weather report) and is not using the day codes as Turing believed (rightfully) that these would soon no longer be used. But the same process could work for other pieces of information found in the text.