- Back to Home »
- Diffie-Hellman key exchange
Posted by : Unknown
Sunday, 11 August 2013
Diffie-Hellman
key exchange/agreement algorithm
Two party agree on symmetric key. This key can be used for encryption/decryption.
This algorithm only for key agreement not for encryption and decryption.
1. Alice & bob agree on two large prime numbers: n and g
(note: these two integer need not be kept secret, insecure channel)
2. Alice choose another large random number x and calculate A such that,
3. Alice send the number A to Bob.
4. Bob independently choose another large random integer y and calculate B such that,
5. Bob send the number B to Alice.
6. Alice, now compute the secret key K1 as follows: A = gx mod n
B = gy mod n
K1 = Bx mod n
7. Bob, now compute the secret key K2 as follows:
8. Surprise, K1=K2=K (which is symmetric key) K2 = Ay mod n
Introduction:-
It is provide the solution to the problem of key agreement or key exchange.Two party agree on symmetric key. This key can be used for encryption/decryption.
This algorithm only for key agreement not for encryption and decryption.
Description of the algorithm:-
Suppose Alice and Bob want to agree upon a key to be used for encryption / decryption message that would be exchanged between them. Then diffie-hellman key exchange works as follows:1. Alice & bob agree on two large prime numbers: n and g
(note: these two integer need not be kept secret, insecure channel)
2. Alice choose another large random number x and calculate A such that,
3. Alice send the number A to Bob.
4. Bob independently choose another large random integer y and calculate B such that,
5. Bob send the number B to Alice.
6. Alice, now compute the secret key K1 as follows: A = gx mod n
B = gy mod n
K1 = Bx mod n
7. Bob, now compute the secret key K2 as follows:
8. Surprise, K1=K2=K (which is symmetric key) K2 = Ay mod n