You can simply use LUKS in detached-header mode:
cryptsetup luksFormat /dev/sda4 --header ~/lukshdr --align-payload 0 --cipher twofish cryptsetup open /dev/sda4 --header ~/lukshdr mycrypt cryptsetup luksSuspend mycrypt --header ~/lukshdr cryptsetup luksResume mycrypt --header ~/lukshdr
You can put the header file wherever you want, including a block device.
~/lukshdr
must be at least 1049600 bytes in size for luksFormat
to work:
dd if=/dev/zero bs=1049600 count=1 > ~/lukshdr
If you run lsblk -b
, you will see that the size of the mapped device precisely equals the size of the LUKS device; there's no room where any header or metadata might hide.
$ lsblk -b NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 80026361856 0 disk ├─sda1 8:1 0 254803968 0 part /boot ├─sda2 8:2 0 5999951872 0 part [SWAP] ├─sda3 8:3 0 19999490048 0 part / └─sda4 8:4 0 53771067392 0 part └─mycrypt 254:0 0 53771067392 0 crypt /tmp/mnt
In fact, as long as the underlying ciphers remain unbroken, the LUKS device will look just like random data to anybody who doesn't have the header file.