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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

212<br />

appendix<br />

For <strong>the</strong> RSA encipherment system we need only <strong>the</strong> special case when<br />

N�pq, where p <strong>and</strong> q are different primes. In this case �(N)�( p�1)(q�1).<br />

M24 Finding numbers which are ‘probably’ primes<br />

The ‘sieve of Eratos<strong>the</strong>nes’ will find all <strong>the</strong> primes below any given<br />

number N <strong>and</strong>, if a list of all <strong>the</strong> primes is what is required, this is <strong>the</strong> st<strong>and</strong>ard<br />

method. If, however, we only want to know if a particular integer is a<br />

prime <strong>the</strong>n finding a list of all <strong>the</strong> primes below it is not necessary <strong>and</strong>, if<br />

<strong>the</strong> number is very large, likely to be very time-consuming. Unfortunately<br />

<strong>the</strong>re is no very fast general method for testing if any given large<br />

number, N, is a prime <strong>and</strong> if N is large enough to be considered for <strong>the</strong> RSA<br />

method, say about 10 50 , <strong>the</strong> time required to establish its primality<br />

beyond doubt is likely to be prohibitive. In view of this a different<br />

approach was proposed by Rabin in 1976 [12.8] <strong>and</strong>, in a different form,<br />

by Solovay <strong>and</strong> Strassen in 1977 [12.9]. The idea behind this is to use a<br />

test, which involves some number less than N, that<br />

(1) will always fail if <strong>the</strong> number, N, is a prime,<br />

(2) will succeed more often than not if N is not a prime.<br />

When N is not a prime <strong>the</strong> test proposed by Rabin will succeed at least 75%<br />

of <strong>the</strong> time. If we use many numbers less than N, m say, <strong>and</strong> apply <strong>the</strong> test<br />

with each of <strong>the</strong>se m <strong>and</strong> find that <strong>the</strong> test never succeeds <strong>the</strong>n <strong>the</strong> probability<br />

that N is not prime is estimated to be (0.25) m <strong>and</strong> by taking m large<br />

enough <strong>the</strong> probability that N is prime can be made arbitrarily close to 1.<br />

A description of Rabin’s test can be found in [1.2], Chapter 9. For a bibliography<br />

of some relevant papers see [13.12].<br />

M25 The Euclidean Algorithm<br />

This algorithm is used to find <strong>the</strong> highest common factor (h.c.f.) of two<br />

integers, x 1 <strong>and</strong> x 2 . If <strong>the</strong> h.c.f is denoted by h <strong>the</strong> algorithm can also be<br />

used to find integers m, n such that<br />

mx 1 �nx 2 �h<br />

which is relevant to <strong>the</strong> RSA encryption/decryption system.<br />

The Euclidean Algorithm is carried out as follows.<br />

We may suppose that both x 1 <strong>and</strong> x 2 are positive <strong>and</strong> that x 1 is greater<br />

than x 2; if not, interchange <strong>the</strong>m.<br />

Divide x 1 by x 2 to give a remainder x 3 :<br />

x 1 �a 1 x 2 �x 3 where a 1 is an integer <strong>and</strong> 0�x 3 � x 2.

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

Saved successfully!

Ooh no, something went wrong!