Brice Goglin's Blog - Encrypting part of /home
May. 2nd, 2010
14:23 - Encrypting part of /home
I am preparing my switch to a new laptop at work in the next weeks. I am considering adding encryption to part of the hard drive, but I don't want to dramatically decrease performance. Encrypting the swap device or some .foo directories in $HOME looks like a good idea to protect private keys, keyrings, ... But encrypting git clones of large projects is probably useless.
So I am thinking of just having a small /home encrypted partition (a couple GB). I'd keep .foo directories in $HOME and only have symlinks to another non-encrypted partition where all my actual source code and other non-sensitive files would be.
Does this make any sense?
Cost of encrypting everything
Re: Cost of encrypting everything
http://www.phoronix.com/scan.php?page=a
I'd like to see some benchmarks with things like git blame in a clone of the kernel git tree, or a kernel build. Those would probably be good examples of my most disk-intensive workloads.
Also I wonder if the AES instructions in latest i7 processors will help that (I will have a i7-620M).
Re: Cost of encrypting everything
yes and no
Myself, I have used for the last 2.5 years a LUKS-formatted LVM holding everything except /boot. The only times I saw CPU usage going up were after boot and after waking from hibernation. Even on my low-grade laptop the bottleneck is most of the time the disk, not the CPU.
So, it makes some sense, but I'd say it's not worth the trouble.
Just don't forget encrypted swap.
Re: Just don't forget encrypted swap.
Why not try eCryptfs?
You can also use eCryptfs to encrypt a directory using what they call "Stacked Filesystem Encryption". This might make more sense in some context and might also perform better, though I have not really checked this.
Install ecryptfs-utils and run
as the user. This will encrypt your home directory and from now on, it will be automatically mounted and decrypted on login; and unmounted when you logout. The encryption key is based on your login password and libpam takes care of notifying ecryptfs to mount the directory.
If you just want to have an encrypted ~/Private, you could just run:
That is, without the -a.
It's not easy to be sure that you have nothing confidential on your machine. There are often dozens of identifiers and passwds in the browser config files or in your mail client cache for instance. Unless you really know everything you're doing, encrypting everything is a good way to make sure nothing confidential leaked when your machine got stolen.
ecryptfs seems to be what you want
http://sunoano.name/ws/public_xhtml/debi