← Foundations of Cryptography

Number Theory

Primes, modular arithmetic and number-theoretic problems.

A subcategory of Foundations of Cryptography, collecting its introduction, articles and resource entry points.

§

Articles here

22 Nov 2026 Foundations of Cryptography

The Chinese Remainder Theorem: Splitting Big Problems into Small Congruences

Starting from the classic counting problem in the Sunzi Suanjing, this article states the Chinese remainder theorem, sketches its constructive proof and uniqueness condition, and shows why it appears in settings as different as RSA acceleration and polynomial interpolation.

number theoryChinese remainder theoremcongruencesRSA

Read more →
22 Nov 2026 Foundations of Cryptography

Continued Fractions and Small Private Exponents: The Lesson of Wiener's Attack

An RSA private exponent chosen too small is a disaster waiting to happen. This article explains, qualitatively and via continued-fraction approximation, why Wiener's attack recovers an undersized private exponent from the public key alone, and the lasting lesson it leaves for parameter selection.

number theorycontinued fractionsRSAWiener attack

Read more →
22 Nov 2026 Foundations of Cryptography

Extended Euclid and Modular Inverses: The Universal Wrench of Cryptographic Engineering

Computing modular inverses is the most frequent low-level operation in key generation and signature verification. This article explains the Euclidean algorithm, its extension and Bézout's identity, and compares inversion via Fermat's little theorem in terms of applicability and engineering trade-offs.

number theoryEuclidean algorithmmodular inverseBézout identity

Read more →
22 Nov 2026 Foundations of Cryptography

Number-Theory Roots: The Two Pillars of Classical Public-Key Cryptography

Starting from modular arithmetic and Euler's theorem, see why integer factorisation and the discrete logarithm are the shared foundation of RSA and Diffie–Hellman — with hand-worked small examples and a glimpse of the Chinese remainder theorem.

number theoryRSAdiscrete logarithm

Read more →
22 Nov 2026 Foundations of Cryptography

Primality Testing: From Trial Division to Miller–Rabin

The first step in RSA key generation is producing large primes. This article explains the ceiling of trial division, why Carmichael numbers defeat the Fermat test, and how the Miller–Rabin probabilistic test trades a minuscule error probability for workable speed.

number theoryprimality testingMiller-RabinRSA

Read more →
22 Nov 2026 Foundations of Cryptography

The Distribution of Primes: The Prime Number Theorem and Key-Space Intuition

How primes are distributed among the integers directly determines the cost of generating large primes at random and the size of the key space. This article uses the prime number theorem to build intuition for prime density and shows why random sampling plus primality testing is an efficient route to large primes.

number theoryprime number theoremprime distributionkey generation

Read more →
22 Nov 2026 Foundations of Cryptography

Quadratic Residues and the Legendre Symbol: A Licence for Square Roots

Modulo a prime, not every number has a square root. This article explains the decision problem for quadratic residues, Euler's criterion, the computational rules of the Legendre symbol and quadratic reciprocity, and where this theory sits in proof systems and pseudorandom generation.

number theoryquadratic residuesLegendre symbolquadratic reciprocity

Read more →
22 Nov 2026 Foundations of Cryptography

Why Discrete Logarithms Are Hard: From Baby-Step Giant-Step to Index Calculus

A modular exponentiation finishes in an instant, yet inverting it is forbiddingly hard. This article explains where the difficulty of the discrete logarithm problem comes from, the ladder of known classical algorithms (brute force, BSGS, Pollard rho, index calculus), and how the choice of group determines real-world security strength.

number theorydiscrete logarithmDiffie-Hellmanalgorithm complexity

Read more →
§

More in this section