Truecrypt is a powerful encryption tool that allows average users to create encrypted files and drives with some of the strongest known encryption algorithms. However, when dealing with some users of Truecrypt I've found that they commit certain mistakes:
- One of the best ways to make sure that your encrypted files are never broken into is to never draw attention to them in the first place, however some users name their Truecrypt files something obvious, like "truecrypt", "private", "secret", "secure", or "encrypted".
- Even if they name it something not so obvious, they make the encrypted volume massive without giving it a legitimate extension. A 10GB file named "stuff" in your home directory will raise suspicion.
- They decrypt the files to access them, but then never unmount the encrypted volume... leaving it exposed until the machine is shut down.
- Even if they do unmount the volume, they don't have a mechanism for making sure they cleared out running memory.
Solving the first two issues is simple, create a Truecrypt volume thats a reasonable size for an extension type and name it something innocuous to that file type. For my example, i'll just make a file with the .iso extension, make it anything between 80MB and 3.8GB and name it as though it were a Linux iso image.
root@oblivion:~# mkdir ~/Downloads
root@oblivion:~# touch ~/Downloads/linux-alt.iso
root@oblivion:~# truecrypt -t -c
Volume type:
1) Normal
2) Hidden
Select [1]: 1
Enter volume path: /root/Downloads/linux-alt.iso
Enter volume size (sizeK/size[M]/sizeG): 120M
When it comes to encryption algorithms, using the two stage cascade is a good mix of paranoia without loosing too much IO performance. Options 5 and 7 can really seem to slow things down at times.
Encryption algorithm:
1) AES
2) Serpent
3) Twofish
4) AES-Twofish
5) AES-Twofish-Serpent
6) Serpent-AES
7) Serpent-Twofish-AES
8) Twofish-Serpent
Select [1]: 8
Hash algorithm:
1) RIPEMD-160
2) SHA-512
3) Whirlpool
Select [1]: 3
Filesystem:
1) FAT
2) None
Select [1]: 1
When choosing a password, value length over complexity. A favourite phrase from a book that you haven't repeated to anyone else is a good choice, anything over 16 characters should be sufficient for most people. Remember, if you forget this password the files stored in the Truecrypt volume are likely to be lost forever.
Enter password:
Re-enter password:
Enter keyfile path [none]:
Please type at least 320 randomly chosen characters and then press Enter:
egw9eughrwp9eghrw9euhgw039urht0239urht20935ugh09guh7205049guhweeeguhpwiehrgpweihrwgergeet35y235w235yw235y235yweywerwergwwregowegruthw935uhg0w8yrh08yhy8g08yG)*YG(O*YFG)(*TYFGITUFCYDTESYEAY@YA#%A*SURYDKTfgK%&EDiurDI^$EdiRDI^%$DIRDIDlkGVKFTGKUFITUFO&FROI^FTouTFOUTDFOITdIORDIIITflglidghfhjgfhghurie8d7fr6t43ghjeirfogp;t.r,f.gb;'hb[np;ml.,,,,,.;"{PL<>:POIJHGFDSAQ!@#$%^&*wewtwetwetweh087w2y30rgh4g02r2hg0r(OL:>
Done: 100.000% Speed: 7.7 MB/s Left: 0 s
The TrueCrypt volume has been successfully created.
So now we have what appears to be a 120MB Linux iso in our downloads folder, which seems perfectly reasonable and likely wont draw any attention, but when mounted has all of our secret data. You can use other locations and file types, just make sure that the name, extension, and size all make sense together.
Problem 3... leaving encrypted volumes mounted after the user is finished with them. Well, if you're lucky whoever is after your files wont realize you have any encryption and will just pull the plug on the machine, at which point after a few minutes (Cold Boot Attack), everything is fine. However.. it would be better to setup a cronjob to attempt to auto unmount all encrypted volumes periodically.
The simple method is ofcourse:
root@oblivion:~# crontab -e
15,30,45,59 * * * * truecrypt -d
This will try to unmount all truecrypt volumes every 15 minutes, it is just an attempt however.. if a volume is in use, the unmount will fail and it will try again in 15 minutes.
Wait though, we've just put a reference to truecrypt in one of the first places someone analyzing your system is going to look in order to gather information. A better option would be to find a script that's reasonable to run that often, such as a log checker, or a security daemon, and hide the truecrypt command inside of it... at least then it wont be quite so obvious, tossed in somewhere around line 80 of a script that looks legitimate.
Problem 4, Wiping memory:
This is a quick script to flush cached memory and thus hopefully make sure your Truecrypt password or any sensitive information isn't still stuck in ram or paged.
root@oblivion:~# cat freemem.sh
sync
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
Add this to that same cronjob script that's unmounting your truecrypt volumes, and make sure to run it after you've unmounted volumes yourself.
There are probably more ways to further improve the security of truecrypt and lessen it's exposure, but following these concepts should give any user a good start.
------
Always remember the wisdom of
xkcd.com though...