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.

166<br />

chapter 12<br />

one or more keys which only <strong>the</strong>y know. The problem is ‘How are <strong>the</strong>y to<br />

let each o<strong>the</strong>r know <strong>the</strong>ir secret key(s) without o<strong>the</strong>r people discovering<br />

<strong>the</strong>m too?’<br />

The key distribution problem<br />

The situation is that X <strong>and</strong> Y wish to communicate with each o<strong>the</strong>r using<br />

an agreed encryption system. A third party, Z, knows <strong>the</strong>ir agreed encryption<br />

system, is able to intercept <strong>the</strong>ir messages <strong>and</strong> would like to be able<br />

to read <strong>the</strong>m. X <strong>and</strong> Y may or may not know of <strong>the</strong> existence of Z but <strong>the</strong>y<br />

want to be sure that <strong>the</strong>ir messages should be unintelligible to anyone<br />

o<strong>the</strong>r than <strong>the</strong>mselves. The system, which <strong>the</strong>y must assume is known to<br />

Z or to anyone else, requires <strong>the</strong> use of one or more keys, which <strong>the</strong>y<br />

intend to keep secret but which may be changed from time to time, possibly<br />

with each message, or possibly less frequently. Anyone who gets<br />

hold of <strong>the</strong> keys <strong>and</strong> knows <strong>the</strong> method of encryption can decipher <strong>the</strong>ir<br />

messages. It is <strong>the</strong>refore essential that <strong>the</strong> keys remain secret, but how can<br />

X <strong>and</strong> Y tell each o<strong>the</strong>r <strong>the</strong>ir keys without running <strong>the</strong> risk that Z will<br />

intercept <strong>and</strong> be able to exploit <strong>the</strong>m?<br />

The Diffie–Hellman key exchange system<br />

An elegant solution to <strong>the</strong> key exchange problem was proposed by Diffie<br />

<strong>and</strong> Hellman in 1976 [12.6]. Their method is implemented by X <strong>and</strong> Y as<br />

follows.<br />

(1) X <strong>and</strong> Y agree upon <strong>the</strong> use of two integers p <strong>and</strong> m (say) where p is a<br />

large prime <strong>and</strong> m lies between 1 <strong>and</strong> ( p�1). The values of p <strong>and</strong> m<br />

need not be kept secret.<br />

(2) X chooses a secret number, x, <strong>and</strong> Y chooses a secret number, y. Both x<br />

<strong>and</strong> y lie between 1 <strong>and</strong> ( p�1) <strong>and</strong> nei<strong>the</strong>r should have any factor in<br />

common with ( p�1). In particular, since ( p�1) is even, nei<strong>the</strong>r x nor y<br />

should be even. X <strong>and</strong> Y do not reveal <strong>the</strong>ir secret numbers to each<br />

o<strong>the</strong>r or to anyone else.<br />

(3) X computes <strong>the</strong> number<br />

k x �m x (mod p)<br />

<strong>and</strong> sends it to Y who raises it to <strong>the</strong> power y, giving <strong>the</strong> number (k x ) y .<br />

Y computes <strong>the</strong> number<br />

k y �m y (mod p)<br />

<strong>and</strong> sends it to X who raises it to <strong>the</strong> power x, giving <strong>the</strong> number (k y ) x .

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

Saved successfully!

Ooh no, something went wrong!