/ quantum course Back to lab
PATHWAY PROGRESS0/27 passed

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.

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

1. What is the order of 2 modulo 15?
2. Could a small, noise-free simulator like this one crack today's RSA keys?

Sign in with email or a wallet to check your answers and keep your lesson progress in sync.

Your account

Sign in to pick up your progress on any device.

or

Wallet sign-in uses a free signature (EIP-4361) on whatever EVM network your wallet is on. No gas, no transaction.