Public-Key Cryptography (RSA)
A way to let anyone lock a message that only one person can unlock, built on modular powers and the difficulty of factoring.
Needs a step first: 2
Choose two large primes , publish and an exponent , and encrypt a message as . Only someone who knows and can compute and the private exponent with , and then by Euler's theorem. Its safety rests on factoring being hard, which is why Shor's algorithm matters.
Where it shows up: Secure web connections and signed software updates have relied on RSA; Shor's algorithm on a large quantum computer would break it, which is why post-quantum cryptography is being adopted.
How to hold it: In your head
Explain why undoes the encryption and why knowing and is the whole secret; the modular powers themselves are the computer's job.
What knowing it looks like
- Generate a toy RSA key from two small primes and find with the extended Euclidean algorithm.
- Encrypt and decrypt a small number by hand, using repeated squaring for the powers.
- Explain why publishing and does not reveal , and what would break the scheme.
Test yourself
With , and public exponent , find , and the private exponent . Then encrypt the message .
Show the worked answer
Needs a step first: 2
Learn it with an AI
Copy this prompt into any AI assistant. It will take you through step by step at your level and finish with the test above.
Be my maths tutor. I'm learning "Public-Key Cryptography (RSA)" (Undergraduate I tier): A way to let anyone lock a message that only one person can unlock, built on modular powers and the difficulty of factoring. I already know: Modular Arithmetic and Primes. Teach it Socratically: first ask what I already know; then explain the core idea with one concrete example and why it's true; then give me three problems, one at a time, easy to hard. Wait for my answer, check every step, and point out mistakes without giving the answer away. Finish by testing me with this: With $p = 5$, $q = 11$ and public exponent $e = 3$, find $n$, $\varphi(n)$ and the private exponent $d$. Then encrypt the message $m = 7$. Use LaTeX for formulas. When you say where it's used later (machine learning, quantum mechanics), be specific.
Needs first
Leads to
This is the end of a path.
On the way to
Recommended
- Book of ProofRichard Hammack · BookA free textbook that teaches how to read and write proofs, from logic and sets through induction and contradiction, with many exercises and solutions.
- MIT 6.1200J Mathematics for Computer ScienceMIT OpenCourseWare · CourseMIT's 2024 course on proofs, number theory, graphs, counting and discrete probability, with lecture videos, notes and problem sets.
- Linear Algebra Done RightSheldon Axler · BookThe standard proof-based second course in linear algebra, built on linear maps rather than determinants; the 4th edition is free to read, also in Chinese.