Back to library

๐Ÿ”ขLearn Modular Arithmetic Basics: Clock Math That Secures the Internet

Start with the clock on your wall and finish by encrypting a short message with a toy RSA example, using primes you pick yourself. You'll feel modular arithmetic as a living tool, not a programming operator.

Foundations14 drops~2-week path ยท 5โ€“8 min/daymath

Phase 1Clocks, Wraparound, and Equivalence Classes

Feel wraparound and equivalence classes through clocks

4 drops
  1. Your clock is already doing modular arithmetic

    5 min

    Your clock is already doing modular arithmetic

  2. Two numbers are 'the same' if they differ by a multiple of n

    6 min

    Two numbers are 'the same' if they differ by a multiple of n

  3. Mod n turns infinity into a ring of n numbers

    6 min

    Mod n turns infinity into a ring of n numbers

  4. You can reduce at every step without breaking anything

    6 min

    You can reduce at every step without breaking anything

Phase 2Arithmetic Inside a Finite World

Compute sums, products, and inverses mod small primes

5 drops
  1. Subtraction mod n is addition in disguise

    5 min

    Subtraction mod n is addition in disguise

  2. Build a multiplication table and spot the zeros

    7 min

    Build a multiplication table and spot the zeros

  3. Some numbers have a multiplicative inverse โ€” and some don't

    7 min

    Some numbers have a multiplicative inverse โ€” and some don't

  4. Fast exponentiation: square, reduce, repeat

    8 min

    Fast exponentiation: square, reduce, repeat

  5. Mod a prime, a^(pโˆ’1) always equals 1

    7 min

    Mod a prime, a^(pโˆ’1) always equals 1

Phase 3Where Modular Math Already Runs

See modular math inside RSA, hashing, and ISBNs

4 drops
  1. Your dictionary lookup relied on mod the whole time

    6 min

    Your dictionary lookup relied on mod the whole time

  2. The barcode on your book was mod 11

    7 min

    The barcode on your book was mod 11

  3. What day of the week will Nov 7, 2055 be?

    7 min

    What day of the week will Nov 7, 2055 be?

  4. RSA is just Fermat's theorem wearing a suit

    8 min

    RSA is just Fermat's theorem wearing a suit

Phase 4Your Own Toy RSA Cipher

Encrypt a short message using a toy RSA

1 drop
  1. Encrypt a short message with your own toy RSA

    8 min

    Encrypt a short message with your own toy RSA

Frequently asked questions

What is modular arithmetic in simple terms?
This is covered in the โ€œLearn Modular Arithmetic Basics: Clock Math That Secures the Internetโ€ learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Why is modular arithmetic used in cryptography like RSA?
This is covered in the โ€œLearn Modular Arithmetic Basics: Clock Math That Secures the Internetโ€ learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
How is the mod operator different from 'true' modular arithmetic?
This is covered in the โ€œLearn Modular Arithmetic Basics: Clock Math That Secures the Internetโ€ learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
What is Fermat's little theorem and why does it matter?
This is covered in the โ€œLearn Modular Arithmetic Basics: Clock Math That Secures the Internetโ€ learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Can I really do RSA by hand with small primes?
This is covered in the โ€œLearn Modular Arithmetic Basics: Clock Math That Secures the Internetโ€ learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.