Skip to main content
Presentation 4 of 16

Primes, Euler's Totient, Fermat's and Euler's Theorems

The number-theory foundation of asymmetric cryptography: how we find large primes and why they provide security.

Slides: 24 PDF · 1.1 MB
Loading slides…

Keyboard: Left arrow Right arrow Slides; F — fullscreen

Summary

Students learn why primes and the fundamental theorem of arithmetic underpin the security of RSA, Diffie-Hellman and ElGamal. The lecture covers the distribution of primes (π(x) ≈ x/ln x), primality tests (trial division, the Fermat test, Carmichael numbers, Miller-Rabin) and the practical scheme for generating a 1024-bit prime. It then develops Euler's totient φ(n), Fermat's little theorem and Euler's theorem (the core of RSA correctness) and the discrete logarithm problem, with Python code.

Key terms

tub son arifmetikaning asosiy teoremasi π(x) sinov bo'lish Ferma testi Karmaykl sonlari Miller-Rabin Eyler funksiyasi φ(n) kichik Ferma teoremasi Eyler teoremasi diskret logarifm φ(pq) = (p-1)(q-1)

Lecture outline

  1. Primes and the fundamental theorem of arithmetic
  2. Distribution of primes: π(x) and the “one in ~710” rule
  3. Trial division and the Fermat test; Carmichael numbers
  4. Miller-Rabin test: witnesses and the 4^(-k) error bound
  5. Generating a large prime: the practical scheme (1024 bits)
  6. Euler's totient φ(n) and its properties
  7. Fermat's little theorem and Euler's theorem — proofs and checks
  8. The discrete logarithm problem
  9. Python practice: Miller-Rabin and φ(n); summary
Related lesson Math Foundations: Modular Arithmetic, GCD & Congruences