EnigmaZone is a simulation of the Enigma machine, an encryption device used heavily by the German army, airforce and navy in WWII. There were different versions of the Enigma and this simulation caters for the Enigma I, M3 and M4 models.
EnigmaZone is completely free and works on Windows 10 and later. Download it from the Microsoft Store via the link below:
As well as a simulation, EnigmaZone offers an automatic facility to crack encrypted messages. You can try this out on authentic German messages from WWII that you can find online, or you can try breaking English language messages instead.
The actual Enigma machine utilised a keyboard, a plug board (the Steckerbrett), a set of rotors (Walzen) and a reflector (Umkehrwalze or UKW). All of this is simulated in EnigmaZone. The operator would type a key on the keyboard and an electric current would travel through a plug board (which transposed individual letters) and into a set of rotors which could rotate after each key was pressed. Each rotor would perform its own letter substitution. After exiting the rotors the current would pass into a reflector which would again transpose the incoming letter and this time reflect the current back through the rotors and back into the plug board where it was switched again with another letter, and finally into a lamp board which would light up the final encrypted letter. The operator would write this down and continue typing the next letter of the message.
All of this required the machine to be set up in a particular way. The plug board was usually configured with ten letters connected by cables to another ten letters. The rotors could be selected from a box of rotors, five for the Enigma I, eight for the M3 and M4. The M4 had a fourth rotor, which could be the “beta” rotor or the “gamma” rotor – this particular rotor did not rotate during the encryption. All rotors could be rotated manually to a starting position and there was also a “ring” setting for each rotor which adjusted the position of the rotor wiring. The reflectors themselves could be chosen from a limited set.
The Enigma I was used by the Wehrmacht (army) and also the Luftwaffe (air force). The M3 model was used in the early part of the war by the navy – the Kriegsmarine. In 1942 the M4 model was ushered in specifically for U-boat communication.
In our EnigmaZone program we have three main areas of the display which can be adjusted by dragging the vertical bars between the sections. From left to right we have the Simulation panel, the Display panel and the Decryption panel.
For our tutorial we will first focus on the Simulation panel on the left and we will select the default Enigma model, which is the Enigma I.
We earlier selected the Enigma I model, so for the three rotor slots we have a selection of five different rotors each with its own internal wiring. There are two reflectors to choose from. We will stay with the default of I-II-III and reflector B.
The wheel settings show the initial position of each rotor. On an actual Enigma machine each rotor had a thumb wheel that could be turned so that a letter would be visible through a window in the top of the machine. These settings were known as the Grundstellung. For now, leave these at A-A-A.
Each rotor had a ring setting (Ringstellung) that could be adjusted by opening the lid of the machine to access the rotors. By turning the ring on a rotor, the wiring core of the rotor is turned relative to the letter showing in the window of the Enigma machine. Leave these at A-A-A.
When a key was typed, the right-hand “fast” rotor would turn one position and this might cause the next rotor to turn if it was aligned a certain way. It is this stepping which meant the machine would not act as a standard substitution cipher but would encrypt the same letter differently on separate key presses.
The Enigma machine had an anomaly called “double-stepping” which meant that in some situations the middle rotor would step twice on successive key presses. After the tutorial, if you want to see double-stepping in action, you can set the rotors to III-II-I, the wheels to A-D-Q and the ring setting as A-A-A. Hitting a key will cause the right and middle rotors to step, resulting in the visible wheel positions to change to A-E-R. Another key press will result in all three rotors stepping to B-F-S, meaning that the middle rotor stepped twice. Not all Enigma simulators have implemented double-stepping correctly but EnigmaZone has an accurate implementation.
For now though, you should be using the default settings. If you need to get back to the default settings at any time, you can click Reset from the Options menu.
Here we have typed the letter A five times. As you can see, although a normal substitution cipher would result in an encryption to five repeated letters, e.g. QQQQQ, the Enigma machine changes the substitution for each letter. This approach made the Enigma very hard to crack.
The letters in yellow represent what would be seen through the window in the top of the machine. Each typed letter results in a turn of one or more rotors and a letter near the top of each rotor appears in each window. The Enigma worked by stepping the rotors before encrypting the letter. After typing AAAAA the rightmost wheel is showing F. If you want to see what it would look like with different initial settings, you can just alter the drop-downs for the rotors/wheels/rings/reflector and the results will be shown immediately.
As each letter is typed the path of the electric current is shown in the Display panel. After entering AAAAA the last letter A appears on the top right, representing the keyboard input, and the path going into the machine is shown in green. There are no plug board settings in this example and so A is transposed to A on the plug board (“self-steckered”). It then enters the rotors and each rotor performs a letter substitution. The small copper-coloured circles are the metal contacts for entry and exit on each rotor. The first rotor has the incoming current at contact F and the internal wiring transposes this to L. It exits at L from the first rotor and enters the next rotor at contact G. Changing the ring settings will alter the wiring in relation to the letters shown in the window. After travelling through the rotors, the reflector (in blue) transposes the the incoming U to C and passes the current back through the machine, shown here by the cyan line. Eventually it passes through the plug board again and into the lamp board where a letter lights up (O in this case). As you can see, our keyboard column is also representing the lamp board.
The Enigma machine has no space bar and no numerals. The operator would usually represent spaces and full stops with an X. Numbers would by typed out in full.
By clicking on the formatting buttons you can separate the text into groups of four or five or you can surround the X character with spaces to make it more readable.
At the bottom of the Simulation panel you can enter the plug board connections. The original German operators would normally use ten cables to switch ten letters with ten other letters, but here we are using two settings, AT and LZ. It’s important to note that the Enigma cannot encrypt a letter to itself, and with the reflector bouncing the current back through the machine this allowed Enigma to have reversible encryption and decryption as long as the same settings are used for both.
After entering the plug board connections, the output text changes. The plug board changes a letter as it is typed, and also as it returns back through the machine and into the lamp board.
Here we have a full set of plug board settings and we have changed the choice of rotors, the initial wheel settings and the ring settings. Doing this immediately refreshes the text that was in the output box.
You can see the 185th typed character was A and it was encrypted to W. The yellow letters at the top show the final positions of the rotors as they would be seen through the lid of the machine. When the plug board received the electric current at the Y position, a plug board cable changed this to W. On our previous plug board settings you can see WY as one of the ten connected plugs.
You can drag the Display panel with the mouse or use the mouse wheel to zoom in or out.
You can also go to full screen and hit the escape key to exit.
On receipt of an encrypted Enigma message, as long as the initial settings are known, the original message can be recovered. The standard procedure on U-boats was to change the settings every day and these would be kept in a code book that would be replaced each month.
EnigmaZone has the ability to crack encrypted messages with no assistance. This can take some time and the results can be variable depending on the length of the message (longer messages=better results, but takes more time).
It’s a tribute to the ingenuity of the original Polish mathematicians and the Bletchley Park staff who continued their work that they were able to break messages without the use of computers, although they often used “cribs” which were pieces of known text that they knew would likely appear in the messages. EnigmaZone is able to crack messages without using cribs.
For our example decryption, we will use a genuine Wehrmacht message from 13 July 1941. Many messages were prefixed with five characters that do not form part of the message, the “Kenngruppe“, in this case “FHPQX”. In the decryption we will ignore these.
FHPQX FDZCJ JDKVW PYFDW POQZG TJQYY XAFRH SQESE RKGJB WBYPE OOKFM MPOMK QDDOL CPKHY PGUZY XBZYA NYSAX IPXVQ CPJBF FFDRD XFIJJ PPPEY ALCYK VLKXQ HWIRZ ANGWU JBWVJ YCKES MJQRY KQHCQ OKMMY WMCKV LZJDV ZXRUM RMNWF DZBQG XJQAP FFFZT AHJQZ PWQWN IVZWU IJTHO YXGDC OJUW
On the Decryption panel, we will choose German as the language:
The key difference between the language decryption settings is that the German setting is specific to the eccentricities that were used by the Germans when using the Enigma, for example X for space or full stop and Q instead of CH. The English decryption ignores these and assumes the text is plain English language without spaces.
Above we see the pasted message (minus the FHPQX) in the input box on the Decryption panel.
For the reflector setting we could choose B, C or All. Most of the time reflector B was used, so to save time we will leave it on the default B setting.
To start the decryption process, click the Start Decryption button in the Display panel.
The bombe display shows a representation of the decryption process. Each bombe is a parallel thread executing its own decryption instructions. In EnigmaZone, the bombe represents a particular combination of rotors. For example, the Enigma I decryption shows 60 bombes, representing the 60 ways of placing the five available rotors into three slots. The bombes in this program do not work exactly the same way as those at Bletchley Park, although there are similarities. The bombes show the rotor combination being tested, e.g. 123, the percentage complete and the current rotor stepping being tested on that bombe, ranging from AAA to ZZZ. The circumference of the bombe has a marker showing the current stepping of the “slow” wheel inside that bombe. A full revolution of this marker corresponds to 100% completion.
On the Decryption panel you can see some statistics for the decryption. In this example, the overall decryption is 0.05% complete and according to the ETA is likely to take almost another 33 hours. Each decryption is given a score based on its closeness to readable text.
You can also see the data for the “best decryption”, showing the rotor and other settings that resulted in the best score so far.
At the bottom of the Decryption panel you can see the text of the best decryption so far and the plug board connections that go with it. In the example above it does not appear to to readable German yet, so the process has some way to go.
After more than 10 hours of processing on this 4-core computer, we reach the above statistics. We still have almost 9 hours to go to completely finish, but you can see that at the timestamp of 7 hours 35 minutes we reached a particular decryption where the rotors were IV-II-III, the wheels were set to 14-12-22 (or NLV) and the rings are 1-1-15 (or AAO). Ten plug connections are shown.
The output text is as above. This is actually the correct decryption of the message. The operators would occasionally put garbles into the text, and misspellings too – some by design, some accidental. The cleaned-up text is below:
AN PANZ GRUPPE VIER SIEGFRIED SIEGFRIED TONI DIV STEHT SEIT EINS ZWO SIEBEN EINS EINS NULL NULL UHR MIT ANFAENGEN AM UNTERKUNFTSRAUM KANN. NIQT EINFLIESZEN DA DRITTE INF DIV UND AQTE PANZ DIV BLOQIEREN UND RAUM BELEGT HALTEN. DIV KDR
In English the text would read something like this:
To Panzer Group Four: Siegfried Siegfried Toni Division is since 12 July 11:00 hours with vanguard at the accommodation space. Cannot enter because 3rd Infantry Div and 8th Panzer Division block and space occupied. Division Kommandeur.
If you want you can enter the discovered settings into the Simulation panel and put the original encrypted message into the input box to see it deciphered using those settings. Because the Simulation and Decryption panels are completely separate, you can even do this while the decryption is running – it will not affect the process:
Because of the way that the automated decryption process works, there is no guarantee that the discovered settings are the actual settings used by the original operator. It is possible that different settings can provide the same results. This appears to be the case here, because the original settings on that particular day were known to be as follows. You can see that some settings are the same as ours, such as the rotor choice and ordering, but others are different:
The differences arise because in the automated decryption we are only trying to obtain the core wiring that corresponds to a readable message. This same core wiring can be produced by a different combination of wheel and ring positions. In our example, the first letter (F) is transcribed to O. With the correct original settings, the F is transcribed to A. This happens because of a left-rotor step that takes place on the first letter, a step which the automated decryption ignores to speed up the processing. There are occasions where this might occur in the middle of a message, giving only half a decryption. It is a trade-off in order to provide reasonable performance.
There are limitations to the automated decryption. Short messages are more likely to fail the process and produce garbled results. We are not able to check every combination of rotor/wheel/ring/plug and thus some shortcuts have necessarily been taken.
And this was just the Enigma I model. The Enigma M3 used the same three rotor slots but with a choice of eight rotors rather than five. On our bombe display this gives us 336 bombes to process. If our German message above was encrypted on an M3 (used by U-boats up to 1942), it could take a few days to get the same result – but still a reasonable timescale especially if you have access to a more powerful system such as a cloud-based virtual machine with a substantial number of vCPUs.
On most computers, trying decryption with the M3 or M4 is likely to lead to a slower user interface because it is very CPU-intensive.
When it comes to cracking messages, the big problem is the M4. With the 4th rotor we have an exponential growth in combinations. The M4 was used from 1942 on U-boats to give extra security and it provided great difficulties for code breakers who were familiar with the Enigma I and M3.
Using our authentic message from earlier, a full decryption on the same 4-core computer would take 476 days to complete. This is best suited to a distributed computing framework, and indeed this has already been done elsewhere. This is even more of a tribute to the work that the WWII code breakers performed, as they were indeed able to eventually break M4 messages.
Hopefully EnigmaZone provides something of interest and an inspiration for further reading on this fascinating subject. If you have any comments, please add them below. Thanks!
References and Acknowledgements
Enigma machine photos courtesy of © Andy Hollingworth Archive and Simon Singh
Enigma insignia courtesy of cryptomuseum.com
Breaking German Army Ciphers (Geoff Sullivan and Frode Weierud)
Modern Breaking of Enigma Ciphertexts (Olaf Ostwald and Frode Weierud)
This Post Has 4 Comments
This is really educational, thank you!
Hello can you add rotors, wheels, rings, plugboard in the decryption, as it will make easier for computer and the time will be reduced and will work more faster!!!
Hi, thanks for the comment. I guess what you’re asking for is a way of restricting the decryption so that it targets certain ranges of settings, which would make decryption faster if the cipher text is known to fall into those ranges. I did consider doing this when I wrote it, and using a crib text too, since they used cribs in the 1940s. I might get around to it one day, but probably not soon! I know there’s at least one other piece of software that does this, if you’re willing to search around. In the meantime, best wishes to you.