Many security teams moved from RSA to elliptic curves over the last fifteen years because the keys are shorter and the operations faster. Most TLS connections to a bank, most mobile payment apps and most SSH logins now use curve cryptography. That was the right call against classical attackers. Against a quantum computer it makes no difference.
This article explains the discrete logarithm problem, how elliptic curves fit in, why Shor's period finding solves both, and what that means for the systems you run.
The discrete logarithm problem in finite fields
Take a large prime p and a number g. Raising g to a power x and keeping the remainder modulo p is easy, even for huge x. Given the result h = gx mod p, finding x is believed to be hard. That is the discrete logarithm problem. The words discrete and modular mean that the arithmetic wraps around, so the usual logarithm does not help.
Two families of protocols use this.
- Diffie–Hellman key exchange. Alice picks a secret a and sends ga. Bob picks b and sends gb. Each raises the other's value to their own secret and both obtain gab, which becomes the session key. An eavesdropper sees ga and gb and would have to find a or b to reproduce it.
- DSA signatures. The signer keeps a secret x and publishes y = gx mod p. A signature proves knowledge of x without revealing it. Anyone who could recover x from y could sign in the owner's name.
The same problem on elliptic curves
An elliptic curve is the set of points (x, y) satisfying an equation of the form y² = x³ + ax + b, worked out modulo a large prime, plus one extra point called the point at infinity. In cryptography the curve is a finite set of points, not a smooth line, but the geometry of the smooth picture explains the rules.
Point addition in words
To add two points P and Q, draw the straight line through them. The line cuts the curve at exactly one other point. Reflect that point across the horizontal axis. The reflection is defined to be P + Q. To double a point, use the tangent line at that point instead. The point at infinity plays the role of zero. These rules are carried out with ordinary arithmetic modulo the prime, with no drawing required, and they obey the usual laws of addition.
Scalar multiplication and the discrete logarithm
Adding a point G to itself k times gives kG. A double-and-add method computes kG with a few hundred steps even when k has 256 bits, so it is fast. Going backwards is the problem. Given G and the point Q = kG, nobody knows a classical method to find k that is much better than generic search, which would take about 2128 steps on a 256-bit curve. This is the elliptic curve discrete logarithm problem. It has the same shape as the finite-field version, with multiplication replaced by point addition. That is why curve keys can be so much shorter than RSA keys for the same classical strength.
The schemes built on curves
- ECDH and X25519. Diffie–Hellman on a curve. X25519 uses the curve known as Curve25519. TLS ECDHE uses a fresh, ephemeral key pair for each connection.
- ECDSA. The curve version of DSA, common with the NIST curves P-256 and P-384 in certificates, JSON Web Tokens and payment cards.
- EdDSA (Ed25519). A signature scheme on a different curve form, popular in SSH keys and modern protocols.
A toy Diffie–Hellman example
Numbers small enough to follow by hand show the shape of the exchange. Let p = 23 and g = 5. Alice picks the secret 6 and sends 56 mod 23 = 8. Bob picks the secret 15 and sends 515 mod 23 = 19. Alice computes 196 mod 23 = 2, and Bob computes 815 mod 23 = 2. Both now hold the shared value 2. An eavesdropper sees 23, 5, 8 and 19. With numbers this small, a quick search through the powers of 5 recovers 6 or 15 and with it the key. Real systems use primes of 2,048 bits or more, or a curve with 256-bit coordinates, which makes classical search hopeless and leaves Shor's algorithm as the only known fast method.
Why Shor's period finding also solves discrete logs
Peter Shor's 1994 paper gave two algorithms in one: one for factoring and one for discrete logarithms.[1] The discrete logarithm version uses the same machinery as factoring, namely superposition, a reversible arithmetic circuit, the quantum Fourier transform and interference.
Here is the idea for the finite-field case. We know g, p and h, and want x with gx ≡ h. Define a function of two variables, f(a, b) = ga · h−b. If we substitute h = gx, then f(a, b) = ga − xb. The value depends only on the quantity a − xb, so f repeats whenever that quantity repeats. The pairs (a, b) that give the same value form a regular grid with a hidden direction, and the direction encodes x.
The quantum computer places both a and b in superposition, evaluates f into a second register, and applies the quantum Fourier transform to the pair. Interference concentrates the measurement on points of the grid that is dual to the hidden direction. A few such measurements, followed by simple classical linear algebra modulo the group order, reveal x.
The same method works in any group where you can compute the group operation reversibly, so it applies equally to elliptic curves, with point addition replacing multiplication. The cost depends on the size of the group and the cost of one group operation.
Why larger curves and groups do not escape
Against a classical attacker, making a key longer raises the cost enormously. Against Shor's algorithm the cost rises only as a modest power of the key length, so the usual defence of moving to a bigger key stops working. A larger curve such as P-384 or P-521 needs more logical qubits and more gates than P-256, but the growth is polynomial, and the arrival of a machine large enough for P-256 would put the others a short step further away. NSA's CNSA 2.0 therefore retires curve cryptography entirely, not merely the smaller curves.[7]
Special curves with fast arithmetic, such as Curve25519 and Ed25519, are designed for speed and safe implementation. That design does nothing against a period-finding attack, which treats the group as a black box that can add points.
Resource estimates for curves
Roetteler, Naehrig, Svore and Lauter published the standard circuit-level estimate in 2017.[2] For a curve over an n-bit prime field they give a circuit using at most 9n + 2⌈log₂ n⌉ + 10 logical qubits. For P-256, with n = 256, this is 2,304 + 16 + 10 = 2,330 logical qubits, matching the roughly 2,330 figure quoted in the paper.
| Target | Key size | Logical qubits | Comment |
|---|---|---|---|
| ECDLP on P-256[2] | 256-bit curve | about 2,330 | Formula 9n + 2⌈log₂ n⌉ + 10 with n = 256 |
| RSA-2048 | 2,048-bit modulus | a few thousand | Simple designs use somewhat over twice the key length; other designs trade qubits for time |
The comparison matters because it settles whether curves are a safe harbour. They are not. A 256-bit curve gives roughly 128-bit classical security, comparable to a much larger RSA key, and the quantum attack on it is smaller, not larger, than the attack on RSA-2048. The authors of the 2017 paper themselves conclude that curve discrete logarithms need fewer quantum resources than factoring at comparable classical security.[2]
Which systems are affected
Two properties matter for each use of a curve: whether it protects confidentiality (key exchange) or authenticity (signatures), and whether the public key is visible to an attacker. Shor's algorithm turns a public key into a private key.
| System | Algorithm | Risk | Why |
|---|---|---|---|
| TLS 1.3 key exchange (ECDHE) | X25519, P-256, P-384 | Recorded traffic can be decrypted later | The ephemeral public values are sent in clear in the handshake, and Shor recovers the private values from them |
| TLS and code-signing certificates | ECDSA P-256, P-384 | Forgery once a machine exists | The public key is in the certificate by design |
| SSH host and user keys | Ed25519, ECDSA | Impersonation once a machine exists; recorded key exchange | Public keys sit in known_hosts and authorized_keys files |
| FIDO2 and passkeys | ES256 (ECDSA P-256), EdDSA | Account takeover once a machine exists | The relying party stores the credential's public key |
| Blockchain signatures | ECDSA, EdDSA, Schnorr variants | Theft from addresses whose public key is visible | A public key appears on chain when a coin is spent or when an address format exposes it directly |
| Mobile and payment apps | ECDH, ECDSA | Recorded exchanges and later forgery | Usually inherited from the platform's TLS and signing libraries |
The blockchain row deserves a precise reading. Some address formats publish only a hash of the public key until the owner spends the funds, which narrows the window of exposure, but anything whose public key is already on chain is open to attack once a machine exists. Details differ by chain and by wallet practice, so check the specific one you hold or run.
Key exchange and signatures carry different urgency
An attacker can record an ECDHE handshake today and attack it years later, so key exchange is the more urgent case. The full argument is in Harvest now, decrypt later. Signatures cannot be forged retroactively, because a signature only matters while someone is relying on it. They become urgent when a key is long-lived, such as a root certificate authority key, a firmware-signing key or a long-term archive signature, because replacing such keys takes years.
For key exchange, hybrid deployments are well under way. As of mid-2026 current browsers, Cloudflare and OpenSSL 3.5 offer X25519MLKEM768, which combines X25519 and ML-KEM-768.[9] OpenSSH 10.0, released in April 2025, uses mlkem768x25519-sha256 as its default key exchange.[8] Check the readiness tracker for the state of the products you depend on.
What the standards say about the transition
NIST's draft IR 8547 proposes that quantum-vulnerable public-key algorithms, a class that includes ECDSA, ECDH and EdDSA along with RSA and finite-field Diffie–Hellman, be deprecated after 2030 at the 112-bit security level and disallowed after 2035.[4] It is a draft, and dates may change. The NSA's CNSA 2.0 suite already removes elliptic curves from national security systems in favour of ML-KEM-1024 and ML-DSA-87, with LMS and XMSS for software and firmware signing.[7]
Mixed designs and where to look first
Real systems rarely use a single algorithm. A typical banking web application negotiates ECDHE for the session key, presents an ECDSA or RSA certificate, validates tokens signed with ES256, and calls services that authenticate with certificates issued by an internal authority. Each of those is a separate use of a vulnerable algorithm with its own owner, its own software stack and its own replacement path. A useful first pass is to list them by owner, so that the team that runs the load balancer, the team that runs the identity provider and the team that runs the internal certificate authority each know what is theirs.
What to do now
- Inventory curve use. Run
qsc scanacross code, configuration and certificates. It reports ECDH, ECDSA, Ed25519 and X25519 use, and with--target host:443andssh://hostit probes what live services negotiate. - Start with key exchange. Enable hybrid groups in TLS and SSH wherever the product supports them.
qsc fixproposes safe TLS and SSH configuration changes that you can review before applying. - Find long-lived signing keys. List root and intermediate certificate authorities, firmware and code-signing keys, and document-signing keys. These move first among signatures.
- Shorten lifetimes. Short-lived certificates and tokens make a later algorithm switch faster.
- Record the result. Export a CBOM and use
--baselineto show progress to auditors and supervisors.
Related reading: How Shor's algorithm breaks RSA works through the period-finding steps in detail, How today's cryptography works covers the algorithms themselves, and The NIST post-quantum standards describes the replacements.