Lorenz and Colossus · Volume 2

Lorenz and Colossus — Volume 2 — Teleprinters, Baudot and Vernam — The Cipher That Adds

Émile Baudot's five-key telegraph, Donald Murray's typewriter and paper tape, the international alphabet of thirty-two characters, and Gilbert Vernam's 1917 discovery that a teleprinter could encipher itself by adding a key tape impulse by impulse — perfect when the key is never repeated, and the root of every weakness Bletchley Park exploited when it was

Figure 1 — A Lorenz T32 teleprinter of about 1936, on display at The National Museum of Computing, Bletchley Park. Machines of this family, made by C. Lorenz AG of Berlin, were the sending and receiving ends …
Figure 1 — A Lorenz T32 teleprinter of about 1936, on display at The National Museum of Computing, Bletchley Park. Machines of this family, made by C. Lorenz AG of Berlin, were the sending and receiving ends of German Army teleprinter links; the SZ cipher attachment sat between such a teleprinter and the line. The typebasket and paper-tape reels sit above a four-row keyboard. — Photo: Timitrius from Great Britain, CC BY-SA 2.0, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:Lorenz_T32_Teleprinter_(Circa_1936)_-_The_National_Museum_of_Computing_-_Bletchley_Park_in_Buckinghamshire,_England.jpg

2.1 About This Volume

The Lorenz machine did not encipher letters. It enciphered electrical impulses — the five on-or-off signals by which a teleprinter sends each character down a line. To understand how it worked, and why it could be broken, it is necessary to understand those impulses first: where the five-unit code came from, how a teleprinter turns a keystroke into a burst of current, and how in 1917 an engineer at the American Telephone and Telegraph Company realised that a second stream of impulses, added to the first, would encipher a message automatically.

This volume tells that background story. It begins with Émile Baudot in 1870s France and his five-key telegraph, moves to Donald Murray’s typewriter keyboard and punched tape and the international alphabet that grew from it, follows the teleprinter into the German state and military networks of the 1930s, and ends with Gilbert Vernam’s additive cipher — the principle inside the Lorenz SZ40/42 and the reason the whole edifice was fragile. It also sets out the notation that the rest of the series uses: dots and crosses, modulo-2 addition, and Bletchley Park’s way of writing the thirty-two teleprinter characters.

Teleprinters, punched tape and radioteletype have a longer history than this volume can give; the companion site Dots & Dashes covers them in its “Teletype, Tape and RTTY” section (dots-and-dashes.fubsypoly.com).

2.2 From Morse to Five Units

The electric telegraph of the mid-nineteenth century sent Morse code: dots and dashes of different lengths, separated by gaps of different lengths, keyed by a skilled operator and read by ear or from a paper strip. Morse is efficient for a human but awkward for a machine. Its characters vary in length from one element (E) to many, and a receiving machine has to measure time intervals to decode them.

Jean-Maurice-Émile Baudot (1845–1903), an engineer in the French telegraph service, attacked the problem differently. In 1874 he patented a printing telegraph (French patent 103,898) in which every character had the same length: a fixed number of elements, each either “current on” or “current off”. He began with six elements and settled on five by 1876 (Wikipedia, “Baudot code”). Five two-state elements give 2⁵ = 32 combinations, enough for the alphabet and a handful of control signals, with a “figures” and a “letters” shift to reach numerals and punctuation.

Figure 2 — Baudot's five-key manipulator, from an 1884 engraving. The operator pressed a chord of keys — two with the left hand, three with the right — for each character, and a click from the distributor (th…
Figure 2 — Baudot's five-key manipulator, from an 1884 engraving. The operator pressed a chord of keys — two with the left hand, three with the right — for each character, and a click from the distributor (the "cadence") told him when to press the next. — Engraving: M. Rothen, 1884, public domain, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:Clavier_Baudot.jpg

Baudot’s operators sent each character by pressing a chord on a five-key manipulator, in time with the clicks of a rotating distributor. The distributor was the clever part. Because each character took a fixed time, a single wire could be shared among several operators in turn, each getting a slice of every revolution — an early form of time-division multiplexing. An operator managed about 30 words a minute; four or six of them could share a line. The system was adopted by the French telegraph administration and spread across Europe. The unit of signalling speed, the baud — one signal element per second — is named after him.

2.3 Murray’s Keyboard and Paper Tape

Baudot’s code was designed for trained fingers. Donald Murray (1865–1945), a New Zealand-born journalist turned telegraph engineer, redesigned it for a machine. In his system, patented around 1901, the operator typed on a typewriter-style keyboard that punched the message onto paper tape; a separate transmitter then read the tape and sent it at full line speed. Keyboarding was decoupled from transmission. A clerk could type at any pace, mistakes could be corrected before sending, and a tape could be sent again, or relayed, without being retyped.

Murray also rearranged the code. Since every hole had to be punched, and punching wore the machinery, he gave the commonest letters the fewest holes: E and T a single hole each, the next ten commonest letters two holes, and so on (Wikipedia, “Baudot code”). He added control characters that a page-printing machine needed — carriage return and line feed — and kept a “blank”, with no holes at all. Murray’s code, with modifications by Western Union and others, became the basis of the International Telegraph Alphabet No. 2 (ITA2), standardised internationally by the early 1930s. It is the code the Lorenz machines used, and the code this series means when it says “teleprinter code”.

Figure 3 — A Murray page-printing telegraph installation, from an early twentieth-century publication: keyboard perforator, tape transmitter and printing receiver. Murray's separation of typing from sending, …
Figure 3 — A Murray page-printing telegraph installation, from an early twentieth-century publication: keyboard perforator, tape transmitter and printing receiver. Murray's separation of typing from sending, by way of punched tape, made the teleprinter practical — and later made it practical for German operators to punch long messages in advance and run them through the cipher at full speed. — Photo: unknown photographer, public domain, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:The_Murray_Page-Printing_Telegraph.jpg

2.3.1 The thirty-two characters

The ITA2 table below gives every character. Two things about it matter for the rest of the series.

First, there are only thirty-two characters, and all thirty-two are used. The Germans did not have the luxury of ignoring the control characters: carriage return, line feed, the two shifts, space and the all-blank “null” all appear in the stream of characters fed to the cipher. Bletchley needed a way to write them, and settled on single symbols: / for the null, 9 for the space, and 3, 4, 8 and + for the others, so that a stretch of teleprinter traffic could be written as a string like SPRUCHNUMMER9 with one symbol per character (Tiltman 1961). In the early Hellschreiber transmissions that Tiltman studied in 1941, 3 and 4 stood for carriage return and line feed.

Second, the code has no structure that helps the codebreaker or the cipher designer. The letters are not in alphabetical order of their codes; adjacent letters are not similar. What matters is the bits.

Figure 4 — The thirty-two characters of ITA2, as used by the Lorenz machines and written at Bletchley Park. Each character is five impulses; a filled circle is a cross (a hole in the tape, a "mark", 1) and an…
Figure 4 — The thirty-two characters of ITA2, as used by the Lorenz machines and written at Bletchley Park. Each character is five impulses; a filled circle is a cross (a hole in the tape, a "mark", 1) and an open circle a dot (no hole, a "space", 0). The six non-letter characters are shaded. — Diagram drawn for this series (03-outputs/diagrams/diagrams_A.py) from the standard ITA2 assignments as printed by Tiltman (1961, Fig. 2) and Tutte (1998, Table 1)

2.3.2 Dots, crosses and impulses

Bletchley Park did not call the two states “mark” and “space”, “1” and “0”, or “hole” and “no hole”. It called them cross (×) and dot (·). A character was written as a column of five dots and crosses, top to bottom, and a stretch of traffic as five rows — the five impulses — running left to right. Bill Tutte, recalling the convention in 1998, remarked that dot and cross “would equally well have been called ‘Zero’ and ‘One’” (Tutte, “FISH and I”, 1998). This way of looking at the traffic — not as a string of letters but as five parallel streams of binary digits — is the single most important habit of mind in the whole Tunny story. Tutte’s breakthrough (Volume 5) came from looking at one impulse at a time.

2.4 The Teleprinter

By the 1920s the printing telegraph had become the teleprinter (in America, the teletypewriter): a machine that looked like a heavy typewriter, sent each keystroke as a burst of current down a line, and printed whatever arrived. The key to making it reliable without a shared clock was start-stop signalling, developed in the United States by Charles and Howard Krum and others in the 1910s. Each character was framed by a start element, which set the receiver’s mechanism turning, and a stop element, which let it come to rest. The two machines needed only to run at roughly the same speed for the duration of one character; small differences did not accumulate.

European teleprinters, the German ones included, usually ran at 50 baud: each character took seven and a half elements — one start, five code, one and a half stop — or 150 milliseconds, about 400 characters a minute. A line could carry messages much faster than a person could type them, which is why long messages were punched onto tape first and transmitted from the tape.

2.4.1 Teleprinters in Germany

Germany took to the teleprinter early. The Reichspost opened a public teleprinter-exchange service, the forerunner of telex, in 1933, and by the late 1930s the state, the railways, the police and the armed forces all depended on teleprinter networks. Two German firms dominated the business: Siemens & Halske, whose machines served the Reichspost, and C. Lorenz AG of Berlin-Tempelhof, a radio and telegraph manufacturer whose teleprinters, such as the T32 in the photograph at the head of this volume, were widely used by the Army.

On land lines the security problem was manageable: wires could be guarded and lines routed through friendly territory. But an army that conquered half a continent in two years could not lay and guard cables to every headquarters. Links to Norway, the Balkans, North Africa and the Russian front had to go, at least in part, by radio. A teleprinter signal could be sent by radio as easily as Morse — as a pair of tones or frequencies standing for mark and space — and it could be intercepted just as easily. Everything sent that way had to be enciphered, and enciphered at the full speed of the teleprinter.

2.4.2 Hellschreiber, a cousin

A third way of sending text, used alongside Morse and teleprinter by the German services, was the Hellschreiber of Rudolf Hell (patented 1929), which sent each character as a little picture scanned in vertical strokes and printed it on a moving strip of paper. Hellschreiber was robust in poor radio conditions because the receiving operator read the printed shapes, smudges and all, by eye. It matters to the Tunny story because in the experimental period of 1941 the first Tunny transmissions were sent by Hellschreiber rather than by teleprinter, with six extra symbols added to the alphabet to make up the 32 five-unit characters (Tiltman 1961). Volume 4 returns to it.

2.5 Vernam: The Teleprinter That Enciphers Itself

In 1917, Gilbert Sandford Vernam (1890–1960), a young engineer in the research department of AT&T in New York, was asked to look at the security of the printing telegraph. His insight was simple and far-reaching. A teleprinter message on tape is already a stream of on-and-off signals. Prepare a second tape — the key — and combine the two, character by character and impulse by impulse, with a simple rule: if the two impulses are the same, send “no current”; if they differ, send “current”. The result is gibberish on the line. At the far end, combine the received signal with an identical key tape, by the same rule, and the original message comes back (Vernam, “Secret Signaling System”, US patent 1,310,719, filed 13 September 1918, granted 22 July 1919).

Figure 5 — Sheet 1 of Gilbert Vernam's patent "Secret Signaling System" (US 1,310,719, filed 13 September 1918, granted 22 July 1919). Two tape transmitters — one for the message, one for the key — drive five…
Figure 5 — Sheet 1 of Gilbert Vernam's patent "Secret Signaling System" (US 1,310,719, filed 13 September 1918, granted 22 July 1919). Two tape transmitters — one for the message, one for the key — drive five pairs of relays whose contacts combine each pair of impulses; the combined signal goes to line. The same circuit, fed the same key, deciphers. — Patent drawing: G. S. Vernam, public domain, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:USpatent1310719.fig1.png

In modern terms Vernam’s rule is the exclusive-or (XOR) of two bits, or addition modulo 2: 0 + 0 = 0, 1 + 1 = 0, 0 + 1 = 1, 1 + 0 = 1. Bletchley Park wrote it with dots and crosses — dot plus dot is dot, cross plus cross is dot, dot plus cross is cross — and simply called it “adding”. Adding is its own inverse: add the same thing twice and it disappears. That is why the identical key enciphers and deciphers, and why, in Bletchley’s notation, there is no difference between adding and subtracting.

Tutte gave the classic illustration in his 1998 lecture. Add the teleprinter letters J and S, impulse by impulse, and the result is the letter C; equally, C plus S gives J, and C plus J gives S.

Figure 6 — Adding two teleprinter characters. J (cross, cross, dot, cross, dot) plus S (cross, dot, cross, dot, dot) gives C (dot, cross, cross, cross, dot): each impulse is added on its own, and like signals…
Figure 6 — Adding two teleprinter characters. J (cross, cross, dot, cross, dot) plus S (cross, dot, cross, dot, dot) gives C (dot, cross, cross, cross, dot): each impulse is added on its own, and like signals cancel. Every three characters related this way form a "triple", and Tiltman's 1941 notes included a full 32 × 32 chart of them. — Diagram drawn for this series (03-outputs/diagrams/diagrams_A.py); the example is Tutte's ("FISH and I", 1998, section 2)

In Bletchley’s letters, if P is the plain text, K the key and Z the cipher text, then

Z = P + K, and therefore P = Z + K and K = Z + P.

Every one of those three relations was used, over and over, in breaking Tunny. The first gives the cipher. The second is how the legitimate receiver, or a codebreaker who has the key, reads the message. The third is how a codebreaker who can guess some plain text recovers the key that enciphered it — and the key, not the message, is what reveals the machine.

2.5.1 The one-time tape

Vernam’s first design used a key tape of random characters prepared in advance. As long as the key tape was at least as long as the message and was used only once, the scheme was, in a precise sense, unbreakable: any cipher text is consistent with any plain text of the same length, given a suitable key, and the cipher text gives no grounds for preferring one key to another. That the one-time condition was essential was grasped very early — it is associated with Captain Joseph Mauborgne of the US Army Signal Corps, who worked with AT&T on the system — and the scheme became known as the one-time tape, the machine form of the one-time pad. (The historian Steven Bellovin showed in 2011 that a San Francisco banker, Frank Miller, had described a one-time pad for telegraph codes as early as 1882.) Claude Shannon proved its perfect secrecy formally in a paper published in 1949.

The difficulty was logistics. Every message needed as much fresh, random key as it had characters, and every key tape had to be made twice, delivered securely to both ends of the link and destroyed after use. For a busy link carrying many long messages a day, that meant shipping enormous quantities of key. AT&T’s Lyman Morehouse proposed a compromise: use two loops of key tape of slightly different lengths, say 999 and 1,000 characters, and add both to the message. The combined key would not repeat until the product of the lengths, nearly a million characters (Bellovin, “Vernam, Mauborgne, and Friedman: The One-Time Pad and the Index of Coincidence”). But a key built from two short repeating components is no longer random, and the US Army’s William Friedman showed that such systems could be attacked. The tension between the convenience of a key made from a few short cycles and the security of a truly random one is the whole story of the Lorenz machine in miniature.

2.6 From Tapes to Wheels: The Idea Behind the SZ

The Lorenz SZ40 solved the logistics problem the way Morehouse had: by generating the key mechanically from short cycles rather than reading it from a one-time tape. Instead of two tape loops it had twelve pin wheels, each with a different number of cams around its rim; each cam could be set to give a cross or a dot. Five of the wheels — the ones Bletchley named chi — stepped regularly and contributed one impulse each; five more — the psi wheels — contributed a second component to each impulse, but moved only when two further motor wheels allowed them to. The key added to each character was the sum of the two components.

The cam counts were chosen to have no common factors (41, 31, 29, 26 and 23 for the chi wheels; 43, 47, 51, 53 and 59 for the psi; 61 and 37 for the motor), so that the combined key would not repeat for an astronomically long time. On paper the result looked like random key, and nothing about it needed to be shipped to the far end except the cam patterns, changed at intervals, and the twelve start positions, chosen for each message. Volume 3 describes the machine in detail.

Figure 7 — Where the cipher attachment sat. The SZ took plain text from a teleprinter (typed, or more often sent from tape), added key to each character and passed the cipher text to the radio; at the other e…
Figure 7 — Where the cipher attachment sat. The SZ took plain text from a teleprinter (typed, or more often sent from tape), added key to each character and passed the cipher text to the radio; at the other end a second SZ with identical settings added the same key again and handed plain text to the receiving teleprinter. Neither operator saw the cipher text. — Diagram drawn for this series (03-outputs/diagrams/diagrams_A.py)

The German designers knew, of course, that the key generator was deterministic. What they appear to have relied on was its size: the twelve wheels had 501 cams between them, and each message started at a different point in a cycle far longer than any message. What they underestimated were three weaknesses that lie in the additive principle itself, and that the rest of this series follows.

2.6.1 Weakness 1: depths

If two messages are ever enciphered with the same key — because both machines were reset to the same start position — then adding the two cipher texts cancels the key:

Z₁ + Z₂ = (P₁ + K) + (P₂ + K) = P₁ + P₂.

The result is the sum of two plain texts, and plain text is not random. A codebreaker who guesses a word in one message can add it in and see whether the corresponding letters of the other make sense. Bletchley called two messages on the same key a depth, and for a Vernam cipher a depth is fatal regardless of how the key was generated. It was a depth, sent on 30 August 1941, that exposed the Lorenz key; Volume 4 tells that story.

2.6.2 Weakness 2: key that is not random

A key made from wheels is periodic in each of its components. A chi wheel with 41 cams produces the same 41-character pattern in its impulse over and over again; the psi wheels repeat too, though stretched irregularly by the motor. If enough key is recovered, the periodic components can be found by writing it out at the right width and looking for repeats. That is what Tutte did; Volume 5 explains how.

2.6.3 Weakness 3: plain text that is not random either

Adding a key to the plain text does not destroy the plain text’s statistics; it hides them under the key’s. If the key’s statistics have a flaw — and the Lorenz key did, because the five psi wheels all stood still together for long stretches — then a combination of cipher text impulses can be found in which the flaws of the key and the habits of the language reinforce each other. Tutte’s statistical method of November 1942, which Colossus was built to run, exploited exactly this; it is introduced in Volume 5 and explained fully in Volume 9.

None of these weaknesses required an error by the cipher machine. Two of them required an error by the people using it. The third required only that the machine be what it was: a clever mechanical imitation of a one-time tape, not the real thing.

2.7 German Teleprinter Ciphers Compared

The Lorenz SZ was not the only German teleprinter cipher, and it is easy to confuse with the others.

Table 1 — German Teleprinter Ciphers Compared

MachineMakerBletchley nameFormKey method
SZ40, SZ42A, SZ42B (Schlüsselzusatz)C. Lorenz AGTunnyAttachment between teleprinter and line12 pin wheels; key added to each impulse
T52a–e (Geheimschreiber)Siemens & HalskeSturgeonComplete cipher teleprinter10 pin wheels; key added and impulses permuted
T43Siemens & Halskeprobably ThrasherCipher teleprinterOne-time key tape

The Siemens T52 was the more complex machine cryptographically: besides adding key it shuffled the order of the five impulses, so that the simple impulse-by-impulse analysis that broke Tunny did not apply directly. Swedish codebreakers under Arne Beurling read early T52 traffic carried over Swedish lines from 1940; Bletchley broke it later but read comparatively little, because Enigma already gave good coverage of the Luftwaffe and Navy that used it (Wikipedia, “Siemens and Halske T52”). The T43, used late in the war, was a true one-time tape machine, and Bletchley judged it unbreakable — exactly as Vernam’s theory predicts. Volume 10 places all three in the wider “Fish” picture.

2.8 Paper Tape at Bletchley

One more piece of technology links the German teleprinter to the British computer: five-hole paper tape. German operators punched long messages onto it before transmission. British interceptors at Knockholt punched the intercepted cipher text onto it. The Newmanry’s machines read it — Heath Robinson two tapes at once, Colossus one tape in a continuous loop at 5,000 characters a second, read by photoelectric cells rather than mechanical pins. And the output of the British Tunny, the relay copy of the Lorenz logic that turned settings into German plain text, came out on a teleprinter.

Figure 8 — Five-hole (left) and eight-hole perforated paper tape. Each row of holes across the tape is one character; the smaller holes are the sprocket holes that drive the tape. The Lorenz traffic, its Brit…
Figure 8 — Five-hole (left) and eight-hole perforated paper tape. Each row of holes across the tape is one character; the smaller holes are the sprocket holes that drive the tape. The Lorenz traffic, its British intercepts and the input to Colossus were all five-hole tape like the cream-coloured roll. — Photo: TedColes, public domain, via Wikimedia Commons, https://commons.wikimedia.org/wiki/File:PaperTapes-5and8Hole.jpg

Paper tape also explains a detail that matters later. Because German messages were usually transmitted from tape and printed at the receiving end on a narrow gummed strip, they rarely contained the carriage-return and line-feed characters a page printer needs; the plain text was a long run of words and spaces, with many repeated characters when operators doubled letters for emphasis or padded with spaces. Those repeated characters were part of what made German plain text statistically lopsided after “differencing” — the habit of adding each character to the next — and so part of what made Tutte’s statistics work.

2.9 The One-Paragraph Version

The Lorenz machine enciphered teleprinter signals, not letters. The five-unit code behind them began with Émile Baudot’s synchronous telegraph of the 1870s, was rebuilt by Donald Murray around a typewriter keyboard and punched paper tape, and became the thirty-two-character International Telegraph Alphabet No. 2, which Bletchley wrote as five rows of dots and crosses and six special symbols. In 1917 Gilbert Vernam at AT&T showed that a teleprinter could encipher automatically by adding a key tape to the message tape impulse by impulse, with the same key deciphering at the far end; with a random key used once, the scheme is unbreakable. The Lorenz SZ40/42 replaced the bulky one-time key tape with twelve pin wheels, gaining convenience at the cost of a key that was periodic in its parts and statistically flawed. That trade left three openings — depths, periodic key, and the joint statistics of key and language — which the following volumes show Tiltman, Tutte, Turing, Newman and Flowers prising open one by one.


Next — Volume 3: The Lorenz SZ40/42 — Twelve Wheels, Chi, Psi and Mu. Inside the box: the twelve pin wheels and their 501 cams, the regular chi wheels and the stuttering psi wheels, the two motor wheels that decide when the psis move, and the “limitations” with which the SZ42 tried to close the weaknesses Bletchley had found. How an operator set the machine up, what the indicators meant, and how its wheels add up — character by character — to the key.

Comments (0)

  1. Loading…

Comments are held for moderation — nothing appears until approved.