Written by Suze Kundu

In The News

Breaking the Code

The work of Alan Turing and his colleagues at Bletchley Park would change the course of the Second World War. Dr Suze Kundu explains how they cracked the Enigma Code and why we should all remember it.


Benedict Cumberbatch as Alan Turing in The Imitation Game.

When I graduated to senior school, life was about three things: Take That, gossiping about boys and writing notes in lessons, usually about the first two things. Naturally, my friends and I needed a way to conceal our treasured secrets from grumpy teachers, so we started to write in code.

Code has had far more impact on the world than keeping the silly thoughts of teenage girls secret. It’s said that cracking the Enigma code brought an end to the Second World War two years earlier than expected. When Alan Turing cracked the code with which the Germans used to communicate, it became possible to translate the enemy’s plans, pre-empt them and defeat them.

The original Enigma Machine was invented by German engineer Arthur Scherbius and used the principle of letter substitution. It was made more complex by running messages through several layers of continually changing letter substitution and throwing in additional random deviations in order to stray from any obvious pattern. Initially, the code’s cipher, or key, was changed infrequently, enabling codebreakers in Poland to crack it and reconstruct the Enigma Machine by reverse engineering. Using information gleaned from the machines, however, alerted the Germans to their success and once the war started, the cipher was changed daily, if not more regularly. Cracking the code became much more difficult thanks to the increased possible permutations of the almost 159 quintillion (or 159 million, million, million) rotor settings and plugboard settings available.

The Polish codebreakers shared their knowledge and experience with the British, and some of their equipment, including their constructed Enigma Machines and the Bomba, an analytical tool said to have the processing power of 100 workers.

I had the privilege of sending a coded message from Aberdeen to Bletchley Park using an Enigma Machine at the British Science Festival in 2012 at an event marking the centenary of Alan Turing’s birth.

The machines are a thing of beauty. Contained within a wooden box are two QWERTY (or QWERTZU) keyboards (the keyboard used to input the message one letter at a time, and a lampboard whose letters light up giving the coded letter output) and a panel of plugs and wires (the plugboard). The secret of the Enigma lies in the series of three to five rotors which scramble the message by consecutively substituting each input letter several times before the lampboard lights up with the designated letter. Visualising the journey of a letter from input uncoded to coded output can help make sense of what is going on.

diagram 1

The journey of a letter (Louise Dade)

Powered by batteries, the machines have rotors which change position each time a letter is input, which results in a change in the electrical pathway, and a different coded letter as the output. As these rotors change position each time (through a process known as stepping), inputting the same letter consecutively would not repeatedly give the same output letter, as can be seen below.

diagram 2

Consecutive letter scrambling (Wikipedia)

Sometimes the machine would ‘double-step’ – that is, one of the rotors would change two positions in one keystroke. The combinations of just three rotor positions resulted in almost 17,000 different electrical pathways that could be taken.

As messages were reasonably succinct, it was difficult to break the code by looking for patterns repeated within the message. In order to decode the message, the receiving party needed to know the rotor settings. By then inputting the coded message, they were able to discover the original message.

Good manners and laziness contributed to the cracking of German code. Regular formal greetings, such as starting messages with ‘To’, featured repeatedly at the start and end communications and allowed codebreakers to spot patterns and form ‘cribs’ or keys to the code and clues to the rotor settings. Similarly, rules stating that a coded letter could not be the same as the uncoded letter, or in some cases any of the two letters either side of it in the alphabet, allowed codebreakers to quickly eliminate possibilities.

But the Germans increased the complexity of their Enigma Machines, meaning if the reader of the message did not have the rotor settings, it would be, statistically speaking, extremely difficult to understand the message.

Luckily one mathematician had the skills to deal with big numbers, the curiosity to crack codes and the keenness to create machines to replace manpower. Step up Alan Turing.

The Bombe, a reconstructed version of which can be seen at Bletchley Park, was designed by Turing – the equivalent of the 36 Enigma machines used to decipher German communications by calculating the rotor settings of their machines on any given day. It was built by Harold “Doc” Keen in 1939 and refined by another Bletchley Park mathematician, Gordon Welchman, in 1940. He used the pairing of letters in the plugboard to further reduce the number of possible solutions.

The cracking of the Enigma Code is an example of the impact collaboration between the different science and engineering disciplines can have on our lives and how hard work and genius need to come together to solve global problems.

The Bombe was wired up based on clues obtained from cribs and worked by eliminating rotor settings which were definitely not used. On discovering the correct settings, the Bombe stopped. The positions of the rotors were noted, and the solutions, or ‘stops’, were further tested until proven correct. The number of stops was greatly reduced if more information was obtained from the cribs, so these two methods were complementary and required the work of hundreds of people. Further analysis was also required and needed to be carried out manually.


The cracking of the Enigma Code is an example of the impact collaboration between the different science and engineering disciplines can have on our lives and how hard work and genius need to come together to solve global problems.

Thanks to the hard work of the codebreakers and the analytical engineering minds of mathematicians such as Turing, the war came to an end earlier than anticipated, saving an estimated 14 million lives.

The Official Secrets Act prevented Turing ever discussing his work during the war. I hope The Imitation Game will finally bring the recognition he rightly deserves for the role he played in bringing about an end to the Second World War. I can’t wait to see it.

– Louise Dade, a coder, has created an Enigma Machine emulator which can be found here.
– The Imitation Game is showing in cinemas across the UK from today.

  • googleplus
  • linkedin
  • rss
  • pinterest

Written by Suze Kundu

Suze is a nanochemist, both literally and professionally, and a Teaching Fellow in the Department of Materials. Suze is also a science presenter, and loves dancing, live gigs, Muse and shoes. @FunSizeSuze