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.

68<br />

chapter 6<br />

before, to remind ourselves how it is done, let us look at an example.<br />

Suppose that we have <strong>the</strong> code group 6394 <strong>and</strong> that <strong>the</strong> key to be applied<br />

to it is 2798; <strong>the</strong>n <strong>the</strong> code group is written down, <strong>the</strong> key placed directly<br />

underneath it <strong>and</strong> corresponding digits are added without carrying so that<br />

when we add <strong>the</strong> last digits of <strong>the</strong> code <strong>and</strong> key, 4 <strong>and</strong> 8, <strong>the</strong> sum is written<br />

as 2, not 12 (that is: we are adding digit by digit (mod 10)). So we have<br />

<strong>Code</strong> group 6394<br />

Key 2798<br />

Sum 8082<br />

<strong>and</strong> <strong>the</strong> cipher text is 8082. The key would not be <strong>the</strong> same for <strong>the</strong> o<strong>the</strong>r<br />

groups since in practice <strong>the</strong> key ei<strong>the</strong>r would not repeat at all or, if it did<br />

repeat, would only do so after many digits. Since encryption involves adding<br />

<strong>the</strong> key to <strong>the</strong> code groups <strong>the</strong> person receiving <strong>the</strong> message would have<br />

to subtract <strong>the</strong> key digit by digit (mod 10) from <strong>the</strong> cipher in order to<br />

recover <strong>the</strong> code groups <strong>and</strong> so decipher <strong>the</strong> message; thus:<br />

Cipher 8082<br />

Key 2798<br />

<strong>Code</strong> group 6394<br />

Obviously <strong>the</strong> code groups are now disguised, <strong>and</strong> <strong>the</strong> security of <strong>the</strong><br />

system is substantially increased provided that <strong>the</strong> key does not repeat for<br />

a sufficiently long period. The question of how to produce sequences of<br />

digits which do not repeat until many thous<strong>and</strong>s have been generated is<br />

one of considerable interest to ma<strong>the</strong>maticians <strong>and</strong> cryptographers, <strong>and</strong><br />

we consider it more fully in Chapter 8. In <strong>the</strong> mean time, by way of illustration,<br />

here is a very simple method, which generates a sequence which<br />

repeats after 60 digits.<br />

Example 6.2<br />

Generate a sequence of digits (mod 10) by starting with <strong>the</strong> digits 3 <strong>and</strong> 7<br />

<strong>and</strong> forming each new digit by adding toge<strong>the</strong>r <strong>the</strong> two previous digits<br />

(mod 10).<br />

Solution<br />

The sequence starts<br />

3 7<br />

so <strong>the</strong> next digit is (3�7)�10 which is 0 (mod 10) <strong>and</strong> <strong>the</strong> 4th digit is<br />

(7�0)�7 <strong>and</strong> so <strong>the</strong> 5th digit is (0�7)�7. Continuing in this way we find<br />

that <strong>the</strong> sequence which is generated is

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

Saved successfully!

Ooh no, something went wrong!