DiffieHellman Diffie Hellman Algorithm DH Diffie Hellman DH

  • Slides: 25
Download presentation
Diffie-Hellman Diffie Hellman Algorithm (DH) Diffie Hellman (DH) key exchange algorithm is a method

Diffie-Hellman Diffie Hellman Algorithm (DH) Diffie Hellman (DH) key exchange algorithm is a method for securely exchanging cryptographic keys over a public communications channel. Keys are not actually exchanged – they are jointly derived. It is named after their inventors Whitfield Diffie and Martin Hellman

Whitfield Diffie Martin Hellman

Whitfield Diffie Martin Hellman

What is Diffie-Hellman • A Public Key Algorithm • Two parties, can agree on

What is Diffie-Hellman • A Public Key Algorithm • Two parties, can agree on a symmetric key using this technique. • This algorithm can be used only for key agreement. • Only for Key Exchange • Does not Encrypt and Decrypt • Widely used in security protocols and commercial products.

Diffie-Hellman Key Exchange • first public-key type scheme proposed by Diffie & Hellman in

Diffie-Hellman Key Exchange • first public-key type scheme proposed by Diffie & Hellman in 1976 along with the exposition of public key concepts is a practical method for public exchange of a secret key • In this the two users agree on a secret key & then authenticate over an unsecure channel by encrypting the authentication information u s i n g t h e s s i o n k e y.

Diffie-Hellman Key Exchange • Steps – User A & B want to share the

Diffie-Hellman Key Exchange • Steps – User A & B want to share the information. – Choose the two large prime number for public key i. e g & n, these 2 numbers need not to be secret & can be shared publicly. – A user pick the large random number say X, which he or she will kept the secret. – B user pick the large random number say Y, which he or she will kept the secret. – A user send message, A= gx modn along with g & n public key

Diffie-Hellman Key Exchange • Steps – User B receive the message from A& then

Diffie-Hellman Key Exchange • Steps – User B receive the message from A& then calculate (gx modn )y, which is equal to gxy mod n – Now B will send, B= gy mod n to user A – Now A will compuet (gy modn )x, which is equal to gxy mod n – Both share the secret key gxy mod n

Example • Alice and Bob get public numbers – n = 23, g =

Example • Alice and Bob get public numbers – n = 23, g = 9 – Alice chooses a number between 0 to 46 say x=4 – Bob chooses a number between 0 to 46, say y=3 – Alice publishes gx modn i. e 94 mode 23 – Bob publishes gy mod n i. e 93 mod 23 • Alice and Bob compute public values – X = 94 mod 23 = 6561 mod 23 = 6 – Y = 93 mod 23 = 729 mod 23 = 16 • Alice and Bob exchange public numbers

Diffie-Hellman Key Exchange • If Alice wants to know the secret key k, she

Diffie-Hellman Key Exchange • If Alice wants to know the secret key k, she takes Bob’s public number, Y = 16, and raises it to her private number, x= 4 (taking the result mod 23). • This gives her: 912 mod 23 = 9.

Diffie-Hellman Key Exchange • If Bob wants to know the secret key, he takes

Diffie-Hellman Key Exchange • If Bob wants to know the secret key, he takes Alice’s public number, X = 6, and raises it to his private number, y = 3 (taking the result mod 23). • This gives him: 912 (mod 47) = 9. • Thus, Alice and Bob have agreed upon a secret key, k = 9.

Diffie-Hellman Key Exchange • User Authentication: Alice encrypts the • message, m, with her

Diffie-Hellman Key Exchange • User Authentication: Alice encrypts the • message, m, with her private key x, call it mx. • Alice encrypts mx with Bob’s public key, Y, and sends the message to Bob. • Bob recovers mx using his private key y and recovers m by using Alice’s public key x. • Thus, Bob is sure that only Alice could have • sent the message.

The Key • • • Only Alice and Bob know k Good for only

The Key • • • Only Alice and Bob know k Good for only one session Can’t be sure connected to the same person Used if you only want a symmetric key No authentication