Yet another thing that has been on my TODO list for quite a while: encrypted USB thumb drives and/or encrypted external USB hard drives.
I have finally tried this over the weekend using loop-AES. This is very useful for securing your USB thumb drive contents in case you lose it or it gets stolen. Also, I use an external USB hard drive for backups (previously unencrypted). This is encryped now, too.
Here's a quick HOWTO:
AES encrypted loop device support" in "Device Drivers -> Block Devices -> Loopback device support", and recompile the kernel.loop encryption key scrubbing support" as it seems to promise higher security (can anybody confirm that?).apt-get install loop-aes-2.6-686 (or a similar package) should suffice.
losetup, mount etc.:apt-get install loop-aes-utils
shred -n 1 -v /dev/sda3.-n 25 or higher if you want more security and have a few days time to wait for the thing to finish...
losetup -e aes256 -C 3 -S 'seed' /dev/loop0 /dev/sda3.-C 3 means "run hashed password through 3000 iterations of AES-256 before using it for loop encryption. This consumes lots of CPU cycles at loop setup/mount time but not thereafter." (see losetup(8)). This is supposed to be more secure.-S 'seed' (replace "seed" with a secret string like "g7sN4" or something) should make brute force attacks a bit harder. Don't forget the seed!mke2fs -j /dev/loop0losetup -d /dev/loop0/etc/fstab:/dev/sda3 /mnt/crypted_sda3 ext3 noauto,loop=/dev/loop0,encryption=AES256,itercountk=3 0 0
mount -o pseed=seed /mnt/crypted_sda3/mnt/crypted_sda3 which will be encrypted automatically.For a more detailed guide read the Encrypted-Root-Filesystem-HOWTO. A performance comparison of different ciphers is available, but in general I didn't notice too much of a slow-down because of the encryption...
Comments
Encrypted USB thumb drives and (USB) hard disks using loop-AES
I feel that dm-crypt works faster, it is also secure and no way be compared by Loop-Aes.
no need for kernel patches
loop-aes builds a module by default. there is no need for kernel patches at all.
One should use the more
One should use the more secure v3 operating mode of loop-aes with gpg-encrypted keyfiles instead of the single-key mode. The iteration count and seed only apply to the old v1 single-key mode.
look at GELI
You should really take a look at GELI on FreeBSD. There was a very, very interesting talk at 22C3 by Jacob Appelbaum (still waiting for the video) and he said: cryptoloop is shit, it has a real bad design and is a stupid implementation!
Cryptoloop and loop-aes are
Cryptoloop and loop-aes are actually two separate projects.
http://mareichelt.de/pub/notmine/linuxbsd-comparison.html
Loop-aes is probably more secure than dm-crypt, since loop-aes supports multi-key mode. Dm-crypt is cryptoloop's successor.
GELI
Hm, I'm using Debian, and I don't see me switching to FreeBSD anytime soon ;) Anyways, I'll definately watch Jacob Applebaums video as soon as it's available...
apt-get install cryptsetup
I suggest to use cryptsetup to automate all the handling of loop device and mounting. It's very nice and handy.
Ciao,
Enrico
crypsetup and loop-AES?
That package looks nice, but it's intended to be used with dm-crypt, right? Or is there a way to use it with loop-AES?
Loop-AES is said to be a bit faster and more secure than dm-crypt, that's why I chose it.