CryptoBook
  • CryptoBook
  • Book Plan
  • Style Guide
    • Sample Page
  • Contributors
  • Fundamentals
    • Mathematical Notation
    • Division and Greatest common divisor
      • Euclidean Algorithm
    • Modular Arithmetic
      • Theorems of Wilson, Euler, and Fermat
        • Fermat's Little Theorem in Detail
        • Euler's Theorem in Detail
      • Quadratic Residues
    • Continued Fractions
  • Number Theory
  • Ideals
  • Polynomials With Shared Roots
  • Integer Factorization
    • Pollard rho
    • Sieves
  • Abstract algebra
    • Groups
      • Another take on groups
      • Discrete Log Problem
    • Rings
    • Fields
    • Polynomials
  • Elliptic Curves
    • Untitled
  • Lattices
    • Introduction
    • LLL reduction
      • Gram-Schmidt Orthogonalization
      • Lagrange's algorithm
      • LLL reduction
    • Lattice reduction
      • Minkowski reduced
      • HKZ reduced
      • LLL reduced
    • Applications
      • Coppersmith algorithm
      • Extensions of Coppersmith algorithm
    • Hard lattice problems
    • Lattices of interest
    • Cryptographic lattice problems
      • Short integer solutions (SIS)
      • Learning with errors (LWE)
      • Ring-LWE
      • NTRU
    • Interactive fun
    • Resources and notations
  • Asymmetric Cryptography
  • RSA
    • Proof of correctness
    • RSA application
    • Low Private Component Attacks
      • Wiener's Attack
      • Boneh-Durfee Attack
    • Common Modulus Attack
    • Recovering the Modulus
  • Diffie-Hellman
    • MITM
  • Elliptic Curve Cryptography
  • Symmetric Cryptography
    • Encryption
    • The One Time Pad
    • AES
      • Rijndael Finite Field
      • Round Transformations
  • Hashes
    • Introduction / overview
    • The Birthday paradox / attack
  • Isogeny Based Cryptography
    • Introduction to Isogeny Cryptography
    • Isogenies
    • Isogeny and Ramanujan Graphs
  • Appendices
    • Sets and Functions
    • Probability Theory
Powered by GitBook
On this page
  • Wilson's Theorem
  • Euler's Theorem
  • Fermat's Little Theorem
  • Reference

Was this helpful?

Export as PDF
  1. Fundamentals
  2. Modular Arithmetic

Theorems of Wilson, Euler, and Fermat

Wilson's Theorem

A positive integer n>1n > 1n>1is a prime if and only if:

(n−1)!≡−1mod  n(n-1)! \equiv -1 \mod n (n−1)!≡−1modn

Euler's Theorem

Let n∈Z+n \in \mathbb{Z}^{+}n∈Z+ and a∈Za \in \mathbb{Z}a∈Z s.t. gcd(a,n)=1gcd(a, n) = 1gcd(a,n)=1, then:

aϕ(n)≡1mod  na^{\phi(n)} \equiv 1 \mod naϕ(n)≡1modn

Fermat's Little Theorem

Let pppbe a prime and a∈Za \in \mathbb{Z}a∈Z, then:

ap≡amod  pa^p \equiv a \mod pap≡amodp

or equivalently:

ap−1≡1mod  pa^{p-1} \equiv 1 \mod pap−1≡1modp

Reference

PreviousModular ArithmeticNextFermat's Little Theorem in Detail

Last updated 3 years ago

Was this helpful?

Wilson's Theorem - Brilliant
Euler's Theorem - Brilliant
Fermat's Little Theorem - Brilliant