A Wartime Cipher

Introduction Jumbling Encoding Decoding Summary A Challenge Application

Introduction

I watched a TV program recently about the Special Operations Executive (SOE) and the activities of its agents during the Second World War. One of the points made in the program was that the codes they used could be easily cracked. They were based on a poem the radio operator had to remember. I thought I would try and devise a code that could encipher messages to be transmitted in Morse code that would only require a pencil and paper. I have come up with the following code but I expect it is not original.

Jumbling

To start the agent is given a keyword, which must be remembered. This can be a very simple word, such as FRED. This is all that is required for the agent to construct a jumbled alphabet. The agent starts with the grid shown below.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 12 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
                                                   

The agent then writes down the code word with the numeric values of the letters given by the table, thus.

F R E D
6 18 5 4

He then copies the sixth letter into box one and crosses it out, the eighteenth letter into box two, the fifth into box three and the fourth into box four. This is shown below

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 12 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
F S E D                                            

The process is now repeated again for the sixth, eighteenth, fifth and fourth remaining letters. Thus I is the sixth, W is the eighteenth, H is the fifth and G is the fourth.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 12 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
F S E D I W H G                                    

The process is repeated until all the letters have been jumbled. This takes a little patience but can be achieved accurately with a little practice. The final result is shown below.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 2 3 4 5 6 7 8 9 10 12 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
F S E D I W H G L A M K P O Q N U Z T R Y J B C X V

Encoding

Now the agent is ready to encipher a message. We will start with a very short message as an example. Let us have the message, the cat sat on the mat. He writes the message in the grid shown below and places the letter values underneath.

T H E C A T S A T O N T H E M A T
19 7 3 24 10 19 2 10 19 14 16 19 7 3 11 10 19

So far we just have a monoalphabetic substitution cipher, which can be easily cracked so we have to do something more to the message. We next add the values of adjacent boxes together starting with the fist box and adding the value in the last box, thus.

T H E C A T S A T O N T H E M A T
19 7 3 24 10 19 2 10 19 14 16 19 7 3 11 10 19
38     46 30     35 28   32   32   20 30 23
12 19 22 20 4 23 25 9 2 16 6 25 6 9 20 4 23

The first calculation is 19+19=38 and this yields a value that is too large to encode so we subtract 26 giving 12. The second sum is 12+7=19. The next calculation is 19+3=22 and so on. Each time the number is larger than 26 we subtract 26. The numbers are then converted into letters using the alphabet we constructed at the beginning, as shown below.

12 19 22 20 4 23 25 9 2 16 6 25 6 9 20 4 23
K T J R D B X L S N W X W L R D B

The message is then sent and must be deciphered by SOE.

Decoding

SOE knows the agent's keyword and can keep copies of the alphabet grid. Indeed there is probably primitive machinary available to automate the process of deciphering. The process is still just as simple as enciphering. The letters of the coded message are written down and their values determined from the alphabet grid, as shown below.

K T J R D B X L S N W X W L R D B
12 19 22 20 4 23 25 9 2 16 6 25 6 9 20 4 23

Having thus written down the message it is decoded in reverse. The penultimate vale is subtracted from the last value so 23-4=19. This give the lookup value of the last letter of the message, i.e. T. The penultimate value of the message is similarly derived by 4-20=-16, because -16 is less than 1 we add 26 giving 10. This equates to the letter A. The whole process is shown below.

K T J R D B X L S N W X W L R D B
12 19 22 20 4 23 25 9 2 16 6 25 6 9 20 4 23
-7 7 3 -2 -16 19 2 -16 -7 14 -10 19 -19 3 11 -16 19
19 7 3 24 10 19 2 10 19 14 16 19 7 3 11 10 19
T H E C A T S A T O N T H E M A T

Summary

The process is relatively simple both for the coders and decoders. The agent only has to remember a simple code word to construct the letter grid and this can be built when required. Accuracy is essential when the message is being encoded as one error will result in the message becoming meaningless. In these days of computers we forget that people used to perform accurate computations like those required to encode the message every day.

I would be interested to receive any comments on the code. I expect that the most common comment will be to inform me of who invented the code.

A Challenge

I thought it might be interesting to issue a challenge to break the code. I will post the names of the people who complete this challenge on this web page. If that is not an incentive I don't know what is. The following message has been encrypted using the method I have described.

XUGEI DVZNN DCPDV JKBQY YKMLK BOSNW YRJNS WGXSV DWHJZ QJLDO WUFEO TFIGN AUVIH RIFVD CZQOZ NBPML YGJUF XTUQR DHLSS JLBPH NRGJB LAFMR GIQYB SMUZG XZUBJ DXHJW HKQWG EOFUV BGJLN HXOQM GXWUL AVWII SMWRD MWFTV PKTEA QXXLM VCFWV CGEYG QOTFP ZSPHP BOFIV CCFJK RWFOG IQMGV MDVVP YVDCO EDZZU VTUUL MVKQA ZZCJD BSVPT AGIHX PLNOZ UAUDD SJRSA VMKCP NSNUU QYYKA DBNBA EGKYY JQWCC TTQRC AAH

Good luck!

VB Application

I have written a simple Visual Basic application that can be used to encrypt and decrypt short messages in the basic cipher. You can download the code by following the link to VB application. If you do not have Visual Basic installed on your PC you will need to download the application extension msvbvm60.dll. This is available on the Internet.

| Contact Details | Pictures | Home | CV | Endymion Limited |

I last modified this page on Monday 29th April 2002