Monday, November 5, 2012

How To Create An Encrypted CD/DVD Image From The Terminal - Ubuntu/Linux Mint


In this tutorial, we will learn how to create an encrypted iso image containing your data using the terminal under Ubuntu or Linux Mint. We will use the AES (Advanced Encryption Standard) encryption which will help us encrypt the entire disk image. You can later mount and burn the encrypted disk image to a CD or DVD.

Getting Started

Let's first install the Loop-AES command line tools with these commands:


sudo apt-get install loop-aes-utils aespipe 
sudo modprobe cryptoloop

1. Creating An Encrypted Disk Image

The command for creating an encrypted disk image is the following:

genisoimage -quiet -r ~/Desktop | aespipe -T -e aes256 > image.iso

~/Desktop >>> Replace it with the path of the folder containing the data to be added to the iso file

image.iso >>> this is the name of the iso file to be generated. You can set any name of your choice.

You will be prompted to enter a passphrase two times of at least 20 characters. Your iso image is now encrypted and can't be mounted unless the user provides the correct passphrase.

2. Mounting An Encrypted Disk Image

Via the terminal, create a mount point with this command:

sudo mkdir /media/iso

Mount now your iso file with this command:

sudo mount -o loop,encryption=aes256 image.iso /media/iso

After entering your user password, you will be prompted to submit the passphrase associated with the iso file.

3. Burning An Encrypted Disk Image

You can burn your encrypted iso image with any software of your choice. For burning iso files from the terminal, you can use wodim. To list your burning device with wodim, run this command:

wodim --devices

For my system, the burning device is mounted as /dev/sg1


$ wodim --devices
wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
 0  dev='/dev/sg1'      rwrw-- :  'Slimtype' 'DVD A DS8A5SH'
-------------------------------------------------------------------------

So, to burn the iso file, run this command:

wodim dev=/dev/sg1 image.iso

1 comment:

  1. Use caution with this if you are running Mint 13 Maya with MATE desktop. The apt-get function wants to remove a lot of MATE apps during the install. Here's the removal warning when you attempt to install loop-aes-utils & aespipe and if you do the install you WILL screw up your current system.

    "The following packages will be REMOVED:
    caja ffmpegthumbnailer-caja fuse fuse-utils gvfs-fuse libmate
    libmatecomponentui libmatepanelapplet libmateui mate-applets mate-netspeed
    mate-panel mate-power-manager mate-screensaver mate-sensors-applet
    mate-session-manager mate-utils mate-vfs mintdesktop mintmenu ntfs-3g
    python-mate"

    ReplyDelete