Network security

Elliptic Curve Cryptography: How ECC Works and When to Use It

ECC is why your phone can do strong cryptography with a tiny key. Here is how the math works, which curves to choose, and what quantum computing changes.

Cysoro Security TeamPublished · 7 min read
y² = x³ + ax + b NETWORK SECURITY Elliptic curvecryptography Small keys. Strong security.
Quick answer

Elliptic curve cryptography (ECC) is public-key cryptography built on the algebraic structure of elliptic curves over finite fields. Its security rests on the elliptic curve discrete logarithm problem, which is much harder per bit than factoring, so a 256-bit ECC key gives roughly the same security as a 3072-bit RSA key. ECC powers ECDSA signatures and ECDH key exchange in TLS, SSH and code signing, usually on the NIST P-256 curve or Curve25519.

Key takeaways

  • A 256-bit ECC key gives about 128-bit security, roughly equal to a 3072-bit RSA key, with smaller certificates and faster handshakes.
  • Use NIST P-256 for broad compatibility or Curve25519 and Ed25519 for new systems; avoid custom or unvetted curves.
  • ECC is not quantum-safe: Shor's algorithm breaks it, so plan migration to NIST post-quantum algorithms for long-lived keys.

Your phone does strong cryptography every time it opens a website, and it does it with a key far smaller than the ones your desktop used a decade ago. That is elliptic curve cryptography at work: the same security, in a fraction of the size.

What is elliptic curve cryptography?

Elliptic curve cryptography (ECC) is a form of public-key cryptography built on the algebraic structure of elliptic curves over finite fields, instead of the large integer factorization problem that RSA relies on.

An elliptic curve is defined by an equation of the form y squared equals x cubed plus a times x plus b. Mathematicians studied these curves for centuries, but in 1985 Neal Koblitz and Victor S. Miller independently discovered their application to cryptography, as Linux Journal's ECC explainer recounts, enabling strong security with much smaller keys than earlier approaches.

Like all public-key cryptography, ECC uses a pair of keys: a public key you share and a private key you keep secret. What makes ECC distinctive is the math that links them, and how hard that math is to reverse.

How does ECC work?

ECC security rests on the elliptic curve discrete logarithm problem (ECDLP). Given a base point G on the curve and a resulting point P computed as P equals k times G, it is computationally infeasible to find k given only G and P.

The operation is called scalar multiplication: repeatedly adding G to itself k times according to the curve's rules. Going forward is easy, but going backward — finding k from P — has no known algorithm that is significantly faster than brute force on a well-chosen curve. That asymmetry is what makes ECC work as cryptography.

Points on a curve can be added together using a geometric rule: draw a line through two points, and it intersects the curve at a third point, which gives you the sum. The curve is symmetric around the x-axis, so negating a point just flips its y-coordinate. These rules turn the points on a curve, plus a special point at infinity, into a mathematical group.

ECC in one picture: private key to public key G (base point) P = kG (public key) Private key k is a secret number. Public key P is a point on the curve. Finding k from P is the hard problem.
Scalar multiplication turns a secret number into a public point. Illustration by Cysoro.

ECC vs RSA: how do the key sizes compare?

ECC reaches the same security level as RSA with dramatically shorter keys. That is its main advantage, and the reason it became the default for TLS, SSH and mobile devices.

Security levelSymmetric keyECC key sizeRSA key size
80 bitsTriple DES (2 keys)160 bits1024 bits
112 bitsTriple DES (3 keys)224 bits2048 bits
128 bitsAES-128256 bits3072 bits
192 bitsAES-192384 bits7680 bits
256 bitsAES-256512 bits15360 bits

The table follows NIST SP 800-57 guidance on equivalent security levels. A 256-bit ECC key provides security roughly equivalent to a 3072-bit RSA key, so certificates are smaller, TLS handshakes complete faster, mobile and IoT devices spend less power, and smart cards can run ECC without a dedicated math coprocessor.

Smaller keys also mean smaller signatures and less data to send, which matters on slow or constrained networks. For most new deployments, ECC is the preferred asymmetric algorithm.

What are ECDSA and ECDH?

ECDSA and ECDH are the two main algorithms built on ECC. One signs, the other agrees on a shared secret, and together they cover most of what public-key cryptography does.

ECDSA: signatures

ECDSA, the Elliptic Curve Digital Signature Algorithm, creates digital signatures. A private key signs a message, and anyone with the public key can verify the signature, proving the message came from the key holder and was not altered. It is used for TLS certificates, code signing and SSH host keys.

ECDH: key exchange

ECDH, Elliptic Curve Diffie-Hellman, is a key exchange protocol. Two parties each combine their private key with the other's public key to derive the same shared secret, without ever sending that secret across the network. TLS 1.3 uses ECDHE, the ephemeral form, where a fresh key pair is used for each session, giving forward secrecy: if a long-term key is later stolen, past sessions stay safe.

EdDSA and Curve25519

EdDSA is a newer signature scheme built on Edwards curves, with Ed25519 as its most common form. It is faster, simpler to implement safely, and more resistant to side-channel attacks than ECDSA. NIST SP 800-186, published in February 2023, added the Edwards curves Ed25519 and Ed448 to the curves recommended for US government use.

Which elliptic curve should you use?

For most enterprise workloads, choose NIST P-256 for broad compatibility or Curve25519 and Ed25519 for new systems that do not need to interoperate with older validated hardware. Both are approved by NIST SP 800-186 and FIPS 186-5.

CurveSecurity levelAlgorithmBest used for
P-256 (secp256r1)128-bitECDSA / ECDHGeneral TLS, widest CA and browser support
P-384192-bitECDSA / ECDHHigher-security government and enterprise use
P-521256-bitECDSA / ECDHHighest-security requirements
Curve25519 / Ed25519128-bitEdDSA / ECDHNew systems, SSH, messaging, fast and simple
Ed448224-bitEdDSAHigher-security Edwards-curve use

P-256 is one specific standardized curve, also called secp256r1 by the SECG standard and prime256v1 by OpenSSL. NIST SP 800-186 specifies it alongside P-384 and P-521 as curves recommended for US government use. It is a Weierstrass curve over a 256-bit prime field, with about 128-bit classical security and a compact 32-byte private key, which is why it became the internet's default.

Never invent your own curve, and never use a curve from an unvetted source. A badly chosen curve can have hidden weaknesses that make the discrete logarithm problem easy. Use a standard curve from NIST SP 800-186 or the IETF, and let a well-tested library such as OpenSSL do the math.

Where is ECC used today?

ECC is everywhere you look in modern security. It is the default for TLS certificates, SSH keys, code signing, messaging apps, smart cards, passkeys and cryptocurrencies.

In TLS, ECDSA certificates are smaller than RSA certificates, so handshakes are faster and use less bandwidth. In SSH, Ed25519 keys are now the recommended default in many guides, because they are short, fast and easy to handle. In messaging, protocols such as Signal use Curve25519 for key exchange. In passkeys, the WebAuthn standard uses ECC for the credentials stored on your device.

ECC is also the reason small devices can do strong cryptography at all. A smart card or IoT sensor cannot easily handle a 3072-bit RSA operation, but it can handle a 256-bit ECC operation with far less power and time.

Is ECC quantum-safe?

No, ECC is not quantum-safe. Shor's algorithm, run on a large enough quantum computer, solves the elliptic curve discrete logarithm problem in polynomial time, which would recover a private key from its public key.

That does not mean ECC is broken today — no quantum computer large enough to do this exists yet. But it does mean that data encrypted or signed with ECC today could be at risk in the future if it is recorded now and decrypted later, a threat known as "harvest now, decrypt later".

NIST has standardized post-quantum algorithms, including ML-KEM for key encapsulation and ML-DSA for signatures, and has set a timeline for migrating away from ECC and RSA for long-lived infrastructure. For new systems with multi-year key lifetimes, start planning that migration now, even while you keep using ECC for current deployments.

ECC today, post-quantum tomorrow TodayECC is the defaultfor TLS, SSH, signingP-256, Ed25519 Now: inventoryFind where ECC and RSAkeys live, and how longthey must last Next: migrateMove long-lived keys toML-KEM and ML-DSAas standards mature ECC is not broken today, but keys that must last for years need a migration plan.
Plan post-quantum migration for long-lived ECC keys. Illustration by Cysoro.

Common ECC mistakes to avoid

The most common mistake is using a weak or non-standard curve, or generating keys with a bad random number generator. ECC security depends entirely on the private key being secret and random; if the randomness is predictable, the key is predictable.

Other mistakes: reusing the same ephemeral key, which can leak the private key in ECDSA; using a curve that is too small for the security level you need; and rolling your own implementation instead of using a tested library. Cryptography is one area where writing your own code is almost always the wrong choice.

For a practical check on your own site, our free SSL checker shows which certificate and key your site actually uses.

You can also test a hash or decode a token with our free hash generator.

The bottom line

ECC gives you strong security with small keys, fast handshakes and low power use, which is why it powers TLS, SSH, passkeys and messaging today. Use a standard curve — P-256 for compatibility, Ed25519 for new systems — and let a tested library do the math.

Keep using ECC, but do not assume it will last forever. Inventory your long-lived keys and plan the move to post-quantum algorithms, so you are ready when the standards and the threat both arrive.

You can start by checking your own site's certificate with our free SSL checker.

Frequently asked questions

What is elliptic curve cryptography in simple terms?

ECC is a type of public-key cryptography that uses the math of elliptic curves instead of factoring large numbers. Because the underlying problem is harder per bit, ECC reaches the same security as RSA with much shorter keys, which makes it faster and lighter for phones, browsers and IoT devices.

What is the difference between ECC and RSA?

RSA security rests on factoring large numbers, while ECC security rests on the elliptic curve discrete logarithm problem. A 256-bit ECC key gives about 128-bit security, roughly equal to a 3072-bit RSA key, so ECC certificates are smaller and TLS handshakes are faster.

What is ECDSA?

ECDSA is the Elliptic Curve Digital Signature Algorithm. It uses ECC to create digital signatures, for example on TLS certificates and code signing, so a recipient can verify that a message came from the holder of the private key and was not altered.

What is ECDH?

ECDH is Elliptic Curve Diffie-Hellman, a key exchange protocol built on ECC. Two parties each combine their private key with the other's public key to derive the same shared secret, without ever sending that secret across the network. TLS 1.3 uses ECDHE, the ephemeral form, for forward secrecy.

Which elliptic curve should I use?

For most workloads, use NIST P-256 for broad compatibility or Curve25519 and Ed25519 for new systems that do not need older hardware. Both are approved in NIST SP 800-186, published in February 2023, which also added the Edwards curves Ed25519 and Ed448.

Is elliptic curve cryptography quantum-safe?

No. A large quantum computer running Shor's algorithm can solve the elliptic curve discrete logarithm problem, so ECC keys would be broken. Plan migration to NIST-standardized post-quantum algorithms such as ML-KEM and ML-DSA for infrastructure with multi-year key lifetimes.

Where is ECC used today?

ECC is used in TLS certificates, SSH keys, code signing, messaging apps, smart cards, passkeys and cryptocurrencies. It is the default for most modern TLS, because it gives strong security with small keys and fast handshakes.

Is ECC faster than RSA?

Yes, in most cases. ECC key generation, signing and key exchange are faster than RSA at equivalent security levels, and the smaller keys mean smaller certificates and less data to send. That is why ECC is preferred on mobile and IoT devices with limited power.

Sources

  1. NIST — SP 800-186, Recommendations for Discrete Logarithm-Based Cryptography: Elliptic Curve Domain Parameters
  2. Linux Journal — Elliptic Curve Cryptography
  3. Encryption Consulting — Elliptic Curve Cryptography: The Future of Encryption
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against NIST SP 800-186 and standard ECC key-size guidance from NIST SP 800-57.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free