Shell TrueCrypt on OS X

TrueCrypt Command Line Help window

As I've discussed before I'm a very heavy TrueCrypt user because I have me some secrets (COUGH!), it makes available my favourite cipher, its simple to use and its cross platform. The graphic interface is a bit kludgey though, so as I do with OS X's hdiutil I've started getting used to using it on the command line.

The problem is, due to Mac OS X's unconventional Unix file system structure, to use it in its default state you have to enter this:

% cd /Applications/TrueCrypt.app/Contents/MacOS/
# ./TrueCrypt [arguments and crap]

Ugh! Basically I can see three ways around this. Firstly you could copy the executable over to a location that’s in your shell’s $PATH variable, but that’d be less than ideal because you’d need to copy this every time you upgrade the original. Secondly, you could simply add the narly TrueCrypt application folder to the $PATH itself, but if you’ve formatted your Mac with a case sensitive file system you’d still need to remember to enter TrueCrypt not truecrypt which would take more effort.

The easiest answer (which makes my question why I even bothered to mention the previous ones!) is just to use a symbolic link which can take care of future upgrades and case sensitivity.

% cd /usr/local/bin/
# ln -s /Applications/TrueCrypt.app/Contents/MacOS/TrueCrypt truecrypt

Budda boom! Now you can just open a shell wherever you are and do things like this:

% sudo truecrypt --mount -k keyfile Thingy.tc

For more information on using TrueCrypt with the command line, shell or whatnot, take the above steps then run truecrypt -h.