Classical Cryptography

The Typex Cipher Machine: 5-Rotor Assemblies, Multi-Notch Irregular Stepping & Axis Cryptanalysis Failure

An exhaustive academic breakdown of Britain's WWII Typex cipher machine: Wing Commander O.G.W. Lywood's 5-rotor architecture, stator permutation discs, multi-notch irregular stepping kinematics, why it remained unbroken by Axis codebreakers, and runnable Python simulators.

By CipherVerse Cryptography Academy • 2026-09-15 • 10 min read

1. Historical Origins: Wing Commander Lywood, RAF & The Bletchley Network

In the late 1920s, the British Royal Air Force (RAF) recognized that their manual codebooks and paper strip ciphers were dangerously vulnerable to interception. British intelligence closely inspected the commercial Enigma machine (Model D) marketed across Europe by Arthur Scherbius’s firm. However, RAF cryptographers deemed the commercial machine cryptanalytically inadequate for high-level military communications.

In 1935, Wing Commander Oswald G.W. Lywood was commissioned by the Air Ministry to design an advanced British rotor machine that eliminated Enigma’s foundational weaknesses. Lywood’s design—initially known as the "RAF Enigma with Type X Attachments" and later officially codified as Typex—underwent prototyping in 1937 as Typex Mark I and entered mass production in 1938 as Typex Mark II.

Typex played a critical role in Allied victory. While Bletchley Park decrypted German Enigma messages (intelligence codenamed ULTRA), the British needed a completely secure method to transmit these decrypted dispatches to field commanders worldwide. Special Liaison Units (SLUs) attached to General Dwight D. Eisenhower, Field Marshal Bernard Montgomery, and General Douglas MacArthur transmitted ULTRA decrypts exclusively over Typex networks.

Throughout the entire duration of World War II, Axis intelligence services (including the German Navy’s B-Dienst and the German Foreign Office’s Pers Z S) never succeeded in reading a single operational Typex message. It was the impenetrable communications backbone of the Western Allies.

2. Electro-Mechanical 5-Rotor Architecture: Stators vs. Rotors

At the heart of the Typex machine was a 5-disc rotor spindle, replacing Enigma’s 3-rotor design. Crucially, the 5 positions were not identical:

1. The Stators (Discs 1 and 2): The first two discs nearest the keyboard were "stators"—stationary scrambler wheels that did not step during message transmission. However, their rotational orientations (and in later models, whether they were inserted forwards or reversed) were defined by daily key sheets, acting as an internal, high-entropy substitute for Enigma’s external Steckerbrett plugboard.

2. The Revolving Rotors (Discs 3, 4, and 5): The remaining three discs rotated during operation to provide dynamic polyalphabetic confusion.

3. The Stationary Reflector (Umkehrwalze): Positioned at the far end of the spindle, the reflector redirected current backward through the inverse wiring of the rotors and stators.

The complete electrical permutation T_t at keystroke t is formulated as:

T_t = S_1 · S_2 · R_{3,t} · R_{4,t} · R_{5,t} · U · R_{5,t}⁻¹ · R_{4,t}⁻¹ · R_{3,t}⁻¹ · S_2⁻¹ · S_1⁻¹

Because the reflector U is an involution with no self-connections (U⁻¹ = U, U(x) ≠ x), the composite permutation T_t inherits self-reciprocity:

T_t⁻¹ = T_t

This mathematical involution guarantees that encryption and decryption are identical: typing the ciphertext back into a Typex configured with the same initial rotor settings instantaneously regenerates the plaintext.

3. Multi-Notch Irregular Stepping vs. Odometers

The fatal cryptographic weakness of the German Enigma machine was its predictable odometer-like stepping mechanism. Rotors I through V possessed only a single turnover notch. Consequently, Rotor III stepped on every keypress, Rotor II stepped once every 26 keystrokes, and Rotor I stepped once every 676 keystrokes. This produced an obvious periodic cycle of 16,900 steps, allowing cryptanalysts to treat the left rotors as effectively stationary during short crib searches.

The British eliminated this periodicity entirely by introducing Multi-Notch Rotors. Instead of 1 or 2 notches, Typex rotors were manufactured with 5, 7, or 9 notches irregularly spaced around their perimeter!

Mathematical Consequences of Multi-Notch Stepping:

• High Turnover Frequency: With 5 to 9 notches on Rotor 5, the adjacent middle rotor (Rotor 4) stepped every 3 to 5 keystrokes instead of waiting 26 strokes. Rotor 3 in turn stepped every 15 to 25 keystrokes.

• Shattered Polyalphabetic Cycles: The internal rotor core advanced through chaotic, non-linear permutations. Two identical words separated by only 10 characters encountered radically different scrambling paths.

• Resistance to Crib Cycle Analysis: Marian Rejewski’s indicator cycle techniques and Alan Turing’s crib-menu loops relied on stationary or predictable slow-rotor positions. Multi-notch irregular stepping made closed deduction loops almost impossible to formulate.

4. Why Axis Cryptanalysts Failed: B-Dienst, Pers Z S & Key Space

Throughout World War II, Axis signals intelligence units expended vast resources attempting to breach Typex transmissions. The German Navy’s cryptanalytic bureau, B-Dienst (Beobachtungsdienst), was remarkably effective against Allied naval codes: between 1941 and 1943, B-Dienst regularly read British Naval Cipher No. 3 (a manual book cipher), allowing U-boat wolfpacks to ambush Atlantic convoys.

However, when the British Admiralty transferred all strategic naval communications to Typex in late 1943, German cryptanalysts suffered a total blackout. Why did the Axis fail?

1. Key Space Explosion: A 5-rotor assembly where 2 rotors act as stators with reversible insertions (2 × 2 = 4 orientations) and 5 choices out of an expanded rotor library yields an astronomical initial key space exceeding 10²⁴ configurations.

2. Lack of Cribs: Allied operators practiced strict communications hygiene. Typex operators never transmitted stereotyped preambles or standardized weather greetings, denying Axis codebreakers the known-plaintext cribs required for Bombe-style analysis.

3. Hardware Capture Without Key Recovery: In May 1940, during the evacuation of Dunkirk and the Fall of France, German forces captured several Typex Mark II machines abandoned by the retreating British Expeditionary Force. German cryptanalysts in Berlin disassembled the machines down to the last screw, mapped the rotor wirings, and built simulator mockups. Yet without the daily key settings, the multi-notch stepping defeated every statistical cryptanalytic attack they attempted.

5. Worked Step-by-Step Trace: Encoding "ROYAL"

Let us trace the first 5 characters of the dispatch "ROYAL" through a 5-rotor Typex assembly.

Parameters: Stators S1, S2 set to index 0; Rotors R3, R4, R5 initialized to positions [0, 0, 0].

Rotor 5 contains turnover notches at offsets [3, 8, 13, 18, 23]. Notice how at Step 3, Rotor 5 reaches position 3, triggering an immediate turnover notch engagement that steps Rotor 4!

6. Complete Python Typex 5-Rotor Simulator & Unit Test

Below is a production-grade, standalone Python implementation of the British Typex cipher machine. It accurately simulates the 2 stationary stators, 3 revolving rotors, multi-notch stepping kinematics, and self-reciprocal reflector involution.

7. Practice Cryptanalysis: The Special Liaison Unit (SLU) ULTRA Dispatch

An urgent dispatch from Bletchley Park Hut 8 has been received by a Special Liaison Unit (SLU) field station in North Africa. The transmission was encrypted with a standard 5-rotor Typex Mark II:

8. Interactive Typex Cipher Machine Workbench

Ready to configure 5-rotor spindles, observe multi-rotor irregular stepping, and test historical British military communications? Use the official CipherVerse Typex Machine Simulator.

Everything operates with complete confidentiality directly inside your web browser.

Try Launch Typex Machine Tool →

Simulate the British 5-rotor Typex cipher machine with authentic stator and multi-rotor stepping.