Virtual Colossus

The Lorenz machine

What was the problem for which Colossus was the answer?

The Lorenz cipher machines

The Lorenz SZ40, SZ42A and SZ42B were a range of teleprinter cipher attachment machines developed by C. Lorenz AG in Berlin during World War II. The SZ model name is from the German “Schlüssel-Zusatz”, which means cipher attachment.

The Lorenz SZ42 cipher machine, showing its twelve wheels
Lorenz SZ42 cipher machine on display at The National Museum of Computing on Bletchley Park. Photo by Ted Coles.

The Enigma cipher machine was portable enough for front-line troops, but it needed two operators at each end of the link: one to encipher the message one letter at a time and another to transmit it in Morse code. What the German High Command needed was something faster and even more secure, to send messages directly between Berlin and the generals at the front. This is what Lorenz built.

How did it work?

The best way to understand the basic working of the Lorenz cipher machine is to watch this short video, in which Dr James Grime explains how it works.

To understand what the Lorenz machine did, we first need to understand how a teleprinter works.

Teleprinters and the Baudot code

The teleprinter was already in use before the war. It used the Baudot code (also called the Baudot–Murray code), invented by Émile Baudot in 1870 and altered by Donald Murray in 1901 for use with teleprinters. This was a way of sending electrical impulses to represent the letters of the alphabet. Each letter is represented by a 5-bit code of impulses or their absence. The signal can be punched onto paper tape as a pattern of holes and no-holes. At Bletchley Park they recorded these impulses as either an x for a hole or a · for no hole.

Chart of the teleprinter code: for each letter, figure and control code, its five code elements are shown as holes or no holes

This gave 32 symbols, which is not enough for the alphabet and numbers together, so there were a number of control codes. Two special control codes switched between letter and figure modes, so depending on the last control code sent, the signal x···· could be either E or 3.

The Vernam cipher

In 1918, Gilbert Vernam in America invented a way of encoding teleprinter information by adding a random string of letters to the text using modulo-2 addition (the same as XOR). Adding the same set of letters a second time returns the cipher string to its original form.

To add two characters in modulo-2, take each of the 5 impulses for that character and use these rules: if the symbols are the same, the result is ·; if they are different, the result is x.

Modulo-2 addition
AddingResult
x+ x=·
·+ ·=·
·+ x=x
x+ ·=x

Example: enciphering the letter A, then deciphering it, using the fixed key letter S

LetterImpulses
Axx···
Sx·x··
?·xx··

Enciphered letter ? = I

LetterImpulses
I·xx··
Sx·x··
?xx···

Deciphered letter ? = A

Vernam proposed having pre-prepared random strings of characters, each used once and discarded as the message was encoded. The receiving party would have the same set of characters, and adding them to the enciphered message would give back the original plain text. Used correctly in this way (a one-time pad system), the message would be unbreakable.

The Lorenz method

Lorenz decided to use the Vernam method to encode their teleprinter signals. But, especially in wartime, making sure each end of the link had the same set of random tapes would have been practically impossible. So they built a machine that generated a random sequence of characters and added it to the message being sent. As long as the receiving end had a similar machine set to the same start point, the same characters would be added to the cipher text, revealing the original message.

Each obscuring character was generated by a set of five rotating wheels, each adding a · or x to one of the 5 impulses. Each letter of plain text entered moved the five wheels on by one position, changing the next obscuring character.

To make sure the generated string of characters did not repeat too often, there were two sets of wheels, so in effect two separate letters were added to each letter of plain text to get the final cipher character. Finally, to mix things up even more, two motor wheels were added which changed how often the second set of wheels turned.

At Bletchley Park, one set of 5 wheels was called the Chi (χ) wheels, which all moved together for each character. The other set was called the Psi (ψ) wheels, which moved in a staggered way depending on the two motor (Mu, μ) wheels. One motor wheel turned with each character, the second moved only when the first had an x, and the result of this told the Psi wheels when to turn.

The twelve wheels of a Lorenz machine, labelled from left to right: Psi wheels, motor wheels and Chi wheels

This means the number of ways of setting the wheels, without even touching the pins, is the product of the number of positions on all the wheels: 43 × 47 × 51 × 53 × 59 × 37 × 61 × 41 × 31 × 29 × 26 × 23 = 1.6034 × 1019. Taking the pin settings into account too gives a total of 1.0 × 10170, more combinations than there are particles in the universe.

Try the Lorenz machine for yourself

If you’d like to know more about how the Lorenz machine worked, try Virtual Lorenz: see and use for yourself the machine that Colossus was built to break.

Use Virtual Lorenz

Otherwise, read on: next is the Tiltman break and Bill Tutte.