Vous êtes sur la page 1sur 2

Diffie-Hellman Key Exchange

Developed in 1976 and published in "New Directions in Cryptography The protocol allows two users to exchange a secret key over an insecure medium without any prior secrets

The Setup: 1. Suppose we have two people wishing to communicate: Alice and Bob. 2. They do not want Eve (eavesdropper) to know their message. 3. Alice and Bob agree upon and make public two numbers 9 and p, where p is a prime and 9 is a primitive root mod p. Note: Anyone has access to these numbers. The Exchange: a 1. Alice chooses a random number a and computes u = g (mod p), and sends u to Bob. b 2. Bob chooses a random number b and computes v = g (mod p), and sends v to Alice. b ab 3. Bob computes the key k= u = (g ) (mod p). a ba 4. Alice computes the key k= v = (g ) (mod p). ab Now, both Alice and Bob have the same key, namely k = g (mod p). CRACK If Eve wants to compute k, then she would need either a or b. Otherwise, Eve would need to solve a Discrete Logarithm Problem. Solve for x if y = g (mod p), given you know y, g and p. There is no known algorithm to accomplish this in a reasonable amount of time. Example: Suppose Alice and Bob agree to use p = 47 and 9 = 5. Alice chooses a number between 0 and 46, say a = 18. Bob chooses a number between 0 and 46, say b = 22

18 a Alice publishes g (mod p), i.e. u = 5 (mod 47) = 2. b 22 Bob publishes g (mod p), i.e. V = 5 (mod 47) = 28.
If Alice wants to know the secret key k, she takes Bob's public number, V = 28, and raises it to her private number, a = 18 (taking the result mod 47). 18 This gives her: 28 (mod 47) = 24 If Bob wants to know the secret key, he takes Alice's public number, U = 2, and raises it to his private number, b = 22 (taking the result mod 47). 22 This gives him: 2 (mod 47) = 24. Thus, Alice and Bob have agreed upon a secret key, k = 24.

Vous aimerez peut-être aussi