Skip to main content

What Is Shor's Algorithm?

Multiply 61 by 53 with a pencil and you get 3,233 in under a minute. Now go the other way: starting from 3,233, find the two numbers that multiply together to give it. By hand, you have to try one divisor after another, and it takes far longer. With numbers hundreds of digits long, no ordinary computer can do it in useful time, and much of the encryption on the internet relies on that difficulty. Shor's algorithm lets a quantum computer find those two numbers quickly. Peter Shor, a mathematician at Bell Labs, presented it in November 1994.

Diagram of Shor's algorithm: a merry-go-round seen from above, with one horse highlighted and an arrow tracing a full turn

In Plain Terms

Picture a merry-go-round seen from far away, too far to count the horses. Time one painted horse as it comes round, and that single lap tells you how the whole ride moves. Shor's algorithm uses the same trick. From the large number, it builds a list of numbers that repeats itself, like the horse coming round. A quantum computer can measure the length of that cycle quickly, and the two numbers follow from it. The machine is sometimes wrong, so an ordinary computer checks each answer.

What It Changes for a Business

Shor's algorithm threatens one part of encryption: the methods that let two computers agree on a secret and prove who they are, as on secure websites and in electronic signatures. Those are the ones to replace. The encryption that protects the data itself holds up with long enough keys, according to the UK's National Cyber Security Centre. So when a supplier calls a product quantum-safe, ask which part it covers.

What People Get Wrong

Every so often, a headline says that a quantum computer has cracked an encryption key. These stories describe other methods, tested on small numbers. The largest number broken down with Shor's algorithm on a quantum computer is 21 (3 × 7), in 2012, and the team simplified the calculation using what they already knew of the answer.

Where It Stands Today

Estimates of the machine needed keep getting smaller. In 2019, breaking a standard key took 20 million fragile qubits on paper. In May 2025, Craig Gidney of Google brought that below one million, for under a week of calculation. No machine of that size exists yet, and the method, ready since 1994, is waiting for the hardware.

Related Terms

Quantum computer · Superposition · Post-quantum cryptography · Q-Day

Frequently Asked Questions

It is a method for quantum computers that finds the two prime numbers multiplied together to make a very large number. RSA encryption is safe only because ordinary computers cannot do that search.

Peter Shor, then at Bell Labs, presented it in November 1994 at the IEEE Symposium on Foundations of Computer Science, in Santa Fe. A fuller version appeared in 1997. He now teaches applied mathematics at MIT.

No. The latest estimate, from May 2025, puts the cost of breaking a 2,048-bit RSA key at fewer than a million fragile qubits running for less than a week. No machine comes close.

No. AES is symmetric encryption, outside the algorithm's reach. Grover's algorithm, another quantum method, weakens it only modestly, and longer keys make up for it.

An ordinary computer first turns factoring into finding the period of a repeating sequence. The quantum computer finds that period with the quantum Fourier transform, which makes wrong answers cancel out. Ordinary arithmetic then turns the period into the two factors.

In principle, yes. Bitcoin relies on elliptic-curve signatures, which the algorithm would also break on a large enough machine. Post-quantum signature standards already exist to replace them.

Sources

1. Shor, P. W., IEEE Symposium on Foundations of Computer Science, Santa Fe, November 1994 · SIAM Journal on Computing 26, 1997.

2. Martín-López, E. et al., factoring 21 with photons, Nature Photonics, 2012.

3. Gidney, C. & Ekerå, M., RSA-2048 with 20 million noisy qubits, 2019 · Gidney, C., RSA-2048 with less than a million noisy qubits, arXiv:2505.15917, 21 May 2025.

4. UK National Cyber Security Centre, Next steps in preparing for post-quantum cryptography, updated August 2024.

Back to top