Mathematical model in the DH key exchange process.

Mathematical model in the DH key exchange process.



•p = large prime number, can be known to all
•g = based or generator, can be known to all
•a = Alice's chosen private key, which is known only to Alice.
•b = Bob's chosen private key, which is known only to Bob.
•A = Alice's calculated public key using g, p, and a, can be known to Alice, Bob, and Eve. A = g^a mod p.
•B = Bob's calculated public key using g, p, and b, can be known to Alice, Bob, and Eve. B = g^b mod p.
•s = The calculated shared secret key using the other party's public key, each party's own chosen secret key, and the prime number p, known to both Alice and Bob, but not to Eve.
•s = B^a mod p (calculated by Alice).
•s = A^b mod p (calculated by Bob).
•s can also be calculated using the formula s = g^ab mod p which requires knowledge of both parties chosen private key.


Learn More :