Why use encrypted email?
It’s simple: the government is reading your emails. Edward Snowden’s revelations make this a plain truth. If you are not an American citizen it’s a little bit worse, because at least two governments are reading your emails: yours, and the American government.
There are many plugins/addons/guides out there that claim to “encrypt” your email, so that “nobody can read it”. Most of those are nonsense. There is currently only one well-known way of encrypting emails so that only the intended recipient will read them. That is the OpenPGP protocol. So if you’re not using the commercial PGP product, the free GnuPG product, or another well-known product that follows the OpenPGP protocol, your emails can still be read by the government.
But if you’ve been following the news you will wonder “Hang on – if OpenPGP is secure, why did a bunch of prominent Internet security experts like the Silent Circle board decide to shut down their Silent Mail service (which used OpenPGP)?” The answer is that OpenPGP is based on cryptographic keys. And Silent Mail tried to manage your keys for you, which made Silent Circle vulnerable to the law – as the law in most countries states that government agencies can force companies to disclose such secrets.
Therefore, the problem was key concentration. If Silent Circle holds all the keys, the FBI slaps them with a few subpoenas and grabs all of our secret keys. Heck, Silent Circle can not even tell us about it – by law!
So, OpenPGP is still considered trustworthy as a technology – what doesn’t work is concentrating key management, because by law the government can grab all secret keys, which will allow them to read all encrypted emails we’ve sent using those keys.
But what if we just manage our own keys? The government would not legally compel all of its citizens – directly, on a one-by-one basis – to give up their secrets. That would be much less politically palatable than a program like PRISM, where they just suck out the data from our service providers (Google, Yahoo!, Microsoft, Apple etc).
Using OpenPGP and managing our own keys, then, is the best we can do right now. Let me show you how.
Note: This tutorial will focus on making using encrypted emails as easy as possible. We will propose settings that are optimised for convenience, not security. If you are a journalist, an activist, a politician or anyone who needs a setup as secure as possible, let me know in the comments and I will propose more secure but inevitably slightly less convenient settings.
Setting up encrypted email
For this example, I will use a free Gmail account and setup access from my Windows 7 computer. Note that this method is not Gmail specific. It will work for any email account out there.
Installing GnuPG will allow your email program to encrypt your emails.
- Download Gpg4win from http://gpg4win.org/download.html
- Run the gpg4win-(version).exe installer to install the software, ensuring that GPA is selected for installation as well:
Thunderbird is the email application we will use to send and receive emails. We can’t just use GMail’s webpage for encrypted emails – it will become cumbersome in the long run.
- Download Thunderbird from https://www.mozilla.org/thunderbird
- Run “Thunderbird Setup (version).exe” to install Thunderbird on your computer.
Connect Thunderbird with your email account
As soon as setup is finished and Thunderbird launches, you are asked whether you’d like a new email address. Let’s skip this for now and go with your existing email address.
(For this example I will use the Gmail account email@example.com)
Fill in your name, email address and Gmail password.
Thunderbird checks for the settings of your email provider
…and, in the case of a well-known service as Gmail, finds the right settings:
If everything works and the dialog disapears with no errors, great. If not, verify that whichever access method you choose (POP or IMAP), is supported and enabled for your account. For our example (Gmail), follow these instructions to enable IMAP.
If you see the following window, with your email account on the top left, you have configured Thunderbird correctly. Congratulations!
Get the encryption addon (EnigMail)
Click on the “menu” icon on the top right and then “Addons“.
Search for “enigmail” and install the addon.
Click on “Restart Now” – this will only restart Thunderbird, not your computer.
After Thunderbird has restarted, close the Add Ons tab – you’re done with this.
Create your encryption keys
Go to Options -> OpenPGP -> Setup Wizard
Go through the wizard, adjusting only the following settings:
In the “Signing” step of the wizard choose “No, I want to create per-recipient rules for emails that need to be signed“.
In the “No OpenPGP Key Found” step of the wizard choose “I want to create a new key pair for signing and encrypting my email“
In the “Create Key” step, choose the passphrase that will be required to read or send encrypted emails.
Note: Choose something that is easy to type and not too long. (remember, we’re optimising for usability here)
Good passphrase: “This is my favourite song!”
Bad passphrase: 9x$Z4;Fq (why?)
When the wizard completes, you will be prompted to generate a revocation certificate. This is a good idea – it’s like an insurance policy for when you lose your key:
Save this file on your Desktop for now – you can decide where to store it permanently (away from your computer! – e.g. on a CDROM or a USB stick you keep in a safe place) later.
Your passphrase is needed to generate the revocation certificate:
… at which point you are done!
Congratulations, you have created cryptographic keys and setup your email program to use them!
You can only exchange encrypted emails with people who also use OpenPGP. Before you can send people encrypted email, you need to make your public key available to the world, otherwise your recipients will not be able to read your emails.
Publishing your public key
Open Thunderbird and click on its “options” button. Then OpenPGP -> Key Management.
Tick “Display All Keys by Default”:
Now click on your name (John Doe) to select your keys and go to Keyserver -> Upload Public Keys
In the next prompt just click OK:
Congratulations – you have published your public keys on the keyservers. Now anyone using OpenPGP can send you encrypted and signed email, and people can read the encrypted emails you send them!
Sending your first encrypted email
Let’s email our friend Bob. He also has a Gmail account and his Gmail address is firstname.lastname@example.org
To start composing a new message in Thunderbird you click the “Write” button:
This brings up a new email window, where you can address and type your message.
Notice the pen and the key icons in the lower right corner? They are greyed-out, i.e. inactive, i.e. you are currently not signing (pen) or encrypting (key) your message.
Let’s click on the key icon to enable message encryption – the icon becomes colourful (gold), which means encryption has been activated:
Let’s attempt to send this message – click the “Send” button. You have just asked Thunderbird to encrypt this message for Bob (email@example.com) – but Thunderbird hasn’t got Bob’s public key! And this is how public key encryption works – you need to have people’s public keys before you can encrypt stuff for them – and only them – to read. Therefore, Thunderbird complains that your recipient has not been found (in your OpenPGP keyring):
Click “Download missing keys” to look for Bob’s key on the keyservers – dedicated computers that host people’s keys.
Just hit OK to allow Thunderbird to look for Bob’s public key online.
And lo! Bob’s public key is there. Just tick it and click OK to import Bob’s key on your keyring. You only need to do this once.
If all went well, Thunderbird lets you know the import was successful:
Great, now you have Bob’s key. You have a new greyed-out line with Bob’s email address. Tick the box of that line and click on “Create per-recipient rule(s)“.
Here you will tell Thunderbird to always use this key to sign and encrypt your emails to Bob.
Click on “Select Key(s)…“:
…and make sure the line with Bob’s address is selected before clicking OK:
Now tell Thunderbird to always sign and encrypt your messages to Bob by changing these fields to “Always“:
Clicking “OK” closes this window and immediately prompts you for your passphrase, as you’re just about to cryptographically sign a message to somebody – that requires access to your secret key, which can only be accessed with the passphrase you setup earlier:
As soon as you hit “OK” with that passphrase – oh my! Look at all this gibberish – that’s encrypted text, otherwise called “ciphertext”. This is what the spooks will now see. This is what Google will store. This is what Bob will see as well, but because he has the right private key, he will be able to decrypt this ciphertext into your plaintext email message.
See, it doesn’t matter that Google and the spooks can still read your email, because now it looks like gibberish, and it can only be decrypted and read by your intended recipients (in this case, Bob). You can use this method to communicate in private with anyone in the world, as long as they use OpenPGP too.
Congratulations! You have just sent you first cryptographically signed and encrypted message, using the most robust encryption technology known to mankind: OpenPGP.
Sending your second, third… 1000′th email
Things are much simpler now that you’ve done all the hard work in advance. All you need to do is compose an email to Bob. Thunderbird will automatically sign and encrypt your message with the right key, so that only Bob can read it. Pretty slick.
Notice the blue “+” next to the pen and the key? That means your message to Bob will be automatically
- signed – so that Bob knows the message came from you and it has not been altered in any way) and
- encrypted – so that no one else but Bob can read its contents.
Enjoy your private chats with Bob!
Receiving OpenPGP encrypted email is not a problem – you just need to provide your passphrase and you will be able to read the message.