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.

200<br />

appendix<br />

Solution<br />

A linear recurrence of order 5 takes <strong>the</strong> form<br />

U n �aU (n�1) �bU (n�2) �cU (n�3) �dU (n�4) �eU (n�5)<br />

where a, b, c, d <strong>and</strong> e are unknown constants whose values are ei<strong>the</strong>r 0 or 1,<br />

since all <strong>the</strong> arithmetic is (mod 2).<br />

We number <strong>the</strong> bits 1 to 15 from left to right <strong>and</strong> <strong>the</strong>n put n�6, 7, 8, 9<br />

<strong>and</strong> 10 in <strong>the</strong> recurrence to obtain five linear equations in <strong>the</strong> five<br />

unknowns a, b, c, d <strong>and</strong> e:<br />

a(1)�b(0)�c(1)�d(0)�e(1)�0, (A.1)<br />

a(0)�b(1)�c(0)�d(1)�e(0)�0, (A.2)<br />

a(0)�b(0)�c(1)�d(0)�e(1)�1, (A.3)<br />

a(1)�b(0)�c(0)�d(1)�e(0)�1, (A.4)<br />

a(1)�b(1)�c(0)�d(0)�e(1)�0. (A.5)<br />

From equations (A.1) <strong>and</strong> (A.3) we find that a�1 <strong>and</strong> <strong>the</strong>n from equation<br />

(A.4) it follows that d�0. From equation (A.2) we <strong>the</strong>n find that b�0 <strong>and</strong><br />

from equation (A.5) that e�1 <strong>and</strong>, finally, from equation (A.1) that c�0.<br />

The solution to <strong>the</strong>se five equations is <strong>the</strong>refore<br />

U n �U (n�1) �U (n�5) .<br />

We now need to confirm that this gives <strong>the</strong> correct values when n�11, 12,<br />

13, 14 <strong>and</strong> 15 <strong>and</strong> it will be seen that this is <strong>the</strong> case. We have <strong>the</strong>refore<br />

verified that <strong>the</strong> recurrence of order 5 that we have just found does generate<br />

<strong>the</strong> given stretch of key.<br />

As mentioned in Chapter 8 it can happen that <strong>the</strong>re are no solutions of<br />

order k or that <strong>the</strong>re is more than one solution. In <strong>the</strong> former case <strong>the</strong><br />

equations are inconsistent <strong>and</strong> in <strong>the</strong> latter <strong>the</strong> ambiguities can usually be<br />

resolved if extra key digits are available. The following examples illustrate<br />

<strong>the</strong>se situations.<br />

Example (More than one solution)<br />

Verify that <strong>the</strong> 10-bit binary key<br />

0110110110<br />

can be generated by ei<strong>the</strong>r of two binary linear recurrences of order 5.

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

Saved successfully!

Ooh no, something went wrong!