Tested tool guide
Tested browser tools
Checked August 16, 2026
What Diffie-Hellman Key Exchange Visualizer does, with a checked example
Follow a finite-field Diffie-Hellman exchange from private exponents to matching shared values, with a color-mixing analogy distinguishing private material, public material, and the combined result. Enter a public modulus and base plus one private value for each participant. The visualizer shows the public values they exchange and the secret each side derives. The common surprise is that the exchanged values are not themselves the shared secret. The colors are only an analogy: the actual calculation is modular exponentiation, not literal color blending.
Worked example
A concrete input and expected output from the current implementation.
Input
p = 23; g = 5; Alice private = 6; Bob private = 15
->
Expected output
Alice public value = 8; Bob public value = 19; Alice shared secret = 2; Bob shared secret = 2
Alice publishes 5^6 mod 23 = 8, while Bob publishes 5^15 mod 23 = 19. Alice then computes 19^6 mod 23 = 2, and Bob computes 8^15 mod 23 = 2, so both sides reach the same value.