How the Lorenz SZ 42 Teleprinter Cipher Machine Worked: Nazi High Command Encryption and Its 1941 Breakthrough

The Lorenz SZ 42 was a teleprinter attachment used by the German high command for encrypting top-secret communications during World War II, operating on the Vernam cipher principle with twelve wheels generating a keystream. Unlike the portable Enigma, Lorenz integrated directly between teletypes for automatic five-bit ITA2 encryption. British interceptors at Knockholt first encountered its signals in 1940, later named Tunny. A critical operator error on 30 August 1941 allowed cryptanalysts at Bletchley Park to deduce the machine's structure. This led to the development of the Colossus computer in 1944 for automated decryption. The article details the χ, ψ, and μ wheel groups, the stuttering psi mechanism, and Python implementations of ITA2 encoding and XOR operations.

HabrTranslated from Russian

Read at source

In 1940, British interceptors detected unfamiliar teleprinter signals in the ether, mechanical trills instead of Morse code. These German encrypted teleprinter systems were collectively called Fish. Analysis of Lorenz messages between Vienna and Athens began in summer 1941, with the codename Tunny adopted in 1942. The German designation was Schlüsselzusatz, first SZ 40 then SZ 42 and variants.

Why Lorenz When Enigma Already Existed

Enigma M3 was portable but required separate encryption and transmission steps. The Wehrmacht high command needed direct teleprinter links between headquarters. The Lorenz SZ 40/42 sat between the teleprinter and the line, automatically encrypting the five-bit stream. Operators prepared messages on punched tape for transmission; the receiving unit restored plaintext for printing.

Four largely complete machines survive. Serial 1137 is at The National Museum of Computing, serial 1077 at Bletchley Park, serial 1116 at the National Cryptologic Museum, and one at the Deutsches Museum.

ITA2 Code and Vernam Cipher

Lorenz used the five-bit ITA2 code. It implements the Vernam cipher: plaintext bits XORed with a keystream produced by the wheels. When the keystream matches exactly and is used once, perfect secrecy results, but mechanical repetition created exploitable patterns.

Twelve Wheels: χ, ψ and μ Groups

Twelve wheels generated the keystream. Five χ wheels stepped every character; five ψ wheels stepped together but could be halted by two μ motor wheels. Each χ and ψ wheel contributed one bit, yielding Kᵢ = χᵢ ⊕ ψᵢ. Wheel lengths were pairwise coprime, producing a long period before repetition.

The Stuttering Psi Mechanism and Cryptanalysis

The μ61 wheel controlled μ37, which in turn decided whether the ψ wheels advanced. When ψ wheels stayed still, Δψ became zero, simplifying statistical attacks on ΔC = ΔP ⊕ Δχ ⊕ Δψ. Long messages revealed language biases once χ was correctly guessed, enabling recovery without exhaustive search of all 1.6 × 10¹⁹ starting positions.

Operator Error of 30 August 1941

Two long transmissions between Vienna and Athens used the same starting positions after an operator repeated a message with minor corrections. This depth allowed British analysts to reconstruct wheel patterns and movement rules, paving the way for Colossus in 1944.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Other

Mail.ru Reduces Lifetime 1TB Cloud Storage Promo to Standard 8GB Quota for Select Users
Kimi K3 Open Model Surpasses Closed AI Leaders with Million-Token Context and 896 Experts
Innostage Completes Functional Testing of PT NGFW 1.10.3 Across 156 Criteria