← Back to section · Research & Analysis
Paper Review: Shor 1994 — How Quantum Computing Rewrote the Difficulty of Factoring
In 1994 Peter Shor gave polynomial-time quantum algorithms for factoring and discrete logarithms. This review covers the background, the core method (period finding and the quantum Fourier transform), the limits of the result, and why it became the origin point of the post-quantum migration.
Background: before 1994, factoring large integers was considered practically infeasible
RSA’s security rests on an empirical fact: multiplying two large primes is easy, but factoring the product back has no known efficient classical algorithm. In the early 1990s, the best classical factoring method (the number field sieve) had running time growing sub-exponentially in the number of digits, and the field believed that lengthening keys could push factoring costs beyond any realistic attacker. The discrete logarithm problem — underpinning Diffie–Hellman and later elliptic-curve cryptography — enjoyed a similar status.
Quantum computing was then a niche direction. Existing quantum algorithm results, such as the Deutsch–Jozsa and Simon problems, were mostly artificially constructed “toy problems”: they demonstrated that quantum speed-ups exist, but touched no real cryptosystem. Shor’s work emerged against this background: he generalized the “hidden period” structure of Simon’s problem to genuine number-theoretic problems. The paper appeared at the IEEE Symposium on Foundations of Computer Science (FOCS) in 1994, with an extended journal version in the SIAM Journal on Computing in 1997.
Method: turning factoring into period finding
The classical part of Shor’s algorithm is actually a number-theoretic reduction: to factor a composite N, pick a random a coprime to N and consider f(x) = a^x mod N. This function is periodic, with period r equal to the order of a modulo N. Whenever r is even and a^(r/2) is not congruent to −1 mod N, computing gcd(a^(r/2) − 1, N) and gcd(a^(r/2) + 1, N) yields a non-trivial factor of N. This reduction was long known in classical number theory — the only difficulty is that finding the period classically takes exponential time.
The quantum contribution is finding that period efficiently. The algorithm prepares a superposition, evaluates f on all inputs in parallel within that superposition, and then applies the quantum Fourier transform (QFT) to the input register: the transform makes amplitudes aligned with the period interfere constructively and the rest cancel, so measurement returns, with high probability, a fraction related to the period, from which continued fractions recover r. The total gate complexity is polynomial in the number of digits. With modest changes, the same structure handles discrete logarithms over finite fields and elliptic curves — meaning DH, DSA, and ECDSA share exactly the same weak point as factoring: a hidden subgroup structure.
A unifying view: the hidden subgroup problem
In later work, Shor abstracted this method into a single framework: the hidden subgroup problem (HSP) over finite abelian groups. Factoring and discrete logarithms look unrelated on the surface, but through the lens of period finding they are two instances of one problem — there is a function that is constant on the cosets of some unknown subgroup and distinct across cosets, and the task is to recover the subgroup from the function’s values. The quantum Fourier transform is precisely the tool tailored to such problems: it “filters” the periodic structure out of the function’s range. This abstraction explains where Shor-type algorithms stop: lattice problems and hash problems have no such group structure, and thirty years of research have found no way to aim the QFT at them. Grasping this point is grasping the screening logic of post-quantum candidates — not trying attacks one by one, but asking whether the problem contains algebraic structure a quantum algorithm can exploit.
One more detail on success probability: a single run of the algorithm yields a usable period with probability that is not low, but success is not guaranteed either; in practice, repeated runs plus classical post-processing of measurement outcomes raise the success rate close to one. This does not affect the complexity conclusion, since polynomially many repetitions are still polynomial time.
Conclusions and limits: what it proved, and what it did not
What the paper proved is that within the quantum computing model, factoring and discrete logarithms are solvable in polynomial time (they belong to BQP). It did not prove that classical computers cannot do the same — factoring has never been shown to be NP-hard, so a classical polynomial algorithm cannot be ruled out in principle; Shor simply left the best known classical results far behind.
The “exponential speed-up” should also be understood precisely: the best classical algorithms cost sub-exponential time in the number of digits, while Shor’s cost grows polynomially, and the gap between the two curves widens dramatically with problem size — double the digits and the classical cost explodes beyond reach, while the quantum cost grows by only a polynomial factor. This is exactly why lengthening keys works against classical attackers but not quantum ones: RSA-4096 is not fundamentally safer than RSA-2048 in front of Shor, it merely multiplies the quantum machine’s bill by a modest factor.
The conditionality matters just as much: the algorithm requires qubits that stay coherent, gate operations that can be error-corrected, and a scale of thousands of logical qubits or more. The 1994 paper did not and could not supply such a machine. Its conclusion takes the form “if fault-tolerant quantum computers reach sufficient scale, the security of RSA and ECC drops to zero.” Thirty years of quantum hardware effort since then have essentially been about pricing the premise of that sentence. Later resource-estimation work (such as Gidney and Ekerå’s 2021 costing of RSA-2048) has progressively translated “sufficient scale” into concrete physical qubit counts and runtimes, but that changes only the timetable, not the conclusion.
Impact: the origin point of post-quantum cryptography
Shor’s algorithm directly defined the notion of a “cryptographically relevant quantum computer” (CRQC), and it drew the boundary of post-quantum cryptography research: every problem whose security reduces to factoring or discrete logarithms is on the retirement list, while lattices, hash functions, error-correcting codes, and multivariate systems — problems without a hidden-period structure — became candidate foundations. The entire urgency of the NIST post-quantum standardization process — harvest-now-decrypt-later (HNDL) risk, migration timelines, hybrid deployment — traces back to this paper of a dozen or so pages.
For today’s reader, the paper also offers a methodological reminder: the security of a cryptosystem is never a mathematical truth, but an empirical statement of the form “no efficient attack is known within the current model of computation.” Once the model of computation expands, the security map must be redrawn. Shor 1994 is the most famous case of an expanded computation model redrawing that map.
Tags: Shor's algorithmfactoringquantum algorithmspaper review