#!/bin/bash # Mount an encrypted loopback disk image. # Setting this up: # modprobe cryptoloop # modprobe aes # dd if=/dev/urandom of=.container.img bs=1M count=8192 # for an 8GB image # losetup -e aes /dev/loop0 .container.img # mkfs.ext4 /dev/loop0 # Then run this script to mount the image to /secure (create this folder in # advance, or use a different folder). `umount /secure` to unmount. # --Kirsle # http://sh.kirsle.net/ sudo modprobe cryptoloop sudo modprobe aes sudo losetup /dev/loop0 ~/.container.img echo "cryptsetup" sudo cryptsetup -y luksOpen /dev/loop0 ~/.container.img sudo mount -o loop,encryption=aes ~/.container.img /secure