prev
next
Slide 7 of 13
Diffie-Hellman: Agreeing on a Secret Key
- Alice and Bob together (publicly) pick large primes n and g
subject to (n - 1)/2 also prime, and other conditions on g
- Alice picks a random secret x, sends Bob (n, g, gx mod n)
- Bob picks a random secret y, sends Alice gy mod n
- Alice and Bob both compute gx * y mod n, the shared
secret key
- only works if it is hard to compute x given
gx mod n, g, and n, and hard to compute
gxy mod n given
gx mod n and
gy mod n
- vulnerable to man-in-the-middle