liveBook · Manning

Modulus

As explained in Real-World Cryptography

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

A modulus is the number where arithmetic wraps around. Division by the modulus leaves a remainder, and numbers with the same remainder are equivalent in modular arithmetic. section 5.2.1

A clock that resets

With modulus 5, 7 divided by 5 leaves remainder 2, so 7 ≡ 2 (mod 5). The same rule maps 5 to 0, 6 to 1, and 9 to 4. section 5.2.1

Modular arithmetic supports several cryptographic operations:

  • Modular multiplication reduces an ordinary product to its remainder; for example, 3 × 2 ≡ 1 (mod 5). section 5.2.1
  • In a multiplicative group, modular inverses connect numbers whose product is equivalent to 1. section 5.2.1
  • RSA raises a message to a public exponent modulo a public modulus; practical RSA uses N = p × q rather than a single prime. section 6.3.1
Figure 5.5 The group of integers modulo the prime number 5 can be pictured as a clock that resets to 0 after the number 4. Thus 5 is represented as 0, 6 as 1, 7 as 2, 8 as 3, 9 as 4, 10 as 0, and so on.

Use the clock diagram to see how integers modulo 5 cycle through 0, 1, 2, 3, and 4. section 5.2.1

How Real-World Cryptography covers it

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 it assumes
Teaches wraparound and remainders from concrete examples before using group, inverse, and cryptographic terminology.
What you can do after
Apply it via modular arithmetic to interpret remainders and follow basic cryptographic exponentiation.
How it connects
Connects modular arithmetic with modular multiplication, multiplicative groups, Diffie-Hellman, and RSA.

Also explained in

Compare how 3 books explain modulus →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.