Beta

How Quantum Computers Break Encryption | Shor's Algorithm Explained

Below is a short summary and detailed review of this video written by FutureFactual:

Shor's Algorithm Demystified: Quantum Computing and the Encryption Breaker

Overview

This video explains how encryption relies on the difficulty of factoring large numbers and how a quantum algorithm, Shor's algorithm, could turn that difficulty into a practical vulnerability. It emphasizes the math behind factoring and the physics that enable quantum speedups, while avoiding heavy technical detail.

  • Shor's algorithm converts a weak starting guess into a strong candidate by exploiting a repeating power pattern
  • A quantum computer uses superposition and interference to find the period of a function, speeding up the search
  • Finding the period 1/p via a quantum Fourier transform paves the way to extracting factors with Euclid's algorithm
  • Despite theoretical speedups, current quantum hardware has memory and scale limits that prevent breaking modern encryption today

Introduction to encryption and the factoring challenge

Encrypting data on the internet often relies on a simple but powerful idea: a large composite number N is easy to multiply into, but hard to factor back into its prime components. The security of many systems rests on this asymmetry. Classical methods for factoring rely on trying numbers as potential factors one by one and checking whether they divide N. That brute force approach becomes infeasible as N grows to hundreds or thousands of digits, which is precisely the scale used in modern RSA-like schemes.

Euclid’s algorithm and the factoring trick

Even when you start with a number that shares a factor with N, you can often exploit Euclid’s algorithm to extract common factors efficiently. The key idea in Shor’s algorithm is to construct two new numbers from a random starting guess G and a power P such that the product of these two new numbers reveals a nontrivial common factor with N when you take their gcd with N. In particular, the method guarantees that some power of G will be 1 modulo N, yielding a relationship that can be exploited to factor N. This is where the math becomes the engine of the algorithm.

The core cleverness: turning a bad guess into a good one

For a random starting guess G that does not share a factor with N, there exists a positive exponent P such that G^P is 1 more than a multiple of N. From this, one can form two improved guesses: G^{P/2} + 1 and G^{P/2} - 1. These two numbers are close to factors of N, and applying Euclid’s algorithm to them yields nontrivial factors of N, provided certain technical conditions hold. Importantly, the process that turns the initial guess into a useful pair of guesses depends on knowing P. Finding P is where quantum mechanics plays a crucial role.

Why quantum computers help: period finding and interference

Shor’s insight is that the problem of finding P can be recast as a problem of discovering the period of a certain function. A quantum computer can evaluate many possible exponents at once using a superposition, producing a huge set of outputs that reflect periodic structure. The trick is to arrange the computation so that all incorrect options interfere destructively and the correct period reinforces, so that a later measurement yields a value closely related to the period P.

From a quantum state to a factor: the role of the quantum Fourier transform

The frequency information that reveals the period is extracted via a quantum Fourier transform, a quantum analogue of the familiar Fourier transform. When you feed a superposition of exponents into the quantum Fourier transform, the resulting state emphasizes the 1/p frequency that corresponds to the period of the sequence. Measuring this state gives a value that, with high probability, leads you to P or a multiple of P. Once P is known, the rest of the steps—raising the guess to P/2 and subtracting or adding 1, followed by Euclid’s algorithm—yield a nontrivial factor of N.

Putting the pieces together and practical limits

In practice, the algorithm has to contend with several issues: p must be even for the half-power step to be well defined, the intermediate guesses must not be multiples of N, and the power P can be large. Statistical analysis shows that for a random guess, there is a substantial probability (roughly 37.5%) that a successful path arises after a small number of attempts, making the overall process efficient in principle. The remaining barrier is hardware: on a big enough quantum computer with enough coherent qubits and memory, Shor’s algorithm could factor numbers used in real-world encryption, thereby breaking RSA-like systems. However, current quantum devices lack the size and stability to factor such large numbers, so the threat remains theoretical for the near term.

Why this matters: the future of cryptography

The potential ability of quantum computers to break standard encryption has driven interest in post-quantum cryptography, which seeks algorithms resistant to quantum attacks. The video highlights that while the math and the physics behind Shor’s algorithm are elegant and clear, turning them into practical, large-scale factoring machines remains a formidable engineering challenge. The takeaway is not to panic, but to recognize the fundamental shift that quantum computing proposes for information security and to prepare cryptographic systems accordingly.

Conclusion

Shor’s algorithm crystallizes a simple, powerful message: a clever combination of number theory and quantum physics can transform a seemingly intractable problem into a tractable one, at least in principle. The core idea is straightforward once you see how a bad guess can be converted into a good one through a repeating structure, and how a quantum computer can expose that structure efficiently via a quantum Fourier transform. The result is a theoretical capability to break encryption that relies on factoring large numbers, underscoring the importance of advancing post-quantum cryptography and continuing to study the intersection of mathematics, computer science, and quantum physics.

Related posts

featured
minutephysics
·22/05/2019

How Shor's Algorithm Factors 314191

featured
Veritasium
·20/03/2023

What makes quantum computers SO powerful?

featured
Veritasium
·20/03/2023

What makes quantum computers SO powerful?