Tuesday, June 9, 2015

A simple TrueCrypt alternative on Linux

A lot of people who were security conscious use TrueCrypt for disk encrytion. Sadly it was discovered to contain security vulnerabilities and for a while now it has been deemed unsafe to use. Thankfully there is an effort to audit the code. So hopfully this may be resolved in the future. Till then there is a really simply way to get portable disk encryption under Linux.

First verify that the package cryptsetup is installed. If not then install it, sudo apt-get install cryptsetup. Once this is installed use the command fallacate to create a file of a paticular size (for example 100M).

rican-linux@lubuntu-powerpc:~/Public$ fallocate -l 100M test.img
rican-linux@lubuntu-powerpc:~/Public$ du -h test.img
100M test.img

What the command did was creat the file test.img and allocate 100M of disk space to it. The extension is really not needed you create a drive without it. The next steps will be to use the disk utility that comes with the Linux desktop you installed to make this file into a loopback drive then create and encrpyted partion using LUX.

First open the disk utility and select attach image.

Then goto the directory where the file is located. Before you select the file uncheck the read-only option on the bottom, then select attach. The file should now be seen as a loopback drive in the disk utility.

Once mounted use disk utility to format the loopback device with ext4.

Once the device is formated to created your encrypted partition select create new parttion.


Then enter the passphrase used to encrypt the volume. Be sure to make it complicated! Now you have a portable encrypted filesystem.


  1. Truecrypt was audited a couple months ago and found to be completely safe.

    1. I was under the impression that it was still being reviewed.