I have a T61 with C2D T7300 CPU/4 GByte RAM. I has SL 6.3 on it, and I ticked the encrypt VG during install. If I start a "normal" windows xp on it, its ~slow.. so.. I need a little performance boost :)

Loud thinking/QUESTION: kcryptd could take ~20% (!) of CPU, but encryption is needed.. soo I was thinking that how can I encrypt only the home directory of that 1 user (and AES256 isn't needed, just a very-very light encryption, so that a burglar can't access the data on the notebook, I'm not defending against the "CIA" :D or at least a lighter encryption)

UPDATE: I'm voting for:

aes-ecb-null -s 128

So before the install I have to manually create the partitions. AFAIK using this and not using the default could really increase performance.

UPDATE2: https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-LUKS_Disk_Encryption.html - so looks like they are using 512 bits aes-xts-plain64.


There are three main storage encryption possibilities under Linux. Ordered from lowest level to highest level, from fastest to slowest, from least flexible to most flexible:

  • Dm-crypt to encrypt a whole filesystem (or more generally any storage device). You get the best performance, but you have to decide to use it when you organize your storage partitions, and there's a key per partition.
  • Ecryptfs to encrypt a user's home directory. Each user has their own key. The encryption is performed in the kernel, but the encryption is at the file level rather than at the block level which slows things down.
  • Encfs to encrypt a few files. This can be set up by an ordinary user, as it only requires the administrator to provide FUSE. You can easily have multiple filesystems with different keys. It's slower than the other two.

Given your constraints, dm-crypt is clearly the right choice. You can get better performance by encrypting only the files that need to be encrypted, and not the operating system. If you haven't really started to use your new system, it'll be simpler to reinstall, but you can also work on your existing system by booting from a live CD such as SystemRescueCD.

Make a system partition and a separate /home partition, or even a separate /encrypted partition if you don't want the whole home directory to be encrypted but only some selected files. Make a dmcrypt volume for the one filesystem that you want to encrypt.

There might be a little to gain by choosing the fastest cipher. AES-128 instead of AES-256 should give you a very slight performance increase at no cost to security. Pick CBC rather than XTS for the cipher mode, since you don't need integrity: cryptsetup luksCreate -c aes-cbc-sha256 -s 128. You can even choose aes-cbc-plain as the cipher: it's insecure, but only if the attacker can plant chosen files on your system, which doesn't matter for your use case; I don't know if there's any gain in performance though. The choice of hash (-h) only influences the time it takes to verify your passphrase when you mount the disk, so don't skimp on it.

  • "aes-ecb-null -s 128" is the winner for me afaik, If I will have time, I will try it. Thanks! – gasko peter Nov 8 '12 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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