Labs / Computer Science

Diffie-Hellman Exchange

Alice and Bob each keep a private key secret, yet they can agree on the same shared number by sending only public values across an open wire. Set their private keys, pick a prime and generator, and step through the exchange — then look at what the eavesdropper is stuck with.

Labs / Computer Science / Diffie-Hellman Exchange

Computer Science20–30 minFoundation

Diffie-Hellman Exchange

Alice and Bob each keep a private key secret, yet they can agree on the same shared number by sending only public values across an open wire. Set their private keys, pick a prime and generator, and step through the exchange — then look at what the eavesdropper is stuck with.

Why it matters

Why explore this?

Computer science turns clear rules into reliable processes. This model lets you step through those rules and see how each decision changes the result.