green=G · blue=P/A · red=Q/B · gold=result/secret

Elliptic Curve Cryptography 2D: Finite-Field Point Addition & ECDH

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.