Breaking the Enigma
Breaking the Enigma
Turing, Bletchley Park and Enigma, perhaps you may have already heard about the mysterious and deeply intriguing connection this trio share. In a time when chaos and turmoil threatened to tear the world apart, they became key players of a shadowy tale the history has ever seen; the breaking of Enigma.
Up until the second world war, the definition of war itself has been an one of trenches, massive troop movements and open battlefields. The second world war was the turning point which brought on an entirely different and much more subtle face to warfare. The battlefield extended beyond the frontlines, secret operations targeted sabotaging economic activities, international espionage was in record heights, information warfare seized the role of bayonets and rifles. And Enigma, was one such revolutionary weapon which became both the shield and achilles heal of the Nazi Germany.
Invented by the engineer Arthur Scherbius in early 1920s Enigma was a rotor encipher device that attempted at automating one-time pad, a mathematically unbreakable cipher. In order to understand Enigma a dive into how enciphering and one-time pad work is necessary. Suppose you want to send a message to one of your neighbours without the nosy runner knowing its contents. One of the ways to accomplish this is to convert the original message into an unintelligible set of characters called “cipher text”. For example consider the message or the “clear text” :
after the enciphering this would look :
The only difference here is that each letter of the clear text is shifted three positions ahead of the alphabet (H + 3 becomes K). Granted this does not qualify as a solid cipher but this was used for nearly … centuries and it was invented by no other than Julius Caesar himself. To overcome the vulnerability of Caesar cipher the idea came up to use the alphabet value of a random letter for each ciphertext letter as the shift. The random set of letters used in this process is called the key. So for instance if “Hello” is enciphered with the key “Abjdf” the result would be “Hfuot”. Simplicity aside, the magic of all this is that so long as you keep the keyword random and its length the same as clear text, it is impenetrable! To demonstrate the case assume that the attacker found the key “Abjdf” and obtained the clear text “Hello”, but then again if he used the key “Fnlam” he will get the clear text “Bring”. So without any other information it would be impossible for him to find the correct clear text out of all five letter words in the English vocabulary. This known as the one-time pad enciphering with the key being called a “pad” which must only be used once, thus the name.
Enigma was conceived as an early way to automate one-time pad. It was an electro-mechanical machine consisted of a keyboard, a panel of lights to indicate the enciphered letter, a plug board and at its heart a set of, typically three, rotors. Each rotor had a complicated network of wiring inside and brushes to maintain contact with other rotors. Each time a key is pressed these rotors would increment and complete a new electrical path to light up the enciphered letter. Each time a rotor move the path changes and lights up a different letter, mimicking a “random” key. So even if the same letter is pressed twice, two different letters would light up. The Enigma also had added complexities like the ability to change the order and choice of rotors and plug board cross wirings to swap letter pairs.
In all the number of possible rotor settings crunched down to a staggering 158 million million million ways. Once started from a specific setting the machine would take billions of revolutions to return to the starting position. The flaw here was that if someone discovered the initial configuration, they would be able to decode all communications during that day. But unfortunately for the allies, the Key sheets, or the initial configuration settings was one of the most tightly guarded secrets of the German army (Wehrmacht). As they watched helplessly, a wealth of military intelligence flowed through the German communication networks incomprehensible to the allies. Enigma was working its magic and only a miracle seemed to be able to break into it.
Invincible as it seemed Enigma was not without flaws. Though these chinks were minor overlooks and negligences, they would proved to be disastrous to the armor Enigma and the lifeblood of entire German war effort. The first major contribution on breaking the Enigma
came from a legendary Polish cryptographer Marian Rajewski. In an extraordinary display of genius, he managed to reconstruct the logical structure of Enigma rotor wirings by purely by analysing the enciphered messages and mathematics. This allowed the Polish cryptographers to reverse engineer Enigma and gain insights into breaking the actual ciphers and design a mechanical computer called “Bomba” which basically simulated multiple Enigma machines at once, checking each rotor setting to determine the initial setting of the day.
When the Poland lost ground to Germany, the technology was handed to the British. In 1938, British intelligence commenced Ultra, a highly classified project to break enciphered German communications, with an elite group of mathematicians like Alan Turing and Bill Tutte. All of the Ultra operations were based off a quaint Victorian estate known as Bletchley Park. Thousands of personnel worked there during the war time, constantly battling to get glimpses of the mind of the enemy. It was in Bletchley Park that Alan Turing made the pioneering move of designing the world’s first electro-mechanical computer, the “Cryptographic Bombe”, which introduced substantial improvements to the Polish Bomba. The Bombe could sift through hundreds of thousands of rotor combinations faster than the original Bomba.
Even so still it would take a huge amount of time and processing power to decipher messages in pure brute force. It was at this point the design and procedural flaws of Enigma system played a fatal role in compromising the secrecy it promised. One of the key design flaws of Enigma was that its inability to encipher a letter to itself. So for an instance the letter ‘H’ would never be enciphered to ‘H’. This provided a way for the codebreakers at Bletchley to eliminate several possibilities and narrow down the search. What made it even worse was the fact that most German transmissions included predictable word patterns in them. As an example the weather report from the German navy often contained the words like “wind speed”, “humidity”, “air pressure” etc. More than often they would put “Hail Hitler” at the start or end of the message. Suppose that the codebreakers intercepted the following message:
JKHD RTIL WHND KLSW
If the code breakers assumed the word “Wind speed” (called “crib”) is in the message. Then they will find this:
JKHD RTIL [W] H [ND] KLSW
[W] I [ND]
This implies that sequence WHND cannot mean WIND as Enigma could not encipher a letter to itself. Then they would try another crib until they find valid possibilities which would be fed into the Bombe (through “menus”) . The Bombe would comb through these possibilities simulating decoding process of multiple Enigma machines at a time and stop once the correct setting is found. Though the procedure sounds cumbersome, with sufficient number of cribs, it would only take a day or two to get to the correct setting. Another weak point of the system was human error. The operators were expected to choose a random rotor combination before each transmission (in addition to daily settings). But most of the operators who were exhausted or clumsy ignored the protocol by just moving the rotors a few notches. (Some even went so far as to be romantic choosing the initials of their girlfriends as the random key!). This allowed certain keys or settings appear more frequently in messages. In other words this provided codebreakers with patterns they were so eagerly looking for.
The final blow to the German war effort came from their blindness to the compromising of Enigma. The confidence their cryptographers had failed them to notice an otherwise very obvious flaw. The extreme secrecy the British imposed over project Ultra also kept German intelligence from discovering the break. It took nearly 75 years for the entire declassification of Bletchley Park and Ultra project. There still are a lot of untold stories of unsung heroes. But what is most fascinating about this entire episode is how sheer ingenuity and genius managed to bring a towering war machine down and the inevitable human error, hubris and overconfidence can always defeat any advantage technology can provide, a lesson still very much applicable today.