Enigma : The hacking that won the war

What it was

The Enigma was the cipher encoding that the Nazis used during the second world war

Types of Enigmas

  • Civilian Enigma (3 wheels + plugboard)
  • Army Enigma (3 wheels + plugboard)
  • Navy Enigma (3 wheels + plugboard)
  • Airforce (Luftwaffe) Enigma (3 wheels + plugboard)
  • Shark Enigma (4 wheels + plugboard)
  • Italian Enigma (3 wheels)

How it works

(the previous nodes pay some closer attention to how the Enigma works)

The Enigma is a machine that looks like a typewriter. It is an electronic device that has three cipher wheels in it. When the operator sets the wheels and presses an "A" on the Enigma, a bulb marked with the letter "T" might light up on a board. The letters that are keyed in are not transmitted - instead, the "converted" text is sent via morse.

When pressing a key on the keyboard, electric current would move via the three cipher wheels and scrambling circuitry. The Enigma had to be set up by turning the wheels to an agreed setting, and by plugging connectors into specific sockets.

So far, there hasn't been much encryption going on. Here is where the fun begins; the right wheel revolved counter-clockwise a twentysixth of a revolution (i.e one letter) every time a key was pressed. This means that writing the string "AAAA" might come out as "FEYW". Not only this, but there was a complicated system of the wheels turning. When the right wheel had made a full revolution, for example, one of the other wheels would turn one notch. Scientists have calculated that if using the Enigma as a regular typewriter (i.e without changing the settings underways) - there would be in excess of 17.000 keystrokes between every time the wheels being back in their original position.

Inside the Enigma, there were three (four, in the Shark Naval enigma towards the end of the wars) wheels with 26 pins in each. These pins would connect with the next wheel or the "switchboard" at the end of the current.

Each of these wheels contained 26 wires, so that if the current could take the following route:

  • Operator presses A
  • Wheel 1: A -> T
  • Wheel 2: B -> W
  • Wheel 3: Q -> B
  • Switchboard E -> Q (also called reflector)
  • Wheel 3: T -> R
  • Wheel 2: N -> P
  • Wheel 1: L -> Y
  • Light: Y

For a closer look on how all of this works, read how to make an enigma

Why it was crucial

Breaking codes today might seem boring, if not trivial to most of us. In wartime, however, the situation is very much different. In wartime, positions of submarines, battle ships and aeroplanes is crucial. Also, most invations and attacks don't happen spontaneously - they are all carefully planned. this is where radio and Morse code comes in.

An old saying says "Keep your friends close and your enemies closer". This is not without reason - knowing what your enemy is going to do before they are going to do it might win you a war. This is what the Enigma cipher was all about. From before the war even started and all the way until D-day, when allied forces set foot on Normandie in France, the Enigma cipher was a constant battle.

The breaking of the Enigma cipher has saved the lives of thousands and thousands of allied sailors, and the fact that the allied forces often knew where the German submarine packs would hang around, meant that the tanks, artillery and other weapons coming across the Atlantic from USA and other countries reached their destinations.

How it was broken

Before the war

In 1931, Hans Thilo Schmidt, brother of a high ranked German army official, and trusted employee of the german cipher office, sells information about the Enigma to french secret service - manuals on how to operate it and the current settings of the machine. The information was sold to the French secret service, who were extatic about this breaktrhough.

Between 1931 and '38, more and more documents about the Enigma were leaking from the cipher office. However, the non-technical documents and current settings of the cipher machine were not believed to be able to help crack the code.

When rumours about the plans of invations by the Germans started moving, several instances started work on trying to break the Enigma codes. A team of Polish cryptographers, led by dr Antoni Palluth, were on the task from 1932.

The German Mistake

When sending a message, the Germans decide d to send the settings twice, before sending the actual message. If you know anything about cryptography, you know that was a big mistake;

Sending the settings would be done in a predetermined setting, say "BLT". If the message would be transmitted on in the wheel settings of "QWE", the operator sending the message would first set his machine to BLT, and then type QWE twice. The result would be something like "RHU TFP". When the receiver gets the RHU TFP message, all he would have to do is to is to set their machine to BLT and then type RHU TFP. The bulbs lighting up would then be "QWE QWE".

The receiver would then set his Enigma machine to the QWE setting, and decode the rest of the message.

The problem with this, of course, is that when the Britons found out that the first 6 characters of the message would be the same sequence repeated twice, this helped them in their quest. Because the manuals had been captured, the fact that the current went through the machine twice, and that the codebreakers knew that the characters were in the pattern "ABC ABC", led them to discover ways to interpret the first 6 characters. Doing this, they could decipher messages relatively fast - usually within 48 hours.

This procedure was changed in 1938 (random letters were sent before the actual message and acknowledgement) but the practice of sending the cipher settings twice continued - allowing the code to be broken again, except it now took some more time.

The second world war

As the second world war broke out, the Germans started making more code wheels. There were still just three wheels in use, but now a total of five wheels were available. Also, considering that each wheel could be placed in any position in the machine, and each wheel had 26 possible positions, you now had a machine with (5*4*3*26^3)

It was not until December 1939 that the Enigma messages could start to be decoded.

Earlier, the codebreakers had discovered that there was a certain pattern to the messages, and devised a system of perforated sheets of paper. A certain result from the first six characters of the message ruled out a load of options - another result ruled out even more etc. The problem, of course, was that the sheet system only worked for a particular set of wirings. If a different order of wheels was used, the sheets were useless. In the beginning there were just three wheels, making 6 different possibilities when it came to wheel order (3*2*1) Later in the war, possibly when the Germans realized that the code had weaknesses, two extra wheels were introduced. Because there were 60 possible combinations now (5*4*3), the codebreakers would need 60 sets of sheets. This was not a good solution, and a new way to break the codes had to be found.

In mid-January 1940, the first "genuine" wartime message was decoded.

Historic points in the breaking of the Enigma code

Alan Turing is the man who has become most famous for the breaking of the Enigma. The first important thing he made was the Bombe. This was an electronic device that had several Enigma machines wired together. The purpose of this was to rule out combinations of wheels and positions, much like the sheet system, only more automated. This original idea was later improved a number of times, and it is believed that this invention is what made the decryption possible at all.

The Navy Enigma was different from the other two, as the Germans felt that the war on sea was the most important to begin with. Indeed, the German wolfpacks (submarines) were a major danger to ships in the Atlantic and North Sea. This was also why the codebreakers tried hardest to break the Naval Enigma. The first time the Naval enigma was actually broken was on April 25th 1940. Unfortunately, the Germans kept changing their codes, and every time a code was changed, the work with breaking the Enigma started over.

The British codebreakers had a lucky break when they discovered a severe weakness in the German coding procedures: When sending weather forecasts around, the Luftwaffe Enigma was used. However, there was a consistency in how the messages were sent; They always begun with something like "Station Oslo reporting". Knowing this, the Brits could automate the tasks of breaking the codes by using the Bombe, and by looking for the message "Station (...) reporting". Because the breakers would usually know where the messages came from, breaking the code became a fairly easy routine task.

From August to October in 1940, the codebreakers couldn't decipher one single naval Enigma message, as there had been a slight change in procedure, making the decoding more difficult.

In May of 1941, Allied ships managed to capture the German submarine U-110. This marked a major breakthrough, as it was the first time the codebreakers had their hands on an original submarine Naval Enigma machine, and copies of all the codebooks that were needed.

From July of 1941 all the Naval Enigma messages were broken. Some of them took a litttle longer than others (up to a week) but most of them were broken within 48 hours. When the code was broken, the codebreakers could quickly decrypt the remainder of the messages for the 48 hour period, until the codes would once again be changed.

In 1942, something bad happened - The Naval Enigma was suddenly unbreakable again; The original Naval Enigma had been switched with what the Germans called the Triton Enigma (the codebreakers at Bletchley called it the Shark Enigma). This was the same as the original enigma, but with another wheel added to it. Fortunately, this wheel was fixed in the machine and did not add up to the total number of wheel orders. On the other hand, this did multiply the number of possible ciphers with 26 - making the use of the Bombe more time consuming.

Chronological overview

  • 1931
  • 1932
  • 1937
    • The Germans change their Enigma indicating system, and the Polish can't read the messages anymore
    • A message is intercepted in France, almost revealing Schmidt's spy role.
  • 1938
    • The Germans change their Enigma procedures, making it impossible for the Polish codebreakers to read the messages
    • The polish develop a Bomby, which became the idea for Turing's Bombe later on.
    • The Germans start using two extra code wheels on their Army enigma. The Polish cryptographers cannot break this code anymore.
  • 1939
  • 1940
    • January: First wartime Enigma messages are broken.
    • February: Two extra code wheels that are issued to Naval Enigma operators are captured from a submarine
    • March: Turing invents the Bombe
    • April: First wartime Enigma message is broken within 24 hours of being sent
    • July: Bigram Tables system is included in the Enigma procedures - makes it impossible to continue using the old methods for breaking the code
    • September Ian Fleming comes up with a crazy plan to capture codebooks: Operation Ruthless
  • 1941
    • March: A german trawler is captured in Norway. The trawler has the settings and charts needed to be able to read the Naval Enigma, even with the Bigram Tables
    • May: A german weather ship is captured in the north sea, with new codebooks
    • May: The U-110 submarine is captured, making it possible to read offizier messages
    • June: The germans start suspecting that the Allied forces are reading the Enigma messages
    • June: The germans start using new bigram tables
    • November: The germans, once more, start using new bigram tables
  • 1942
    • January: The weather stations now use a separate codebook, making it impossible to use the weather stations as a "back door" into the Enigma settings
    • February: The Shark Naval Enigma gets introduced; adding a new reflector and another code wheel
    • December: The Shark Naval Enigma is finally broken
  • 1943
    • February: The codebooks are being replaced
    • March: The codebreakers find a way to break into the Shark Enigma again
    • September: Hans Thilo Schmidt commits suicide, before the germans find out how much information he has leaked to the allied forces
  • 1944
    • The Enigma gets broken a few times, and then is closed up by the germans. Again and again :)
    • June: D-day, Germany goes down.

 

The Enigma Metanode

  • Codebreaking tools & Techniques

Sources and Comments

The base of this writeup is the book Enigma: The Battle for the Code written by Hugh Sebag-Montefiorte. If you are interested in reading an engaging, well written and seemingly complete account of what went on when the Enigma was broken, this would be the book.

Other sources include a selection of sources from the internet and history books (particularily Seizing the Enigma, by David Kahn, as well as the play Breaking the Code, written by Hugh Whitmore.

There is really no way to tell the whole story about the Enigma without doing a lengthy study on the topic. This writeup becomes a mere shadow of the complexity and excitement, but I believe it makes a good overview of what went on and why.


-30-