30.11.2012 Views

Code and ciphers: Julius Caesar, the Enigma and the internet

Code and ciphers: Julius Caesar, the Enigma and the internet

Code and ciphers: Julius Caesar, the Enigma and the internet

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

76<br />

chapter 7<br />

We first convert <strong>the</strong> texts to numbers by using <strong>the</strong> table:<br />

Text 1 T H E X C U R F E W X T O L L S X<br />

19 7 4 23 2 2017 5 4 222319141111 1823<br />

Text 2 O N C E X U P O N X A X T I M E X<br />

14 13 2 4 23 20 15 14 13 23 0 23 19 8 12 4 23<br />

Now we add <strong>the</strong>m <strong>and</strong> <strong>the</strong>n reduce <strong>the</strong>m (mod 26):<br />

19 7 4 232 20175 4 2223191411111823<br />

14 13 2 4 23 20 15 14 13 23 0 23 19 8 12 4 23<br />

Sum: 33206 2725403219174523423319232246 (mod 26): 7 20 6 1 25 14 6 19 17 19 23 16 7 19 23 22 20<br />

Finally we convert <strong>the</strong> numbers back into letters, using <strong>the</strong> table:<br />

H U G B Z O G T R T X Q H T X W U<br />

<strong>and</strong> this is <strong>the</strong> cipher text that would be sent. The recipient would, of<br />

course, need to subtract Text 2 from <strong>the</strong> cipher (mod 26) in order to recover<br />

Text 1, viz:<br />

Cipher H U G B Z O G T R T X Q H T X W U<br />

Text 2 O N C E X U P O N X A X T I M E X<br />

Convert 7 20 6 1 25 14 6 19 17 19 23 16 7 19 23 22 20<br />

14 13 2 4 23 20 15 14 13 23 0 23 19 8 12 4 23<br />

Subtract (mod 26), i.e if <strong>the</strong> result is negative, add 26:<br />

Re-convert to letters:<br />

19 7 4 23 2 2017 5 4 2223191411111823<br />

T H E X C U R F E W X T O L L S X<br />

which is Text 1, <strong>the</strong> original ‘message’.<br />

Obviously it would be a very tedious <strong>and</strong> error-prone process to have to<br />

convert <strong>the</strong> texts to numbers, add <strong>the</strong>m, subtract 26 where necessary, <strong>and</strong><br />

re-convert to letters every time a message was to be enciphered so it is very<br />

worthwhile having two tables, one for enciphering <strong>and</strong> one for deciphering,<br />

from which <strong>the</strong> result of applying <strong>the</strong>se processes can be read off<br />

immediately. Experienced users would not need such tables since <strong>the</strong>y<br />

would soon learn to ‘add <strong>the</strong> letters’ at sight but for o<strong>the</strong>rs <strong>the</strong> tables save<br />

a lot of time <strong>and</strong> effort. They are given in Tables 7.2 <strong>and</strong> 7.3. Notice that in<br />

<strong>the</strong> encipher table (Table 7.2) it makes no difference whe<strong>the</strong>r we call <strong>the</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!