liveBook · Manning

Modulus

A modulus is the positive integer that determines equivalence classes, remainder values, and the repeating cycle of modular arithmetic.

How 3 Manning books explain it

Hacking Cryptography

The positive integer that defines the modulus and bounds the residue classes in modular arithmetic.

How it is used
Defines the numeric range and recurrence behavior of a linear congruential pseudorandom number generator.
How deep it goes
Develops the definition through implementation and derives modulus recovery from output differences and greatest common divisors.
Examples
Uses C++ minstd_rand constants, a Go LCG implementation, and an exploit that recovers parameters from generated outputs.
What you can do after
Diagnose/debug with it by implementing an LCG and tracing how recovered parameters reproduce future outputs.

Read how Hacking Cryptography explains modulus →

Real-World Cryptography

A modulus is the positive integer that determines the equivalence of values by their division remainders in modular arithmetic.

How it is used
Uses modular arithmetic to construct operations in Diffie-Hellman and RSA cryptographic systems.
How deep it goes
Defines remainders, wraparound, multiplication, inverses, and RSA exponentiation without developing formal proofs.
Examples
Uses clock wraparound, 7 ≡ 2 (mod 5), 3 × 2 ≡ 1 (mod 5), and RSA encryption of 2 modulo 5.
What you can do after
Apply it via modular arithmetic to interpret remainders and follow basic cryptographic exponentiation.

Read how Real-World Cryptography explains modulus →

Elliptic Curve Cryptography for Developers

The modulus is the positive integer that defines the equivalence classes and wraparound behavior in modular arithmetic.

How it is used
Uses the modulus to implement finite-field arithmetic and manage field domains in cryptographic computations.
How deep it goes
Explains wraparound, congruence, GMP routines, polynomial reduction, inverse checks, and modulus switching, stopping short of full number-theory proofs.
Examples
Uses clock arithmetic, a prime field modulo 43, GMP C routines, polynomial reduction, and CRS modulus switching.
What you can do after
Builds GMP-backed modular arithmetic and configures the modulus for polynomial and elliptic-curve cryptographic operations.

Read how Elliptic Curve Cryptography for Developers explains modulus →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.