Modular Arithmetic Basics
Understand clock arithmetic and why it is central to cryptography.
Welcome
Modular arithmetic — sometimes called 'clock arithmetic' — is the mathematical foundation of AES, RSA, Diffie-Hellman, and nearly every modern cipher.
What Is Modulo?
a mod m is the remainder when a is divided by m. 17 mod 5 = 2 (because 17 = 3×5 + 2). In Python: 17 % 5 == 2.