Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc



Did you ever want to back up sensitive information in an easily accessible encrypted form? Now you can.

Note: according to HOWTO Burn Encrypted Optical Media With Luks this method is "not safe" for journaling filesystems, including ext3/reiserfs.

Required Kernel Modules

Device Drivers ->
 Block Devices ->
  <M> Loopback Device Support
   <M> Cryptoloop Support
Cryptographic options ->
 <M> AES cipher algorithms

Install dependencies

emerge aespipe

see also

Choose your key length

We will be using the AES ciper because it offers great performance. Choose from either 128 or 256 bit key lengths, depending on your box's processing power.

Choose your password

Choose a 20 character password (aespipe requires this) and don't forget it, or you'll never get your data back!

Create your DVD Image

Create a directory called DVD. Copy or move the files you want to back up into that directory. Make sure that the size of contents of the directory will fit on your target disk's size. For CDs, don't go over 703 MB and for single-sided, single-layered DVDs, stay below 4.4 GB. Double-/Dual-layer DVDs can hold approximately 8 GB.

mkisofs -r DVD | aespipe -e AES256 > DVD.iso

You will be prompted for the password you chose earlier, so enter it.

Mounting the Image

This is the best way to test your image before you burn it. Assuming you are using a 128 bit ciper: modprobe aes; modprobe cryptoloop; mount -t iso9660 DVD.iso /mnt/iso -o loop=/dev/loop0,encryption=AES128

Burn the Image

Burn the image using your favorite burning program. K3B works just fine. Ignore any warnings about the image being invalid or corrupted, it will work anyway.

Mounting the DVD

Assuming your dvd drive is /dev/dvd and you are using a 128 bit ciper::

modprobe aes; modprobe cryptoloop; mount -t iso9660 /dev/dvd /mnt/iso -o loop=/dev/loop0,encryption=AES128


I wrote a bash script, which creates, mounts and burns an encrypted iso.

Retrieved from ""

Last modified: Mon, 21 Jul 2008 21:41:00 +0000 Hits: 12,743