Elliptic Curve Cryptography 2D: Finite-Field Point Addition & ECDH
A flat 2D finite-field elliptic curve lab: real modular point addition and doubling on y² = x³ + ax + b (mod p) with a wraparound chord-and-reflect construction, a live double-and-add scalar multiplication ladder, and a genuine BigInt ECDH key-exchange demo.
This 2D companion to the 3D Elliptic Curve simulator moves the same group law from the continuous real numbers into an actual finite field Fp, which is what every real ECC deployment uses. Pick a curve y² = x³ + ax + b (mod p), and the lab enumerates every point on it by brute-force search, finds a generator of maximal order, and lets you add or double points using the real modular-inverse formulas — visualised as a wraparound chord that breaks and reappears on the opposite edge of the field each time the line's y-value wraps past 0 or p. Switch to scalar mode to watch k·P built one bit at a time by the double-and-add algorithm, the same ladder used inside every production ECC implementation, or switch to ECDH mode to run a complete Diffie-Hellman key exchange over the curve: Alice and Bob each pick a private scalar, exchange public points, and independently multiply the other's public point by their own private key to land on the identical shared secret — computed live with BigInt, not staged.
A flat 2D finite-field elliptic curve lab: real modular point addition and doubling on y² = x³ + ax + b (mod p) with a genuine wraparound chord-and-reflect construction, a live double-and-add scalar-multiplication ladder shown step by step, and a working BigInt ECDH key-exchange demo where two independently computed shared secrets are verified equal.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install