|Version 2 (modified by dkg, 6 years ago) (diff)|
LUKS is the modern linux standard for encrypted block devices. It's a good, simple way to encrypt any data that needs to be written to disk
The idea behind LUKS starts with the fact that a given disk (or partition) is treated by the computer a block device.
Normally, you'd put a filesystem directly onto the block device. With LUKS, there is a short header at the start of the block device that contains a well-scrambled secret key and a set of 1 or more scrambled passphrases.
When you want to use a LUKS-formatted volume, the computer you're using asks you for a passphrase (or a passphrase file). It uses that passphrase with one of the scrambled passphrases to unscramble the secret key. The key is then used to unscramble sections of the underlying block device as they are requested by the OS. This is represented as a new virtual block device available to the system. A regular filesystem can be written to the virtual block device, and the actual data stored on disk will be encrypted.
advantages of LUKS
encrypting at the block device layer means that you can put whatever type of filesystem you want on the virtual block device it exports, and the filesystem code doesn't need to know anything about encryption.
the LUKS header contains information about what kind of key is used, and what cipher (method of block-device encryption) is used (there are several different standards). By including that information in the header, if the "default choice" of key type or cipher changes in the future, you'll still be able to access your old volumes.
Having a set of key slots allows you to give different people the right to decrypt the volume, without asking them to share a passphrase. More importantly, it also allows you to change the passphrase without having to rewrite the entire disk
disadvantages of LUKS
It seems like having key type/size and cipher info in the LUKS header would reduce the search space for any attacker trying to recover data from the device, because they only need to search within one algorithmic scheme.
cryptsetup (a common GNU/Linux userspace tool for managing LUKS volumes) also somehow knows when your passphrase is wrong. I'm not sure how that works, but if it knows that it's wrong, presumably an attacker can determine the same thing. So all the attacker needs to break is your passphrase directly. This is probably no worse than other schemes, and isn't a very well-thought-out objection.
having a LUKS header at all is an indication to an attacker that you've got an encrypted volume in the first place. Something that looks like totally random data might be more secure in really paranoid situations.
Once an encrypted block device is "LuksOpen"ed on a computer, any process running as superuser on that computer has access to all the unencrypted data. If you want individual files to be opaque to the system administrator, you probably should encrypt those files individually somewhere else before transferring the encrypted version to the computer in question.