Modular Exponentiation Clock: Key Exchange Under Attack (2D)
Interactive 2D companion to the 3D key-exchange lab: watch the actual square-and-multiply steps trace out a path on a mod-23 residue clock as Alice and Bob compute their Diffie-Hellman public values, then follow a live timeline chart of the replay-defense freshness window instead of the 3D sim's black-box numbers.
This 2D companion to the 3D key-exchange lab drives the exact same protocol story — Alice and Bob agree on a Diffie-Hellman shared secret, an optional man-in-the-middle attacker tries to substitute her own values, signed nonces defeat that substitution, and a captured packet can be replayed to test freshness-window defenses — but it computes and shows genuinely different math. Instead of a black-box modular exponentiation result, it traces the actual bit-by-bit square-and-multiply algorithm as a path on a circular "clock" of residues, and it verifies live that g=5 really is a primitive root mod p=23 rather than assuming it. The replay side is rebuilt as a real-time sweeping timeline instead of a one-shot log line, so you can watch the accept/reject boundary of the freshness window happen rather than just reading a number.
2D companion to the 3D Diffie-Hellman key-exchange lab: watch the actual square-and-multiply steps trace a path on a mod-23 residue clock as Alice and Bob compute their public values, verify live that g=5 is a genuine primitive root, then follow a real-time sweeping timeline of the replay-defense freshness window instead of the 3D sim's black-box numbers.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install