Quantum Academy is now open. Enroll in live online training – see the schedule.
Skip to content
Browse courses

Is RSA-4096 Quantum-Safe?

Post-Quantum Cryptography

Quantum Academy6 min read

No. Shor’s algorithm is a quantum method for factoring the large numbers that RSA keys are built from. A quantum computer large enough to run it would break RSA-4096 the same way it would break RSA-2048, and the attack costs only a few times more against the longer key. In a 2019 estimate by Craig Gidney and Martin Ekerå, attacking RSA-4096 required 55 million physical qubits, the hardware components a quantum computer is built from, against 20 million for RSA-2048, and about four times the running time. NIST’s draft transition plan disallows RSA at every key size after 2035.

A larger key does add margin against classical attackers, and NIST’s draft deprecates RSA-2048 after 2030 but not RSA-3072 or RSA-4096. Both help during the transition, and the 2035 date applies to all three sizes.

Classical and quantum scaling

Against a classical attacker, each step up in RSA key length costs the attacker far more than it costs you. The fastest known classical method for factoring numbers this size, the number field sieve, has a cost that grows faster than any polynomial in the key length. NIST rates RSA-2048 at 112 bits of security strength and RSA-4096 at 152 bits in SP 800-56B. A security strength of S bits means that breaking the key takes roughly 2^S basic operations, so a classical attacker needs about 2⁴⁰ times as much work, roughly a trillion times, to break RSA-4096.

NIST defines its five security categories for post-quantum algorithms against quantum attacks as well as classical ones, and measures the cost of a quantum attack in circuit size. In our explainer on NIST’s security categories, RSA-3072 is listed next to Category 1 as a classical comparison only.

For an attacker running Shor’s algorithm, the cost grows only polynomially with key length. In the Gidney and Ekerå construction, factoring an n-bit RSA key takes about 3n logical qubits and 0.3n³ Toffoli gates, before the overheads of error correction. A logical qubit is built from many physical qubits and protected by error correction. A Toffoli gate is a three-qubit operation that computes a reversible AND, and the authors use Toffoli counts to measure the work. By our arithmetic on the paper’s formulas, attacking an RSA-4096 key requires about 12,400 logical qubits, twice the 6,200 needed for RSA-2048. It also requires about 21 billion Toffoli gates, eight times the 2.6 billion for RSA-2048.

RSA-2048 and RSA-4096 compared

Measure RSA-2048 RSA-4096 Change
Modulus and each signature 256 bytes 512 bytes 2 times
Signing, median processor cycles 1.7 million 8.0 million 4.6 times
Verification, median processor cycles 42,000 110,000 2.6 times
Classical attack, NIST security strength 112 bits 152 bits about 2⁴⁰ times the work
Quantum attack, physical qubits (2019 estimate) 20 million 55 million 2.75 times
Quantum attack, hours per run (2019 estimate) 5.1 22 4.3 times

An RSA signature is as long as the modulus, the large public number at the center of the key (RFC 8017), so an RSA-4096 signature is 512 bytes, twice the size of an RSA-2048 signature. Signing is a modular exponentiation, and in the textbook method its cost grows with the cube of the key length (Handbook of Applied Cryptography, Table 2.5), up to eight times the work for twice the bits.

Measured slowdowns are smaller. The cycle counts in the table are eBACS measurements on a 64-core server processor from 2024; eBACS is a public benchmarking project for cryptographic software. On a four-core processor from 2023, RSA-4096 signing took 6.4 times the cycles of RSA-2048, and verification 3.2 times.

Against a classical attacker, you pay 4.6 to 6.4 times the signing cost and the attacker pays about a trillion times the work. Against Shor’s algorithm, the attacker’s costs grow at about your rate: 2.75 times the physical qubits and 4.3 times the hours per run.

The 2019 figures aren’t the most recent for RSA-2048. In 2025, Gidney estimated that a 2048-bit key could be factored in less than a week with fewer than a million physical qubits, under the same hardware assumptions: a 0.1% error rate per operation, a 1-microsecond error-correction cycle and a 10-microsecond reaction time. Gidney’s 2025 headline estimate is for 2048-bit keys only, so the table uses the 2019 figures, which include both sizes under one set of assumptions.

The 2017 post-quantum RSA paper

In 2017, Daniel J. Bernstein, Nadia Heninger, Paul Lou and Luke Valenta worked out how large an RSA key would have to be for every known quantum attack to need more than 2¹⁰⁰ qubit operations. Their answer, in the paper Post-quantum RSA, presented at the PQCrypto 2017 conference, was a 1-terabyte public key: a 2⁴³-bit modulus, the product of 2³¹ primes of 4,096 bits each. By our arithmetic, that modulus is about two billion times as long as an RSA-4096 modulus.

The authors took standard ways of speeding up RSA to extremes: 2³¹ primes in one modulus and a public exponent of 3. For their version of RSA, “the attack cost is essentially quadratic in the usage cost”. The usage cost was still large. Generating the primes took about 1,975,000 core-hours, four months on the spare capacity of a 1,400-core cluster, and multiplying them into the key took about four days on a 24-core machine with 3 terabytes of memory. The authors timed decryption for keys up to 16 gigabytes. For encryption, they reported timings for keys up to 256 gigabytes, a little over 100 hours at that size. They called the result “not what one would call lightweight cryptography”.

An RSA-4096 modulus is 512 bytes. A key that costs Shor’s algorithm 2¹⁰⁰ qubit operations, by the paper’s estimate, is a terabyte.

Where a larger key still helps

During the transition, you get two things from a larger RSA key. The first is classical margin: NIST’s estimate of 152 bits for RSA-4096, against 112 for RSA-2048. The second is a later deadline. NIST’s draft deprecates RSA at 112 bits of security strength, which means RSA-2048, after 2030. Deprecated means the algorithm “may be used, but the user must accept some security risk”. RSA at 128 bits or more, from RSA-3072 up, has no 2030 step and is disallowed after 2035.

If a system will still use RSA after 2030, RSA-3072 provides the 128 bits at a lower cost than RSA-4096. In the eBACS server measurements, RSA-3072 signing took 2.4 times the cycles of RSA-2048, against 4.6 times for RSA-4096.

Neither benefit protects against a quantum attacker. Data protected by RSA today, such as a session key sent with RSA key transport, can be recorded now and decrypted once a large enough quantum computer exists. That risk is known as harvest now, decrypt later, and in the 2019 estimate the machine for RSA-4096 has under three times the physical qubits of the one for RSA-2048.

What NIST’s draft plan says

NIST released the initial public draft of IR 8547 on November 12, 2024. Its tables of quantum-vulnerable algorithms list RSA for both digital signatures and key establishment, in two rows. At 112 bits of security strength, RSA is deprecated after 2030 and disallowed after 2035. At 128 bits or more, it’s disallowed after 2035. Disallowed means “no longer allowed for applying cryptographic protection”, and after 2035 that status applies to RSA at every key size. Our post on the two dates in NIST IR 8547 explains what each date requires of a migration plan.

The replacements are ML-KEM (Kyber) for key establishment and ML-DSA (Dilithium) for signatures. NIST published both standards, FIPS 203 for ML-KEM and FIPS 204 for ML-DSA, on August 13, 2024. ML-DSA is larger than RSA too. An ML-DSA-44 public key is 1,312 bytes and its signature 2,420 bytes. For RSA-4096, the modulus and the signature are 512 bytes each. NIST describes ML-DSA as “believed to be secure, even against adversaries in possession of a large-scale quantum computer.”

If you’re making the case against a bigger-keys plan, The Quantum Threat: Technical Deep Dive covers Shor’s algorithm mechanics, resource estimates and how to read quantum computing papers. Post-Quantum Certified Specialist (PQCS) Training covers the migration side: algorithm selection, hybrid implementation concepts and cryptographic agility.

Before you approve a key-size increase made for quantum reasons, run openssl speed rsa2048 rsa3072 rsa4096 on the hardware that will produce the signatures, and note the signing and verification rates at each size. Then add two fields to the change request: the post-quantum algorithm that replaces RSA in that system, and the date it’s due.