Deutsch   | » English

Enigma simulation in Javascript/HTML

by Daniel Palloks


Choose a simulation ...
-new-  Universal Enigma  (v2.0 EN)
12 models | Custom combinations | Enigma-Uhr

Start=>  enigma-u_v20_en.html
—————— Legacy versions —————–
Enigma M4  (Version 1.6 EN)
Start=>  enigma-m4_v16_en.html
Enigma G//s  (Abwehr)  (German v1.6)
Start=>  enigma-g_v16.html
Enigma I & M3  (German v1.6)
Start=>  enigma-i+m3_v16.html

 

Introduction

The Enigma is probably the most famous electromechanical device (or rather, series of devices) for message encrypting. It was used to a great extent by Germany during World War II. The successful reverse engineering of the machine in Poland and the codebreaking activities at Bletchley Park (UK) involving thousands of people, among them several ingenious mathematicians, have become legend.

Modus operandi

Enigma operates as a rotor machine to achieve polyalphabetic substitution. This means the letter substitution scheme is not fixed but changes with the propagation of Enigma's rotating ciphering wheels and thus, the letter's position in a text. The wheels advance stepwise with every keystroke, thereby triggering, in some positions, the adjacent wheel to the left to perform a step as well, pretty much as in a mechanical counter. Inside a wheel each letter position is biuniquely rendered to another position through a fixed set of wires. By combining and rotating the wheels however, a very complex substitution code is obtained. Furthermore, the inner wiring as a whole can be rotated with respect to the outer letter positions – and the trigger notches (this is known as "ring setting"). In some models, pairs of letters can additionally be permuted by interconnecting plugs ("stecker") on a plugboard via cables. Finally, towards the end of WWII an external device called Enigma-Uhr, or Stecker-Uhr, was introduced that allowed the stecker connections' in- and outputs to be scrambled in complex, even non-reciprocal patterns. The Uhr thus acted on the stecker I/Os very much like a settable, non-rotating cipher wheel.

Signal routing

Enigmas are equipped with a typewriter-like keyboard for input, while output is shown on a lampboard that in its layout resembles the keyboard. With every keystroke, the signal is routed first through the plugboard (if present), then through the fixed entry wheel, crossing the rotor wheels and arriving at the reflector wheel. From there it is sent back on a different path – but with all rotor positions still the same – through the rotors, the entry wheel and again the plugboard until it reaches the lampboard where it lights the bulb corresponding to the substitute letter. This symmetrized signal path and the resulting symmetric (involutory) encryption make it possible to decipher a message using the same key setting it was encrypted with. At the same time, involution was one of the principal flaws in the Enigma's encryption concept.

Meet the family

There was a variety of Enigma models available for civilian and military use, as well as special setups for export. Even within a model line there were sometimes variants with altered specifiations. An "Enigma family tree" can be found in the Links section.
The best-known models today are Enigmas I ("Service Enigma"), M3 ("Naval Enigma"), M4 ("Shark") and G ("Abwehr"). There are separate simulations for each of them on this website.

Enigmas I and M3 came with three rotor wheels, and fixed entry wheel (ETW) and reflector (RFL / German: UKW). They were used by the German Army including, in the case of the M3, the Navy with the exception of the submarine fleet. The latter used the more advanced M4, with an additional adjustable (but non-rotating) wheel in combination with a thinner reflector – a setup that in preset configuration was "backward compatible" to the I/M3.

In contrast to the other models, the Abwehr Enigma G, a technical gem used mainly by German counter-intelligence, was driven by a gear box rather than a lever mechanism. It also had a rotating reflector/UKW and wheels with multiple notches, but no plugboard. The stand-alone Enigma G simulation on this website reproduces model G-312, on display at the museum in Bletchley Park. In April 2000 this machine was briefly pilfered in a quite spectacular coup, but not by me.

Catch-all:  "Universal Enigma + Stecker-Uhr"

All Enigma models fall into either of two categories with respect to the wheel stepping mechanism: lever-induced stepping, i.e. pawls and ratchets (which leads to a typical stepping anomaly of the middle rotor, known as double-stepping, see Features) – and gear-driven, with regular stepping, like a mechanical counter. Within each category only minor differences remain, such as wiring schemes or settable/non-settable UKW.

Since any serious codebreaker wants to be girded for what's out there, while at the same time creating and maintaining separate simulations for all the model variants would be pretty dull, this website offers, as of version 2.0, the "Universal Enigma". It contains almost every model whose specifications are presently known. Moreover, it is also equipped with a Stecker-Uhr. There was of course no such Enigma for real, historically! However, bundling everything into a single entity has the benefit of making all models available at any time and in a compact way, which makes it possible to easily switch between them and compare their features and functionality. Any selected model preset will behave exactly as in a separate simulation, including possible limitations for wheel selection, reflector type and so on. But in addition to this, a "custom" mode allows for free combination of all features and functionalities (including wheel stepping mechanism!) and thereby for the creation of entirely new Enigma models.

News   -new-

Simulations

  • [ RELEASE ] Universal Enigma with Stecker-Uhr v2.0
    12 models, 42 wheels, custom combinations; new monitor -- 30 Oct 2011
    English version (2.0 EN) -- 08 Nov 2011
  • [ Update ] I/M/G v1.6 (deactivatable plugs) -- 30 Oct 2011
  • [ Update ] I/M/G v1.5c (bugfix: sync issue in Firefox) -- 28 Oct 2011

Website

  • Major text upgrade (Universal Enigma, Enigma-Uhr; Q&A) and revision; auto-TOC function for Q&A section; some new weblinks, acknowledgements. — 30 Oct 2011
  • (!) Modified folder structure: All sims now in the homepage directory – please update any links/bookmarks! — 30 Oct 2011

External

  • [ Video ] Universal Enigma in action, and a basic tutorial here (courtesy of poughkeepsieblue) — Dec 2013

Features

Files

  • Each simulation comprises a single page of HTML/Javascript, working in all current browser models with Javascript enabled, on any platform. (→ Browser compatibility, Security)
  • No installation: To take it home, just save the web page.
    (To save the Enigma logo as well, choose the "Web page, complete" option, or right-click the image, choose "View background image" and save.)

Enigma models

  • The "Universal Enigma" simulates the following 12 models:

    with lever mechanism (double-stepping):

    I  "Services" (Army; Air Force)
    M3  (Army; Navy)
    M4  "Shark" (U-Boats)
    D  (commercial)
    K  "Swiss K"
    N  "Norenigma" (Norway)
    R  "Rocket" (Railway)
    T  "Tirpitz" (Japan)

    with gear drive:

    A-865  "Zählwerk" (1928)
    G-111  (Abwehr / Munich)
    G-260  (Abwehr / Argentina)
    G-312  (Abwehr / Bletchley Park)
    … and additionally the Enigma-Uhr ("Stecker-Uhr"), an interesting external add-on for models equipped with a plugboard. (→ Introduction / Some Help)
  • Separate simulations remain available for:
    Enigma I/M3, M4 "Shark" and G-312 (Abwehr)

Original Functionality

  • Complete wheel sets for all models (that's, as far as they are known)
  • Full range of features and settings: Wheel selection; start positions and ring setting; switchable plugboard with auto-verification and Enigma-Uhr*
    (*Universal Enigma only)
  • Virtual keyboard / lampboard combination, original 'QWERTZU' layout (switchable to an input pane, see below).
  • "M-type" machines exhibit irregular double-stepping of the middle rotor as it engages the rotor to the left.
    The reason for this anomaly was that the T-shaped lever (pawl) driving a wheel was allowed to engage by a notch in the wheel to the right, pushing against this notch as well when advancing its own wheel. – The more sophisticated mechanism in Enigmas A and G eradicated this design flaw.
    -- Tip: Watch the double-stepping of wheel II, in preset configuration with wheel positions II="D" and I="Q" and by typing two characters.

Additional Functionality

  • Two input modes:
    1. clickable "QWERTZU" keyboard in original layout with integrated lampboard and optional input field for convenient typing
    2. normal text pane with full editing capability (including copy&paste → see Some Help)
      (Here, with every new input action the whole content is being re-coded from start. The down-side is it may slow down operation in case of larger texts!)
    Switching between input modes clears all text I/O, and restores current message key (rotor start positions).
  • The plugboard is not limited to 10 stecker pluggings. Plugs can be deactivated, without deleting them.
  • The Enigma-Uhr within "Universal Enigma" is available whenever the plugboard is. Uhr position "00" leaves the stecker configuration unaffected. (→ Some Help)
  • Multiple selection of same rotor is possible (e.g. VI-VI-VI).
  • Rotors can be locked (as can the UKW/Greek wheel in the Universal Enigma)
  • A live monitor displays signal path, wheel wiring, performance and other information.
  • Status bar shows current encryption settings
  • Balloon help for several items (on mouse-over)
  • Separate reset buttons for all sections
  • Enigma G//s: Unlike the original, the separate Enigma G simulation does have a plugboard (hence "//s", for "stecker").
    The G-312 within "Universal Enigma" on the other hand is simulated true to original. The plugboard can still be activated though, via "Custom" mode, see below.
  • "Universal Enigma":
    • 12 model presets (I, M3, M4, D, K, N, R, T, A-865, G-111, G-260, G-312)
    • altogether 42 rotor wheels, 10 reflectors + 2 Greek wheels, 3 ETW, 2 rotor stepping mechanisms; plugboard; Enigma-Uhr (see above)
    • Stecker connections and Uhr can be de- and reactivated separately
    • Steckers are remembered in deactivated state when switching model presets
    • More detailed configuration info is shown in the monitor as well
    • In "Custom" mode all features and functions can be combined ad lib
      This may result in some exotic wheel stepping patterns, e.g. propagating double-steps in case of lever mechanism and rotating UKW, which could not be attained in a real Enigma.

[ Changelog ]

Some Help

This section gives some hints and background for operating the simulations. The interface is hopefully quite self-explanatory as to how to use it. As to what it all means, you may want to familiarize yourself with the basic concepts of the Enigma, as laid out in the Introduction or, in greater detail, on the respective pages given in the Links.

General

  • Many items show infos and tips via balloon help when pointing on them with the mouse.
  • For further clarification the Questions & Answers may be worth a look.

Message input

  • When pasting text with the mouse via context menu, you'll have to press a key in the input field afterwards ('Ctrl' or Space, for instance, which will not be coded) to let the interface know there's new input, as it doesn't catch mouse activity but only keystrokes.
    -- This is not necessary when pasting via shortcut (Ctrl+V).
  • Switching between input modes will erase all text, but will preserve the encryption key (including the starting positions of the rotors, which will be restored).
  • In text pane input mode all wheels will be locked against manual setting as soon as there is text input.
    This is necessary to keep the input fully editable, which demands that the current key settings apply to the whole text.
  • In text pane input mode it is still easily possible to re-code existing text.
    For a new message key (wheels' starting positions),
    1. reset the rotors [Home pos.],
    2. enter new start positions.
    3. To trigger re-coding, press any key in the input field (such as 'Ctrl', which will not be coded).
    Ring setting and plugs can be changed as well (observing item 3 in above list).
  • In 'QWERTZU' mode, re-adjusting the wheels will only affect text being entered afterwards, as in the real machine.
  • Input and output fields: double-click to select the entire content.

Enigma-Uhr

  • The Uhr requires exactly 10 pairs of activated plugs (steckers). Less than that will not work and the Uhr therefore be deactivated and locked. More steckers are allowed, with the first 10 (counting from left) then being affected by the Uhr and the remaining ones being just "normal" stecker connections.
    -- IMPORTANT: Unlike normal plugging, for the Uhr the order of the stecker pairs as well as within each pair is relevant!
  • The Uhr has 40 positions (00..39). On "00" it is neutral, or practically deactivated: The letter substitutions on this position are exactly the ones plugged (steckered).
  • All positions with numbers divisible by 4 yield reciprocal letter substitutions, although different ones than actually steckered (except for "00"). All other positions result in non-reciprocal substitutions that cannot be attained by mere plugging.
  • When the steckers are deactivated, so is the Uhr. After reactivation of the steckers the Uhr remains inactive and has to be activated separately.
  • Clicking on the Uhr position display toggles between "00" (neutral) and the last active position.

Key and coding procedures

Daily key & message key

Enigma's cryptographic key consists of the following parts:

  • Wheel selection and alignment (wheel order)
  • Ring settings
  • Plug settings (stecker)
  • Initial wheel positions.

The first three make up the daily key, laid out in a code book and known to both sender and recipient. The wheels' initial positions were assigned individually to each message, and are called the message key.

Encrypting the message key ...

Being unknown to the recipient, the message key had to be included in the transmission and therefore, had to be encrypted itself. This was done using the common daily key as follows:

  1. Sender chooses a message key, e.g. CODE (or a three-letter key with the M3);
  2. Sender sets up the Enigma according to the daily key and chooses arbitrary initial wheel positions for encrypting the message key, e.g. WPOS;
  3. Sender enters the chosen message key (CODE), notes the outcome (say, IPXH) along with the chosen wheel positions, like "WPOS IPXH", and puts the two groups of letters in front of the coded message (without coding them again, of course).

... Decrypting the message key

Having received the transmission, the recipient would now follow the same procedure (involution!): set the machine to the daily key, adjust wheel positions according to the first group (WPOS), type in the second group (IPXH), thus obtaining the message key (CODE). This would then be set as starting position for the wheels, so the message could be deciphered.

* * *

Substitutes

Since the wheels only contain letters A to Z, only these can be encrypted. Numbers and other characters have to be either spelled, omitted, or represented (preferably by rarely used letters or letter combinations).

Precautions

To make decryption harder (cycle detection), the length of a message had been restricted to 250 characters. After that the message key was to be changed. Longer messages were split up in parts to be coded with different message keys.

Sometimes the message key was altered within a running message part; this would be indicated in the plain text by a pre-arranged code (e.g. "CYDE" for "set leftmost rotor on position 'D' now").
NB: In the simulations one would want to use 'QWERTZU' input mode in such a case, as it allows for re-adjusting the wheel positions with text already input. The new wheel settings affect only subsequent input.

It was important to vary the structure of messages, especially when parts of the content, such as proper names or the message header ("From... To...") were likely to be deduced. Abbreviations had to be varied for the same reason. Or, for example, while X was commonly used to denote a full stop in clear text, it had to be omitted at the very end of a message. Such precautions were not always observed, though, a fact that played greatly into the hands of the codebreakers.

Interoperability of Enigma models

Enigma I within M3

The Enigma I (aka Wehrmacht Enigma or Services Enigma) can bee seen as a predecessor of the M3. Already in use with the Reichswehr in 1930, it remained the most widely-used model until the end of World War II.

Enigmas of type I and M3 are compatible if the following is being considered:

  • Enigma I was only equipped with rotors I-III. (M3/Army: I-V; Naval M3: I-VIII)
  • An earlier reflector wheel, named UKW A, was used exclusively in Enigma I, but put out of service in 1937 to be replaced by UKW B (reflector B, same as in the M3).

-- Tip: The combined simulations "Enigma I & M3" and "Universal Enigma" have the old reflector UKW A included as well.

Enigma M3 within M4

Model M3 (and thus, also Enigma I) can be emulated within the M4. For this the reflectors have to be made "compatible" by either of the following settings:

  • Reflector UKW B 'thin' + wheel Beta (position A, ring setting 01)  <—corresponds to—>  reflector UKW B;
  • Reflector UKW C 'thin' + wheel Gamma (on A-01)  <—corresponds to—>  reflector UKW C.

Browser compatibility, Security

  • The sims should be working in all modern browsers.
      Look and operability may vary depending on the browser model. It's the curse of web design. The pages have been optimized for Firefox 3, this is where all GUI effects do work as intended (although the browser's overall performance is not preeminent). Internet Explorer 8 or higher manages almost as well. Chrome, Safari and Opera – who are really quite fast with the sims – will do alright as well, although i.e. tooltips in the wheel select menus are missing. The latter goes also for Konqueror and older IE versions (prior to IE8), but those browsers' rendering is rather insufficient, definitely spoiling the fun with the GUI – especially Konqueror. Last not least, modified default style sheets in branded browsers (like Firefox KDE) may have unfavourable effects on the visual appearance of the simulations.
  • Keep in mind that with Javascript activated, your browser becomes vulnerable in a way, since code may be planted and executed. Faulty scripts or processing of larger amounts of data may lead to browser malfunction, freezing or crashes. In anonymized networks like TOR, anonymity could be compromised (tracking, or recognition using cookies).
      That said, nowadays it is virtually impossible to avoid Javascript while browsing the web. Most "modern" websites use or even depend on it, especially webmail interfaces, social networks, but also image collections that use "lightbox" effects. Unlike the simulations presented here, however, those script monsters are not really comprehendible anymore to non-experts.
  • Cryptographic strength: The method demonstrated here is *not* suited for encryption of sensitive data! Although it might be hard to decipher a single message of unknown content, the Enigma's encryption – due to some serious flaws in design – is not nearly as strong as one might guess, or in fact as it could have been. (The machine had already been broken by the allies during the war, albeit with sheer incredible effort and a good deal of luck. This is a fascinating story, by the way...)

Questions & Answers

  • Q: I'm completely at a loss with all the items and settings in the simulation. How do I operate this?
    A: The basic principle is: Settings must be the same for coding and decoding. – But since you really cannot break anything here, it won't hurt to try everything out and see what happens. For starters you may even ignore settings at all, as the Enigma will code anyway as soon as there is valid text input. Just start a new session or reload the page, enter your message on the left-hand side and observe the output to the right. You can also see the rotors step at every (codeable) keystroke. To decipher the output, copy it and feed it to the (cleared!) input pane. In case of a problem, just reset/reload and retry. The next step could be to successivley play with the different "knobs" and observe the effects, starting for instance with the wheel positions, then including the rings, steckers, and so on.
    -- Tip (1): Values can be modified by pressing the '+' and '-' buttons or by direct input in the display fields. The monitor reveals some interesting information about the coding process.
    -- Tip (2): For a nice video tutorial, check out this clip by poughkeepsieblue... (<<)
  • Q: In a geocaching puzzle I have come across a 3-wheel (4-wheel) Enigma key. Which machine should I use?
    A: Usually it's the M-series you want. These are the best known and consequently, the most frequently simulated models. Use the M3 for a 3-wheel key and the M4 for a 4-wheel key. (NB: The M4 can be used for M3-related keys as well, if the correct combined reflector is chosen; see section about interoperability.) If this fails, and all options are exhausted (→ Key and coding procedures), you may give it a try with the Abwehr Enigma G-312 – expecially if the key does not contain any stecker settings. Sometimes cache owners seem to be using their own Enigma creations or modifications (like altered rotor wirings); in such cases it is hard to tell which model these are based on and whether they operate accordingly.
    Come to think of it: Maybe, with the "Universal Enigma" out, the range of models used for those puzzles will even broaden :)  (<<)
  • Q: I have entered text to the left but nothing happens. How do I start the simulation?
    A: The simulation, i.e. ciphering, starts automatically at any valid input or keystroke (valid means letters a-Z). If however you have pasted text with the mouse, the interface is unaware of it. This is normal behaviour of HTML forms, which are used here. To let the interface know that there is input, an additional keystroke is therefore required in the input field in that case. About any key will do, but a good choice would be 'Ctrl' or Space, as those are ignored for ciphering and won't alter the message text.
    -- Tip: Use the keyboard shortcut Ctrl+V (or equivalent) to paste previosly copied text. The ciphering will then start immediately. (<<)
  • Q: The wheel positions cannot be altered anymore!?
    A: This is normal in input pane mode. As soon as there is text input, manual wheel position modification is locked. This is the price for having the input pane fully editable, as it ensures that the message key remains the same for the whole text.
        This does not mean the key cannot be changed. It can, but only for the message as a whole. Here is how:
    1. Reset the wheels to [Home pos.]
    2. Enter new configuration
    3. Start re-coding through a random keystroke in the input area (like 'Ctrl' or Space).
    Alternatively, copy and then delete (or simply cut) the input text. As the input area is cleared the wheels will return to their starting positions and be unlocked for manual setting. After your adjustments just paste the text back (Ctrl+V) to re-encrypt it.
    -- See also: Some help
    (<<)
  • Q: How do I clear the output window in 'QWERTZU' mode?
    A: By changing to text field input mode and back again. All wheels will be reset to their last starting positions (message key), too. (<<)
  • Q: Why is the Enigma-Uhr not responding?
    A: The Uhr always requires exactly 10 stecker connections. So, at least 10 pairs of letters must be input and activated(!). Since the algorithm for the Uhr would lead to faulty coding or errors when used with less than 10 steckers, the Uhr is automatically locked inactive in such a case (i.e. remains on position "00", where it is neutral towards the plugging).
    -- For more help on the Enigma-Uhr, see Some help.
    (<<)
  • Q: The sim is responding sluggishly or not at all. What could be causing this?
    A: By Javascript standards, the Enigma sim can become quite a resource hog, especially with very long messages and in text field input mode, where the entire message has to be re-enciphered at every new keystroke (making this mode fully editable). This will at some point inevitably affect the performance, and may eventually even freeze the application. This is not the end of the world, though. Most browsers meanwhile offer an option to abort the execution of a "hanging" script. The worst that can happen is that you have to restart the browser, losing your key settings and message text (and yes, possibly other open webpages if the browser cannot restore them afterwards, which would indeed be annyoing). Furthermore, the performance depends on the browser's age and its Javascript engine. Current browsers should have no problems with texts containing 1,000 or more characters. Historically, messages were limited to 250 characters per message key anyway, so as to not lose cryptographic strength (cf. section "Key and coding procedures").
    -- Tip: The following measures may help to speed up the simulation:
    • Close the monitor (especially in the separate sims)
    • Use the 'QWERTZU' keyboard; this mode always operates at the same speed, as it doesn't remember any previous input but processes only one character at a time
    • Split up longer texts into several parts, as was done in reality (see above)
    • Try another, more recent browser model or version
    (<<)
  • Q: The sim and the browser are frozen completely (and a warning has popped up that says something about a script slowing down the website)!
    A: Don't panic. The script itself has never crashed as of now – except perhaps when clicking any buttons while a ciphering operation is running. In that case you may have to restart the browser (unless the warning has popped up and offers you to cancel the operation). More likely though, the script is busy processing large amount of text input (possibly in 'QWERTZU' mode?), and/or the web browser's performance is not cutting-edge. If the popup warning has appeared, you may of course click "Cancel", and no harm done. (Except in cases where the now undefined state of the aborted script leads to garbled output in subsequent ciphering; see Q10!) Or you may click "Continue" and wait for the ciphering to complete. Depending on your browser/CPU and on the amount of text to be processed, this may take a while, and more warning messages may appear at intervals. (<<)
  • Q: I have a key here that has numbers instead of letters for the wheel positions (letters for the ringsetting / pairs of numbers for the steckers). How do I interpret this?
    A: That's probably a Navy key. There were indeed, depending also on Enigma model and wheel labeling, several different ways to formulate the key. The variant being used here – letters for everything except for ringsetting – was certainly the prevalent method, as most wheels are labeled with letters to indicate their positions. Plus, letters facilitate the input of stecker pairs in the simulation. This means, other key variants will have to be translated into the one being used here. This is done by a simple progressive enumeration of the letter in the alphabet:
    A B C D E F G H I   J  K  L  M  N  O  P  Q   R  S  T  U  V  W  X  Y  Z
    1 2 3 4 5 6 7 8 9  10 11 12 13 14 15 16 17  18 19 20 21 22 23 24 25 26
    -- Tip: When placing the mouse pointer over a field containing a key value, a tooltip will show its corresponding value in the alternative reading. Hope this isn't too confusing... (<<)
  • Q: Deciphering does not yield the original message. What went wrong?
    A: The simulations have been tested and should decipher all messages correctly, provided the same settings apply that were used for encryption. Possible reasons for decryption issues are:
    • During copying or pasting a portion of the text was left out (i.e. the beginning). Perhaps the her text was bigger than the visible output window and due to not scrolling back to the very top for copying some lines are missing now.
      -- Tip: Double-clicking into the output area selects the entire content.
    • In 'QWERTZU' mode, text that has been encrypted will remain unchanged even if the encryption key had been modified since! Unlike in text field input mode, there is no re-coding of the entire message here. This is the behaviour of the original machines, by the way. You therefore have to memorize the exact position(s) the key was altered at, and copy only those areas where a respective key applies.
      -- Tip: The output window is cleared by switching to text field input mode and back again. The current key will be preserved.
    • Since the 'QWERTZU' mode does not have a memory, the modification of any parameter (rings, plugs, whatever – even if undone before encryption) means that a new message key is given, i.e. the current rotor positions are automatically set as new start positions!
      -- Tip: Consult the status bar for the current encryption settings; re-adjust start positions if necessary.
    • Stecker connections were entered but not activated (red activation button). -- For the separate sims and Firefox/IE8+: Steckers might have been in use prior to a page reload. The stecker inputs are then recalled, but have to be activated again.
    • When (re-)selectng a wheel its starting position will always be 'A' and the ringsetting '1'. That's why these settings should always be made after wheel selection, lest they get lost. (With the real machine this comes natural of course.)
    • Should only certain characters from the original text be missing, chances are that they are special characters, umlauts, or numbers. This is normal, because they cannot be encrypted since the wheels and the keyboard only know letters. Read more on this in section Key and coding procedures.
    • If a decoded text is correct up to a certain position and then gets scrambled, this could be indicating a wrong carryover position. In this case shift rotor position and ring setting of the rightmost wheel simultaneously and in the same direction until the result is correct.
    • If you suspect that particular letters are permuted, or cyclically permuted, it is probably a stecker problem. One or more letters might have been entered incorrectly.
    • In case of a very long input text the browser may give standard warning that a running script is slowing down the website (cf. Q8). If at this point script execution was canceled, subsequent (de)ciphering may result in garbled output. The reason for this is in the internal workings of the browser, not in the Enigma script. The browser forces the script to stop but not to reset (values of variables, counters etc.), leaving it in a random state. The remedy here is to reload the page.
    • see also next question...
    (<<)
  • Q: I encrypted a message with another simulator and don't get the correct plain text here (or vice versa).
    A: There was a specific bug in previous versions of the separate I/M3/M4 simulations. It took effect whenever the wheel's starting positions were set to be within the "dead area" of double-stepping, that is, a configuration normally skipped by the running machine due to the middle rotor's stepping anomaly. The bug was fixed in version 1.5a. (Many thanks to Sylvie Grasmück for her contribution and assistance!)
        The separate simulation Enigma G//s had a bug, due to which a wheel's carryover position was affected by its ringsetting. This occured when a ring was set to anything other than '1'. The bug was fixed in v1.5a. It should also be noted that the G//s sim has plugboard, while the original model hadn't. Maybe stecker connections are active?
        Generally, my simulations have been checked against the programmes referenced in the Links, as far as possible, and those in turn against real Enigma machines (according to the developers). The probability of malfunctions could thus be minimized, although bugs can never fully be ruled out (e.g. after modifying or upgrading the script). I should add however that many "external" messages have already been successfully decoded with this website's simulations. So, perhaps another thorough check of all settings might just solve the mystery. See also the previous question. (<<)
  • Q: Most of the time only the wheel to the right is stepping. Isn't there a bit more action?
    A: Just question – and even one of cryptographic significance. Because wheels with only a single carryover point per rotation are likely to leave especially the leftmost wheel practically static during a typical message coding. An Enigma in such a configuration has de facto only one or two rotor wheels, considerably reducing cryptographic strength. Models of "type G" overcame this flaw through wheels with multiple carryover points (and additionally, a rotating reflector). The wheel sets for the other models were never upgraded, though. This may have had financial, logistical or compatibility reasons.
    -- Tip: The wheels for models A-865 and for the G-series have by far the most carryover points (notches), with the wheel labeled as "1.." always at the top with 17 notches. The wheels for the "Tirpitz" each have 5 notches still. Wheels VI to VIII of the M-series carry over twice per rotation (although exactly on every half rotation, thereby actually deteriorating, instead of improving, cryptographic strength: the carryover and rotational period should always be mutually prime!). All other wheels have only one notch. (<<)
  • Q: In the red status bar, what do the symbols between the wheels stand for?
    A: They indicate the currently active "coupling" of the wheels, i.e. the stepping mechaism.
    There are 3 possible cases: stepping induced by levers (pawls), gear-induced stepping, or no stepping (wheels locked). Consequently there are three different symbols to (hopefully) illustrate these cases: '&ndash' for a lever; '¤' for gear-drive (the currency symbol resembling a cogwheel); and '^' for uncoupled ('tilted up'), i.e. rotors locked.
    -- If a symbol appears between reflector/UKW and leftmost rotor wheel, those two are coupled as well, meaning the UKW is rotating. (<<)
  • Q: How do I read the monitor in the Universal Enigma?
    A: The first and third column should be self-explanatory ("cps" means "characters per second" in the left-hand column). In the central field the monitor displays either the current signal path or the current internal wiring, depending on the operation being performed:
    1. If any adjustments are made (wheels, starting positions, ring settings, plugs, Enigma-Uhr), the monitor will switch to wiring display. You will then see a uniform per-line scheme of corresponding input/output values for all components (wheels, plugs/uhr). This is shown by input value left-to-right in alphabetical order or – depending on a wheel's current position – alphabetically, starting at that position. In case of a wheel, the first line is the outer alphabet ring: the one that shows in the real machine's (and the sim's) little rotor windows during operation and the one we are talking about when referring to the message key. The first letter to the left is always the current position, as seen in the machine's rotor windows. Capital letters are turnover positions. In the second line the corresponding output position (referring also to the outer alphabet ring) is shown for each input position. The light-blue area to the left names all the components shown.
      -- For instance, changing a wheel's starting position will result in a synchronous shift of both lines for that wheel so that the starting point is the upper line's left-most character. Changing a ring setting will not move the outer ring but only rotate the internal wiring, so only the lower line will be altered. In case of steckers, the Uhr, and the ETW the monitor will always leave the upper line unchanged and modify only the lower line (output).
    2. If something is typed or pasted on the sim's input side, the monitor switches to signal path view, where you can follow the physical signal as indicated by green and red arrows for entry and return path, respectively. As in the case of internal wiring display, all components (i.e. wheels, plugs/uhr) are shown with signal positions input-wise in alphabetical order and, for rotor wheels, starting with the current position (outer ring) on the left. This time only the upper line is shown, while the arrows indicate the input and output position at each component for the current signal. Again, capital letters represent the wheels' turnover points (as you may check against the tooltips given for the rotor position windows).
    (<<)
  • Q: In the separate simulations the monitor shows an incorrect signal path most of the time!
    A: That's true, I'm afraid. It concerns the legacy versions only. Still, the final output is always correct! -- The monitor is really consistent within its own logic, tracing a variable which at start contains the original and in the end the enciphered letter. Due to the algorithm being used, the position and ring setting of a wheel contribute to the value of the variable, making it represent not the letter's actual permutations but rather its positions with respect to the point of origin 'A' (12 o'clock) in the non-permuted ETW. For the same reason, the wiring in case of ringsetting should not be taken at face value. The monitor thus illustrates the simulations' internal operation.
    -- Tip: In the Universal Enigma I redesigned the monitor from scratch and it now displays the actual physical signal path (i.e. current flow), as well as the correct wiring in case of ringsetting. (<<)
  • Q: The GUI is messed up: Letters in the QWERTZU keyboard are out of place, and similar issues.
    A: This is due to page rendering in the actual browser you are using. Although the page has been optimized for many common browsers, deviations are possible. Often this is a matter of standard font size. In Firefox (Windows) the standard, being used in the sims as well, is Times New Roman 16px. This can be adjusted in Tools>Options>Content. Most browsers also let you change the current page's global font size on the fly, usually by pressing Ctrl and the '+' or '-' key at the same time.
    -- See also next question. (<<)
  • Q: In Firefox the whole page content jumps to the right edge whenever an info popup message appears.
    A: This annoying problem concerns Firefox 7 and 8 only. It seems to have been fixed in Ffx 9. Other browsers or versions are not affected.
    In Ffx 7+, Javascript "alert" messages apparently are no longer generated via OS requesters, but via Javascript/CSS browser-internal layers. Those seem to be colliding with the simulation's own page layout (CSS) in a rather enigmatic (ha!) way, due to an implementation issue. The problem occurs when the browser window has a certain width (not always, but typically in a maximized window on modern displays) and the message text is too long.
    -- Workaround: Maximize/unmaximize window, or jiggle the window width a little, to re-center the content. (<<)
  • Q: The separate Enigma G simulation (G//s) has a plugboard, but the Universal Enigma's G-312 has not. Does this mean the two are not compatible anymore?
    A: No, they remain compatible. What you have to do though, if you want steckers, is switch from model preset "G-312" to "Custom" mode. While this will leave all settings intact, even message text, it will unlock the full range of options and settings, including the plugboard. (NB: When switching back from "custom" to a model preset, however, all settings will attain their model-specific defaults, and message text will be deleted. Stecker inputs will be deactivated only, but the plugboard might not be available, depending on the model preset.)
    Background: I decided that for the Universal Enigma all model presets should be reflecting the exact capabilities of their real counterparts. This is to ensure compatibility with any external simulations for those models. Plus, it is more logical to consider any "bonus features" as part of a "custom" setup.
    -- Tip: Model preset "G-111" has the plugboard enabled, as there was a variant of this machine with the option to connect an external plugboard (cf. "Enigma family tree" in the Links section). G-111 and G-312 are however not compatible to one another. (<<)
  • Q: Where can I download the sims? The links are just getting me directly to the sim pages.
    A: There are no downloads. Because the sims consist merely of a single page of HTML including the script (plus the file of the logo graphics). When on the sim page, just save the page (Ctrl+S). You can also right-click on a simulation link and "Save target as...". Download complete!
    -- Tip: To save the logo image as well, either select "Web Page complete" in the Save dialog, or right-click the logo, select "View background image", and save. (<<)
  • Q: Why another Enigma simulation? There are already loads of them, some even with much better graphics.
    A: Graphics was not a priority consideration here, but usability and size. The arguments in favour of these sims: 1. Running them requires only a fairly up-to-date web browser, and the sims will work platform-independently, i.e. with virtually any computer and operating system. -- 2. The source code is plain text and thus immediately readable. You are even free to modify it (in accordance with the Terms of licence; see also 'i'-swith in the simulations). Javascript is a quite comprehensible language and the interaction of its algorithms with the frontend/GUI is managed through (dynamically altered) HTML, which is also easy to understand. -- 3. The sims, although in plain text with connotations, are extremely compact (a single HTML page of about 40-50kB each; plus the logo image).-- 4. The Universal Enigma with Stecker-Uhr offers a hitherto unique range of models and options for this type of simulation.
    -- My motivation for this project was to find out if it can be done reasonably in Javascript/HTML and within the limits of a "normal size" web page. As of the initial release (October 2007), I could not find anything on the internet that matched these criteria while at the same time offering the complete set of features. (<<)
  • Q: Where can I dispose of that old wooden box from my basement... the one with the funny typewriter in it?
    A: Hey, there's plenty of room in my basement! (<<)
  • Q: How can I support this project?
    A: Feedback and suggestions are very welcome and appreciated. And of course you can spread the link, and spread the word. (<<)

Get in touch

 
  palloks@physik.hu-berlin.de
 

Links

  • Wikipedia articles (English, German; the latter also links to separate articles on some models and the Stecker-Uhr). These were my main sources in the initial stage of the project. Very comprehensive and well worth reading. There is a lot on the historic and cryptographic context, as well as details on the double-stepping mechanism.
  • Enigma rotor details on Wikipedia. More extensive compilations of wiring schemes for different Enigma models I found on a University of Toledo site: "python" cryptanalysis files: Enigma" (in the file "enigma_configs.py"), and on Rotor Compendium within the Spanish website "Taller de Criptografía" (both sites are offline now; the links go to the Internet Archive), as well as on the CryptoMuseum website (see below).
  • The extensive Dutch website of Crypto Museum offers not only specifications of most Enigma models (wheel wiring included), but also lots of pictures and original(!) documentation. There is comprehensible information on the Enigma-Uhr, too, as well as an Enigma Family Tree. The website is continuously being updated and extended.
  • Dirk Rijmenants' really beautiful Enigma simulation (Windows executable), was of great help during debugging. The manual offers valuable information on the mechanical process (e.g. wheels rotate first, coding happens afterwards). The website contains a lot of material related to cipher machines and cryptography, and is being updated regularly.
  • For analysis of the ring setting mechanism I also consulted the "M3 Naval Enigma Simulator" by Geoff Sullivan and the Crypto Simulation Group (see Hut Six and CryptoCellar). Their Windows executable offers a neat visualization of the signal propagation through the wheels. For the Enigma-Uhr, Geoff's simulation of the same name is to my knowledge the only validated reference available on the internet and thus, indispensable for resolving the exact signal path (stecker jacks for incoming/outgoing signals). Finally, the first Abwehr G-312 sim was checked against one of Geoff's simulations as well, and I am indebted to him and to David Hamer for their help in clarifying the ETW diagonal.
  • I also want to thank Mavis Batey ("the only one left who was present when the Abwehr machine was broken") and John Alexander, of Bletchley Park Museum.
  • The Universal Enigma simulator is featured in this video by poughkeepsieblue (3:00 min into the clip). Not only a nice tutorial on the sim, it also shows how you can put it to creative use... Thanks a lot, poughkeepsieblue!

Copyright, Licence, Disclaimer

Copyright © 2007-2011 by Daniel Palloks. -- This software and source code may be used, distributed and modified freely as long as (1) my authorship remains acknowledged, (2) any modification is properly indicated, (3) the freeware/ open source status and the conditions for distribution and modification remain unchanged. A copy of this statement must be distributed together with the software. -- This software is provided "as is". The author will not be liable for any damage - direct, indirect or consequential - resulting from the use of this software.

I am not responsible for the contents of external web pages reached via links from this site.
The Enigma logo graphic is in the public domain (source: Wikimedia Commons).

 


© Daniel Palloks 2009-2014
Last change: 10 May 2014

HTML 4.01 Strict