Internet Systems Design:
Technologies for Modern Information Systems

cached from



About Enigma and Its Decryption


The Enigma Machine

German Use of the Enigma in WW2

Early Decryption

Decryption at Bletchley Park

Further Reading

Related Sites

The Enigma Machine

The Enigma machine began life in 1923 as a commercial product produced by a German named Arthur Scherbius aimed at businesses with a need for secure communication. It was a simple device to use, after setting it up, the operator types in the plaintext of his message. Each time a key is pressed, a letter on the lampboard is illuminated corresponding to the cyphertext. The operator then simply notes down the cyphertext letter and carries on. The commercial Enigma was based on a simple principle shown in the diagram below. Note that the machine was not actually built in this form, to find out why not, read on...

The user types a message in using the keyboard. Each key pressed energises one of 26 'letter' circuits within the machine. Power is passed from the keyboard to one of 26 end contacts in the scrambler unit. Power then passes through the three rotors, each being wired so that it changes the letter to another one. The machine has now applied a scrambling operation to the original letter. The 'wiring' of the machine is altered after each letter by rotating the first rotor by one position (and the next after 26 letters), thus pressing the same plaintext letter twice is unlikely to result in the same cyphertext letter.

An important factor in the Enigma's design was ease of use. Applying a simple 'one way' scrambling operation as described above has an important disadvantage: to decrypt the message it would be necessary to reconfigure the machine so as to feed power from the keyboard to the opposite end of the rotors. This would both make the engineering of the machine more difficult and more importantly, complicate its use and make it more error prone.

The Enigma solves this problem by adding a 'reflecting' rotor after the circuit passes through the rotors. This connects each end contact to another, thus routing the circuit back through the three rotors to one of the 26 input contacts. The result is shown below.

Note that the rotor arrangement from the first diagram has now been reversed. The arrangement shown here is the same as the actual Enigma machine.

While this solution is simple and provides the machine with an elegant simplicity it is also the cause of one of the major flaws in the scheme. Introduction of the reflecting rotor also introduces the restriction that no plaintext letter can ever be encrypted to itself.

To try out a Java model of the Enigma click here.

German Use of the Enigma in WW2

The commercial enigma was exhibited at a couple of trade shows during 1923 but soon attracted the interest of the German military. The result was the withdrawal from the market of the enigma machine which then continued to be produced and refined for military use.

The most significant addition to the commercial machine described earlier was the addition of a plugboard or 'Stecker'. This device allowed individual pairs of letters to be swapped, thus causing extra substitutions in addition to those made by the rotors. An important feature of the Stecker was that if, for example, an 'A' was swapped with a 'Z', then the converse was also true, so a 'Z' became an 'A'. This preserved the simplicity of use of the machine and also preserved the key weakness that a letter could never be encrypted to itself.

By the outbreak of WWII, the Enigma was in widespread use throughout most branches of the German military. Its small size, perceived impregnability, portability and ease of use made it an ideal tool for use as part of the German 'Blitzkrieg' strategy where mobility and close co-operation between ground and air forces were the keys to success.

One of the principle 'Electronic Battlefields' in which Enigma played a central role during WWII was the Battle of the Atlantic. German U Boats were equipped with the Enigma machine which the used to send periodic position reports as well as sighting of convoys. Dissemination of knowledge of convoy positions was essential to the U Boats as they could then concentrate a large number of boats on a single convoy, thus vastly increasing the tonnage which could be sunk. Likewise, knowledge of U Boat positions was essential to the allies as they could then alter convoy routes to avoid U Boat concentrations. The security or readability of the German Naval Enigma during the Battle of the Atlantic was thus a key factor in the survival of Great Britain during this period.

There were many variations and improvements in the construction of the machine and in the procedures for using it during WWII. As we will see later, an early improvement was the introduction of two additional rotors so that 3 out of 5 rotors could be installed in the machine in any order. The German Navy also introduced a much stronger four rotor variant of the machine in 1942.

NOTE: To try out the four letter variant, click the 'Advanced Settings' button on the Applet.and select the 4 rotor machine.

Early Decryption

The Germans perceived the Enigma as being practically unbreakable. They were wrong. The Enigma and the procedures with which it was used had a number of weaknesses which were exploited by the Germans' opponents to probe into the tactical and strategic secrets of the German military.

The first to take up the battle against the Enigma were the Poles. Their German cypher bureau, BS4, received something of a windfall in 1928 when the Germans accidentally dispatched an Enigma to their legation in Warsaw by ordinary freight. Realising their mistake, the Germans in Warsaw made urgent enquiries about the package which alerted the Polish Customs. The result was that BS4 had a weekend in which to examine an Enigma before carefully repackaging it for collection the following Monday.

The design of any worthwhile encryption system assumes that the 'enemy' has a complete knowledge of how the system works, so knowing the make-up of the machine (and even producing reproductions of it) is not enough. The Enigma relied for its security on the fact that it could be set up to any one of a huge number of different configurations (or 'states') at the beginning of a message:-

bulletThe three rotors could be installed in any order.
bulletThe initial positions of the rotors could be varied
bulletThe letter rings on the rotors could be moved relative to the 'core' wiring.
bulletThe plugboard ('Stecker') connections could be varied.

After considerable effort, a group of three mathematicians at BS4 came up with an approach allowing them to read German Enigma traffic. The Polish approach relied on a weakness in the procedure with which the Enigma was set up at the start of a message. The procedure, known as the 'Indicator System' enabled the receiving operator to identify how to set up his machine to decrypt the message.

Most of the setup of the machine was determined by looking up the settings for the day in a code book. There was, however one element which was supposed to be altered for each message sent, namely the letters showing on each of the moving rotors (and hence their position). The system called for the sending operator to choose three letters at random. he would then set the machine to a predetermined setting for the day (the ground setting) and transmit the three chosen letters twice. This repetition was intended to reduce errors but was in fact a gift to the cryptanalysts, who could use this information to work out the initial settings of the machine for that day and hence read that day's traffic.

In September 1938 the Germans changed the indicator system on which the Poles had relied. The new system was more complex than the old but, significantly still involved the repetition of a 3 letter group. The poles broke into this indicator system by looking for situations where two letters known (because of the repetition) to be the same where both enciphered to the same letter. This phenomenon was known as a 'female' and gave the cryptanalysts a vital clue about the initial setup of the machine. By listing the occurrence of 'females' for each setting of the machine and analysing many messages on the same day, the settings could be determined. This system relied on manipulating a stack of perforated sheets on an illuminated table until alignments in the perforations were achieved.

The poles devised a second method of attack on the new indicator system. This method still relied on the 'females', but required less of them. Instead of using a manual approach, the Poles built an elector-mechanical machine called a 'bomba' which had similar circuitry to the Enigma but could search through all of the possible rotor positions until the observed 'females' were found. Six of the machines were required to allow for the fact that there were six possible orders for the moving rotors.

In December 1938, Enigma became secure again. This time the Germans had introduced two extra rotors, so that although there were still only 3 used at a time, there were now sixty possible permutations of wheels, thus requiring sixty bombas or sixty sets of perforated sheets. The Poles did not have the resources to produce either.

Decryption at Bletchley Park

In January 1939 a meeting took place in Paris between representatives from British, Polish and French Intelligence (who had been obtaining information about the Enigma via a clandestine contact). Following this meeting, the British Government Code & Cypher School (GC&CS) took up the attack on the Enigma.

The British commenced by applying their more plentiful resources to the production of the necessary sixty sets of perforated sheets. They also set the eminent mathematician, Alan Turing, to work on the design of a new version of the Polish 'Bomba', dubbed the 'Bombe'.

The British Bombe was more advanced than its Polish predecessor, both in speed of operation and in that it no longer relied on a specific indicator system. The British approach relied on attacking a specific message with a 'probable word' approach in which an informed guess was taken as to the content of the message (which contrary to German policy, frequently began in exactly the same way). This approach was greatly assisted by the fundamental property of the Enigma that no letter could be encrypted to itself, it was therefore a trivial matter to place the plaintext guess and cyphertext side by side and search for a position in which no letters matched between the two texts.

Having found a message and guess of suitable size, the information was used to construct a 'menu' of settings which was configured on the Bombe. The Bombe was then set in motion to search through all of the Enigma wheel positions for a position which satisfied the menu.

For (much much) more on the Turing Bombe, including details of the current Bombe Rebuild Project at Bletchley Park, see John Harper's Turing Bombe Pages

I have also built a C++ simulator of the Turing Bombe which I successfully used 'in anger' on some real Enigma samples posted to the Bletchley Mailing list by Tony Sale in 1998. You can find out more about this simulator here.

Another key aspect of the work at Bletchley Park was its sheer scale and organisation. The information gathered from the Enigma came in in huge volume and usually a single message would convey only a tiny part of the larger strategic picture. To cope with this, Bletchley Park was organised into co-operating areas (called huts after the luxurious office accommodation in which they were housed during the early years of the war) in which one area would handle the cryptanalysis of a particular type of traffic and the results would be passed to a second intelligence group who would collate the information in massive indexes in order to build up 'the big picture'. By the end of WWII, Bletchley Park employed 10,000 people working round the clock shifts.

Further Reading

The Factual Stuff...

bulletCodebreakers : the inside story of Bletchley Park; edited by F.H.Hinsley, Alan Stripp; Oxford University Press 1994; ISBN 0-19-285304-X - recollections from people who worked at BP.
bulletAlan Turing: The Enigma; Andrew Hodges; Vintage 1992; ISBN 0-09-911641-3 - A Biography of Alan Turing
bulletThe Secret War; Brian Johnson; BBC 1978; ISBN 0-563-17425-0 - One of the earliest sources to 'break' the Bletchley Park story. This was how I first became interested.
bulletThe Hut Six Story : Breaking the Enigma Codes; Gordon Welchman; M&M Baldwin 1997; ISBN 0-947712-34-8 - An account by one of the co-creators of the Bombe. Includes a very detailed description of the working of the Bombe.
bulletStation X: The Codebreakers of Bletchley Park; Michael Smith; Channel 4 Books 1998; ISBN 0-7522-2189-2 - The book of the excellent TV series. Like 'Codebreakers', this book concentrates on the personal side of the story.
bulletSeizing The Enigma; David Kahn; Arrow Books 1996; ISBN 0-09-978411-4 - Concentrating on the operational side of the Naval Enigma story, including accounts of several daring 'pinches' - captures of cypher materials from the enemy.
bulletBletchley Park Trust Report No 9 - The Enigma Machine and the Bombe; Frank Carter & John Gallehawk; Bletchley Park Trust 1998 - A detailed account of how Enigma works, an overview of the Bombe and some Historical notes.

For an atmospheric, well researched fictional novel set in Bletchley Park...

bulletEnigma; Robert Harris; Arrow Books 1995; ISBN 0-09-999200-0

Related Sites

Bletchley Park Official Home Page
Codes and Ciphers in the Second World War by Tony Sale - formerly known as the The Bletchley Park Home Page
Andrew Hodges' Alan Turing Home Page - Turing's life and work and a condensed Biography.
John Harper's Turing Bombe Pages and the Bombe Rebuild Project
A document describing the Polish work on the Enigma
An archive of cryptographical software
Enigma page at Bill Momsen's Nautical Brass Online site - a free e-zine for the nautically minded.
Turing's Treatise on the Enigma A contemporary (but hard to read) account by the man himself - retyped by Frode Weierud, Philip Marks and Ralph Erskine. A must-read for anyone serious about Enigma research.
A real Enigma message from 1938 - Another gem from Frode Weierud's crypto site
The 'Y' Service - Pages about the 'Y' (wireless intercept) service and the Royal British Legion Branch serving its members.
GCHQ See their history pages, under 'About' last time I looked.

horizontal rule

Copyright (c) 1997-2000, Andy Carlson. All rights reserved.