ecdsa.com

Elliptic Curve Playground

Every ECDSA key is one scalar and one point addition, repeated. Here the same arithmetic runs over a field small enough to draw: pick a curve, add points, slide k and watch kG jump around — then see why running that backwards is the hard part.

100% local — everything runs in your browser, nothing is sent to any server

Big enough that the point cloud stops looking like a pattern, small enough that a full search takes a few dozen steps. Its 100 points do not form a single cycle — the longest run any generator produces here is 50.

y² = x³ + 2x + 3 over F₉₇ — every point, plotted

00101020203030404050506060707080809090y = p/2 · mirror: P ↔ −PG(0, 10)(0, 87)(1, 43)(1, 54)(3, 6)(3, 91)(4, 47)(4, 50)(10, 21)(10, 76)(11, 17)(11, 80)(12, 3)(12, 94)(17, 10)(17, 87)(20, 34)(20, 63)(21, 24)(21, 73)(22, 5)(22, 92)(23, 24)(23, 73)(24, 2)(24, 95)(25, 35)(25, 62)(27, 7)(27, 90)(28, 34)(28, 63)(29, 43)(29, 54)(30, 0)(32, 7)(32, 90)(37, 22)(37, 75)(38, 7)(38, 90)(39, 6)(39, 91)(44, 20)(44, 77)(46, 25)(46, 72)(47, 18)(47, 79)(49, 34)(49, 63)(50, 19)(50, 78)(52, 29)(52, 68)(53, 24)(53, 73)(54, 12)(54, 85)(55, 6)(55, 91)(56, 8)(56, 89)(59, 32)(59, 65)(65, 32)(65, 65)(67, 43)(67, 54)(68, 0)(70, 32)(70, 65)(73, 14)(73, 83)(74, 20)(74, 77)(76, 20)(76, 77)(80, 10)(80, 87)(83, 23)(83, 74)(84, 37)(84, 60)(85, 26)(85, 71)(86, 28)(86, 69)(87, 27)(87, 70)(88, 41)(88, 56)(91, 39)(91, 58)(92, 16)(92, 81)(95, 31)(95, 66)(96, 0)

Click any point to make it the generator G. The dashed line is y = p/2: every point has a partner mirrored across it, and that partner is its negative −P. Points on the line itself (y = 0) are their own negatives.

Generator and scalar

k — the scalar1 … 50
1

1G = 1 × (0, 10)

(0, 10)

Points on curve
100 including O (99 affine + the point at infinity)
Hasse check
p + 1 = 98, so #E must lie in [79, 117] — found 100 ✓
Order of G
50 (50G = O) — G reaches 50 of the 100 points, a subgroup
Wrap-around
50G = O, so (50 + 1)G = G — the sequence repeats forever

Forwards is cheap: double-and-add

Nobody computes 1G by adding G to itself 0 times. Write k in binary and you only need one doubling per bit, plus one addition per 1-bit — the idea behind every ECDSA implementation, which then adds windowing and constant-time handling on top.

k = 1 in binary
1₂ (1 bits)
Double-and-add
0 doublings + 0 additions = 0 point operations
Naive loop
0 additions
secp256k1
a 256-bit k costs at most 255 doublings + 255 additions — still microseconds

Backwards is the hard part

The reverse question — given G and 1G, find k — is the elliptic-curve discrete logarithm problem. On a curve this small it is not a problem at all: just walk the sequence.

Brute force here
k = 1, found after 1 additions (at most 50 on this curve)
Best generic method
Pollard's rho: about √50 ≈ 7 operations — a rounding error at this size
Same method, secp256k1
√n ≈ 2¹²⁸ ≈ 3.4 · 10³⁸ operations

That last number is the whole point. A machine doing 10⁹ curve operations per second, run on 10⁹ machines in parallel, would still need about 10¹³ years — several hundred times the current age of the universe. No faster general algorithm against a well-chosen curve is publicly known; that assumption, not any secrecy in the formulas, is what an ECDSA key rests on.

From the playground to a real key

Nothing changes between this page and a production key except the size of the numbers. secp256k1 — the curve behind Bitcoin and Ethereum — is y² = x³ + 7, the same equation as the mini-curve above, over a prime just under 2²⁵⁶ instead of 127. P-256, the curve in most TLS certificates and passkeys, is y² = x³ − 3x + b over a different 256-bit prime. Both have a published generator point G and a group order n of about 2²⁵⁶.

A key pair is exactly the two things the Scalar multiplication tab shows. The private key is the scalar k: a random integer in 1 … n − 1. The public key is the point kG: the generator added to itself k times, computed by the same double-and-add ladder, about 256 doublings and a couple of hundred additions. Publishing kG reveals nothing usable about k for the same reason the slider does not — the only known way back is to search, and the search space is the size of the group.

Signing adds one more scalar: a per-signature nonce, multiplied by G to produce r, with s tying the message hash and the private key together. That is why nonce handling is the sharp edge of ECDSA — the arithmetic on this page is unforgiving of a repeated random value. Generate real key pairs and signatures with the Test Vector Generator, or read how this compares with the factoring problem in ECDSA vs RSA.

How it works

The playground enumerates every solution of y² = x³ + ax + b modulo a small prime p by squaring each field element once and matching the results against the right-hand side — a few thousand operations, which is why the plot appears instantly and why the same approach is hopeless for a 256-bit prime. Point addition uses the standard chord-and-tangent formulas with a modular inverse computed by the extended Euclidean algorithm, and kG uses double-and-add, the same ladder a real signing routine walks.

Two sanity checks run on the arithmetic itself: the number of points found always lands inside the interval Hasse's theorem allows around p + 1, and the order of every point divides the group order, as Lagrange requires. The real-number tab draws the identical formulas with ordinary floating-point math, which is only ever a teaching aid — cryptography needs the exactness of integers modulo a prime. Everything is computed locally in your browser; the page makes no network requests and has no inputs worth keeping.