Ubuntu – Decrypt TrueCrypt containers using dm-crypt


Is it possible to decrypt TrueCrypt containers using dm-crypt?

I have some container files created with TrueCrypt and I just wanted to know if it's possible to decrypt them using dm-crypt so I can stop using TrueCrypt and use something more opensource like dm-crypt.

Best Answer

Yes you can do that. I use an external harddrive and mount it on my Ubuntu installations with cryptsetup/dm-crypt. But you need to update your cryptsetup packages to version 1.6 to get this functionality. I used this PPA on older Ubuntu releases.

Mounting a container is no different from mounting an encrypted partition as one would expect:

$ sudo cryptsetup tcryptOpen testcontainer.tc testcontainer

Now a new disk shows up in Nautilus or the launcher and you can mount it via Nautilus or terminal if you like. I mounted the container via Nautilus.

$ mount | grep testcontainer
/dev/mapper/testcontainer on /media/livewire/F29F-27D2 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)

Don't forget to unmount the filesystem and the container itself after unmounting the filesystem:

$ sudo cryptsetup tcryptClose /dev/mapper/testcontainer

While a GUI only solution to mount such containers and partitions the same way you can mount LUKS partitions would be more comfortable, it is currently not possible as it seems.

Automounting via pam_mount also seems to be not possible at the moment.