| Enigma Home Page |
IntroductionThe 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:
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.
A description of the machine –the user interface in detail
Input and OutputThe 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 ConfigurationThe 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 PlugboardThis 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 BatteryWhen 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:
Contents of the Enigma carrying case
The permutation of letters – the electric circuit
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.
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
Rotor Advancement – The Mechanical Component
Simple SteppingThe 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).
Simple Stepping - more detailed explanationAt 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 SteppingIn 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
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:
A perspective using permutations:
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 sizeThe key space for an Enigma machine without Steckers consists of:
The number of combinations for 10 Steckers is: 26! / ((26-20)! * (2^10) * 10!) = 1.5 × 10^14So the total number of combinations is: 7.12 * 10^8 * 1.5 * 10^14 ~ 10^23 ~ 2^76Then, the key length is 76. So, a military Enigma key is almost breakable these days via brute force. Notes:
Using the Machine - Encryption / DecryptingAfter 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
|