Saturday, January 26, 2013

Data Privacy Day Prep Part 4: Encryption

Data Privacy Day is one of my favorite holidays and falls on this upcoming Monday. Every year, for the days leading up to it, I like to talk and publish reminders about. I normally post this on the Bethesda forums, where I'm quite active, but now that I have a blog, why not also add it on here? Here's part 4; it's about encryption. It's long, so maybe read it in chunks. It'll always be here for you to refer to later :P

The goal of Data Privacy Day is to make people more informed about their data and privacy. I hope you find some of this information useful and put it into action. Security and privacy are constantly evolving items, and what cuts it today may not in the future, but this should be a good springboard to boost your security and privacy for Data Privacy Day and the years to come. As always, the level of security you need will differ from others, so you need to figure out what level is good for your needs. Some things, though, are universally applicable to all, such as a good password system. Another thing to remember is that even if you follow the best of security practices, it may not be enough to stay safe if a company who has poor security practices gets hacked (and after the summer of 2011 hacks and the ones that followed in 2012, I think we are all familiar with that).

Encryption remains the same as ever mostly. AES is still going strong, in spite of a very tiny chink in the armor being found over a year ago now (still unexploitable because even with the chink it takes hundreds of years to decrypt).

Email Encryption

Most people send emails fairly frequently, sometimes even containing confidential information. The Dead-simple file encryption options listed below are excellent for attaching encrypted attachments, but what about the email message itself? Well, there's been a long-standing encryption for email known as PGP (Pretty Good Privacy) and it is still going today. Some derivatives of it are OpenPGP and GnuPG, but they all play nice with each other.

 One caveat about PGP until recently was you needed a dedicated email client to use it. It's still probably the easiest way, but it's no longer the only option. If you want to go this route, I recommend GnuPG + Thunderbird + Enigmail. Here are some instructions on how to set it up.

 Most of us, though, probably use a web browser for our email. Now there are PGP encryption options directly in your browser thanks to OpenPGP.js -- an open source Javascript library. There are two browser plugins useing it: Mailvelope, which has a Firefox and Chrome plugin, and MyMail-crypt for Gmail which is a Chrome-only plugin. Once more, Mailvelope works with numerous webmail platforms, not just Gmail, so is an option for more people. OpenPGP.js (and these plugins) are still under active development, and not quite 100% stable, so issues may be encountered. An advantage, though, is that they'll work with any OpenPGP/GnuPG program, being fully compatible.

 The downside to Mailvelope and MyMail-Crypt being fully compatible with OpenPGP/GnuPG is that they have the same barriers to entry as regular OpenPGP/GnuPG -- in order to use them you must generate a private and public key pair, and so must anyone you want to securely send email to. For you to send email to someone securely, you encrypt it with their public key. They can then decrypt it. To reply they must encrypt the reply with your public key for you to be able to decrypt it with your private key.

 A simpler solution is SafeGmail. It's Gmail-only and Chrome-only, but a Firefox plugin is in the works. It's an open source project and tries to make PGP simpler and more friendly to newcomers. On the plus side is that only you need the plugin installed, the recipient doesn't need to mess with keys or anything. They just click a link, enter in a password you sent them/answer a question, paste the encrypted text, and press the decrypt button. The downside is that you are dependant on SafeGmail, and without looking at the source code I can't say with 100% confidence that no snooping is being done, though I do believe it's a strong candidate for being 100% secure.

Dead-Simple File Encryption

TrueCrypt is a great tool and all, but it's not the best choice out there for simple file encryption. You have to create a virtual container and then put the files in there, it's a bit of a hassle and waste. The problems with TrueCrypt are amplified if you are trying to share files with someone else securely, especially if that other person isn't very computer literate. Thankfully there are alternatives. The big ones are AxCrypt, AES Crypt, and 7-Zip.

AXCrypt - AxCrypt is a simple file encryption tool that uses AES-128 available in installed and portable versions. The advantage of the installed version is that it offers context menu integration, allowing simple right-clicks to decrypt and encrypt. Another advantage of the tool is it offers a portable Decrypt-only tool. This makes it simple for your non-savvy friends to decrypt files you send them. Unfortunately it is currently Windows-only, but version 2.0 will be cross-platform (through Mono). If you have a Mac OS X friend you'd like to send encrypted files to, thoguh, they can use the prerelease. Linux also has a prerelease, but you have to register on the AXCrypt website to access it. My experience with the prerelease has been positive so far, though getting your friends to install Mono may be a bit hard (it's a separate installer). Once they do, they simply launch AxCrypt from the download and click the unlocked icon to decrypt files. Simple enough for even a Mac OS X user (in jest, I promise).

AES Crypt - AES Crypt isn't as slick as AxCrypt, but has the advantage of having a stable cross-platform release. Context menu available once again and the Mac OS X application is simple drag-and-drop. It lacks the portable or decrypt-only Windows options that AxCrypt has, but that's the price to pay for a cross-platform application.

7-Zip - When combined with the AES-256 encryption option available for .zip and .7z archives, 7-Zip becomes a powerful encryption tool. It's made even simpler with the SFX archive option (Self-extracting archive) when using .7z. This creates a .exe archive that when run will ask for the password and extract the contents once entered in properly. It's not without problems, though. First, AES-256 .zip files are a bit of a hack, and not compatible with all archiving programs (for example, Windows can't handle them natively). Second, 7-Zip isn't properly cross-platform. You'll have to direct your Mac OS X and Linux friends to an alternative tool for them to decrypt the files. Thirdly, you'll find it hard to email self-extracting archives to people as most email programs will block .exe attachments (so you'll need to use a file hosting service). Still, it's a viable option especially for Windows users.

Drive Encryption

Drive encryption is the ultimate in data privacy and security. There are many encryption tools out there, but for the purposes of discussion here I will only talk about TrueCrypt. TrueCrypt offers many advantages over other options, including BitLocker. In being cross-platform, it makes recovery in any situation possible. Other encryption schemes may offer advantages over TrueCrypt (for example, if interested in TPM), so it may not necessarily be the right choice for you.

 There are three basic encryption options, as well as the choice between hidden and non-hidden volumes. These options are: an encrypted file container, an encrypted non-system partition or drive, and an encrypted system partition/drive (this last option is currently only available on Windows). Two-factor authentication is also available through the use of keyfiles, though it isn't an option for system encryption (but two-factor authentication still can be achieved).

 Encrypted file container: This option is the simplest to implement. You create a volume that appears to be a normal file (you can make it any filetype you want), but when you mount it with the proper password (and/or keyfile) it reveals the truth. You can make it a hidden volume for even added privacy/security (a would-be attacker may uncover the outer volume in one way or another, but the hidden volume remains secure). The disadvantage to making an encrypted file container is it is relatively simple to just copy the file container to a removable drive where the attacker can try and crack it at their leisure without you being aware of it (a keyfile would drastically lower their ability to succeed, if the keyfile and file container are not stored in the same location).

 Encrypted non-system drive/partition: This option is relatively simple to implement. The advantage is it looks like just unallocated disk space to the untrained eye, and, in the case of removable storage, the user would be prompted to format it before use. Of course in removable storage you must be careful to not format it yourself. Once again the use of a hidden volume and keyfile can be used for increased privacy/security.

System drive/partition Encryption

SSD users: Please note that there is currently no way to verifiably securely wipe an SSD short of drive destruction. As such I highly recommend encrypting SSDs.

 This one is a bit more advanced than the earlier options, but offers significantly greater security and privacy as well. On your system there are temporary files and various files tied to programs that make it hard (though not necessarily impossible) to seamlessly use file containers or encrytped non-system drives/partitions to protect their contents from prying eyes. For example, say you stored your IM logs, program profiles, and bookmarks in an encrypted file container. It would be relatively simple to accidentally start up the program those files are related to without unencrypting the container, which could either cause instability or write new files to an unencrypted area. System drive/partition encryption allows for seamless encryption of all system/program files you want out of prying eyes. You can make it a hidden volume if you choose, which LifeHacker did a good job at covering.

Unfortunately keyfiles do not work with system encryption, but you can still get two-factor authentication. Before you encrypt the system, you will be prompted to create a recovery disc in case anything goes wrong, which you can use to restore the TrueCrypt boot loader, boot into the encrypted system, restore the original system loader, or permanently decrypt your system. By restoring the original system loader, or installing a new boot loader to the MBR (such as GRUB2), you would be required to boot from the rescue disc, making a two-factor authentication setup (you must know the password, and you must have the recovery disk). This can be further streamlined if your computer can boot from USB by loading a USB drive with the recovery disk. You'd then do something like booting the TrueCrypt ISO from Grub4Dos.

Dual-booting is complicated for Linux-TrueCrypted Windows (Windows-Windows can be simply done through the use of the hidden operating system feature), but not impossible. You can do the above and have GRUB2 written to MBR and use the CD/USB to boot into Windows, or you can force GRUB2 to install to the root (or boot) partition. Here's a guide to doing this.

If Linux is already installed, simply restore GRUB2 from the TrueCrypt rescue disc, boot into it, force GRUB2 to install to your root/boot partition, and then reinstall TrueCrypt Boot Loader to the MBR from the rescue disc. If you are using the two-factor authentication method, all you need to do is restore GRUB2. Since you don't need TrueCrypt on the MBR, GRUB2 can happily rest there.

 If Linux isn't already installed, make sure you have the necessary unencryped partition to install it to. You cannot partition a TrueCrypt encrypted volume, so the partitioning for Linux needs to be done before encryption (or if you have a non-system partition/drive already, you could further partition that). Encrypt Windows with TrueCrypt and install the Linux distro of your choice. After installation force GRUB2 to the root/boot partition and restore TrueCrypt to the MBR (once again, this last step can be skipped if you are going to use the two-factor authentication method for TrueCrypt).

 Linux can also be encrypted. Many distros offer options to encrypt Home at install. Full encryption, including root, requires more work and generally not included as options from live CD install. Just look through the distro documentation for dm-crypt/LUKS or Google your distro along with those terms and you will find a guide on how to do it.

Mac OS X offers built-in full-system encryption in the since 10.7 Lion through Filevault 2. Apple posted excellent instructions on how to do this on their knowledge base. Older versions of Mac OS X could only encrypt their home directory.

There is one disadvantage to system encryption: it will slow down your OS. This is mitigated with a good hard drive and a modern processors that has AES-NI when using just AES encryption -- to the point it is negligible to unnoticable. Currently most i5s and newer i7s (the entire i5 and i7 line for Sandy Bridge) support it as well as AMD's Bulldozer line, but still something you should be aware of.

 Further reading:

TrueCrypt Docs: Keyfiles
TrueCrypt Docs: Hidden Volumes
TrueCrypt Docs: TrueCrypt Rescue Disk

 With that, you can properly encrypt your important data and keep it from prying eyes.

0 comments:

Post a Comment