LUKS
LUKS is a disk-encryption metadata format that stores cipher parameters and keyslots so that several passphrases or keys can unlock one volume key.
LUKS1 has a binary header and eight keyslots for independent passphrases that unlock one volume key. LUKS2 stores most metadata in JSON and limits keyslots only by header area size, while the reference implementation allows 32. Its binary header occupies one 4096-byte sector, of which 512 bytes are used, and the secondary header starts at one of nine fixed offsets from 16 KiB to 4 MiB. [4] The format names no particular cipher, and integrity protection stacks the encryption mapping on a dm-integrity device. LUKS2 can also manage hardware encryption on OPAL self-encrypting drives with Linux 6.4 or later. [1]
Relations
- related
- LUKS header backup, LUKS keyslot, dm-crypt, XTS-AES, Authenticated encryption, Backup, Cryptographic erase
Advantages
- Primary and secondary copies of the binary and JSON areas, together with a metadata checksum, allow a damaged header to be detected and recovered. [4]
- Passphrases can be revoked or changed individually because each one uses its own keyslot. [1]
Limitations
- Recovery copies of the header/keyslots are security-sensitive, not harmless configuration exports. [2]
- Binary keyslot data have no redundant copy, so damage to a keyslot area is not repaired from the secondary header. [4]
- In authenticated encryption mode, discards cannot be passed through because the kernel encryption target does not support them when dm-integrity provides tag space. [1]
Citations
- cryptsetup v2.8.1 manual: LUKS, authenticated disk encryption and OPAL extension
- cryptsetup-luksHeaderBackup(8): header backups and retained decryption access
- Broz. LUKS2 On-Disk Format Specification, version 1.1.4 (2025-06-16), sections 1-2.
Further reading
Sources & caveats
- luks2-spec is the LUKS2 On-Disk Format Specification version 1.1.4, read in sections 1 and 2 for keyslot limits, header layout and offsets.
- cryptsetup-source is the v2.8.1 reference manual page, read for keyslots, authenticated disk encryption, discard support and the OPAL extension.
- luks-header was not re-read and is kept only for the existing header-backup limitation.