Skip to content

Lorenz Cipher – – Bletchley Park

July 16, 2013

So Cryptography! (Secret-writing)! Its goal is damn simple. Alice tries to send a text message to Bob, when they know there could be someone eavesdropping over the insecure channel. So they use an Encryption-Decryption function and make it possible, with the eavesdropper a.k.a. Drake, gets a weird sequence of letters that he cannot understand. The encryption(E) and decryption(D) functions are inverse to each other, for e.g. D(E(m)) = m (where m is the message). Alice takes her message, encodes it with the key, Bob gets the cipher, Decodes it with the same key, and he has the message!

Now HOW could you encode your message to a cipher text? One easy way is the logical XOR function! where 0 XOR 1 = 1 XOR 0 = 1 and 0 XOR 0 = 1 XOR 1 = 0. WAIT! and watch the magic. Lets say you take the binary number 1011 and XOR it with another binary number lets say 1001. So, (1011)XOR(1001) = 0010 OKAY? Now XOR this solution with the same random binary that we chose (1001), and observe that (0010)XOR(1001) = ? Yes its 1011 again. This is called a One-Time-Pad, where the key is used only once. Now when you use this function correctly, your encryption will be IMPOSSIBLE to crack, and hence called A Perfect Cipher.

Done with the intro for newbies, lets get to business 😀

Back in The World War II, sending highly classified and secret messages was a necessity. The Lorenz Cipher Machine was built by the Lorenz company for the German Army High Command. The Nazis used 5-bit Baudot Code, by which they got a maximum of 32 = 25 letters to make use of. These included the 26 letters of the alphabet and other punctuation marks like period, comma, forward slash, etc. These message letters were converted to their respective 5-bit Baudot codes, and then each bit of a single letter was enciphered with a key. Now have a look at the plan of the machine:-

Lorenz Cipher Machine Diagram

The number written on each of the wheels is the total number of teeth on that wheel, where each tooth could be a 0 or a 1. Now the ‘K’ wheels rotated every letter, and the movement of the ‘S’ wheels was determined by the positions of the ‘M’ wheels. For e.g., if your message is “HI”, the message in its Baudot code would be “10100 00110”. Now a random starting configuration would be decided for the wheels, and a random key would be generated. This key would be used to encode “H” and the subsequent key obtained by the movement of those wheels would give the key for “I”. Lets \assume that the first key is “10101” and the next key is “10010”. So, the cipher text now is ((10100)XOR(10101), (00110)XOR(10010)) and these correspond to “EH” according to Baudot code definitions, and so the intercepted message is “EH”, which in no way can be decoded to “HI” by the interceptor.

Now the Germans considered their machine as unbreakable, as it boasted a whooping 16,033,955,073,056,318,658 starting wheel positions. But then, it HAD to happen. The Britishers got their break when a German operator tried sending his message and the cipher was indeed intercepted, but there was some problem at the other end, which forced the operator to resend his message. AND HE CHOKED! Firstly, He reset the machine to the previous configuration. Secondly, he was too lazy to retype the entire 4000-letter message exact, and used abbreviations wherever possible (for e.g. No. for Number and so on). This message was transferred successfully, but was also intercepted by the Britishers.

The two messages were not completely different, they were almost the same due to abbreviations, and also encoded with the same key. There they found a possibility on breaking the code. Bletchley Park! Where a section of enthusiastic code-breakers was formed, headed by Major Ralph Tester. These intercepts were quickly sent to John Tiltman, one of the best code-breakers at Bletchley Park. SPRUCHNUMMER (“Message Number” in German) is the popular phrase associated with this event. The operator had written it as SPRUCHNR in the second message. Tiltman already had a sound knowledge of the Vernam Encoding pattern which was applied in the Lorenz machine. Because the Vernam system depended on addition of characters, Tiltman reasoned that if the operators made a mistake and used the same Lorenz machine starts for two messages (a depth), then by adding the two cipher texts together character by character, the obscuring character sequence would disappear. He would then be left with a sequence of characters each of which represented the addition of the two characters in the original German message texts. For two completely different messages it is virtually impossible to assign the correct characters to each message. Just small sections at the start could be derived but not complete messages.

He applied this technique to the messages and this time he was able to get much further with working out the actual message texts because when he tried SPRUCHNUMMER at the start he immediately spotted that the second message was nearly identical to the first. Thus the combined errors of having the machines back to the same start position and the text being re-keyed with just slight differences enabled Tiltman to recover completely both texts. The second one was about 500 characters shorter than the first where the German operator had been saving his fingers. This fact also allowed Tiltman to assign the correct message to its original cipher text. Of course, this method took a lot of time and by the time message could be decoded, there would be no importance to knowing them. Tiltman assigned this brute-force job in the “Before Computers” to Bill Tutte, a pass out from Cambridge. And after a couple of months, the team had designed a logical pattern of the Lorenz Cipher machine, that looked identical to the image on top.

Based on their derivations, the Britishers built Colossus, their machine to Decrypt the Lorenz machine generated ciphers. In the period between 1943-1944, 10 Colossi were built and they helped to break some of the most important German messages during the WW II. One of the messages broken by Colossus was crucial to the D-Day Invasion since the allies were able to learn that their campaign to deceive Hitler about where the attack would come was succeeding and also knew where the German troops were positioned.

Thats the kind of motivation and hunger which comes in only by the fear of your own country being destroyed! Of course, doing this in the “Before Computers” era was a big big achievement for Bletchley Park!

My next post would probably be for the math lovers (Prob-Stats lovers to be precise), some possibilities of the Britishers’ approach towards Lorenz code-breaking. Thats all folks….

Reference Links:

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: