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 level | Symmetric key | RSA modulus | ECC key |
|---|---|---|---|
| 112 bits | 3DES (legacy) | 2048 bits | 224 bits |
| 128 bits | AES-128 | 3072 bits | 256 bits |
| 192 bits | AES-192 | 7680 bits | 384 bits |
| 256 bits | AES-256 | 15360 bits | 512 to 521 bits |
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.
| Curve | Security level | Typical use | Notes |
|---|---|---|---|
| P-256 (secp256r1) | About 128 bits | TLS, WebAuthn, government systems | NIST standard, broad hardware support |
| P-384 | About 192 bits | High-assurance government use | Slower, larger keys |
| Curve25519 / X25519 | About 128 bits | Key exchange in TLS 1.3, SSH, Signal | Designed for safe, constant-time code |
| Ed25519 | About 128 bits | Signatures in SSH, GPG, software signing | Deterministic, fast |
| secp256k1 | About 128 bits | Bitcoin and Ethereum signatures | Koblitz curve, rarely used elsewhere |
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.
| Property | ECC | RSA | Lattice-based (ML-KEM, ML-DSA) |
|---|---|---|---|
| Hard problem | Elliptic curve discrete logarithm | Integer factorization | Module lattice problems |
| Key size at 128-bit level | 32-byte keys | 384-byte modulus | About 1 to 2 KB public keys |
| Signature speed | Fast signing and verifying | Slow signing, fast verifying | Fast, larger signatures |
| Quantum resistance | None (Shor’s algorithm) | None (Shor’s algorithm) | Designed to resist |
| Maturity | Widely deployed | Most widely deployed | Standardized in 2024, rolling out |
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.
| Mistake | Consequence | Prevention |
|---|---|---|
| Reused or biased ECDSA nonce | Private key recoverable from signatures | Deterministic nonces (RFC 6979) or EdDSA |
| Missing point validation | Invalid-curve attacks leak the key | Validate received points or use X25519 |
| Non-constant-time code | Timing side channels reveal key bits | Use audited constant-time libraries |
| Weak random number generator | Predictable private keys | Use the operating system’s CSPRNG |
| Custom or obscure curves | Hidden weaknesses, poor interoperability | Stick to standardized curves |
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.