Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to http://16s.us/Linux/dm-crypt.txt, it's better to use only dm-crypt, because LUKS leaves a trace.

That's OK. But, what are the most secure cryptsetup parameters to use? E.g.: "aes-cbc-essiv:sha512" is better then the default. Also the default cryptsetup uses 256bit AES, but it could be (max?) 512bit. Which parameters create an encrypted partition with the most security?

share|improve this question

closed as not a real question by Gilles, Michael Mrozek May 22 '11 at 3:08

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

That document indicates that LUKS leaves a header -- but not that this is a bad thing! If you want your partition to not look like an encrypted partition, then yes, a header is a give-away. But there are several advantages to having one: it gives you the contextual information needed to decrypt it. Without a header, you will need both your passphrase and the precise parameters you used to encrypt the partition. In a recovery scenario, it's plausible you have have lost/forgotten the latter. – jmtd May 20 '11 at 12:43
“Most secure is meaningless”. And there's no point in hiding the fact that you have an encrypted partition: the fact that it contains random-looking bytes gives it away. – Gilles May 20 '11 at 21:37
up vote 2 down vote accepted

Hiding the fact that you are using encryption is very hard. Consider that some minimal decryption software (like in initrd) must be stored in plain text somewhere. Seeing that and a disk full of random data people might find out.

If you can't prevent that you might as well take advantage of LUKS. For example if you have multiple users they can have their own password.

About the cipher modes and algorithms. AES is the most widely used algorithm and it supports 128, 192 and 256 bit keys. None of them are even close to being broken. CBC means cipher block chaining. It should not be used for disk encryption because it is vulnerable to watermarking. Use the XTS mode instead. Essiv means that the IV is secret too. This also prevents watermarking. SHA512 is a hashing algorithm used to generate the encryption key from the password. It is considered secure.

You may want to look at loop-aes. It has no header, uses multiple 64x256 bit keys and you can use an external disk (like a pendrive) for storing the keys encrypted with your password. Unfortunately it requires kernel patching.

BTW I agree with the comments. There is no most secure way. Think about what are you trying to protect and what kind of attacks do you expect.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.