How did you like the article?
How did you like the article?

E-mail encryption: how PGP secures the content of your e-mails

Although a considerable amount of internet communication today takes place over social networks and instant messenger, e-mail is still going strong. E-mails are usually favored over chat systems when confidential information is involved such as contract details, bank details, etc. In many companies exchanging messages by e-mail is just a normal part of everyday business. Naturally, businesses want to protect this sensitive information and prevent others from reading the contents of their dispatched e-mails. If an e-mail is sent in plain text, criminals can get hold of sensitive user data, as can  prying eyes, on the hunt for any useful information they can find and use. To ensure that no unauthorized people can read the contents of your messages, you should ensure that you encrypt your e-mails at all costs.

PGP encryption – protect your privacy with a pair of keys

PGP encryption offers an excellent means of protecting information and encrypting the content of your e-mails. PGP (pretty good privacy) was originally developed in 1991 by Phil Zimmermann as a software for encrypting e-mails. Over the years, PGP has come to be generally accepted as the name of this method of encryption.

PGP encryption is based on a public key protocol, where a assigned pair of keys (comprising of a public and a private key) is used. The public key is available to potential e-mail contacts since it is directly transferred or uploaded on an external key server. This key enables your contacts to encrypt all the e-mails that they send to you. The private key can only be accessed by you and is normally password-protected. It allows you to decrypt the received e-mails that have been encrypted with a public key. The person you’re communicating with should also be using PGP and give you access to their public key so that you can communicate securely. The public key protocol is described as an asymmetrical procedure since the two parties involved use different keys. Using signatures guarantees the authenticity of your messages even more.

Encrypting your e-mails with PGP: only for the experts?

Securing your e-mails with PGP might seem like a lot of effort at first glance, but you just need to find free or inexpensive PGP software and install it. During the installation process, a pair of keys will be automatically generated, but the rest is the user’s responsibility. The private key is archived on its own server whereas the public key is uploaded on an external server (e.g. on a web server) or e-mailed directly to contacts. This is still not enough since the contacts involved must also access the PGP encryption and send you their public key. Verifying the trustworthiness of the received keys and managing your own key is your responsibility so play it safe and encrypt your e-mails with PGP.

The steps needed for the set-up sometimes deter less-experienced users from this type of e-mail encryption. In the last few years, new plugins like OutlookPrivacyPlugin and Mailvelope have been developed in order to make secure e-mails available to a wider audience. You can implement them into current e-mail clients and browsers, which then support the user during the configuration process. Many established e-mail providers value encryption highly and link their service with PGP plugins and self-explanatory set up assistants. These plugins make it easier than ever to set up PGP encryption for your e-mail account. Another service offered at present is storing a public key in the provider’s database.

This is how you can implement PGP encryption for your messages

Many e-mail service providers now come with pre-packaged PGP encryption as well as easy-to-understand instructions to guide you through the process. If this isn’t the case, you should perform the necessary steps that have already been mentioned above. The following PGP tutorial deals with the general approach to setting up encryption.

Step 1: select and install the appropriate PGP software

The first step is to find the right PGP software, which must be compatible with both the operating system and the e-mail program. Linux users have made a good decision by using the open source solution, GnuPG (GNU Privacy Guard) that was released in 1997. The software runs on almost all GNU/Linux distributions and enables encryption according to the OpenPGP standard with all important e-mail programs such as Evolution, Kmail, and Thunderbird. The somewhat older version 1.4 is pre-installed on many systems by default, the latest version can be downloaded from the official website.

Users of Windows or OS-X operating systems will also find binary files there with which they can install the system-specific Gpg4win and Mac GPG, which are based on GnuPG.

Step 2: generate a pair of keys

Once the PGP program is installed, a key pair can be created. For Linux, open the command line and use the respective command, which can be found in the program’s manual. This is the example for GnuPG:

sudo gpg --gen-key

Then select the type of encryption. You should only change it from the default setting ('RSA and RSA') if you have the necessary background knowledge. Then enter the key length in bits: the higher the value, the more secure the keys, but also the slower the performance. Security experts recommend a length of 4096 bits for RSA keys. This is followed by a request for the validity period of the keys, and finally the name and e-mail address for which the key pair should apply. Finally, you need to confirm that all this information is correct and define the passphrase for your private key. You will need this later in order to encrypt or decrypt your electronic messages.

On Windows and mac OS X, you start the code generation through graphic programs. Regardless of PGP software and platform, you are often prompted to generate the key through random keyboard entries or mouse movements.

Step 3: share the public key with contacts

You can manage the generated keys under Linux either via the terminal or with a graphical program such as Seahorse (for Gnome/Unity) or KGpg (for KDE). The command line commands for GnuPG presented in this PGP tutorial are, for example,

sudo gpg --list-secret-keys
sudo -K

for the private key as well as

sudo gpg --list-keys
sudo -K

for a list of all generated public keys. Of course, you can not only see the listed keys here, but also directly export them. By doing this, you create an .asc file, which is then sent directly to the desired contacts via e-mail (as an attachment), uploaded to a certificate server, or transferred via USB stick. If the contact has received your public key and also has a key management program, they can send you encrypted messages from now on, which can be decrypted with the associated private key, including passphrase. If you also want to send encrypted e-mails to this contact as well, you need their public key.

Online PGP encryption and decryption

Instead of programs that you install on your own system, you can also use online PGP tools to create key pairs, encrypt your e-mails, or decrypt received e-mails. As examples, we will take the web service PGP Key Generator and the online encryption tool sela.

PGP Key Generator

The PGP Key Generator web tool is a JavaScript program, which can be executed in ordinary web browsers and enables a key pair to be generated. You can use the open source service free of charge and without needing to register. In the first step, you simply enter the required specifications for the keys in the 'Options' form: your name, e-mail address, desired encryption algorithm (RSA/ECC), the key length (up to 4096 bits), the validity period (up to eight years), as well as a passphrase. By clicking on 'Generate keys', you start the key generation, which takes some time. When the process is complete, your will see the public key and your private key appear in windows named accordingly. Using the respective download button, download both in the .asc format.

Both the input of the data as well as the key pair generation take place on the client’s site (i.e. the browser) via TLS connection. The tool uses a TLS certificate that is verified by Amazon. The web service managers do not store information about you, your e-mail address, or the generated keys on their servers (Amazon S3 and CloudFront). Only Google Analytics records information for web analysis purposes. As with all other JavaScript applications, however, criminals can find security gaps in the PGP Key Generator, which can then be used to attack the system and obtain sensitive information such as the generated private key including the passphrase.

sela – simple online PGP encryption

The web service, sela, offers you the possibility to encrypt and decrypt e-mails online. You only need the relevant key and the passphrase (when decrypting). If you want to encrypt a message, add your contact’s public key as well as the mail’s content into the appropriate fields and click on 'Encrypt message'. You will then receive the finger print of the public key as well as the encrypted message, which you can then copy and paste elsewhere.

If you want to decrypt a received message, copy your private key, the corresponding passphrase, and the message that is to be decrypted, into the three respective fields and then click on 'Decrypt message'. Sela will then display the content of the mail in plain text. Designer Stefan Dosdal is responsible for this service, but he doesn’t divulge any information on whether he uses analysis tools such as Google Analytics. The connection to the tool is TLS certified (through GeoTrust Inc.), but still contains the aforementioned risk of JavaScript applications. In addition, it sends the secret key to the server during decryption, which is in sharp contrast to the PGP principle.

PGP encryption for webmail providers: browser extension, Mailvelope

If you prefer to communicate via Webmail providers such as Gmail, Yahoo, and Outlook, won’t go far wrong if they use the browser extension, Mailvelope. The add-on is based on OpenPGP.js, a JavaScript implementation of the OpenPGP standard, and is available for both Google Chrome and Mozilla Firefox – on the Mailvelope website you will find links to download. Once you have installed the extension, your browser’s toolbar displays the Mailvelope icon, which you can then use to access the user interface. Here you can create, import, and manage your keys, as well as the public keys of your business partners. It’s also possible to upload generated public keys to a public key server.

How to use PGP keys on your Android device

To use PGP encryption on Android devices, you need an e-mail client that supports the encryption type as well as a key management software. Two apps have proven to be particularly useful – the free Squeaky Mail e-mail program and the fee-based PGP KeyRing application, which is also available as a trial version (limited to one private key and two public keys).

First, install Squeaky Mail and set up your inbox using your e-mail address. You can then use PGP KeyRing to import your key pair and share the public key with your communication partners. If you send them an encrypted e-mail, Squeaky Mail asks for your passphrase and only shows the content of the e-mail once you have entered it correctly. In order to send encrypted messages, you have to import your contacts’ public keys. When sending the e-mail, check the 'Encrypt' box and select the corresponding key.

Encrypted contents vs. encrypted connections

Many users believe that the e-mails they are sending are already encrypted because of the SSL/TLS certificates, but that’s not entirely true. The SSL/TLS certificates mean that only the transmission path of the e-mail is encrypted. The disadvantage is that they can be intercepted by third parties, who can then read them in plain text. On the other hand, SSL/TLS certificates enable the encryption of elements that remain unencrypted through PGP. These elements can include information about the sender, recipient, and the subject. A combination of PGP encryption and SSL/TLS encryptions is thus the optimal solution to protect the content of your e-mails. Further information about encrypted transmission can be found in the article about SSL and TLS encryption.

SSL Data Protection