Shor's Algorithm: Breaking Classical Cryptography
A detailed review of Peter Shor's polynomial-time algorithm for integer factorization.
QWiki Team 2 min read
#algorithms#cryptography#shors#rsa
Explore LabsIntroduction
Shor's algorithm, formulated by Peter Shor in 1994, is a quantum algorithm for finding the prime factors of an integer . On a classical computer, factoring large integers is believed to be computationally intractable, forming the security foundation of modern encryption (RSA).
Complexity Comparison
- Classical: The best-known classical algorithm is the General Number Field Sieve (GNFS), which operates in sub-exponential time:
- Quantum: Shor's algorithm solves the problem in polynomial time:
How It Works
Shor's algorithm reduces the factoring problem to a period-finding problem on a group, which can be solved efficiently using a quantum computer.
- Classical Reduction: Factoring is shown to be equivalent to finding the period of the function .
- Quantum Period Finding:
- Create a superposition of states.
- Evaluate in parallel.
- Apply the Quantum Fourier Transform (QFT) to extract the period from the interference pattern.
- Classical Calculation: Use the period to calculate the greatest common divisor to find the factors.
Cryptographic Implications
Shor's algorithm renders RSA and elliptic-curve cryptography vulnerable once large-scale, fault-tolerant quantum computers are constructed. This has driven the global migration to Post-Quantum Cryptography (PQC).