EncryptedFilesystems

From code/src wiki
Jump to: navigation, search

Creating the filesystem

sudo modprobe cryptoloop
sudo modprobe aes
dd if=/dev/zero of=$HOME/filesystem.aes bs=1M count=100
sudo losetup -e aes -k 256 /dev/loop0 $HOME/filesystem.aes
sudo /sbin/mkfs.ext2 /dev/loop0
sudo mkdir /mnt/filesystem.aes
sudo mount /dev/loop0 /mnt/filesystem.aes/

Subsequent mounts

sudo modprobe cryptoloop
sudo modprobe aes
sudo losetup -e aes -k 256 /dev/loop0 $HOME/filesystem.aes
sudo mount /dev/loop0 /mnt/filesystem.aes/

Unmounting

Remember to delete the /dev/loop0 device when unmounting, or else the data will still be accessible in its uncrypted form

sudo umount /mnt/filesystem.aes/
sudo losetup -d /dev/loop0
Personal tools