Example
Exchange fresh toy Diffie-Hellman shares and manually compute the same shared secret.
highlighted = computed this step
Step 1 — DH setup
Set up the exact toy cryptography values.
p, g(23, 5)
Step 2 — Client share
Compute the highlighted cryptography value.
a, A=g power a mod p(6, 8)
Step 3 — Server share
Compute the highlighted cryptography value.
b, B=g power b mod p(15, 19)
Step 4 — Client secret
Compute the highlighted cryptography value.
B power a mod p2
Step 5 — Server secret
Compute the highlighted cryptography value.
A power b mod p2
Step 6 — Verdict
Compute the highlighted cryptography value.
verdictmatch
cryptography
This lesson follows a tiny HTTPS-like protocol sequence so every value can be checked by hand.