Lion Cipher Lab

Guarantee a read-only root filesystem's integrity with dm-verity

Why it matters

Encryption gets all the attention, but a huge class of real attacks never touches your secrets — it changes your system. A rootkit in a system binary, a poisoned shared library, a backdoored init script: none of that is a confidentiality breach, it's an INTEGRITY breach, and encryption alone does nothing to stop it. dm-verity is the Linux answer, and it's not a niche tool — it is the mechanism underneath Android Verified Boot and ChromeOS, guaranteeing that the system partition on billions of devices is byte-for-byte what the vendor shipped. The idea is beautiful and worth internalizing by…

What you'll learn

Steps in this lab

  1. What dm-verity actually is: a Merkle tree over a read-only device
  2. Install veritysetup and confirm device-mapper works here
  3. Build a small read-only ext4 image and populate it
  4. Format the hash tree and capture the ROOT HASH
  5. Open the verified device, mount it read-only, and prove normal reads work
  6. The money shot: tamper one byte and watch the read FAIL
  7. The root hash is the whole trust anchor (and why unsigned = worthless)
  8. When NOT to use verity, and the confidentiality gap
  9. The judgment: what verity really buys, and how a pro ships it

Open the full interactive lab →