08 / Advanced algorithms · LESSON 18 / 27 · 25 MIN
Shor's algorithm, order finding and what it means for cryptography.
Relate periodicity modulo N to factoring, without overclaiming.
f(x)=aˣ mod N aʳ ≡ 1 (mod N)
Factoring reduced to order finding
Pick a with no common factor with N and find its order r modulo N. When r is even and a^(r/2) is not −1 modulo N, gcd(a^(r/2)±1,N) can give factors. For N=15 and a=2 the sequence 1,2,4,8 repeats, so r=4.
Quantum and classical parts
The quantum step finds the period using modular arithmetic and Fourier structure; continued fractions and gcd computations are classical. Unlucky choices of a call for retries. Modular exponentiation is a large reversible circuit, not a free oracle.
Security timeline
Shor's algorithm endangers RSA and related discrete-log cryptosystems once sufficiently capable fault-tolerant machines exist. This simulator is no such hardware and cannot break modern RSA keys. Moving to post-quantum schemes is a systems project, and symmetric cryptography raises different considerations.
TEST YOURSELF
Lesson quiz
Get all 2 questions right to pass. Retry as often as you like.
0/2 answered
Sign in with email or a wallet to check your answers and keep your lesson progress in sync.