Elliptic curve cryptography

Also known as: elliptic-curve cryptography

On this page 7

Elliptic curve cryptography (ECC) is a family of public-key cryptography schemes whose security rests on the difficulty of the elliptic curve discrete logarithm problem: given two points on a curve over a finite field, finding how many times one was added to itself to produce the other. ECC provides key exchange, digital signatures and, less commonly, encryption.

Its practical appeal in cryptography is efficiency. A 256-bit elliptic curve key offers roughly the security of a 3072-bit RSA key, which means smaller keys, shorter signatures, faster handshakes and lower power use. That is why ECC now secures most TLS connections, messaging apps, SSH logins, passkeys and cryptocurrency wallets.

How elliptic curve cryptography works

An elliptic curve used in cryptography is the set of points satisfying an equation such as y² = x³ + ax + b over a large prime field, together with a special point at infinity. A geometric rule defines point addition: a line through two points meets the curve at a third, which is reflected to give the sum. Repeated addition of a point to itself is called scalar multiplication.

A private key is a random integer d, and the matching public key is the point Q = d·G, where G is a fixed generator point published with the curve. Computing Q from d takes only a few hundred doublings and additions, but recovering d from Q is believed infeasible for well-chosen curves. This one-way relationship is the trapdoor on which every ECC scheme is built.

The best known classical attacks on secure curves, such as Pollard’s rho, take roughly the square root of the group order. A curve with a 256-bit order therefore provides about 128 bits of security, the level regarded as adequate for long-term protection against classical computers.

Key sizes and security levels

The efficiency advantage of ECC grows with the security level, because RSA and finite-field Diffie-Hellman keys must grow much faster to keep pace. The table compares commonly cited equivalent strengths.

Security levelSymmetric keyRSA modulusECC key
112 bits3DES (legacy)2048 bits224 bits
128 bitsAES-1283072 bits256 bits
192 bitsAES-1927680 bits384 bits
256 bitsAES-25615360 bits512 to 521 bits
Approximate equivalent key sizes

The practical consequence is visible in protocols: an Ed25519 signature is 64 bytes, while an RSA-3072 signature is 384 bytes. On constrained devices such as smart cards and sensors, this difference determines whether public-key operations are feasible at all.

Common curves and algorithms

ECC is not one algorithm but a combination of a curve and a scheme that uses it. Interoperability depends on choosing standardized, widely implemented pairs.

CurveSecurity levelTypical useNotes
P-256 (secp256r1)About 128 bitsTLS, WebAuthn, government systemsNIST standard, broad hardware support
P-384About 192 bitsHigh-assurance government useSlower, larger keys
Curve25519 / X25519About 128 bitsKey exchange in TLS 1.3, SSH, SignalDesigned for safe, constant-time code
Ed25519About 128 bitsSignatures in SSH, GPG, software signingDeterministic, fast
secp256k1About 128 bitsBitcoin and Ethereum signaturesKoblitz curve, rarely used elsewhere
Widely used curves

The schemes most often met are ECDH for key exchange, usually in its ephemeral form ECDHE for forward secrecy, ECDSA for signatures on NIST curves and EdDSA on Edwards curves. ECIES-style hybrid encryption exists but is less common, because ECC is mostly used to agree on a symmetric key that AES or ChaCha20 then uses.

Curve choice has also been shaped by trust in how parameters were generated. The NIST curves use seed values whose origin was never fully explained, which led some designers to prefer curves with transparent, rigid parameter choices such as Curve25519. No practical weakness in P-256 has been demonstrated, and both families remain acceptable; the difference lies mainly in how easily each can be implemented safely.

ECC compared with RSA and post-quantum schemes

Choosing between ECC and RSA today is mostly a question of legacy compatibility versus efficiency, while the longer-term question is the transition to post-quantum cryptography.

PropertyECCRSALattice-based (ML-KEM, ML-DSA)
Hard problemElliptic curve discrete logarithmInteger factorizationModule lattice problems
Key size at 128-bit level32-byte keys384-byte modulusAbout 1 to 2 KB public keys
Signature speedFast signing and verifyingSlow signing, fast verifyingFast, larger signatures
Quantum resistanceNone (Shor’s algorithm)None (Shor’s algorithm)Designed to resist
MaturityWidely deployedMost widely deployedStandardized in 2024, rolling out
ECC compared with neighboring public-key families

A sufficiently large quantum computer would break ECC, and in fact a smaller one would be needed than for RSA at comparable classical strength. For this reason, current deployments increasingly use hybrid key exchange such as X25519 combined with ML-KEM, which stays secure as long as either component holds.

Implementation pitfalls

The mathematics of ECC is sound, but real-world breaks almost always come from implementation errors. Several have caused well-documented failures.

MistakeConsequencePrevention
Reused or biased ECDSA noncePrivate key recoverable from signaturesDeterministic nonces (RFC 6979) or EdDSA
Missing point validationInvalid-curve attacks leak the keyValidate received points or use X25519
Non-constant-time codeTiming side channels reveal key bitsUse audited constant-time libraries
Weak random number generatorPredictable private keysUse the operating system’s CSPRNG
Custom or obscure curvesHidden weaknesses, poor interoperabilityStick to standardized curves
Typical ECC implementation mistakes

The nonce problem is the most notorious: ECDSA requires a fresh secret random value for every signature, and reusing it even twice allows simple algebra to reveal the private key. EdDSA derives this value deterministically from the key and message, removing the risk by design. The safest advice is to never implement ECC yourself and to rely on established libraries.

Stripped to the essentials

Elliptic curve cryptography is a way to create a pair of linked keys: one you keep secret and one you can share with anyone. It relies on a math operation that is easy to do forward and practically impossible to reverse.

Think of mixing paint. Mixing two colors is easy, but separating the result back into exact ingredients is very hard. ECC gives the same protection as older methods with far smaller keys, which makes phones, websites and security keys faster.

Where it is applied

When a person opens a banking website, the browser and server perform a TLS 1.3 handshake. They each generate a temporary X25519 key pair, exchange the public halves and compute the same shared secret without ever sending it. The server proves its identity with an ECDSA P-256 signature on the handshake, verified against its certificate.

The whole exchange adds only a few hundred bytes and well under a millisecond of computation on modern hardware. Because the temporary keys are discarded after the session, recorded traffic cannot be decrypted later even if the server’s long-term key is stolen. The same customer later signs in to the bank’s app with a passkey, which uses a P-256 key held in the phone’s secure hardware.