CPE 645 / CS 685
Applied Cryptography
Calculators

Diffie–Hellman Key Exchange

Alice and Bob agree on a key over a public channel. The attacker sees every number they send. Then an attacker in the middle swaps the numbers, and nobody notices.

Public-key cryptographyKey exchangedemo
Objectives
  • Compute A, B and the shared secret K from p = 19, g = 2 and two secrets, and explain why both sides get the same K.

  • Read a secret from the table of 2^x mod 19, and explain why a table cannot work when p has 2048 bits.

  • Explain how an attacker in the middle gives Alice and Bob two different keys, and why the exchange needs authentication.


Static site. Every demo computes in your browser, and nothing you type is sent anywhere.