The Lorenz Machine

What was the Lorenz SZ and how did it work?

The Lorenz SZ40, SZ42A and SZ24B were a range of teleprinter cipher attachment machines developed by C. Lorenz AG in Berlin during World War II, the first being created in 1940 (hence the naming). The SZ model name is from the German "Schlüssel-Zusatz" which means cipher attachment.

The Enigma cipher machine was portable enough for front line troops but it took time to encipher a long message and also required at least two operators each end of the link - one to encipher the message one letter at a time and another to transmit it via Morse code. What was required by the German high command was something faster and even more secure to transmit messages directly between Berlin and the front line generals and this is what Lorenz built.

Lorenz SZ42 cipher machine on display at The National Museum of Computing on Bletchley Park

Dr James Grime introduces the Lorenz

Lorenz SZ42 : Rare footage of cipher attachment running at the Heinz Nixdorf Computer Museum in Paderborn, Germany as part of the Cipher Event in 2007 when a message was transmitted for the rebuilt Colossus at The National Museum of Computing to break.

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

Teleprinters and the Baudot Code

The teleprinter was already in use pre-war and used the Baudot code (also called the Baudot-Murray Code), which was 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 letters of the alphabet. Each letter can be represented by a 5-bit code of impulses or their absence. This signal can be encoded onto a punched paper tape as a series of holes or no-holes where an impulse was required. At Bletchley Park, they would record these impulses as either an X for a hole or a . for a no-hole character.

This gave a total of 32 symbols available which is not enough to encode the alphabet and numbers together so there were a number of control codes available. There were two special control codes to switch between letter and figure modes. Therefore depending on the last control code sent, the signal x····· could either be 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 (the same as XOR). This meant that adding the same set of letters a second time would return the cipher string back to it's original format.

X + X = •
• + • = •
X + • = X
• + X = X

To add two characters in modulo-2, take each of the 5 impulses for that character and use the following rules: If the symbols are the same return •, if they are different, return X

An example, enciphering the letter C using the key M, which gives the result L

Letter
Impulses
C
X
X
X
M
X
X
X
L
X
X

The clever part is that this method is reciprocal, if you take the resulting cipher text and add back the key, it returns you to the original plain text letter.

Letter
Impulses
L
X
X
M
X
X
X
C
X
X
X

Vernam proposed having pre-prepared random strings of characters available each of which would be used up one at a time and discarded as your message was encoded. Your receiving party would have the same set of characters available as well and when added to the enciphered message would give the original plain text message. Used correctly in this way (a one-time pad system) would make the message unbreakable.

The Lorenz method

Lorenz decided to use the Vernam method to encode their teleprinter signals, but especially in a war situation, there was a difficult problem that to ensure each end of the link had the same set of random encoded tapes available would have been practically impossible so they decided to create a machine which would generate a random sequence of characters and add that to the message being sent. As long as the receiving end had a similar machine and could set the same start point, the same set of generated characters woudld be added to the message, revealing the message

Each obscuring character would be generated by a set of five rotating wheels which either add a • or X for each of the 5 impulses. Each letter of the plaintext entered would move the five wheels on one setting changing the next obscuring character.

To make sure that the random generated string of characters did not repeat too often, it was decided to have two sets of wheels so it is essentially adding two seperate letters to the initial letter to get the final cipher character to send. Finally, to enable even more differences to the mix, two seperate motor wheels were added which changed how often the second character wheels turned.

At Bletchley Park, one set of 5 wheels were called the Chi (or X) wheels which all moved together for each character encoded, the other set were called the Psi (or ψ) wheels which moved in a staggered motion dependant on the result of the final two motor (Mu or μ) wheels. One motor wheel turned for each character (like the Chi wheels), while the second moved only when the first wheel had an X result and the result of this told the Psi wheels when to turn.

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

The Lorenz models

The Lorenz Schlüsselzusatz 40/42 went through a few changes during it's lifetime which were designed to add extra security to the encryption.

The Lorenz SZ-40

The Lorenz SZ-40, originally built in 1940 had two stages. The initial pre-production SZ-40 had 10 wheels but it was decided to update this to include the extra two motor wheels to try to stop a repetitive pattern.

The first transmissions were intercepted in early 1940 by a group of policemen on the South Coast who were listening out for possible German spy transmissions from inside the UK and an experimental link using SZ-40 machines was recorded in June 1941.

The regular SZ 40 model consists of five "spaltencaesar" (Chi) wheels which all stepped in unison for each character enciphered. These drive two "vorgelege" (control / Mu) wheels which then step the five "springcaesar" (Psi) wheels irregularly.

Possibly a photo of the Lorenz model SZ40. Note the different configuration of the send/receive equipment and meters at the top and what appears to be two locked covers, one allowing access to the Chi & Mu rotors and one to the Psi only.

The Lorenz SZ-42A

The SZ 42 was brought into use from 1942 onwards to improve upon the security of the SZ 40. The 12 wheels are exactly the same as the original model, but an additional limitation was introduced to alter the pattern of the Psi wheels.

Instead of just using the 37-pin motor wheel setting to tell when the Psi wheels should turn, the setting of the second Chi wheel(No.9) from one position back was also checked. If the 37-pin wheel active setting was off and the limitation value from Chi2(1 back) wheel was on, the Psi wheels would not move, any other combination would move the all of the Psi wheels together forward one position.

A further optional limitation, which was based on the fifth impulse from the plaintext character 2 back, was also available which could be added.
The Plaintext Limitation (Klartextfunktion) represents an additional security measure. This can be turned on or off by a switch located under the hood in a box at the upper right of the Lorenz. It has a screwed on lid marked "KT-Schalter" (KT-Switch).

This means an addition of the plaintext fifth impulse from two characters back to the limitation affecting the Psi wheels (1-5). It was used on the SZ42a and SZ42b later in the war, but caused issues when used due to radio interference which would cause the message to be garbled on reception. Bletchley Park named this the P5 limitation.

Also at this time in 1942, the Germans switched from using the Ablesetafel 40 to a QEP book of codes to stop the limits imposed by the fixed number of options by the original method and also to stop giving away extra information with the full set of twelve indicator letters being sent each message. Fortunately (for the Allies and Bletchley Park), Bill Tutte had already worked out methods of calculating the pin settings without having to rely on the indicator values.

The Lorenz SZ-42B

The SZ 42B was almost idenitcal to the SZ-42A with the further addition of another wheel into the limitation calculation. The limitation value was now set using both the Chi2 wheel, 1 back (wheel 9) and also the Psi1, 1 back (Wheel 1). These affected the movement of the Psi wheels as on the SZ-42A. The optional P5 (KT-Switch) limitation was also available as before.

The Lorenz SZ-42C

This is a simulation of the Lorenz SZ 42c (also known as SK-44). This was never in production but was being built to replace the SZ42a/b. it was not completed by the time the war ended. The information comes from sparse TICOM reports - I am not aware of any photos or models of this version running so this could be the first time this action has been shown since 1945. There were to be 10 wheels which moved constantly unless interrupted. Interuption of wheels 1-5, which move in unison, was by the settings of wheel 9+10, wheel 6 by 8+2, 7 by 9+3, 8 by 10+4, 9 by 6+5 and 10 by 7+1. Should all wheels become locked together, the machine would count to 3 then step wheels 1 to 5.

Another feature was that the sending Lorenz would continue to operate, sending a pseudo-random string of character between messages and was to be kept in sync with the receiving machine by using a crystal-controlled teleprinter. This was to try to hide the exact position of the real encoded message thereby making searching for cribs within the text much more difficult. There were plans for a further additional machine beyond this one (SK-45) which had an additional eleventh wheel which was to step the machine past dead spots so the three count device would not be required.

How did Bletchley Park break this cipher?

The story of how Bletchley Park came to break this hugely complex cipher machine is a facinating one! Find out with this brief video overview below or if you want to find out more about the story and the details of Colossus, the first computer ever built, which was created to decipher this machine - follow this link below.

Go to Virtual Colossus