Skip to content
CryptographyInternals

05 / 08 · Math basics

Modular arithmetic

Clock arithmetic: numbers that wrap around.

On a 12-hour clock, 5 hours after 10 o’clock is 3 o’clock: the numbers wrap around. That is modular arithmetic, and it keeps the huge numbers of public-key cryptography inside a fixed range.

A clockmod 12
10 / 12 hours

01 / 12 · Modular arithmetic

You already know this

Look at a clock: it is 10 o’clock. The clock only has 12 hours on it, yet it never runs out of room. Keep an eye on the hand.