Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Class+Notes5 Diffie+Hellman+Key+Exchange+Algorithm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Diffie Hellman Key Exchange Algorithm

Whitefield Diffie and Martin Hellman develop Diffie Hellman key exchange Algorithms in
1976 to overcome the problem of key agreement and exchange. It enables the two parties
who want to communicate with each other to agree on a symmetric key, a key that can be
used for encrypting and decryption; note that Diffie Hellman key exchange algorithm can be
used for only key exchange, not for encryption and decryption process. The algorithm is
based on mathematical principles.
The Diffie-Hellman key exchange was one of the most important developments in public-key
cryptography (Symmetric key cryptography) and it is still frequently implemented in a range
of today’s different security protocols. It allows two parties who have not previously met to
securely establish a key which they can use to secure their communications. In this article,
we’ll explain what it’s used for, how it works on a step-by-step basis, its different variations,
as well as the security considerations that need to be noted in order to implement it safely.

1. The protocol enables 2 users to establish a secret key using a public key scheme based on
discrete algorithms.
2. The protocol is secure only if the authenticity of the 2 participants (Alice and Bob) can be
established.
3. or this scheme, there are 2 publicly known prime numbers :

o Consider a prime number q


o Another prime number p that is a primitive root of q, where p < q.

(Note: Primitive root of a prime number P is one, whose powers module P generate all the
images from 1 to P-1)
4. Suppose users Alice and Bob wish to exchange the key.

Alice selects a random integer x<q and computes

5. Alice sends the number A to Bob.


6. Bob independently selects another random integer y<q and compute

7. Bob sends the number B to Alice.


8. Alice now computes the secret key K1 as:

9. Bob alo computes the secret key K2 as:

K1 is actually equal to K2.


Example:

Step 1: Alice and Bob get prime numbers q = 11, p = 7 (p is a


primitive root of q)
Step 2: Alice selected a random number x = 3 and
Bob selected a random number y = 6
Step 3: Alice and Bob compute A and B
Alice: A =(7^3 mod 11) = (343 mod 11) = 2
Bob: B = (7^6 mod 11) = (117649 mod 11) = 4
Step 4: Alice and Bob exchange public numbers A and B
Step 5: Alice receives public key B = 4 and
Bob receives public key A = 2
Step 6: Alice and Bob compute symmetric keys K1 and K2
Alice: K1 = B^x mod q = 4^3 mod 11 = 64 mod 11 = 9
Bob: kb = A^y mod q = 2^6 mod 11 = 64 mod 11 = 9
Step 7: 9 is the shared secret.

You might also like