Lion Cipher Lab

Leak a secret across the CPU cache with a Flush+Reload side channel

Why it matters

You can implement a cipher whose math is flawless and still hand an attacker the key -- because the CPU underneath you is quietly narrating what your code does. A cache side channel doesn't factor your modulus or guess your key; it measures a physical fact of the hardware: memory you touched recently is cached, and a cached read is several times faster than an uncached one. Flush+Reload turns that timing gap into a covert channel. An attacker flushes a shared memory line out of the cache, lets your code run, then times how long it takes to read that line back -- if it's fast, your code…

What you'll learn

Steps in this lab

  1. What a side channel is, in one breath
  2. Set up a Linux box (and why WSL2 / a VM may lie to you)
  3. Calibrate: see the hit/miss gap with your own eyes
  4. Build the channel: a page-strided probe array + a secret-indexed victim
  5. Flush, run the victim, reload-and-time: read the secret out
  6. Failure mode you reproduce: the prefetcher (why you STRIDE)
  7. The channel's other fragilities: threshold, shared pages, VMs, jitter
  8. The whole point: constant-time code and the AES T-table lesson
  9. The judgment call: 'it's encrypted' is not the same as 'it's safe'

Open the full interactive lab →