Mount an encrypted file as loopback device (linux)

  1. Make sure you have the required modules in the kernel. Use ‘modprobe cryptoloop’ and ‘modprobe aes’.
  2. Create empty 100MB file image  named MyImage.img with ‘dd if=/dev/urandom of=MyImage.img bs=1M count=100’. Be warned, this my take some minutes.
  3. ‘losetup -e aes /dev/loop0 MyImage.img’ connects your image to loop0.
  4. You have to enter your new password now.
  5. With ‘mkfs -t ext2 /dev/loop0’ formats your new ‘drive’.
  6. ‘mount /dev/loop0’ and
  7. ‘mount -o loop,encryption=aes MyImage.img /mysafe’ mount your new document safe to /mysafe. You might need to create /mysafe before that.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: