← All modules
Public-key·28 min

Elliptic Curve Cryptography (ECC / ECDSA)

The same public-key guarantees as RSA, with dramatically smaller keys — because the underlying hard problem is different math entirely.

Developer / EngineerSecurity ArchitectResearcher / Academic

A different hard problem

Elliptic Curve Cryptography builds public-key systems on the algebra of points on an elliptic curve over a finite field, rather than on integer factorization. The hard problem here is the elliptic curve discrete logarithm problem (ECDLP): given a starting point G and a resulting point Q = kG (k applications of a 'point addition' operation), it's computationally infeasible to recover k.

Crucially, no sub-exponential classical algorithm is known for ECDLP the way one exists for factoring — which means ECC achieves equivalent classical security to RSA with far smaller keys. A 256-bit ECC key is considered roughly as strong as a 3072-bit RSA key.

y2=x3+ax+b(modp)y^{2} = x^{3} + ax + b \pmod{p}

The general form of an elliptic curve over a finite field — the set of (x, y) points satisfying this equation, plus a point at infinity.

Q=kGQ = k \cdot G

Public key Q is the base point G "added to itself" k times. Easy forward; recovering k (the private key) is the ECDLP.

Point addition: the operation everything is built from

"Adding" two points on an elliptic curve has a genuinely geometric definition, which is part of why ECC feels less intuitive than RSA's arithmetic at first. To add two distinct points P and Q, draw a straight line through them — since the curve is cubic, that line crosses it at exactly one more point. Reflecting that third point across the x-axis gives P + Q. This isn't a metaphor for the algebra; it's literally how the group operation is defined, and it has a closed-form algebraic formula that a computer evaluates directly, with no actual line-drawing involved.

Doubling a point (adding P to itself, needed whenever a bit of the private key is 1 during scalar multiplication) works the same way in the limit: instead of a line through two distinct points, you use the tangent line at P.

Point addition on a real curve (y² = x³ − 3x + 3): P + Q = R

PQ−RR = P+Q

P and Q sit on the right-hand branch of the curve. The line through them crosses the curve a third time on the left, at −R; reflecting that point across the x-axis gives R = P + Q. Every point drawn here is on the actual curve y² = x³ − 3x + 3 — nothing is approximated for effect.

Scalar multiplication: how kG is actually computed

Computing Q = kG for a 256-bit private key k doesn't mean adding G to itself k times — that would be astronomically slow. Instead, implementations use double-and-add, the same square-and-multiply idea behind fast RSA exponentiation: scan the bits of k, doubling a running point at every step and adding G whenever that bit is 1. A 256-bit scalar multiplication takes on the order of 256 doublings and up to 256 additions — fast enough to run thousands of times per second, while still being, as far as anyone knows, computationally impossible to reverse.

A worked example over a small curve

Real curves use primes hundreds of bits long, but the arithmetic works identically at toy scale. Take the curve y² = x³ + 2x + 2 (mod 17) — a small finite field with only 17 possible values for each coordinate — with base point G = (5, 1).

Computing 2G (doubling G) using the curve's point-doubling formula gives (6, 3). Computing 3G = 2G + G gives (10, 6). An attacker who only sees G and 3G = (10, 6) has to recover the scalar 3 — trivial here with a 17-element field, but the identical computation over a 256-bit field is the ECDLP that underpins every ECC key in production.

y2=x3+2x+2(mod17),G=(5,1)y^{2} = x^{3} + 2x + 2 \pmod{17}, \quad G = (5,1)
2G=(6,3)3G=(10,6)2G = (6,3) \qquad 3G = (10,6)

Smaller keys, real consequences

Smaller keys mean less data to transmit and store, faster key generation, and faster signing operations — which is why ECC dominates mobile, IoT, and high-volume TLS deployments. Curve25519 (for key exchange, as X25519) and Curve448 are widely used modern curves chosen partly to avoid pitfalls found in some earlier NIST-standardized curves.

NIST P-256 (secp256r1)

  • Standardized by NIST in 1999, still the most widely deployed curve in TLS certificates
  • Parameters generated from an unexplained random seed — a long-running source of community distrust
  • Implementation is more prone to subtle timing side-channels if not written carefully

Curve25519 (X25519)

  • Designed by Daniel J. Bernstein in 2005 specifically to make safe implementation easier
  • Every parameter choice is publicly justified — no unexplained constants
  • Default key exchange curve in TLS 1.3, SSH, Signal, and WireGuard

ECDSA: signatures on curves

The Elliptic Curve Digital Signature Algorithm (ECDSA) uses ECC to produce digital signatures — proof that a message came from the holder of a private key, without revealing that key. It's the signature scheme behind most modern TLS certificates and behind Bitcoin and Ethereum transaction signing.

ECDSA requires a fresh, truly random per-signature value (the nonce) for every signature. Reusing a nonce, or generating it with a weak random number generator, leaks the private key directly — this has caused real-world key compromises, including a widely cited 2010 Sony PlayStation 3 signing-key leak caused by a static nonce.

ECDSA sign and verify

  1. 1

    Sign

    Hash the message, generate a fresh random nonce k, and combine them with the private key to produce a signature pair (r, s).

  2. 2

    Publish

    The message and signature (r, s) travel together; the private key never leaves the signer.

  3. 3

    Verify

    Anyone with the public key Q recomputes a value from (r, s) and the message hash, and checks it matches r.

  4. 4

    Accept or reject

    A match proves the signer holds the private key for Q — without Q ever having been used to sign anything itself.

r=(kG)xmodns=k1(H(m)+rd)modnr = (k \cdot G)_x \bmod n \qquad s = k^{-1}(H(m) + r \cdot d) \bmod n

The signature is the pair (r, s); k is the per-signature nonce, d is the private key, n is the curve's group order.

How a leaked nonce leaks the entire private key

The ECDSA signing formula involves the nonce k algebraically alongside the private key d. If an attacker ever learns k for even one signature — through a weak RNG, a side-channel leak, or (as in the PS3 case) the same k reused across two different signatures — they can rearrange the signing equation to solve directly for d. This is a one-shot, deterministic break, not a probabilistic weakening: a single exposed nonce is equivalent to publishing the private key outright.

Why it matters for the PQC conversation

ECC's smaller keys and wide deployment make it, if anything, a more urgent migration target than RSA in some contexts — it's cryptographically broken by the same Shor's algorithm class of quantum attack, but it's embedded in more places (TLS 1.3 defaults, most modern certificate authorities, cryptocurrency).

Knowledge check

Test what you just learned →

3 quick questions, with an explanation for every answer.

Up next

Diffie-Hellman key exchange

Two parties agree on a shared secret over a public channel, without ever transmitting the secret itself — the idea that started public-key cryptography.