Using TrueCrypt from the command line in OSX

If you still love TrueCrypt and like to keep all you workflow inside the command line like me, this small guide is for you.

A comment before the installation

As you may know, on May 2014, TrueCrypt developers announced that the the project was discontinued and will no longer receive any updates and fixes. But before this happened, Kenneth White and Matthew Green planned, crowd-sourced, and executed an independent full-level security audit.

TL;DR: "The NCC audit found no evidence of deliberate backdoors, or any severe design flaws that will make the software insecure in most instances".

This means that it's OK to keep using TrueCrypt 7.1a. This being said, let’s continue with the installation guide.

Installation

  1. Download the TrueCrypt 7.1a Mac OS X.dmg file .
  2. Open the .dmg file and double click the .mpkg installer.

Yosemite Issue

If you are using Yosemite you will get this error and the installation blocked.

A TrueCrypt error when trying to install it without the fix

For some reason TrueCrypt thinks 10.10 is less than 10.4.

Fix

  1. Open the .dmg.
  2. Copy the content inside to a different location (the .dmg file is read only).
  3. Once you got your files inside something like ~/Downloads/TrueCrypt/, open the .mpkg package contents, then the /Contents folder.
  4. Open the distribution.dis file with a text editor.
  5. Remove lines from 13 to 18.

Snippet showing the code that you have to remove

  1. Save the file and open the .mpkg.

Sources:

Command line setup

After you install TrueCrypt you still can't use it from the Terminal, you need to put this in your ~/.bashrc or ~/.bash_profile:

alias truecrypt='/Applications/TrueCrypt.app/Contents/MacOS/Truecrypt --text'

Then it will be ready to use:

$ truecrypt

Usage: Truecrypt [--auto-mount <str>] [--backup-headers] [--background-task] [-C] [-c] [--create-keyfile] [--delete-token-keyfiles] [-d] [--display-password] [--encryption <str>] [--explore] [--export-token-keyfile] [--filesystem <str>] [-f] [--hash <str>] [-h] [--import-token-keyfiles] [-k <str>] [-l] [--list-token-keyfiles] [--load-preferences] [--mount] [-m <str>] [--new-keyfiles <str>] [--new-password <str>] [--non-interactive] [-p <str>] [--protect-hidden <str>] [--protection-keyfiles <str>] [--protection-password <str>] [--random-source <str>] [--restore-headers] [--save-preferences] [--quick] [--size <str>] [--slot <str>] [--test] [-t] [--token-lib <str>] [-v] [--version] [--volume-properties] [--volume-type <str>] [Volume path] [Mount point]

Basic usage:

Create a volume:

$ truecrypt -c -t

Mount a volume:

$ truecrypt secrets.tc /Volumes/truecrypt1

Unmount specific volume:

$ truecrypt -d /Volumes/truecrypt1

Unmount all volumes:

$ truecrypt -d

Full documentation and man page:

Related links: