Shor's Algorithm
Shor's algorithm factors large integers in polynomial time O((log N)^3), providing an exponential speedup over the best known classical algorithms and threatening RSA cryptography.
What it means
Shor's algorithm (1994) factors an integer N in polynomial time by reducing factoring to period-finding using the Quantum Fourier Transform.The algorithm: (1) chooses random a < N, (2) uses quantum period-finding to determine the period r of f(x) = a^x mod N, (3) if r is even, computes gcd(a^(r/2) +/- 1, N) to find factors.The QFT enables efficient period-finding which is exponentially hard classically.This algorithm motivates post-quantum cryptography research since it can break RSA, Diffie-Hellman, and elliptic curve cryptography with a sufficiently large quantum computer.Current quantum computers are too small and noisy to factor cryptographically relevant numbers.Everyday analogy
Common misconceptions
- Shor's algorithm does NOT instantly break all encryption -- it specifically targets integer factoring and discrete logarithm problems.
- Current quantum computers CANNOT run Shor's algorithm on cryptographically relevant numbers -- they lack sufficient qubits and error correction.
Key takeaways
- Factors integers in polynomial time O((log N)^3) -- exponential speedup over classical.
- Reduces factoring to quantum period-finding using the QFT.
- Motivates the entire field of post-quantum cryptography.
Check your understanding
What mathematical problem does Shor's algorithm reduce integer factoring to?
- A.Matrix multiplication
- B.Period finding
- C.Graph coloring
- D.Sorting
Show the answer
Answer: B. Period finding
Why: Shor's algorithm reduces integer factoring to period-finding, which can be solved efficiently using the Quantum Fourier Transform.
Builds on
Primary source: Shor, SIAM J. Comput. 26, 1484 (1997), doi:10.1137/S0097539795293172
Hardware-status sentences ('current quantum computers cannot factor...') are explicitly era-qualified honesty statements protecting against hype; algorithm itself is established mathematics.
Learn it hands-on
This concept is part of a 46-level curriculum with an interactive simulator and Lumen, a tutor whose answers are verified before you see them. Levels 1–5 are free.
