Series

How Encryption Works

From First Principles — Simple to Advanced

Encryption transforms readable data into unreadable gibberish — and back again, if you know the secret. This series builds up from the simplest ciphers to the public-key systems that secure the modern internet.

How to read this series: Start from the top. Each cipher builds on ideas from the previous one.
  1. 001
    Beginner Caesar Cipher & Substitution

    The oldest encryption algorithms

    8 min
  2. 002
    Beginner XOR & One-Time Pad

    The only provably unbreakable cipher

    9 min
  3. 003
    Intermediate Block Ciphers & DES

    Scrambling data in fixed-size chunks

    9 min
  4. 004
    Intermediate AES

    The world's most widely used cipher

    11 min
  5. 005
    Intermediate Block Cipher Modes

    How to safely encrypt more than one block

    10 min
  6. 006
    Intermediate Stream Ciphers

    Generating an endless river of pseudorandom keystream

    17 min
  7. 007
    Intermediate Authenticated Encryption

    Confidentiality and integrity in a single pass

    19 min
  8. 008
    Intermediate RSA & Public-Key Cryptography

    Encrypt with one key, decrypt with another

    10 min
  9. 009
    Intermediate Diffie-Hellman Key Exchange

    Agreeing on a secret over a public channel

    9 min
  10. 010
    Advanced Elliptic Curve Cryptography

    The same security with far smaller keys

    11 min
  11. 011
    Intermediate Hash Functions & MACs

    One-way fingerprints for data integrity

    14 min
  12. 012
    Intermediate Digital Signatures

    Proving authorship without sharing secrets

    13 min
  13. 013
    Advanced The TLS Handshake

    Every piece snapping together

    15 min
  14. 014
    Intermediate Key Derivation & Password Hashing

    Turning human passwords into strong keys

    16 min

Applied Protocols

How the building blocks above combine into real-world systems people use every day.

  1. 015
    Advanced The Signal Protocol

    End-to-end encryption with forward and future secrecy

    21 min
  2. 016
    Intermediate Web Authentication

    Sessions, tokens, cookies, and keeping logins safe in the browser

    22 min
  3. 017
    Advanced Hardening Web Auth

    JWT internals, OAuth/OIDC, revocation, and token binding

    19 min

Attacks & Cryptanalysis

Understanding how cryptographic systems break — and why each defense exists.

  1. 018
    Advanced Padding Oracle Attacks

    How a single leaked bit can break encryption

    17 min
  2. 019
    Advanced Birthday Attacks & Hash Collisions

    When mathematical inevitability meets cryptographic assumptions

    23 min