LUKS (Linux Unified Key Setup) is the standard specification for block device encryption on Linux, created by Clemens Fruhwirth in 2004. It sits above the kernel’s dm-crypt subsystem — which performs the actual AES sector-by-sector encryption via the device mapper — and adds a structured, on-disk header that decouples key management from the encryption itself. Any block device can be a LUKS container: a partition, a logical volume, a loop device; anything that sits beneath it (filesystem, swap, LVM) is encrypted transparently, with no changes required to the software using it. The managed cryptsetup tool and the libcryptsetup library provide userspace access to LUKS volumes, and are the canonical interface for all operations on them.
The architectural centrepiece of LUKS is its volume key (also called the master key): a randomly generated key that directly encrypts the block device data and never changes for the lifetime of the volume. What LUKS stores in its header are not the volume key itself but the volume key encrypted by each active unlock credential, one per keyslot. LUKS1 supports 8 keyslots; LUKS2 (the current format, required by most modern tooling) supports 32. This design means multiple independent passphrases or tokens can unlock the same volume, and revoking one — by wiping its keyslot — does not require re-encrypting the device. Losing the header, however, makes the volume permanently unrecoverable, since no other path to the volume key exists.
LUKS2 introduced a token mechanism that embeds metadata in the header to describe how a keyslot can be unlocked by means other than a passphrase. systemd-cryptenroll uses this to enroll TPM2 chips, FIDO2 hardware tokens, and recovery keys as first-class unlock methods alongside or instead of passphrases. TPM2 enrollment seals the volume key against a set of PCR values — by default PCR 7 (Secure Boot state) — so the disk unlocks automatically at boot only if the system’s measured boot state matches what was present at enrollment time; any change to the firmware, bootloader, or Secure Boot configuration breaks the seal and falls back to requiring a passphrase. This is the mechanism that ties LUKS disk encryption into the broader measured boot stack: TPM PCR binding, UKI-based boot, and Secure Boot enforcement together form a chain in which LUKS-encrypted root filesystems unlock automatically on a verified boot and require manual intervention on anything else. The alternative network-based approach — Clevis with a Tang server — releases the unlock key from a remote server only when the client can prove it is on a trusted network, providing a complementary model without requiring a local TPM.
