How to play, and the history
How to read today's intercept, how the machine works under the bonnet, and a short history, with sources, of how Bletchley Park broke it.
This is a game. The cam patterns, the QEP book and the messages are made up for it, and nothing here is a real intercept. Not affiliated with or endorsed by Bletchley Park, The National Museum of Computing or the Crypto Museum.
How to play
- Press Play today's round. Everyone gets the same intercept on the same UTC day, and a new one arrives at 00:00 UTC.
- Read the QEP number at the top. That's the number the German operator sent in clear before the message.
- Find that number in the QEP book page. Its line gives the start position for each of the twelve wheels, in the same order as they stand on the machine: five psi, two motor, five chi.
- Set the twelve wheels to match. Click the arrows, drag a number up or down, or type it in. The arrow keys work too.
- Press Decode the tape (or the D key). The tape runs through, the wheels turn, and the teleprinter prints what comes out.
To see how it works, set the teleprinter speed to Visual demonstration. The first few characters go through one step at a time: the character's five bits, the chi bits added, the psi bits added (and whether the motor let the psi wheels step), then what comes out. It's drawn on the machine itself, with a panel above the chi wheels, the motor wheels and the psi wheels, and the wheels step as each character goes through. Then the rest of the message speeds up. The whole run takes about 13 seconds. With reduced motion on, each step just appears with no movement.
The book got damp. On some lines one tens figure is smudged, so all you can read is the last figure. If your line has a smudge, try the positions that end in that figure. A wrong guess prints garbage and costs points, so think before you run the tape.
A tip: if the first few letters come out right and then it turns to garbage, the chi and psi wheels are probably fine and a motor wheel is out. That's because the motors only decide when the psi wheels move.
Scoring and hints
A correct decode is worth 1,000 points. Each wrong try takes off 150, but running the exact same wrong settings again is free. You never get less than 100 for a decode. Hints are paid for with points, which are shared with Skywave, so they don't touch your score: checking whether one wheel is right costs 20 points and reading the smudge costs 50. Decoding today's round earns you 100 points, and a practice round earns 20. Your score is shown as you go, so you know what a decode is worth right now.
Decode the daily round on consecutive UTC days to build a streak. It's kept in this browser only. Practice rounds never touch it. When you decode, a card shows the sum, the tape runs off at speed and the score counts up. With reduced motion on, in settings or on your device, the card and score just appear.
Hard mode
Pick Hard on the title screen, then Play today's round. It's the same intercept as normal mode that day: the same message, the same QEP number, the same start positions and the same smudge. What changes is how much I do for you. Hard and Realistic are the whole job as the operators did it: read the QEP off the tape, find today's page, set the wheel pins from the pattern sheet, set the start positions, read the tape and send a reply. Hard has you prove each step once and fills in the rest; Realistic leaves all of it to you.
- The QEP number isn't given. It comes on the tape before the message, in clear and not enciphered: letter shift, QEP, a space, figure shift, the two figures, then letter shift again. Read it with the telecode cheat sheet. You can type it in to check it, and getting it right first time is worth 200 extra points.
- The book has five pages, each with a date across the top, and it opens on the wrong one. Turn the pages with the buttons either side of the date, the left and right keys, or a swipe, and find today's date. The other pages have a line for the same QEP number with different settings, so the date matters.
- The machine doesn't print. It punches tape, and you read that tape yourself with the cheat sheet, then type the message in. Capitals, spaces and punctuation don't matter, figures have to be exact, and I'll let one wrong letter in one word go. If you'd rather type Bletchley letters with 9 for a space, that works too. You can tap a row of the tape to mark it as read.
- The wheels come with every pin down, and you set them from the day's wheel pattern sheet. Tap a wheel on the machine (or the Set the pins button) and it turns to face you, with the pin numbers round the edge. Drag it round, or use Step back and Step forward, or the arrow keys, and raise or lower the pin at the top. Above the wheel a strip shows the pattern sheet unrolled, the pin at the top in the middle under the red pointer, so you needn't read the dots and crosses; the cog shows your own pins. Back returns to the machine, where your pins show raised or lowered. There's a list view under the sheet if you'd rather tick pins in a grid.
- In hard mode you choose Set one chi wheel or Set the chi and motor wheels. Once the wheels you chose match the sheet, the rest flick up wheel by wheel. While you set them, the pin at the top gets a small mark when yours differs from the sheet.
- In hard mode, once the first 5 characters you type of the message are right, the rest fills in for you, and the same goes for the reply.
- Wrong wheels give you garbage tape, and you won't know until you start reading it. A wrong reading costs 150 points, and in hard mode I'll tell you how many of the words are right, but not which.
Hard mode has two more hints, paid with points like the others: revealing the QEP costs 40 and each character of the message you reveal costs 10. Checking a wheel is 20 and reading the smudge is 50. Reading today's hard round earns you 250 points. You never get less than 100 for the score. Hard mode keeps its own score and streak, apart from normal mode's, and the result you share is marked HARD. The page dates are real calendar dates around today, but the pages themselves are made up, like the rest of the book.
Reading the message isn't the end of a hard round. You then send a short reply back: it's shown under the tape, it's the same for everyone that day, and it names the message you read. Leave the wheels on the settings you read the message with, type the reply, and the machine enciphers it and punches the tape. If the tape reads as the reply at the other end, the round is done. The reply has its own score: 300, less 100 for each wrong tape, never less than 50. Today's reply also earns 100 points.
To read the tape quicker, use the reading aid. It highlights one row of the tape at a time. Tap the five hole positions to copy that row, and the matching line lights up on the cheat sheet. The shift is up to you: the Letter shift button switches the highlight to the figures column and back, because the machine never changes shift for you. Then type what you read in the answer box. Next and Previous move along the tape.
Realistic mode is all by hand: every pin on all twelve wheels, every character of the message and of the reply. There's no mark on a pin that differs, no word count after a wrong reading, and no Reveal a character or Check a wheel hint. Only the QEP tells you when it's right. You learn whether the rest is right when you send the whole reading. Realistic has its own score (1,500 to start), its own streak and 400 points a day, the most of the three.
Both walk you through the job in four steps: read the QEP, set the pins, set the start positions and run the tape. Once the QEP is right the earlier panels fold away and the wheels turn to face you; Set start positions takes you on, and Back to setting pins takes you back to fix things. The page remembers which step you were on. Every pin has to be right, and you have to read the tape from a run on your own pins.
Every panel has a Hide button, and the page remembers what you've hidden. While a wheel is face on the panels fold away, any one comes back with Show, and Back puts them as they were.
With Hard or Realistic picked, Practice gives you rounds of that mode too, on random settings: a fresh book, preamble and message every time, the page to find is the one dated today, and the answer check is the same. Practice never touches your score or streak.
Practice
Practice has three tabs. Random settings gives you a fresh intercept as often as you like, on the SZ40 or the SZ42A. Encipher lets you type your own message and get a tape out, using today's cam patterns and whatever wheel settings you choose. Run that tape back in with the same settings and you get your message back. Chi only is below.
Chi only mode, which matches the printable model
Chi only uses just the five chi wheels (41, 31, 29, 26 and 23 cams), with no psi or motor wheels, so the key for each character is the chi on its own. It's there because I've made a simplified printable model of the chi wheels, and this mode works the same way as that model. You can type your own cam pattern for each chi wheel and set the start positions, then encipher or decipher.
The conventions are the same as the model's, so your paper workings, the model and the screen all agree:
- Each character is five impulses, written 1 to 5 from left to right. Impulse 1 is the top hole on the tape, so E is 10000 and T is 00001.
- A 1 (or x) is a mark: a hole in the tape and a raised cam, with the pin out. A 0 (or .) is a space: no hole and a lowered cam.
- Impulse 1 comes from chi 1, impulse 2 from chi 2, and so on.
- Positions count from 01. Position 01 means the first symbol of the pattern you typed is the cam being read for the first character.
- Read all five wheels, add (XOR) the result to the character, then move every chi wheel on one. Deciphering is the same job with the same start positions.
- Messages are in Bletchley letters: A to Z, 9 for a space, 3 and 4 for carriage return and line feed, 5 and 8 for figure and letter shift, / for null. A typed space counts as 9, like on the model's letter card.
A worked example, using the key on the model's fixed wheels (the Worked example button loads it). It's an example key made up for the model, not a wartime one. With all five wheels at 01 the first cams read 0 1 0 1 0, which is R. The first letter is H (00101). Adding them, a 0 where they're the same and a 1 where they differ, gives 01111, which is V. Keep going and HELLO enciphers to VNTDH. Three more to try on the model: ATTACK AT DAWN at 05 12 07 20 03 gives AIX4XKOXF9QFCX, BLETCHLEY PARK at 41 31 29 26 23 gives 4ONLYOMTOW9W4T, and TUTTE at 17 03 22 09 11 gives A9SVO.
Reading the tape
Each row across the tape is one character, five holes wide. A small sprocket hole runs between holes 2 and 3, two on one side and three on the other, which is how 5 hole teleprinter tape was laid out. The letter under each row is what the teleprinter printed. The arrows mark the shift characters, and ␣ is a space.
Intercepts are written the way Bletchley Park wrote them: letters for letters, and figures for the characters that aren't letters. 9 is a space, 3 a carriage return, 4 a line feed, 5 the shift to figures, 8 the shift back to letters, and / is blank tape. So a full stop goes out as 5M8, because M in figure shift is a full stop.
The full teleprinter alphabet
| Value | Impulses 1 to 5 | Bletchley name | Letter shift | Figure shift |
|---|---|---|---|---|
| 0 | ..... | / | blank | same |
| 1 | ....x | T | T | 5 |
| 2 | ...x. | 3 | carriage return | same |
| 3 | ...xx | O | O | 9 |
| 4 | ..x.. | 9 | space | same |
| 5 | ..x.x | H | H | £ |
| 6 | ..xx. | N | N | , |
| 7 | ..xxx | M | M | . |
| 8 | .x... | 4 | line feed | same |
| 9 | .x..x | L | L | ) |
| 10 | .x.x. | R | R | 4 |
| 11 | .x.xx | G | G | @ |
| 12 | .xx.. | I | I | 8 |
| 13 | .xx.x | P | P | 0 |
| 14 | .xxx. | C | C | : |
| 15 | .xxxx | V | V | = |
| 16 | x.... | E | E | 3 |
| 17 | x...x | Z | Z | + |
| 18 | x..x. | D | D | Who are you? (WRU) |
| 19 | x..xx | B | B | ? |
| 20 | x.x.. | S | S | ' |
| 21 | x.x.x | Y | Y | 6 |
| 22 | x.xx. | F | F | % |
| 23 | x.xxx | X | X | / |
| 24 | xx... | A | A | dash (-) |
| 25 | xx..x | W | W | 2 |
| 26 | xx.x. | J | J | Bell |
| 27 | xx.xx | 5 | figure shift | same |
| 28 | xxx.. | U | U | 7 |
| 29 | xxx.x | Q | Q | 1 |
| 30 | xxxx. | K | K | ( |
| 31 | xxxxx | 8 | letter shift | same |
How the machine works
The SZ40 and SZ42 were cipher attachments that sat between a teleprinter and the radio. Each character's five impulses were added, impulse by impulse, to five impulses of key. Adding is simple: two the same gives a dot, two different gives a cross. Add the same key twice and you're back where you started, so one machine with the same settings both enciphers and deciphers.
The key came from twelve pinwheels, each with a different number of cams that could be set raised or lowered. Standing in a row, left to right, there were five psi wheels (43, 47, 51, 53 and 59 cams), two motor wheels (37 and 61) and five chi wheels (41, 31, 29, 26 and 23). The 3D view shows them in that order, with raised cams sticking out. It's simplified: I've sized the wheels by cam count so they're easy to tell apart, and it isn't a scale model.
For every character, this is exactly what the game does:
- Read every wheel at its current position. Nothing has moved yet.
- The key is the five chi cams added to the five psi cams.
- The basic motor is the cam on the 37 wheel. On the SZ40 the psi wheels move on after this character only if the basic motor is a cross.
- Then everything steps. All five chi wheels move on one, every time. The psi wheels all move on one together, or all stay put. The 37 wheel moves on one if the 61 wheel's cam was a cross. The 61 wheel moves on one every time.
On the motor wheels a cross means go and a dot means stop. Because the psi wheels sometimes stood still, they often added the same letter several times in a row. Bletchley called that the extended psi, and it turned out to be the machine's big weakness.
The SZ42A, introduced in February 1943, added what Bletchley called a limitation. The one in this game is chi 2 one back: the psi wheels stand still only when the basic motor is a dot and the chi 2 cam read for the previous character is a cross. Otherwise they move. For the very first character the game uses the chi 2 cam one place back on the wheel, which is the same cam. Later limitations brought in the plaintext itself (for example the fifth impulse two characters back), which made depths much harder to use. I haven't put those in.
The QEP book
At first the sending operator told the other end where to set the wheels with a 12 letter indicator, sent in clear, one letter per wheel. From October 1942 that changed. Both ends had the same QEP book, a list of a hundred or more wheel settings. The operator sent QEP and a number, both ends set their wheels from that line, and once every line had been used the book was replaced. Settings weren't supposed to be used twice. In the game the QEP number points at a line of twelve start positions, which is how it worked, but the book page, its layout and the smudges are mine.
What's real and what's made up
- From the sources: the twelve wheels and their cam counts, the order they stand in, the motor logic and the chi 2 one back limitation as the General Report on Tunny describes them for the SZ40 and SZ42A, the teleprinter alphabet, the tape layout and the way the QEP number pointed to a set of start positions.
- Made up: the cam patterns. The real ones changed regularly and were never published, so the game makes a new set every day from the date. My rules are: chi and psi wheels about half raised with no more than four the same in a row, and the motor wheels a bit over half raised. Those are my rules, not the German ones.
- Made up: every message. I wrote them in the clipped style of wartime signals in English. Real Tunny traffic was in German, and none of these is a real intercept.
- Simplified: the hard mode preamble (letter shift, QEP, a space, figure shift, two figures, letter shift) is a layout I made for the game, not a copy of a real one.
- Simplified: the receiving teleprinter here prints figures in a UK style, figure shift D (Who are you?) and J (bell) print nothing, and messages only use letters, figures, spaces and a little punctuation.
The history, briefly
Tunny was Bletchley Park's name for the Lorenz SZ machines and their traffic. The Germans used them for high level messages between the High Command and army commanders across Europe, sent as enciphered teleprinter signals by radio. An experimental link started in June 1941, and by 1944 the British knew of 26 links.
On 30 August 1941 an operator sent a message of about 4,000 characters, was asked to send it again, and did so on the same wheel settings, with small changes to the text. Two messages on the same key is called a depth. John Tiltman spent about ten days teasing the two texts apart, and that gave him the key itself.
Bill Tutte, a young Cambridge graduate in the Research Section, took that key and found a repeat every 41 characters in its first impulse. By January 1942, working with the rest of the section, he had worked out the logical structure of the whole machine. Nobody at Bletchley saw a real Lorenz machine until the end of the war.
From July 1942 a section under Major Ralph Tester, the Testery, broke messages by hand. When the QEP books arrived in October 1942 they had to rely on depths, which got rarer. In November 1942 Tutte found a statistical way to find the chi settings without a depth, but it needed far too much counting to do by hand.
Max Newman's section, the Newmanry, set out to do the counting by machine. Its first, Heath Robinson, was working in June 1943. It ran two paper tapes that had to stay in step, which they often didn't. Tommy Flowers, an engineer at the Post Office Research Station at Dollis Hill, proposed an electronic machine that generated the wheel patterns itself and read just one tape. That was Colossus. The first one arrived at Bletchley Park on 18 January 1944 and did its first job on 5 February 1944. The first Mark 2 was working on 1 June 1944, days before D Day, and ten were in use by the end of the war.
Colossus didn't print German. It counted, to find the wheel settings. The plaintext came off British Tunny machines, built at Dollis Hill to copy the logic Tutte had worked out.
Sources
- Good, Michie and Timms, General Report on Tunny (1945), the section on the machine and its motors, transcribed by Graham Ellsbury. The full report is also listed at AlanTuring.net.
- W. T. Tutte, FISH and I, his own account, a 1998 lecture at the University of Waterloo (PDF).
- Jack Copeland, Colossus: Breaking the German Tunny Code at Bletchley Park, The Rutherford Journal.
- Bletchley Park, 75 years since Colossus arrived at Bletchley.
- The National Museum of Computing, Colossus and Tunny and Heath Robinson.
- Tony Sale, The Lorenz cipher and how Bletchley Park broke it, and his page on the Bedstead and the tape layout.
- The Bill Tutte Memorial Fund, Teleprinter code.
Spotted something I've got wrong? Email me: hello@dexmlabs.app