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.

In this case <strong>the</strong> remainder is 4, not 1. Why is this? The answer is that<br />

15�3�5 <strong>and</strong> so is not a prime <strong>and</strong> Fermat’s Little Theorem only applies<br />

when <strong>the</strong> modulus is a prime, such as 5, 7, 11 or 97, as in <strong>the</strong> examples<br />

above. Euler showed how <strong>the</strong> <strong>the</strong>orem must be modified when <strong>the</strong><br />

modulus is not a prime. The original <strong>the</strong>orem though is<br />

Fermat’s Little Theorem<br />

If p is a prime number <strong>and</strong> m is any number which is not divisible by p <strong>the</strong>n<br />

m ( p�1) �1 (mod p),<br />

i.e. m ( p�1) leaves remainder 1 when divided by p.<br />

The proof is not difficult <strong>and</strong> generalises fairly easily to give a proof of <strong>the</strong><br />

Fermat–Euler <strong>the</strong>orem, which is given in M23.<br />

The generalisation discovered <strong>and</strong> proved by Euler applies to any<br />

modulus but <strong>the</strong> version required by <strong>the</strong> RSA system requires only <strong>the</strong><br />

case where <strong>the</strong> modulus is <strong>the</strong> product of just two distinct primes <strong>and</strong> so is<br />

worth stating in its own right:<br />

The Fermat–Euler Therorem (as needed in <strong>the</strong> RSA system)<br />

If p <strong>and</strong> q are different prime numbers <strong>and</strong> m is any number which is not divisible by<br />

p or q <strong>the</strong>n<br />

m ( p�1)(q�1) �1 (mod pq).<br />

In <strong>the</strong> example above we had p�3, q�5 <strong>and</strong> m�2 <strong>and</strong> <strong>the</strong> <strong>the</strong>orem tells us<br />

that<br />

2 (2)(4) �1 (mod 15)<br />

<strong>and</strong> indeed 2 8 �256�17�15�1.<br />

Encipherment <strong>and</strong> decipherment keys in <strong>the</strong> RSA system<br />

To encipher a text by means of <strong>the</strong> RSA method we require:<br />

Encipherment <strong>and</strong> <strong>the</strong> <strong>internet</strong> 175<br />

(1) a large number n (�pq) which is <strong>the</strong> product of just two distinct<br />

primes, p <strong>and</strong> q (The question as to how one finds very large primes is<br />

highly relevant. We have met this problem before, in connection with<br />

<strong>the</strong> Diffie–Hellman key exchange system. In general a considerable<br />

amount of computation is required. Since <strong>the</strong> primes to be used

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

Saved successfully!

Ooh no, something went wrong!