Subject 04 / Course

Cryptography

Keys, signatures, and encryption, connected to the assumptions that make them useful.

5 modules20 lessons≈ 6 h reading
Start with lesson 1.a

Cryptography rarely fails because a cipher is broken. It fails because a nonce was reused, a signature was checked against the wrong key, a key lived on a laptop for six years, or the system needed integrity and got only confidentiality. Start from the property the system needs, then choose the primitive, then protect the keys, and most of the famous failures never happen.

The course builds that habit: security properties and their assumptions first, then symmetric and public-key primitives, then the key lifecycle (where most real risk lives), then the failure modes and the migration to post-quantum algorithms. It assumes you can read Python. It does not assume a math background beyond arithmetic.

The path#

From property to practice
flowchart LR
  P["<b>Property</b><br/><small>what must hold?</small>"] --> S["<b>Symmetric</b><br/><small>AEAD, MAC, KDF</small>"]
  S --> A["<b>Public key</b><br/><small>exchange, signatures, PKI</small>"]
  A --> K["<b>Keys</b><br/><small>lifecycle, HSMs, rotation</small>"]
  K --> AP["<b>Applied</b><br/><small>failures, PQC, agility</small>"]
  class P neutral
  class S,A compute
  class K good
  class AP warn
classDef neutral fill:#faf9f5,stroke:#5f5e55,color:#141413,stroke-width:1.5px
classDef compute fill:#ece4fb,stroke:#6431c0,color:#141413,stroke-width:1.5px
classDef memory fill:#ece4fb,stroke:#6431c0,color:#141413,stroke-width:1.5px
classDef queue fill:#ece4fb,stroke:#6431c0,color:#141413,stroke-width:1.5px
classDef io fill:#ece4fb,stroke:#6431c0,color:#141413,stroke-width:1.5px
classDef default fill:#ece4fb,stroke:#6431c0,color:#141413,stroke-width:1.5px
classDef warn fill:#f9e2e9,stroke:#b3154f,color:#141413,stroke-width:2px,stroke-dasharray:5 3
classDef good fill:#e2efd8,stroke:#2b6a24,color:#141413,stroke-width:2px

How each lesson works#

  1. The idea in one minute. The claim, before the detail.
  2. A picture of the construction or the failure.
  3. How it really works, with the standards (NIST, IETF RFCs) named.
  4. Code: small Python programs using only the standard library (hashlib, hmac, secrets). Where the standard library has no primitive, the lesson builds a toy version to show the mechanism and says so plainly.
  5. Where it breaks. The assumption that, once violated, defeats it.
  6. Remember this, Try it, and Check yourself.

What you need#

  • Python 3.10 or newer and a terminal. Every program runs offline.

The modules

1

Foundations

The habits every later module depends on: name the security property first, trust only real randomness, know what a hash does and does not promise, and leave primitive design to specialists.

  1. 1.aStart from the property18 min
  2. 1.bRandomness and entropy22 min
  3. 1.cHash functions17 min
  4. 1.dWhy not to roll your own19 min
2

Symmetric cryptography

The shared-key primitives that do most of the work in real systems: block ciphers and their modes, authenticated encryption, MACs, and key derivation.

  1. 2.aBlock ciphers and modes20 min
  2. 2.bAuthenticated encryption20 min
  3. 2.cMACs and HMAC21 min
  4. 2.dKey derivation20 min
3

Public-key cryptography

Key exchange, signatures, certificates, and the TLS handshake that combines them: how two parties who share nothing end up with keys they can trust.

  1. 3.aKey exchange21 min
  2. 3.bDigital signatures22 min
  3. 3.cCertificates and PKI20 min
  4. 3.dThe TLS handshake20 min
4

Key management

Algorithms are rarely what fails; keys are. This module covers the key lifecycle, envelope encryption and KMS, HSMs and key ceremonies, and rotation and revocation.

  1. 4.aThe key lifecycle18 min
  2. 4.bEnvelope encryption and KMS18 min
  3. 4.cHSMs and key ceremonies22 min
  4. 4.dRotation and revocation21 min
5

Applied cryptography

Where cryptography meets real systems: the failure classes that cause breaches, side channels and constant-time code, the migration to post-quantum algorithms, and the agility and inventory that make the next migration survivable.

  1. 5.aHow cryptography fails in practice15 min
  2. 5.bSide channels and constant-time15 min
  3. 5.cPost-quantum migration14 min
  4. 5.dCrypto-agility and inventory15 min
← Back to the library