On May 7, 2014, at 21:57, "J. Roeleveld" <jo...@antarean.org> wrote:

> The create and remove commands with LUKS also require root. They use a 
> session manager in desktop environments to allow users to do it. Sudo with a 
> secure wrapper script might be sufficient for you?
> 
> I was wondering. What is the actual reason why cryptsetup has a LUKS and 
> non-LUKS set of options?

Well that is of course to let you have the control over how the encryption is 
done.

In the kernel point of view the disk encryption is just bare encryption with 
the given parameters. These include the cipher (AES etc), the mode (CBC, CTR 
etc) and Initialization Vector (IV) creation (ESSIV etc) and last but not least 
the key that is used with the cipher. Now without LUKS cryptsetup just sets 
these parameters and you have to provide them each time to cryptsetup when you 
are using your encrypted volume.

With LUKS cryptsetup will store all these parameters in a binary format. By 
default this binary data is stored at the beginning of the disk. Kernel then 
only uses the remaining disk space for encryption. The binary data at the 
beginning of the disk is not encrypted because the setup would the be 
unreadable.

When you setup a LUKS partition, cryptsetup creates a random key used for 
encryption the partition. Using a random key for disk encryption is an absolute 
MUST! A hash of this key is stored in binary data to do key verification. By 
default a 128k salt is created for each password you wish to use to access the 
disk (anti forensics). The disk key is then encrypted with the salt and the 
password. The salt and the encrypted key is stored in the binary data.

If the salt is lost, the disk key is lost and recovery of your data is 
virtually impossible with only your password. With only the password it is 
impossible to decrypt the disk. If you have a backup of the disk key, with that 
key you can decrypt the disk without the password.

All the steps done by LUKS are necessary for a proper disk encryption! If you 
do not use LUKS you need to write your own software to do the necessary steps! 
Cryptsetup without LUKS uses just a plain hash function without a salt to 
derive disk key from your password. The entropy in this kind of key creation is 
not nearly enough for secure disk encryption!

Unless you know what you are doing use LUKS.

-- 
-Matti



Reply via email to