In our last episode of Private I, I explained the basics of public-key (PK) cryptography, a way to scramble messages in a way that only someone possessing a particular key can decrypt, without that key ever having to be publicly disclosed or shared. It’s an effective system that has no known theoretical exploits, and currently deployed implementations are considered robust.
And to recap: The clever bit with the public-key approach is that you have two complementary keys, one public and one private. The public key can be freely distributed. Anything encrypted by someone else with the public key can only be decrypted by having access to the corresponding private key. And a private key can be used to “sign” a string of text or a document to prove mathematically that only the private key’s possessor could have signed it.
But there are two missing pieces that would let Mac, iOS, and other platforms’ users take advantage of PK. The first is pragmatic: Senders and recipients need compatible software tools or plugins, preferably integrated into apps so that little effort is required. The second is existential: Without pre-arrangement, such as meeting in person or a phone call, how do you know that what purports to be someone’s public key is actually that person’s key?
The easiest way to solve both problems is to use an end-to-end proprietary ecosystem, but that gets us back, more or less, to iMessage or something similar. Silent Circle has one of the best options that embeds public-key cryptography, if you can convince all the people with whom you need to communicate to opt in. It starts at $10 per month for unlimited text, calls, video chat, and file transfers among its users. The service’s messaging and calling options received scores of 7 out of 7 in the Electronic Frontier Foundation’s secure messaging scorecard.
PGP on the Mac
But most of us don’t live in a walled garden, and one of the company’s founders, Phil Zimmermann, is responsible nearly 25 years ago for turning public-key cryptography into what he called PGP, for Pretty Good Privacy. (How PGP works is described in Part 1.)
PGP is available for the Mac via GPGTools, a version of the free software GPG (GNU Privacy Guard). It lets you build a directory of other people’s public keys, while also letting you carry out encryption, decryption, signing, and verifying. (PGP is a trademark, and GPG coined to get around it, but you’ll often see PGP used generically to refer to this method of using public keys.)
The EFF has very nice step-by-step instructions for installing GPGTools to allow it to be used directly with either Apple Mail or Mozilla Thunderbird for email; the tools are also available via the application Services menu wherever you can manipulate or select text. GPGTools is currently free, but plans to charge a very modest fee for its email plug-in at some point to help support development costs.
The EFF instructions walk you through creating your own public/private key in GPG Keychain. To use GPGTools with email, your key needs to have the same email address as the return address from which you want to send encrypted messages. Once you have a key, you can upload a key to a keyserver by selecting your key and choosing Key > Send Public Key to Keyserver. This makes your key searchable by your name and email address in a PGP directory. A key has an associated fingerprint, a cryptographic transformation of the public key that’s far shorter, which I’ll get to in a moment.
When you compose an email in Mail after going through the installation and key creation, you now have two new icons on the Subject line as long as the sending account matches any public key you’ve created. The blue starburst checkmark indicates your outgoing mail will be signed by your private key, allowing others to validate that it’s been unchanged in transmission as long as they have your public key. And you can click the lock icon if all of the recipients in the address fields have public keys stored in GPG Keychain.
(Note that PGP-encrypted email protects the contents of the message, but not its subject line nor the metadata: the routing information and other details stored in email headers, and which have formed a large portion of the analysis by the NSA and other governments’ security agencies to identify patterns.)
On sending such a message, you’re prompted for your passphrase. I store my passphrase in 1Password, so I can bring it up rapidly. If you plan to type it, make it something long and memorable with a single piece of punctuation, like “From the still of the ! night” — this is essentially uncrackable due to length and the fact that the phrase would never appear in any English text used for word-frequency analysis.
Now, of course, your recipients have to go through the same procedure, or use other compatible PGP software. Symantec still makes PGP, although it works on the Mac only with Microsoft Outlook. There are other implementations of GPG for other platforms. And some mobile apps can handle PGP-encrypted documents and email. (I looked for PGP iOS app that meet the bill, and the current lineup have a variety of limitations. I’ll be looking into this further as this situation changes.)
With GPGTools installed, you can also perform all the other PGP-style operations from the Services menu. For instance, as I compose this in BBEdit, I can select BBEdit > Services > Insert My Fingerprint (which is 53F4 9E97 2652 4E2F 2993 4611 BB54 A24B EDD1 8384). I can also encrypt, sign, verify, and so forth.
Checking on the keys
But let’s turn to the existential problem. You have a key that’s associated with your email address, and you post the public key to a keyserver. How can someone be sure it’s your key? If they email you at the address, it’s possible your email has been tampered with, and the message is intercepted, and responded to without you ever knowing about it. One method of validating a key is to call someone, because there’s about zero probability that a man-in-the-middle could know you were making the call, intercept it, and speak in real time the fingerprint of a false key. Once you’ve verified a key by voice or in person using its fingerprint, you’re set.
The reason I’m so sure, though, that public-key messaging might rise in popularity, though, is due to Keybase.io, currently an invitation-only and free public-key service that manages keys and handles encryption tasks in the browser or via command-line tools — but which also provides substantive and useful ways to validate your public key to other people’s satisfaction.
Visit my profile on Keybase.io, and you see that I’ve verified myself in several ways. I posted a tweet with a code provided by Keybase, posted an item to my Github repository, added a special text-only DNS record, and uploaded a file to my web site. This is probably a good set of vectors that no other person should be able to hijack without being noticed.
The nice part of Keybase is that as it expands outside of its invitation-only phase, it will provide a common place for people to upload keys or generate new ones, and validate themselves all at once. Although Keybase doesn’t operate keyserver software (for a variety of reasons, obscure and otherwise), you can click on the key of anyone’s profile, and up pops a window from which you can save that person’s public key or copy it.
GPG Keychain lets you paste a public key into the main window or import the public key file. Then you can immediately confirm that key against the fingerprint on the site in the same pop-up window.
None of this is, shall we say, straightforward. But neither does it require the level of tweakiness and complexity of years past. Once set up, you can send and receive encrypted emails with other people who use PGP simply by remembering or retrieving your key’s passphrase. And that takes us a lot closer to reliably encrypted communications on demand than we have been until now.
This story, "How to keep your email private with PGP encryption on your Mac" was originally published by Macworld.