You cannot understand cryptography without this foundation.
All of cryptography—including zero-knowledge proofs, FHE, and MPC—is built on:
- Number theory: Primes, modular arithmetic, discrete logarithm problem
- Algebra: Groups, rings, fields, finite fields
- Mathematical structures: The frameworks that make crypto secure
Skip this at your peril. Trying to learn ZK without number theory is like trying to build a house without understanding materials.
2-4 weeks of focused study (10-20 hours/week)
-
number theory/ (9 papers)
- Prime numbers, factorization
- Discrete logarithm problem
- Modular arithmetic
- Number-theoretic assumptions
-
algebra/ (6 papers)
- Group theory
- Rings and fields
- Finite fields (GF(p) and GF(2^m))
- Algebraic structures
-
Handbook of Applied Cryptography/ (19 chapters)
- THE comprehensive reference
- Chapters 1-3: Mathematical background
- Chapters 4-14: Cryptographic protocols
- Your cryptography bible
-
"An Introduction to Mathematical Cryptography" (2014) - Hoffstein, Pipher, Silverman
- Perfect starting point
- Covers number theory, algebra, and cryptography together
- Highly recommended to read first
-
"Cryptography Made Simple" (2016) - Smart
- Clear explanations
- Modern approach
- Good companion to Handbook
-
Handbook of Applied Cryptography - Chapters 1-3
- Mathematical background
- Comprehensive reference
- Come back to this repeatedly
Goal: Understand primes, modular arithmetic, discrete log
Read:
- "An Introduction to Mathematical Cryptography" - Chapters 1-2
- Papers in number theory/ folder on primes and discrete logarithm
- Handbook - Chapter 2 (Mathematical Background)
Key Concepts to Master:
- Modular arithmetic (a ≡ b mod n)
- Greatest common divisor (GCD)
- Euler's totient function φ(n)
- Fermat's Little Theorem
- Chinese Remainder Theorem
- Discrete Logarithm Problem (DLP)
- Factorization hardness
Self-Check: Can you explain why factoring large numbers is hard?
Goal: Understand groups, rings, fields
Read:
- Papers in algebra/ folder
- "Cryptography Made Simple" - Chapter on algebraic structures
- Handbook - Chapter 2, sections on groups and fields
Key Concepts to Master:
- Groups: Definition, properties, cyclic groups
- Subgroups and generators
- Rings and fields
- Finite fields GF(p) and GF(2^m)
- Field arithmetic
- Polynomial arithmetic over finite fields
Self-Check: Can you explain what a cyclic group is and why it's useful in crypto?
Goal: Deep understanding of finite fields
Read:
- "Finite Fields with Applications to Coding Theory, Cryptography..." (if available)
- Handbook - Advanced sections on finite fields
- Papers on elliptic curves over finite fields (preview for next folder)
Key Concepts to Master:
- Construction of finite fields
- Primitive elements
- Irreducible polynomials
- Extension fields
- Field isomorphisms
Self-Check: Can you construct GF(2^8) and do arithmetic in it?
Goal: See how math connects to crypto
Read:
- Handbook - Chapters 1, 3 (Overview, Number-Theoretic Reference)
- Begin reading Handbook - Chapter 8 (Public-Key Encryption)
- Preview: Start looking at elliptic curve papers
Key Concepts to Master:
- How DLP provides security
- Why certain mathematical problems are hard
- Connection between algebra and cryptographic protocols
- Security reductions
Self-Check: Can you explain why breaking RSA requires factoring?
- ⭐⭐⭐ "An Introduction to Mathematical Cryptography" - Your primary textbook
- ⭐⭐⭐ Handbook of Applied Cryptography - Chapters 1-3 - Essential reference
- ⭐⭐⭐ Papers on discrete logarithm in number theory/
- ⭐⭐⭐ Papers on finite fields in algebra/
- ⭐⭐ "Cryptography Made Simple" - Clear explanations
- ⭐⭐ Papers on prime numbers - Understanding primes is crucial
- ⭐⭐ Papers on polynomial arithmetic - Needed for elliptic curves
- ⭐ Gröbner Bases papers - Very advanced algebra
- ⭐ Ideals, Varieties, and Algorithms - Advanced algebraic geometry
- ⭐ Specialized number theory papers - For specific protocols
- Fermat's Little Theorem: a^p ≡ a (mod p) for prime p
- Euler's Theorem: a^φ(n) ≡ 1 (mod n)
- Chinese Remainder Theorem: Solving simultaneous congruences
- Lagrange's Theorem: |H| divides |G| for subgroup H of G
- Fundamental Theorem of Finite Abelian Groups
❌ Don't:
- Skip the "boring" number theory - it's fundamental
- Memorize formulas without understanding
- Rush through this to get to "cool ZK stuff"
- Ignore problem sets and exercises
✅ Do:
- Work through examples by hand
- Implement basic operations in code (mod exp, GCD, etc.)
- Understand why theorems are true, not just what they say
- Practice, practice, practice
Implement in Python:
- Modular exponentiation (a^b mod n)
- Extended Euclidean algorithm
- Finding multiplicative inverses
Implement GF(p) arithmetic:
- Addition, subtraction, multiplication
- Division (using multiplicative inverse)
- Finding generators of GF(p)*
- Find all generators of Z_11*
- Compute the discrete logarithm of 5 in Z_23* (base 5)
- Implement baby-step giant-step algorithm
- SageMath: Excellent for number theory and algebra
- Python: Good for basic implementations
- Mathematica/Maple: Symbolic computation
- Online calculators: For checking your work
- "A Course in Number Theory and Cryptography" - Koblitz
- "Abstract Algebra" - Dummit & Foote (if you want deeper math)
- "Concrete Mathematics" - Knuth et al.
- Khan Academy: Number theory basics
- MIT OCW: Number Theory courses
- Coursera: Introduction to Mathematical Thinking
Q: How much math do I really need? A: All of it in this folder. Every paper in ZK assumes you know this cold.
Q: Can I skip to ZK and come back when needed? A: No. You'll be constantly confused. Invest the time now.
Q: I'm not good at math. Can I still learn ZK? A: Yes! But you need to work through this methodically. Take 6-8 weeks if needed.
Q: Do I need abstract algebra courses? A: Not full courses, but you need groups/rings/fields from this folder.
Q: What about linear algebra? A: Some papers assume it. Khan Academy has good linear algebra courses.
After finishing this folder, you should be able to:
✅ Explain the discrete logarithm problem ✅ Perform modular arithmetic confidently ✅ Understand what a cyclic group is ✅ Work with finite fields GF(p) ✅ Explain why certain mathematical problems are hard ✅ Understand security reductions ✅ Read cryptographic papers that assume math background
If you can't do these, spend more time here before moving on.
Once you've mastered this material:
→ Go to 02_ESSENTIAL_Crypto_Primitives/README.md
You'll learn:
- Elliptic curve cryptography
- Pairing-based cryptography
- Hash functions and commitments
- Digital signatures
All of which build directly on the math you just learned.
Remember: This is the foundation. Everything else is built on this. Take your time and do it right.