Quantum Information Science I (MIT Open Learning Library)
Prof. Isaac Chuang and Prof. Peter Shor, MIT
Shor's algorithm factors large integers in polynomial time - a task that takes classical computers sub-exponential time. Because RSA and other public-key cryptosystems depend on factoring being hard, Shor's algorithm is the most consequential quantum algorithm for cybersecurity, even though large-scale implementation is still years away.
The algorithm is a hybrid: most of the clever quantum work reduces factoring to a period-finding problem, which a quantum Fourier transform solves efficiently. The steps, simplified:
Choose a random integer a that shares no factors with N (the number to factor). Consider the function f(x) = a^x mod N. This function is periodic - it repeats with some period r. If you can find r, you can often factor N using classical number theory (with high probability).
The quantum Fourier transform (QFT) is the engine of Shor's algorithm. It takes a superposition of function values and extracts the period exponentially faster than classical discrete Fourier transform methods. This is the step where quantum speedup happens - the QFT runs in O(n^2) quantum gates versus O(n * 2^n) for a classical DFT.
Once the period r is known, classical math takes over. If r is even and a^(r/2) is not -1 mod N, then gcd(a^(r/2) +/- 1, N) yields non-trivial factors of N with high probability. If not, restart with a different random a - the algorithm succeeds quickly on average.
Modern internet security rests on the difficulty of factoring large numbers and computing discrete logarithms. Shor's algorithm solves both problems efficiently.
RSA key pairs are generated from two large primes. Security depends on the difficulty of factoring their product N. Shor's algorithm factors N in polynomial time, recovering private keys from public keys.
ECDSA and ECDH use the discrete logarithm problem on elliptic curves. Shor's algorithm solves the elliptic curve discrete logarithm problem too, breaking ECC-based key exchange and signatures.
Adversaries can record encrypted traffic today and decrypt it once quantum computers are capable. Long-lived sensitive data - government secrets, financial records, health data - is already at risk from this strategy.
NIST finalized post-quantum standards in 2024: CRYSTALS-Kyber, CRYSTALS-Dilithium, and SPHINCS+. These are based on lattice and hash problems, not factoring - they remain secure against Shor's algorithm.
Quantum computing courses that include Shor's algorithm in their curriculum.
Prof. Isaac Chuang and Prof. Peter Shor, MIT
IBM Quantum / Qiskit Team
Dept of Computer Science, University of Oxford
Prof. Elias Fernandez-Combarro Alvarez, University of Oviedo
Prof. Peter Shor, MIT
QWorld volunteer instructors
Packt
Hands-on implementations and deep dives into the quantum Fourier transform and period finding.