Skip to content
CryptographyInternals

Math basics

The few math ideas behind every cipher: bits, hexadecimal, XOR, powers of two, modular arithmetic, primes, one-way functions and randomness. Animated for beginners.

  1. 01

    Bits and bytes

    How a computer turns everything into 0s and 1s.

    Learn it →
  2. 02

    Hexadecimal

    A short way to write bytes: two characters each.

    Learn it →
  3. 03

    XOR

    The operation that mixes a key into data, and takes it back out.

    Learn it →
  4. 04

    Powers of two

    Why one more bit doubles the work for an attacker.

    Learn it →
  5. 05

    Modular arithmetic

    Clock arithmetic: numbers that wrap around.

    Learn it →
  6. 06

    Prime numbers

    Easy to multiply, very hard to split apart.

    Learn it →
  7. 07

    One-way functions

    Powers with wrap-around: fast forward, hopeless backward.

    Learn it →
  8. 08

    Randomness

    Why a key must be unpredictable, not just secret.

    Learn it →