What is Mod?
The mod operation gives you the remainder after division.
Example:
So:
That’s it. Mod = remainder.
Reading Mod
When you see , ask yourself:
“If I divide by , what’s left over?”
Examples:
| Expression | Division | Remainder |
|---|---|---|
| r 1 | 1 | |
| r 0 | 0 | |
| r 7 | 7 | |
| r 2 | 2 |
The Clock Analogy
Think of a 12-hour clock.
What time is it 15 hours after 12 o’clock?
It’s 3 o’clock. The hour hand wrapped around past 12.
What about 27 hours after 12?
Still 3 o’clock. It wrapped around twice, but landed in the same spot.
The Key Insight
Numbers that differ by the modulus land on the same spot.
, , , all give remainder when divided by .
We say these numbers are congruent modulo 12.
The Range of Results
The result of is always between and .
| Modulus | Possible results |
|---|---|
| 0, 1, 2, 3, 4 | |
| 0, 1, 2, 3, …, 11 | |
| 0, 1 |
Mod keeps numbers in a fixed range. They wrap around instead of growing forever.
Why This Matters for Cryptography
In cryptography, we work with huge numbers.
RSA encryption computes things like:
Without mod, that exponentiation would produce a number with millions of digits.
With mod, the result stays manageable. Always less than .