Discover how two parties can securely establish a shared secret key over an insecure channel without ever directly exchanging the key itself.
Private Key: ?
Public Key: ?
Private Key: ?
Public Key: ?
Alice and Bob agree on public parameters: a prime number p and a generator g.
Each party generates a private key (random number).
Each party calculates their public key using the formula:
Alice and Bob exchange their public keys over the insecure channel.
Each party computes the shared secret using the received public key:
The security of Diffie-Hellman relies on the discrete logarithm problem - it's computationally infeasible to determine the private keys from the public keys and parameters. Even if an eavesdropper intercepts the public keys, they cannot compute the shared secret without solving the discrete logarithm problem.