Enigma description and working


Enigma Home Page
Fig. 1: Enigma I

Introduction

The military Enigma is a cipher machine that swaps the letters of the alphabet.

The user interface consists primarily of a keyboard and an illuminated display board. When the operator presses a key, the transformed (encrypted or decrypted) letter appears on the display board—it is the letter that lights up. For each transformed letter, there is a sequence of transpositions that forms an alphabet. For example:

	(ae)(bm)(cx)(dv)(fh)(gi)(jq)(ko)(lp)(nw)(rs)(tu)(yz)
Thus, the letter 'a' is transformed into 'e', 'b' into 'm', 'c' into 'x', and so on. This process is completely reversible: 'e' yields 'a', 'm' yields 'b', etc. This offers a significant advantage: the operator cannot mistakenly use the wrong mode (encryption versus decryption)—a common error with other cipher machines that often leads to security compromises. Conversely, a letter can never be transformed into itself; for instance, an 'e' can never be transformed into another 'e'. This serves as a major aid to a cryptanalyst. Each transformation is carried out by an electrical circuit, the core component of which is a series of rotors. The transformation is not static; it changes every time a letter is encrypted. A mechanical mechanism causes the rotors to rotate whenever a key on the keyboard is pressed. Consequently, the electrical circuit—and thus the encryption or decryption process—is altered after each keystroke.

Pressing a key has two effects:

  • It advances one or more rotors.
  • It completes an electrical circuit, illuminating a letter on the display board.
The circuit breaks as soon as the key is released, and the illuminated letter turns off. To record which letter lit up, one must keep the key pressed down.

Note: This page focuses primarily on the Enigma I—the military version of the Enigma used by the army and the air force. The "Models" page will detail the specific characteristics of the various other versions. Enigma operators possessed a manual that described the machine and its use.

Fig. 2: A commercial Enigma with the internal lid open

A description of the machine –the user interface in detail

Input and Output

The machine consists of a box with 26 keys labelled with the letters of the alphabet and 26 bulbs which shine through stencils on wich letters are marked.

The Rotors, Current Rotor Position, and Configuration

The machine contains rotors, which are its fundamental components. When the internal cover is closed, only the current letter of each of the three rotors is visible, along with a portion of the notched thumbwheel used to rotate them. When the cover is open, the reflector can be shifted to the left, allowing the rotors to be removed. The three rotors specified in the daily key can then be selected, placed onto a spindle in the order indicated by the daily key, and reinserted into the machine. The reflector is then shifted back to the right to ensure that the electrical contacts are engaged. Either before or after placing the rotors into the machine, the position of the ring on each rotor must be set according to the instructions in the daily key. Finally, the cover is closed. Through windows cut into the cover, the letter indicating each rotor's position can be seen. Using the notched thumbwheel on each rotor, the operator can set it either to the base position specified in the daily key (Grundstellung) or to the message key—that is, the position of the rotors prior to typing the message (whether in plaintext or ciphertext).

Note: The military Enigma I features a small cover that prevents the rotors from being turned via the notched thumbwheels. Personally, I do not understand the purpose of this component. Other models (M3, M4, the commercial model, etc.) do not have it.

The Plugboard

This board consists of removable plugs: the Steckers. Each Stecker allows for the swapping of two letters; they are positioned according to the daily key. If no plugs are inserted, the military Enigma offers a level of security similar to that of the commercial Enigma. This board can be covered so that it is not visible to the operator.

The Battery

When the internal lid is lifted, the battery—which provides a 4.5V direct current—can be replaced. When the internal lid is closed, a selector switch can be set to the following positions:

  • hell (Hell): The battery is considered partially discharged; this setting allows for the maximum possible current intensity.
  • dkl. (Dunkel): The battery is considered recently charged; this setting reduces the current intensity supplied.
  • aus (Ausschalten) : Disconnects the battery.
  • 4V: An external 4V power supply can be connected to the two black terminals on the right-hand edge.

Contents of the Enigma carrying case

  • The Enigma machine itself.
  • The lid contains:
    • Spare light bulbs.
    • Two spare Steckers.
    • An instruction sheet (excerpted from the manual) providing information on operation and maintenance. It is titled “Zur Beachtung” (Attention!). The sheet concludes with a table showing the equivalence between letters and numbers:
      
      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
      01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
      
Notes:
  1. In most cases, the case is made of wood (Fig. 2), though metal versions also exist (Fig. 1).
  2. Depending on the specific network, keys may be specified using either numbers or letters. Similarly, rotor positions and Steckers settings are represented by either numbers or letters, depending on the Enigma model. The Army Enigma uses numbers, while the Navy Enigma uses letters. In all cases, the numbers and letters are functionally equivalent for the purpose of operation or key setting.

The permutation of letters – the electric circuit

Fig. 3: Enigma Permutations

Each permutation consists of the result of several permutations. When you type a letter on the keyboard, a variable permutation occurs, created by plug-in cords (Steckers). Then, the ETW (Eintrittswalze) a fixed permutation is realized. Finally, three permutations are made in a row by three rotors which rotate like an odometer. Thus, this global permutation is different for each letter struck. After the permutation is executed by the three rotors, the reflector called UKW (Umkehrwalze), a fixed and reciprocal permutation, occurs. Its result is the input of a series of permutations that correspond to the permutations described above but are executed in the opposite direction. The resulting letter appears through lamplight.

Fig. 4: Electrical circuit

Each permutation is realized as portions of an electrical circuit. An electrical circuit is closed when a key on the keyboard is pressed. Current from the battery then passes through a Stecker, if present, and reaches the input of the ETW (entry wheel). The current then travels through the three rotors—from right to left (right rotor, middle rotor, left rotor)—before passing through the reflector and heading back toward the rotors. Now, the current travels through the rotors from left to right. It then passes through the ETW and potentially through another Stecker (if present). The current then reaches one of the keyboard keys (note that this key is necessarily not the one being pressed; due to the reflector, the current cannot return through the same key used for input). The current then passes through one of the lamps—causing it to light up—and finally returns to the battery.

Important: due to the reflector, encryption and decryption are reciprocal—if the letter A is encrypted, it might result in the letter X; conversely, if an X is encrypted using the same machine configuration, the result is A.

A few specific features

  • The ETW (entry wheel): Physically, the ETW resembles a rotor, but it is stationary. It allows the electrical current coming from the keyboard to reach the right-hand rotor. In the case of the commercial Enigma (known to the Allies), the wiring (from the rotors toward the keyboard) is QWERZUIAOASDFGHKPYXCVRNML. In the case of the military Enigma, however, it is the identity permutation: ABCDEFGHIJKLMNOPQRSTUVWXYZ. For historical reasons, the wiring of ETW was called QWERTZU by Allies.
  • The reflector (called UKW): For the commercial Enigma, the reflector is a rotor that can be positioned before encryption begins, but it does not advance during the encryption process. Its initial position is therefore part of the message key. In the military Enigma, the reflector is static. There were several versions: Reflector A was used in 1930, and in 1937, Reflector B replaced it. Reflector C was used for a short period. Reflector D, used by the Air Force starting in 1943, is configurable—its wiring is specified by the key. -
  • The three rotors (left, middle, right): For the Army and the Air Force, during the early period (1930–1938), these were selected from a set of three: I, II, and III. From 1938 onward, the three rotors were chosen from a set of five (rotors I, II, III, plus rotors IV and V). In addition to the five rotors used by the Army, the Navy also utilized rotors VI, VII, and VIII.
  • The main models used by the Wehrmacht (Army, Air Force, and Navy):
    • Enigma I, equipped with three rotors selected from a set of five. It was used by both the Army and the Air Force. The components that make up the key (rotor positions, Steckers settings, and Ringstellung [ring settings]) are numbered from 01 to 26.
    • The Enigma M3 is equipped with three rotors, chosen from a set of eight—the first five of which are the same as those used in the Enigma I. The components that constitute the key are represented by letters of the alphabet. The M3 is 100% compatible with the Enigma I.
    • The Enigma M4 is equipped with four rotors. - The naval Enigma M4 features four rotors. The three rotors on the right are those of the Enigma M3. The fourth rotor (then on the left)—as well as the reflector— is narrower, as the M4 was developed by modifying the reflector of the M3. For the fourth position, there are two thinner rotors available: "alpha" and "beta." There is also a choice between two reflectors: "thin-B" and "thin-C." For a given position of the "alpha" rotor, the "thin-B" reflector and alpha, functions identically to the standard "B" reflector; similarly, for a given position of the "beta" rotor, the "thin-C" reflector and beta, functions identically to the standard "C" reflector. Consequently, an Enigma M4 can simulate the behavior of an M3.

Rotor Advancement – The Mechanical Component

Fig. 5: An Enigma Rotor

Simple Stepping

The letter visible in the Enigma’s window when the lid is closed belongs to a ring that can be positioned relative to the rotor’s core, which contains the internal wiring. Consequently, if the ring is set to the letter 'B' and 'B' appears in the window, the wiring is in the same orientation as it would be if the ring were set to 'A' and 'A' appeared in the window. On the military Enigma (unlike the commercial version), the ring is linked to a notch that triggers the advancement of the rotor located to its left.

Note: The Germans made the error of positioning this notch differently for each rotor: rotor I triggers the turnover of the wheel to its left when it moves from Q to R; for rotor II, it occurs from E to F; for rotor III, from V to W; for rotor IV, from J to K; and for rotor V, from Z to A. These variations serve as a "signature" for each rotor, allowing cryptologists to identify which rotor is in a given position under certain circumstances. Pressing a key on the keyboard tilts a metal frame, which lifts a lever that advances the right-hand rotor by one position (one letter). It should be remembered that each rotor features a ring equipped with a notch. When the right-hand rotor has completed a full rotation, its notch—located on the right side of the rotor (when viewed from the back of the machine)—engages a second lever, which causes the middle rotor to advance by one step (one letter).

Fig. 6: The three levers and the three arms (in front)
Fig. 7: Blueprint: rotor, lever and arm

Simple Stepping - more detailed explanation

At the rear of the machine, there are three levers. All three are lifted whenever one of the keys is pressed. The first lever engages with one of the notches on the right-hand rotor, causing it to advance with each press. The middle lever, however, is twice as wide. Normally, it cannot engage the notches on the middle rotor because it is held back by a ring on the right-hand rotor. But once the right-hand rotor has completed a full rotation, the notch on its ring aligns with the middle lever, allowing the latter to engage the notches on the middle rotor and advance it.

There are also 3 arms (larger than the levers). Each arm locks the rotor positioned in front of it, once that rotor has been turned by the action of the lever or when turning a rotor by hand.

Important note: when this "simple stepping" (of the middle rotor) occurs, the right-hand rotor is pushed by the first two levers—the one positioned to its left and the one positioned to its right.

Double Stepping

In fact, a similar phenomenon occurs during the "double stepping" of the middle rotor. When the third lever engages the notches on the third rotor (the left one)—because the notch on the middle rotor has completed a full rotation—both rotors (the middle one and the left one) advance! Thus, with the rotors arranged in the order III-II-I, the following advancement occurs: (the ring on the left-hand rotor is not used)

	ADP
	ADQ
	AER
	BFS
	BFT
	...
There are 17,576 initial rotor positions (26×26×26), but the key length is only 16,926 (26×26×26)-(26x25) due to the "double stepping" mechanism. Thus, if one starts with the key "AAA," the system will return to that same position after 16,926 keystrokes.

Mathematical formula

  • P: Permutation associated with the rotation of a rotor
  • R: Right-hand rotor
  • M: Middle rotor
  • L: Left-hand rotor
  • U: The reflector (UKW)
  • S: The permutation associated with the Steckers
  • k, j, i: The visible positions of the rotors in the Enigma’s display windows
  • z, y, x: The ring settings (Ringstellung) (where z == 0 is equivalent to z == 'A' or ‘01’) z-k, y-j, x-i: The absolute positions of the rotors (the positions of their internal wiring)
  • E: The permutation performed by the Enigma machine.

Using SymPy notation (a Python library):

	E = S * ((P**(i-x))*R*(P**(-(i-x))) *
		((P**(j-y))*M*(P**(-(j-y))) *
		((P**(k-z))*L*(P**(-(k-z))) * U *
		((P**(k-z))*(~L)*(P**(-(k-z)))  *
		((P**(j-y))*(~M)*(P**(-(j-y)))  *
		((P**(i-x))*(~R)*(P**(-(i-x)))  * (~S)

For each key pressed, i = i + 1. When the right-hand rotor (R) reaches a specific "turnover" position (e.g., 'R' for Rotor I), the rotor to its left advances. Thus, if the right-hand rotor (R) is Rotor I and i equals 17 (corresponding to letter 'R'), then j = j + 1. Similarly, if the middle rotor (M) is in a position to trigger the advancement of the left-hand rotor (L), then both j = j + 1 and k = k + 1 occur (a phenomenon known as "double stepping").

Refers to the Enigma simplified version and the rotor-based model for an introduction to permutations and the SymPy library.

An example (I use my modified sympy bib)

We encrypt TAG (hello in German) with the following key:

  • Reflector: B
  • Walzenlage: III-II-I
  • Ringstellung: AAA or 01,01,01
  • Steckers: A/B, E/F, I/J, M/N, Q/A, U/V or 01/02, 05/06, 09/10, 13/14, 17/18, 21/22
  • Message key: AAZ or 01,01,26

A perspective using permutations:

  • S (Steckers): (ab)(c)(d)(ef)(g)(h)(ij)(k)(l)(mn)(o)(p)(qr)(s)(t)(uv)(w)(x)(y)(z)
  • B (Reflector): (ay)(br)(cu)(dh)(eq)(fs)(gl)(ip)(jx)(kn)(mo)(tz)(vw)
  • rotor III: (abdhpejt)(cflvmzoyqirwukxsg)(n)
  • rotor II: (a)(bj)(cdklhup)(esz)(fixvyomw)(gr)(nt)(q)
  • rotor I: (aeltphqxru)(bknw)(cmoy)(dfg)(iv)(jz)(s)
  • P (rotation): (abcdefghijklmnopqrstuvwxyz)
It is assumed that only the right rotor (I) moves forward.
	Position Alphabet
	AAA ==== (ae)(bm)(cx)(dv)(fh)(gi)(jq)(ko)(lp)(nw)(rs)(tu)(yz)
	AAB ==== (aw)(be)(cp)(do)(fu)(gy)(hn)(iq)(jl)(km)(rv)(sx)(tz)
	AAC ==== (av)(bt)(cy)(dn)(ef)(gx)(hp)(ik)(jr)(lo)(mw)(qs)(uz)
TAG (plain text) = UWX (cryptogram)

Note: The indicated position specifies the position of the rotors AFTER a key is pressed (rotors advance before encryption).

Key size

The key space for an Enigma machine without Steckers consists of:

  • The number of possible rotor orders (choosing three rotors out of five): 60
  • The number of ring settings: 26*26 = 676
  • The number of starting positions for the rotors: 26*26*26 = 17,576.
This results in 712 million possibilities. However, if the ring settings are not taken into account, this figure drops to 1 million distinct keys.

The number of combinations for 10 Steckers is:

	26! / ((26-20)! * (2^10) * 10!) = 1.5 × 10^14

So the total number of combinations is:
	7.12 * 10^8 * 1.5 * 10^14 ~  10^23  ~  2^76
Then, the key length is 76. So, a military Enigma key is almost breakable these days via brute force.

Notes:

  • It is worth noting that DES keys (56 bits) were broken in 1977. In principle, 3DES keys (112 bits) and AES keys (128 bits) are considered immune to quantum computers.
  • A commercial Enigma generally offers a level of security similar to that of a military Enigma without Steckers.
  • The number of combinations resulting from the Steckers, 1.5 followed by 14 zeros, is an astronomical number. This led the Germans to believe in the inviolability of the military Enigma. In reality, the attacks carried out by the Allies—most notably using the Bombe—were based on mathematical theory (cycles associated with permutations). In this context, the Steckers do not come into play. Furthermore, if the messages being analyzed are such that the middle rotor does not advance, the ring settings also do not factor in. Ultimately, this leaves approximately one million possibilities to analyze. It is a large number, but it is manageable (as demonstrated by using Bombes). Bombes require knowledge of a portion of the plaintext (This is not a brute-force type of attack).

Using the Machine - Encryption / Decrypting

After configuring the Enigma machine (order of rotors, rings setting, steckers settings, start position of rotors), the operator encrypts (or decrypts) the message letter by letter. To ensure he have time to see which letter lights up, the operator keeps the key pressed down. Either the operator or a colleague then records the letter on a paper. Most of the time, the message will be transmitted to the correspondent via radio using Morse code.

The procedures webpage describes how to use the Enigma in practical terms—that is, within a communications center. The following concepts are covered: keys, daily keys, message keys, networks, indicators, drafting, and more.

References

  • Crypto Museum: Enigma cipher machines. A very comprehensive description of all the different Enigma models. This is the go-to reference page (link).
  • Tom Perera: EnigmaMuseum.com. A website maintained by the foremost Enigma collector. It notably contains many photos of the Enigma machine, both from the outside and the inside (link).
  • Dirk Rijmenants: Enigma Cipher machine Simulator. What better way to understand how an Enigma works and is used than by using one? Dirk's simulator is a must. If you use it after reading the accompanying manual, you will feel as though you are handling an authentic Enigma machine (link).
  • Jared’s animations: How the Enigma Machine work? A video that describes how the Enigma machine works, using a 3D digital simulation (link).