Factorization using Shor's
Algorithm
Quantum Computing Approach to
Integer Factorization
What is Shor's Algorithm?
• • Shor's algorithm is a quantum algorithm for
integer factorization.
• • Developed by Peter Shor in 1994.
• • Efficiently finds the prime factors of a
composite number.
• • Runs exponentially faster than the best-
known classical algorithms.
• • Has significant implications for cryptography
(e.g., RSA).
Classical vs Quantum Factorization
• • Classical algorithms (like trial division) are
slow for large numbers.
• • Quantum algorithms leverage superposition
and entanglement.
• • Shor's algorithm can factor in polynomial
time: O((log N)^3).
• • Breaks RSA encryption if large-scale
quantum computers become practical.
Steps in Shor’s Algorithm
• 1. Choose a composite number N to factor.
• 2. Choose a random number a < N.
• 3. Compute gcd(a, N); if > 1, it’s a factor.
• 4. Use quantum period-finding to find r, the
period of a^x mod N.
• 5. If r is even and a^(r/2) ≠ -1 mod N, compute
gcd(a^(r/2) ± 1, N).
• 6. These gcds give non-trivial factors of N.
Example: Factoring 15
• 1. N = 15, choose a = 2.
• 2. gcd(2, 15) = 1 → continue.
• 3. Use quantum computer to find r such that
2^r ≡ 1 mod 15.
• 4. r = 4 (2^4 = 16 ≡ 1 mod 15).
• 5. Compute gcd(2^(r/2) ± 1, 15) = gcd(4 ± 1,
15).
• 6. Factors: gcd(5, 15) = 5 and gcd(3, 15) = 3.
Quantum Period Finding Circuit
• • Superposition: Apply Hadamard gates to
initialize qubits.
• • Modular exponentiation: Apply unitary
operator for a^x mod N.
• • Quantum Fourier Transform: Extract period
from interference pattern.
• • Measurement: Collapse state to get period r
with high probability.
Applications & Limitations
• • Applications:
• - Breaking RSA encryption
• - Cryptanalysis
• • Limitations:
• - Requires scalable quantum hardware
• - Quantum error correction still a challenge
• - Practical only for small numbers with
current tech
Conclusion
• • Shor's algorithm revolutionizes factorization
via quantum computing.
• • Demonstrates real advantage of quantum
over classical.
• • Promotes the need for quantum-safe
cryptographic systems.
• • Still a theoretical threat pending quantum
hardware advancements.

Shors_Algorithm_Factorization using.pptx

  • 1.
    Factorization using Shor's Algorithm QuantumComputing Approach to Integer Factorization
  • 2.
    What is Shor'sAlgorithm? • • Shor's algorithm is a quantum algorithm for integer factorization. • • Developed by Peter Shor in 1994. • • Efficiently finds the prime factors of a composite number. • • Runs exponentially faster than the best- known classical algorithms. • • Has significant implications for cryptography (e.g., RSA).
  • 3.
    Classical vs QuantumFactorization • • Classical algorithms (like trial division) are slow for large numbers. • • Quantum algorithms leverage superposition and entanglement. • • Shor's algorithm can factor in polynomial time: O((log N)^3). • • Breaks RSA encryption if large-scale quantum computers become practical.
  • 4.
    Steps in Shor’sAlgorithm • 1. Choose a composite number N to factor. • 2. Choose a random number a < N. • 3. Compute gcd(a, N); if > 1, it’s a factor. • 4. Use quantum period-finding to find r, the period of a^x mod N. • 5. If r is even and a^(r/2) ≠ -1 mod N, compute gcd(a^(r/2) ± 1, N). • 6. These gcds give non-trivial factors of N.
  • 5.
    Example: Factoring 15 •1. N = 15, choose a = 2. • 2. gcd(2, 15) = 1 → continue. • 3. Use quantum computer to find r such that 2^r ≡ 1 mod 15. • 4. r = 4 (2^4 = 16 ≡ 1 mod 15). • 5. Compute gcd(2^(r/2) ± 1, 15) = gcd(4 ± 1, 15). • 6. Factors: gcd(5, 15) = 5 and gcd(3, 15) = 3.
  • 6.
    Quantum Period FindingCircuit • • Superposition: Apply Hadamard gates to initialize qubits. • • Modular exponentiation: Apply unitary operator for a^x mod N. • • Quantum Fourier Transform: Extract period from interference pattern. • • Measurement: Collapse state to get period r with high probability.
  • 7.
    Applications & Limitations •• Applications: • - Breaking RSA encryption • - Cryptanalysis • • Limitations: • - Requires scalable quantum hardware • - Quantum error correction still a challenge • - Practical only for small numbers with current tech
  • 8.
    Conclusion • • Shor'salgorithm revolutionizes factorization via quantum computing. • • Demonstrates real advantage of quantum over classical. • • Promotes the need for quantum-safe cryptographic systems. • • Still a theoretical threat pending quantum hardware advancements.