This is part 4 of an article on using TrueCrypt, a free, open source, on the fly encryption utility for Windows and Linux. Here’s the other parts:
- Part 1: why privacy tools?
- Part 2: why PGP isn’t good enough
- Part 3: installing and using TrueCrypt part 1
- And this article finishes it off: more on using True Crypt.
Last time I talked about using TrueCrypt on a file-based volume, and I reported that, unless you were running some heavy background tasks, you almost certainly won’t be inconvenienced by the extra time the encryption and decryption take, and you may not even notice any time difference between reading and writing an encrypted volume and reading and writing an unencrypted volume.
I also reported on using a hidden volume, which worked exactly as advertised: enter one passphrase and TrueCrypt will mount the regular volume; enter another passphrase and it mounts the hidden volume.
Up an Order of Magnitude
I decided to take it up a step, from a 700MB file to an 80GB USB drive I had lying around. You know how it is with disc drives: unless the drive is broken, it’ll never be empty. So while I wanted to test a device volume by formatting the whole disc, I didn’t have enough convenient places to stuff the files that were already on it, so I ended up making a 50GB partition.
They warn you that seek time will be hideous if the file is seriously fragmented, so I defragged the disc on the USB drive. Since I only had USB 1.1 on the ancient laptop I was using, that took a whole day. And then when I had TrueCrypt format the volume, that took another day. I just about gave up on the idea of putting a hidden volume in there, but I figured, in for a penny, in for a pound, and to my delight I discovered that it only took a few seconds to format the hidden volume.
Writing to the Outer Volume and Hidden Volume
Then I experimented with adding files to each volume. That’s not quite as straightforward as it sounds. There is no way for TrueCrypt to know, even after it’s mounted the outer volume, that there is a hidden volume. If it could tell, so could an adversary. But when you’re writing to the outer volume, it’s kind of important to keep from writing on sectors that have been set aside for the hidden volume. Hmmmm. Fortunately, there’s a way around this. When you mount the outer volume, and before you write anything to it, select the “Mount Options” button on the Mount dialog box and you’ll see another dialog box like this pop up:
Click the checkbox to protect the hidden volume and enter the passphrase for the hidden volume in this window. Enter the passphrase for the outer volume in the other Mount dialog box (that’s where you usually type it). If you typed both passphrases correctly, you’ll get a verbose little dialog that tells you that you were successful. Now you can write to the outer volume without having to worry about messing up the hidden volume.
Notice that, if you’re writing to the hidden volume, you don’t have to do anything special. When you had TrueCrypt format the volume, it already allocated all the sectors it intends to use, and the hidden volume knows where all its sectors are.
Crash!
No sooner had I finished setting up my 50GB volume (with a 25GB hidden volume inside) and transferred some files to the two volumes to test it out, my computer died.
I considered that an opportunity! I copied the 700MB file to my new laptop, slipped the CD where I’d burned another volume into the CD drive, plugged the USB drive into my laptop, and they all worked fine. I know, these encrypted volumes shouldn’t have required any information from the computer that had created them — that information could probably serve as a back door to clever cryptographers. But it’s nice to see it with your own eyes. If you’ve got the file and you’ve got the password and you have TrueCrypt installed on any machine, you’re in.
The Glitch
Sometimes when I mounted a volume, it came up like a removable drive: no Recycled folder, no System Volume Information folder, and when you delete a file it’s gone. Other times it came up as an internal drive: those folders were present, and when you deleted a file on that volume, it went to the recycle bin, where it could be retrieved. And I think that indeterminate way of mounting a volume got me into trouble. Somewhere along the line, I ended up with a folder on my outer volume whose files and subfolders had nonprintable names. And unless you were very, very careful (e.g., don’t write to the volume root), you could get an error message and the files wouldn’t save.
Note to self: when you’re writing to a removable drive and it uses buffered I/O, use Copy, not Move. Fortunately, none of the files I’d put on there before were hosed, and it wasn’t very hard to replace the files that I only thought I’d copied. And too, the inner volume kept working fine. But I was suspicious, so I decided I’d better get the files off that disc as quick as I could.
A Device Volume
After burning a few of the larger files to CD, listening to others and deciding I didn’t like them anyway, and stuffing files here and there, I ended up with an empty 80GB drive. I formatted it like before (except that with the new PC and a USB 2 interface, it only took 2 hours.
I found an Options dialog, and sure enough, you can tell TrueCrypt to always mount volumes as removable. I can live with the pain of having files go away forever when I delete them (that’s what backups are for) so long as I can be sure that the only time the computer writes to that volume is when I tell it to.
After I started mounting volumes as removable by default, I haven’t seen the glitch return.
By the way, I’m in love with device volumes. Unless you really do have a need for layers of security, the device volume presents such a blank, featureless face to an attacker that I can’t see why you’d use hidden volumes on a device volume.
Options
There’s another couple of options I have checked in that last figure that I’d like to mention. By default I mount volumes as read-write, not read-only (when I need to, I can do that using the Mount Options dialog). If you enable the “background task”, whenever there’s a volume mounted, when you exit from TrueCrypt it’ll stick around in the tray. When you’ve dismounted the last volume, exiting from TrueCrypt makes it exit for real. Very slick.
And I’ve also got it set up so that if I wander away with a volume mounted and the thief doesn’t grab it right away but waits long enough for the screen saver to come on, TrueCrypt will dismount the volume automatically. I don’t understand enough about power saving mode to know whether it’s a good idea or a bad idea to check that box, so I left it unchecked.
Backing Up
TrueCrypt puts headers on your volume (they’re encrypted, of course). Your passphrase decrypts the headers and then the headers let you go find the sectors where your files are. Obviously losing those headers is a very bad thing. So, just in case, TrueCrypt lets you save the headers from all your volumes in a set of files you’d hopefully back up 6 ways from Sunday. The headers never change, unless you change your password, so you can save them early. Since some volumes have hidden volumes inside them and others don’t, TrueCrypt saves not only the outer volume header, but the sectors where the hidden volume header would be if there is one.
Limitations
One fairly substantial limitation is that you have to figure out the size for your volumes before you create them. You can’t make them bigger or smaller. Well, actually there’s a way using sparse NTFS files to make a partition that can grow, but (a) it doesn’t support hidden volumes, and (b) I didn’t understand it and didn’t want to try it. Help yourself if you want.
Also (this is on their to-do list) you have to use printable ASCII characters for your passphrase. This isn’t a huge annoyance compared with systems that restrict password length to something ridiculous or rule out spaces and punctuation.
This is a limitation on this review, not on TrueCrypt: There’s a “traveler mode” that I haven’t played with enough to say if it’s useful or not.
TrueCrypt allows you to specify one or more keyfiles that are to be used in conjunction with your passphrase. If an adversary has installed a keylogger on your computer, he still won’t be able to access your private data without knowing the name of the keyfile (which you hopefully have always selected with a dialog box rather than typing in the filename). I don’t like that much: it seems to me if you’ve got one volume and a passphrase to keep track of, you might just succeed. If you’ve got a volume, a passphrase, and a bunch of files to keep track of — all of which you need to get at your data — you’re fixin’ to have a bad experience.
Finally, TrueCrypt has a bunch of options that let you do things like make a list of favorite archives, remember the archives you’ve opened, and cache passwords. Every one of those things sounds like an awful idea. I ain’t doin’ it.
Finishing Clean
As soon as you dismount a volume with TrueCrypt, the data in it is unreadable until you mount it again. But what about other ways of exiting? I’ve discovered a couple of things so far.
First, if you unplug the USB cable from a device volume, the volume automatically dismounts. If there was data in the buffer on the way to the USB drive, it may get lost, so I don’t recommend it. Nevertheless, it works. Ditto for rebooting the computer and powering it off. And I’ve got TrueCrypt set up to dismount volumes whenever the screen saver kicks in. So all kinds of actions, including doing nothing, will dismount a volume and leave you in a secure state.
Ejecting a CD that has a file volume on it from the CD drive is a bad idea, since Windows pops up a huge stack of annoying dialog boxes. But if you do it and then stick the CD back in, TrueCrypt does not dismount the volume. So be warned!
But remember, the alternative is a three-step process: (a) decrypt the files, (b) work with the files, and (c) encrypt the files. With on-the-fly encryption programs, the process becomes (a) mount the volume, (b) work with the files, (c) dismount the volume. While that doesn’t look like much of an improvement, in fact mounting and dismounting the volume take seconds, while encrypting the files can take so long that sometimes you won’t do it.
And too, with TrueCrypt your files are never put on disc in an unencrypted state. I’m not going to dwell too heavily on that point, because Windows and the *ixes I’ve used have no compunction about maintaining scratch files and paging files on the disc. And applications often make scratch files of their own. Still, the artifacts left behind by applications and the OS may turn out to be so difficult to retrieve and reconstruct that you’ve effectively denied the information to an adversary, particularly casual snoopers like laptop thieves and dumpster diving neighbor kids.
So all told, I think TrueCrypt is a keeper. More than that, it’s a “user”: I’ve already inventoried my private data and put it in an encrypted volume, so I’ll be keeping my private data private from now on, and I’ll be using TrueCrypt to do it.