⛓️ Key Chains
Symmetric Key Ratchet Explained
In 15 minutes: Understand how KDF chains derive message keys
Prerequisite: What is Ratcheting
🎯 The Simple Story
Alice and Bob have a root key RK. How do they get a message key for each message?
KDF Chains!
- RK → Chain Key CK (sending/receiving)
- CK → Message Key K1 → Use → Delete
- CK → New CK (KDF of old CK)
- New CK → Message Key K2 → Use → Delete
- ...
Each step uses a KDF - one-way function. Can't go back!
🧠 Mental Model
Hold this picture in your head:
Root Key RK (from X3DH):
↓
KDF_R (root → chain)
↓
Chain Key CK1
↓
KDF_C (chain → message)
↓
Message Key K1
↓
Encrypt Message 1
↓
Delete K1 (gone!)
↓
CK1 → KDF → CK2 (next chain key)
↓
Chain Key CK2
↓
KDF_C
↓
Message Key K2
↓
Encrypt Message 2
Think of it like:
🎢 Recipe chain (Recipe for recipe for ingredient)
🌳 Family tree (Parent → child → grandchild keys)
🔢 One-way sequence (Can compute K2 from K1, not K1 from K2)
📊 See It Happen
Key derivation flow: