Loop-AES crypto container

From NAS-2000.org

Jump to: navigation, search

In order to protect your data you may want to use a encrypted container.
Creating a encrypted loop-AES container is strait forward.

1. create a container (100MB)

 dd if=/dev/zero of=./crypt.img bs=1k count=102400

2. bind the container to a loop-device

 losetup -e AES128 /dev/loop1 ./crypt.img

3. create a filesystem (ext2)

 mke2fs /dev/loop1

4. remove the loop-device

 losetup -d /dev/loop1

5. create the mount point

 mkdir crypto

6. mount the crypto container

 lomount -t ext2 -o loop=/dev/loop1,encryption=AES128 ./crypt.img ./crypto

7. umount the crypto container

 loumount ./crypto

To setup a crypto container you'll need step 1-5.
For the every day use step 6 and 7 are needed.

Please Note:
Because you don't have to retype your password make sure to umount and remount the container befor you start to copy files into it!

Personal tools