How to use Virtual Enigma

Overview

Virtual Enigma is an internet-based simulation of Enigma. It requires a computer which can run a recent internet browser* and does not need to be installed.
*Google Chrome is recommended on PC and Mac for compatibility and speed. Sorry, but currently, Safari on the Mac does not have the current 3d implementations required.

It can also be run on a fast mobile or tablet although results may vary depending on your handset. In mobile mode, you are able to look around using your phone and activate functions via the touch screen.

PC version : controls & moving around

Looking around

There are two modes available which you can switch between. The first is cursor mode , where you can use the cursor to manipulate the buttons and objects in the virtual world. The second mode is view mode , which allows you to look around and move within the area.

Click anywhere on the screen where the standard cursor arrow is shown to move into View mode. The cursor will be hidden and moving the mouse will change where you are looking. Click a second time to return to Cursor mode.

While in View mode, you can use the WASD keys to move around. W/S move you forwards and backwards and A/D side to side. This allows you to move to look at a particular viewpoint of interest.

In Cursor mode, the cursor icon will change to show objects that you can interact with like this . Try clicking on the top of the Enigma case to open it (the wooden box in the centre of the table).

Some objects require just a click to active, while others are used by clicking and holding the mouse button and then dragging the cursor left/right or up/down to change the state of the object. This will be shown by the cursor changing to a set of direction arrows when you hold click showing you which way to move. For example, try clicking then dragging over one of the rotors on Enigma.

Mobile/Tablet version : controls & moving around

Looking around

On a mobile or tablet with orientation sensors, Virtual Enigma will switch to mobile mode. You should hold your mobile vertically in front of you and preferrably in portrait to start.

If you cannot see the Enigma on it's table, try moving your mobile around 360 degrees - Enigma may be behind you!

A camera position pad is set on the bottom right. This enables you to quickly change camera position to some preset useful views. Just press the left or right arrows to switch between views. The lower part of this button (with the Stecker plug) switches you in and out of Stecker setting view to make it easier to set the Stecker wires.

On the bottom left is a cursor pad, this enables you to fine tune your current camera position if you want a different view from the one provided

To press buttons or move switches, simply touch them on screen to press a key or touch and drag to change a switch position.

The Clipboard

At the top of the screen is a blue button marked 'Clipboard'. This will assist you when sending or receiving Enigma messages. When using Enigma during WW2, the normal procedure was to have one person typing the message and another writing down the result from the lights shown.

As you type on Enigma, the resulting light shown will be automatically written on the top section and any messages being received on the Transceiver will shown on the lower section.

A few buttons are available at the top, these are in order from left to right

  • Write current settings: This will type the letters that the rotors are currently set to for use in the key
  • Show Morse Code: Any text on the sending section will be converted to Morse code.
  • Clear Page: Empty both sections
  • Enter: Move down a row on the sending section
  • Transmit Morse: Typing or copy/pasting text in the input box and pressing the Transmit button will send that text as Morse to the current Frequency on the Transmitter.

Enigma I (3 rotor)

Enigma Quick-start

How to encipher a message on Enigma I

Position yourself in front of Enigma and open up the top and front covers by clicking on them in cursor mode.

The power switch is the black dial at the top right of the machine, there are four settings which are, from left to right: hell Batterie (battery bright), dkl. Batterie (battery dark), aus (off) and Sammler 4V (4v external supply). The first two run from the internal battery and set how bright the lights of the lampboard are while the 4v setting allowed an external supply to be attached to the terminals to the right of the switch.

Click and hold the mouse button on the power switch then drag to the left until it is set to hell Batterie.

Before typing out the message to be enciphered, the operator would choose three random letters and set the three rotors so that the number of the character was shown in the window of each rotor. The letter can be converted to a number by using the table written on the lid of the Enigma machine where A = 01, B = 02 ... Z = 24.
For example, to set FNB you would set the rotors to 06 14 02.

Click on the rotor where it shows the number in the small window or alternatively, on the thumbwheel, then drag up or down to change the rotor. Set all three rotors to a random start position.

You are now ready to encipher your message. Note as you type each letter, the right-hand rotor moves one position each time changing the wiring in the scrambler while the middle and left-hand rotor move each time the rotor to its right has rotated a full turn. This means you are likely to get a different letter each time even if you keep pressing the same key!

Press and hold each letter of your message one at a time and note down the letter shown on the lampboard. You can click the mouse on the keyboard of the model Enigma or use your keyboard (if you have one).

Setting the Day Key

Removing the rotors

Firstly, open the top cover of the Enigma by clicking on it. Inside, you will see the three cipher rotors between the entry wheel (ETW) on the right and the reflector(UKW) on the left with the red B marked on it.

The rotors are removed by using the Release lever on the left of the machine which moves the UKW to the left, giving space for the rotors mounted on an axle to be removed. The wooden box to the right of Enigma contains two extra rotors (marked IV and V) which can be accessed by again, clicking on the box top.

The order of the three rotors in the machine were chosen each day by using a supplied keysheet. The Enigma model I being simulated has five rotors in total which give 60 possisble combinations. An example key day sheet is available on the table, click on it to bring it up next to the rotors for reference. If you look at the key sheet, there is a row for each day of the month, listed under the column Datum. Lets try setting for the row for day 25.

Swapping rotors

The next three columns listed under the heading Walzenlage (Roller position) against row 25 are I, III and V so we need to swap the second and third rotors to the correct ones. Note that Rotor I is already in the right place by default on this simulation.

The rotor numbers are listed on the right-hand side of the three rotors so swapping rotors is simply a matter of click/dragging a rotor onto another one. To exchange with a rotor in the box, always begin with one of the three main rotors held in mid-air and drag to one of the ones in the box.

First, swap rotor II and III by clicking on Rotor II (the middle one) and dragging the cursor onto Rotor III (the one on the right) then letting go of the mouse button.

Secondly, we need to swap rotor II (the one now on the far right) with Rotor V which is currently in the spare box.

Click on Rotor II (the right-hand one) and drag the cursor onto Rotor V (in the box) then let go of the mouse button to exchange them.

You should now be able to see the three main rotors are now set to I, III then V

Setting the Ringstellung

The Ringstellung (ring position) is another setting on each of the rotors that rotates the number tyre and notch position relative to the wiring. Take a look at the first rotor in the area between the number tyre and the thumbwheel at the number 01 position. You should be able to see a spring-loaded pin stuck into the 01 setting which means the Ringstellung for this rotor is 01. If we switch back to the day settings sheet, there is a set of three columns titled Ringstellung, the three values for our day 25 being: 09, 20 & 19.

To change the Ringstellung value, you firstly need to remove the pin to unlock the tyre, rotate the tyre section then release the pin back to lock the rotor in place.

On the first rotor, drag up or down on the rotor to find the 01 value where the pin is. Click the pin to remove it then drag up or down again on the rotor to rotate just the tyre and notch section around until the value 09 is next to the pin. Finally click the pin again to fix it back. Repeat for rotor III (set to 20) and rotor V (set to 19).

Fitting the rotors back into Enigma

We have now setup our rotor order and Ringstellung so we can return the three configured rotors to the Enigma machine. The three rotors are placed in the correct order onto the axle, this is then placed back between the ETW and UKW and the release lever set back to connect them all together.

Click on the rotor release lever in Enigma which will return the rotors and lock them back in place. Finally, click on the Enigma lid to close it.

Setting the Steckers

To further complicate the encryption, a number of wires were available which were plugged in to a board at the front which transposed letters. On Enigma I, ten cables were supplied with two letters swapped with each cable.

Open the front cover of Enigma. A closer view of the Stecker board can be obtained by clicking the blue ? icon on the table top. This will also move the day key sheet closer.

Take a look at the settings sheet again, you should see a list of ten pairs of letters. Against the 25 day, it starts 'JS MK FB...'. These are the pairs of letters which we should connect together with cables on the Stecker board. To fit a stecker cable, firstly click on an empty socket which will fit the first end of the cable. You will then have a second end which will move position as you hover over the other sockets to connect to. Once you are over the correct socket, click again to fit the second plug. To move a cable, click one connector end which is already fitted to remove it so it can be moved, then a second click will fit it back again. To remove a cable completely, click on one connector plug as before but then click on the removed plug itself.

Click on the socket marked J then move the second plug to the socket letter S and click again to fit the wire.

Fit the second wire the same way, click on the socket marked M then move the second plug to the socket letter K and click again. Complete all ten wires the same way. Click the blue ? icon to switch back to normal view.

This completes setting the day key and as the name suggests, this was set first thing in the morning and stayed the same all day until it was reset the same way the following day.

Enciphering a message: Enigma I

Setting the message key before 1940

Before 1940, the German Army used a key setting method for each new message which used a fixed start position from the day key sheet (the Grundstellung) and then they would pick three letters at random, eg RLW. They would set the three rotors to the Grundstellung letters, for example TKC, (using the table on the instruction sheet stuck on the box lid) and then type in the random letters they had chosen twice (to make sure there were no errors). This might have given the resulting lights YQCPKR. The operator then set his Enigma to the letters RLW and enciphed his message. These six key characters generated would be transmitted at the beginning of the message and the receiving party would set their Enigma up using the same day key sheet and set their rotors to the same Grundstellung. If they then typed in the key letter YQCPKR, Enigma would have deciphered these back to RLWRLW. The operator would then know to set his Enigma to RLW and be able to correctly decipher the message.

The problem was that duplicating the same letters twice was quite a security flaw and this was picked up and used by the team at the Polish cipher bureau, Marian Rejewski, Jerzy Różycki & Henryk Zygalski to make the initial break into Enigma traffic and to be able to read most of the German traffic.

Setting the message key after 1940

Realizing this flaw, after 1940, the German Army changed their procedure and this is the one we will be using with this Enigma I simulation.

As with the pre 1940 method, the operator sets the rotors, ring settings and plugboard each day from the day settings sheet. For each new message, the would pick two random trigrams (three letters), a Grundstellung start position and a Spruchschlüssel or message key. The next step is to move the rotors to the Grundstellung chosen and type in Spruchschlüssel just once. This gives a new encrypted three letter code. To encipher the message, he would then set the start position of the rotors to the Spruchschlüssel trigram and type in the message, noting down which letter each light shows. The actual key letters transmitted would be the Grundstellung chosen followed by the encrypted Spruchschlüssel.

Example encryption

The following is an example using the day key settings for day 25 as setup in the Setting the Day Key section above. Firstly, make sure the Enigma is switched on by dragging the switch on top fully to the left to the hell (bright) setting. Next, we pick a random Grundstellung trigram, let's choose DKR and, looking up these on the instruction table, find that we should set out rotors to the values 04 11 18.

Click and drag the first rotor on the left and move it so that position 04 is shown in the window. Set the second and third rotor to 11 and 18.

Next, we choose a new different random trigram, OCW and type this, one letter at a time, noting down which letter lights up each time.

Press the letters O, C and W noting which letters are shown, in this case WGB

This new three letter trigram is our encrypted message key. We can now complete our new sending key by placing this on the end of the random Grundstellung we chose. This gives the final message key we want to send as DKR CGB. We will need this when we are ready to send the message in the next part of the tutorial.

Now, to actually write out our message, we again change the start position of the rotors, but this time set them to OCW, or the values 15 03 and 23

Set the rotors to positions 15 03 23

Lastly, we type out our message to be encrypted, again, holding down each key and noting which letters light up each time. Where a space appears, Enigma operators would instead use the letter X.

Type SECRETXMESSAGE which should encrypt to OXPSQ LZXMO ERYB

The final part to complete before our message is ready to send is to add a Buchstabenkenngruppe (Letter identification group) to the beginning of the enciphered message. This five letter group is set as the first group of the message and identifies to the recipient which key was used for this particular message. This is important if the message is sent late in the day on one particular key setting, but by the time the recipient receives it on the beginning of the next day, he needs to know that it was created on yesterday's key.

The Buchstabenkenngruppe is made up of two randomly selected letters and one of the four available three-letter Kenngruppen on the key sheet. Take a look at the key sheet on the row for day 25, the final column is titled Kenngruppen and shows the following options: ZUI, NNM, UJR and EII. Picking one of these at random, we choose UJR, we add an extra two characters to the beginning, eg. TPUJR.

To complete our message ready to send, this new group is added to the start of our encrypted message (we do not need to encipher this group through the Enigma machine).

TPUJR OXPSQ LZXMO ERYB

Sending your message

Preparing the header

The final part before we send the encrypted message is to generate the message "header" which gives the recipient information about the message we are sending. This includes the time the message is created, the number of parts it is split into, the number of characters in the message and finally the message key that was generated in the last section of this tutorial. An example header for our message would be

2230 = 2tle = 1tl = 22 = DKR WGB

The first section is the time the message was created (in 24 hour clock, 22:30 or half-past ten at night). The second and third parts, 2tle and 1tl, shows how many parts (teile) this message is split into followed by which part this is (a long message would be split into multiple parts, each encrypted with a new key and Buchstabenkenngruppe). Therefore, this example shows there is two parts to this message (2tle) and this is the first of those.

Next, we count the number of characters in our message, including the five of the Buchstabenkenngruppe group, a total of 22 characters. This is to make sure the whole message is received correctly. Finally, we add our final message key we created in the last section of the tutorial which is the Grundstellung we chose followed by the encrypted message key, DKR WGB.

Our total message that we want to send via the transceiver therefore is

2230 = 2TLE = 1TL = 22 = DKR WGB
TPUJR OXPSQ LZXMO ERYB

Using the transceiver

We are now ready to send our message so move over to the transceiver radio.

The transceiver modeled in this simulation is the Telefunken 15W.S.E.a, a 15 Watt Sende-Empfänger (transmitter-receiver). Before using this transceiver, take note of the warning in red on the front 'Feind hört mit!', the enemy is listening in! Virtual Enigma transmits sent characters to others, also using Virtual Enigma, across the internet on the same frequency. If you do not want this option, simply leave the on/off switch to Aus (off)!

To enable the transceiver, use the on/off dial at the bottom centre and move it one position to the right to the 'Senden/Empfang Tg' setting (the only one that is currently simulated).

Click and drag the dial to the right to Tg setting.

The frequency dial is the green dial to the upper right of the on/off switch marked 'Frequenzeinstellung'. Rotating this will change the frequency you are transmitting/receiving on. if you wish to send and receive from a friend on Virtual Enigma, just make sure you decide on a frequency in advance and both set to the same frequency. Some frequencies have automated scripts which send encrypted traffic on a regular basis.

Sending the message

To send our message, if we have an actual live recipient, we first need to check that they are on the same frequency. You can send Morse using the key provided or open up the Clipboard provided to type in a message which will be converted into Morse for you and sent. Note that you can open up the Clipboard by clicking on the blue button at the top of the screen and return to this tutorial by clicking on the Tutorial button. Type ARE YOU RECEIVING ME in the input box marked "Convert to Morse and transmit" provided (see image below) and click the blue transmit button at the end to send. Hopefully they will respond so you know they are waiting for your message. Note that while conversing in plain text before sending your encrypted message, you should not be giving away any personal information that an enemy listening might use!

Press the Clear icon (third in) on the top of the clipboard to clear anything that's already there and either type in the message above or copy/paste it into the input box (on Windows select the text then use Ctrl-C to copy, Ctrl-V to paste) then click the transmit button.

Deciphering a message

Reading the header

Once we have received an encrypted message, we need to know how to decrypt it so that it can be read. Let's take a look at our example message we sent from the last page of the tutorial.

2230 = 2TLE = 1TL = 22 = DKR WGB
TPUJR OXPSQ LZXMO ERYB

The header shows the time sent, the number of parts (1 of 2 although we're ignoring the fact that we've only sent the one so far), the number of characters in the message and the message key.

The first thing to do is to check that we do indeed have 22 characters received, if not, then we may have a missed or corrupted character during the transmission. Secondly, we need to check which key the message was enciphered in. Remember, the day key changes at midnight so if this message was transmitted late at night, it may not be being decrypted until the next day so we would have to make sure to use yesterday's key.

To do this, we take the first group of five characters from the front of the message TPUJR, this is the Buchstabenkenngruppe and is not part of the encrypted message. The first two characters are randomly chosen by the sender so the important bit is the trigram UJR. As todays example is from the 25th, we assume that this is from the 25th day so take a look at the day key sheet on the desk. Looking at the row marked Datum 25, we can confirm that the trigram UJR exists on the list of possible Kenngruppen on the last column (which it does), so we know we're using the right day key settings. If the message was from another day, we can check back each day until we find the matching Kenngruppen.

Setting the Day Key

The next step is to set our Enigma up using the day key settings to check that the rotors are in the order specified on the sheet (I, III, V), that the Ringstellung are set correctly (09, 20, 19) and that the Steckerbrett cables are all fitted as specified (JS, MK, FB ... RY). See the section Setting the Day Key above if you are unsure how to do this.

Finding the encryption key

We now take the message key sent DKR WGB which includes two trigrams. The first one DKR is the Grundstellung and we should set our configured Enigma rotors to this start position. Checking the table on the lid, we can find which numbers relate to the letters and set these start positions.

Set the rotors to the values 04 11 and 18

Now to decrypt the actual start position used to encipher the message, we type in the second trigram received WGB. As long as we have our Enigma setup exactly the same way as the sender, we should then get the correct start position back.

Type W, G and B keys, writing down which letters are illuminated (or check on the Clipboard).

Deciphering the message

Hopefully, if all has been setup correctly, you should have seen the result OCW. If not, go back and check your day key settings are all correct and begin again.

To decipher our message, we can now set our rotor start positions to the numbers which relate to this new key which should be the one that the message was originally encrypted using.

Set the rotors to the values 15 03 and 23

Now, carefully, type in the message, remembering to ignore the first group of five characters received. You should start from OXPSQ again recording which lights are set.

Type the letters of the encrypted message OXPSQ LZXMO ERYB

Did you receive the message "SECRETXMESSAGE", if so, congratulations on your first Virtual Enigma decrypt!

How is Enigma M4 different to the I model?

The M4 was developed by the Kriegsmarine, the German Navy and although based on, and compatible with, the Army's Enigma I, a number of changes were made to make it more secure. It was famously used on the German U-Boats where it caused many problems for Bletchley Park who were unable to read the new traffic from this machine until key sheets were captured.

Changes to the rotors

The Kriegsmarine supplied not only the same five rotors as the Army, meaning the new machine could be backwards compatible, but also added a further three, giving a total of eight rotors to choose from. The rotors themselves are of similar size to Enigma I's but have the letters of the alphabet around the tyre rather than numbers, this would have made it simpler to set the message key rather than using a lookup table. Finally, the mechanism to change the Ringstellung (ring-setting) involved pressing two levers at the same time rather than with a spring-loaded pin.

The Zusatzwalze (extra wheel)

An additional extra fourth wheel was added by removing the larger fixed reflector from the Army model and replacing it with a thinner, interchangeable reflector and a thin extra rotor just to the left of the three regular wheels. While the fourth wheel can be set to any of the same 26 positions and adds an extra level of encryption to Enigma, it does not turn during encipherment like the other three rotors, but stays static. Two different versions of the extra wheel are supplied, named Beta (β) and Gamma (γ) plus, two versions of the new thin UKW (reflector) named b and c (note the lower case to distinguish from the standard UKWs). The b and c thin reflectors are wired differently from the standard B and C Enigma I version, but using the b UKW with the Beta rotor and setting the start position to A was wired to be compatible. Likewise, the c UKW and Gamma rotors, set at A, was compatible with the C UKW. The Beta and Gamma rotors are thinner and have pins both sides (unlike the pin/contacts on the standard rotors) and can only be exchanged with each other and not with any of the other eight rotors. For Beta and Gamma, the method of changing the Ringstellung has been left at the spring-loaded pin method.

Changes to the machine

The main, most obvious, difference is the split of the top cover into two parts. The top part, allowing access to remove the rotors, has a separate lock to restrict access to just the authorised officers. The lower part, over the lampboard, could be removed without the top section to allow fitting of the optional Schreibmax printer (cryptomuseum.com). Next, the battery was replaced with a smaller version to allow fitting of a power socket to allow the machine to be powered directly from the 4V DC supply of the U-boat. The Steckerbrett board is still placed in the same position at the front of the machine, but the sockets are marked with numbers from 1-26 rather than letters.

For a full tutorial on sending and receiving an Enigma M4 message, please see the tutorial within the simulation itself.