It has been said that you should not put anything in an e-mail which you would not put on a postcard. That was said some time ago. Now, knowing that the NSA has been snooping on e-mails, with governments pushing for stricter data retention laws and law enforcement agitating for increased powers to monitor your mail, you don’t even have that level of privacy. That is just the government. There are even greater threats from the private sphere. Hacktivists, crackers and other miscreants attack political opponents, or just for fun, launching Denial Of Service attacks, or trying to gain information by hacking computers and e-mail accounts. Then there’s the threat from yourself, accidentally losing a USB stick with important information, or accidentally sending sensitive information to the wrong person. Encryption can help here and it is never too early to begin using it. You will only find out whether you need encryption or not, when it is too late.

Introduction to encryption.

The encryption scheme that we recommend for guarding your e-mails privacy is PGP (Pretty Good Privacy). There are guides on the Internet which explain how encryption work, the basics, the mathematics and the terminology. This guide will only introduce the basic concepts, and how they can be used and what PGP can do, giving an overview of what exactly PGP does. There is also a guide here which also goes over the basic. The standard is called OpenPGP and is implemented by a variety of programs which adhere to this standard.

Digital encryption is the process of turning digital information (text, data, a file) into an undecipherable stream of data. This encrypted data is referred to as cipher-text. A good encryption algorithm will produce cipher-text that is indistinguishable from purely random data and not reveal or hint at any patterns which may be in the original data or otherwise give any indication as to what the original data was. Modern digital encryption works on publicly known algorithms, that is, the method by which the cipher-text is produced is known, and therefore the method by which the cipher-text is decrypted back to the original message is also known. The advantage that this has over using a secretly held scheme, is that a publicly known scheme will be reviewed and analysed by many cryptologists, and therefore not likely to have weaknesses. A secretly scheme may be good, but it could contain flaws that the people who developed and used it don’t know about. So how can a publicly known method be used for secrecy? The key is the key!

One example of a key based encryption system is Caesars cipher. This simply works by picking a random number, and adding that number to each letter in the message, so if you pick a key of 3, the word “Legend” becomes “Ohjhqg”. So while you may know the method, you still need the key, in this case ‘3’, to convert the cipher-text back to the original message. This encryption may be good for schoolchildren, as it is easy to crack and guess You only have to try 26 different keys to get the right one, something that takes milliseconds on a computer, and the cipher-text also has the same patters are the original text, giving further clues. Modern digital encryption has astronomically large numbers of keys, and the cipher-text reveals no pattern or indication of what the original text or data was like.

Open PGP and Public Key Encryption

You may have encrypted documents or ZIP files before. This probably worked by choosing a password (which is used as the key) and you then use the password again to decrypt. This is a bit like using a briefcase with a combination lock to transfer papers securely. You set the code to lock the briefcase, and only those who know the code can open it. This creates two problems. Firstly, how do you communicate the code to the recipients securely? Send it in the mail as is? Then the code is potentially compromised because the code itself can be plainly read! Also, if you share the code between three people, Alice, Bob and John, but then want to send a message to only Alice and Bob, the code is still known by John, so you’ll need another code which only Alice and Bob know. Then, if you want to send a message to someone else, say Bob and Derek you need another code again. This can become unwieldy, needing a combination for each combination of people you communicate with.

PGP uses public key encryption which solves these problems. This method can appear confusing at first and leads to many people not quite getting how PGP works. Imagine that instead of using a briefcase with a combination to lock papers, a metal box with a padlock is used instead. Alice, Bob and John decide that they want to send messages through the post securely. They go and get a blank metal key, and have a random key shape cut by a locksmith. Lets assume the possible key combinations number in the millions of trillions and they get one random key shape cut, which is going to be unlike any other key in the world. They then get the locksmith to make several dozen padlocks which can only be opened by that key. These padlocks are designed in a way that you cannot possibly determine what the key shape is like from examining the lock. The padlocks are unlocked and have their names on it. So now the three people, Alice, Bob and John have a key in their sole possession which is unique and can’t be created by anyone else (due to the high number of key combinations), and a number of padlocks which can ONLY be opened by that key.

So far so good, but all they can do is padlock the box and open it themselves. This scheme is meant for exchange of notes, so one more step is needed. Alice, Bob and John need to exchange locks so they all have a small number of each others locks. Now, lets say Alice wants to send Bob a message. Alice puts the message in the box, and padlocks it shut using one of the padlocks that she got from Bob. What this means, is that now the only person that can open the padlock is Bob. Only Bob has the key and Alice can now be assured that no one else can open it. Not even Alice can open it! Bob gets the message, reads it, writes a response and puts it back in the box. He then uses one of the padlocks he got from Alice, locks it, and send it on its way. As long as they are the sole possessor of their keys, any one can use the padlocks they made to lock a box, knowing that the person who’s name on the padlock will be the only ones able to unlock. This solves the problem of having to exchange secret information. The lock can be only used to lock, not to unlock and not to determine what the key might be and therefore it doesn’t matter at all if it falls into the wrong hands. No secret information is exchanged.

Public key encryption which PGP uses works this way. Instead of a metal box, we have encryption. Instead of a padlock, we have a ‘public key’ and instead of the key, we have the ‘private key’, also called the ‘secret key’. Just like our metal box and padlock analogy, you create a public and private key using PGP, which together are called a key pair. Instead of distributing padlocks, you distribute your public key. Instead of keeping your metal key private, you keep your private key private. The public key ‘locks’ by encrypting, and the private key ‘unlocks’ by decrypting. There are a couple of minor differences. You can use multiple public keys to encrypt, so Alice can use Bob AND Johns public key (and her own so she can decrypt her own message), and only Bob and John can decrypt (and Alice if she used her own key too). Also, unlike padlocks which cost money to reproduce, the public key is easily copied and transmitted.

A common rookie mistake, is to think that once PGP is installed, and a key made, that you can go encrypting messages to others. But as you can see by the padlock analogy, you need the ‘locks’, that is, the ‘public keys’ of the people you want to ‘lock’, i.e., encrypt the message to.

PGP’s two functions

PGP has two primary functions. The first, as mentioned is encryption. PGP encryption allows you to ensure, using military grade encryption, privacy of electronic data. You can encrypt an e-mail, a file or any other data so that only the people you want, can decrypt and view it. This is to avoid unwanted people from potentially accessing information you would prefer they not access. While normally, e-mails only go to the intended recipients, e-mail accounts can also be hacked, giving the hacker access to incoming e-mails and potentially your sent e-mails and archives. E-mails can be stored on your ISP’s or e-mail providers servers and scanned for keywords. E-mails can be read ‘in transit’ by someone monitoring data coming in and out of your computer or simply sent to the wrong address by accident. PGP encrypts the message BEFORE it leaves your computer, and it gets decrypted only after it arrives, providing end to end privacy. Some services may provide encryption, but this may involve in sending unencrypted data to the server for encryption. Using PGP software on your computer provides true end to end privacy. You can now send a list of member details to someone else, knowing that if their account is hacked, that if the data is leaked or read in transit, it cannot be understood.

The second useful function is digital signatures which can be used in combination with or without encryption. PGP can use your key to create a digital signature for an e-mail or file or other data. The digital signature is generally a short sequence of characters which could have only been generated using your private key and the message. The recipient can verify the signature using the public key. If the signature was not made by you, or the message has changed in any way, the verification will fail. Therefore, the digital signature can give the recipient assurance that the message came from you, and has not been tampered with. Someone who has gained access to your e-mail account can send messages on your behalf to others, or, they could spoof your e-mail address, sending a message that looks like it came from you. Or, or in addition to this, they can change the message. However they cannot forge a digital signature. Using PGP’s digital signatures, you can send a message to people, to say, meet up at a particular place and time, and the recipients can verify, with certainty, that it came from you.

These two functions provide an invaluable tool in protecting your privacy and your data, and are underused.

Signing keys and using PGP securely.

Installing PGP and using it is not enough for security. Like any security system, it is only as secure as its implementation. You may have a state of the art alarm system, but it’s no good if you don’t switch it on. You may have a fantastic electronic door lock with key code entry, but it is not that good if you have a post it note in your meter box with the code. PGP is no different. It provides unbreakable encryption and unforgeable digital signatures, but it can be compromised if not used properly. Most people seem to obsess about whether the encryption can be broken or not, but the reality is, that if there is going to be any weakness in the system, it won’t be the encryption method, but the way in which PGP is used.

Signing keys

The public encryption scheme has one immediate weakness. You can encrypt using a public key, but how can you be sure that key belongs to that person? Using the padlock analogy, lets say Chris wants to gain information from those three. Chris makes his own key and locks, but gets “Bob” printed on them. Chris sends them to Alice in the mail, using Bobs return address on the package. Now Alice has keys which look like they are Bobs, but aren’t. Alice uses the forged key with “Bob” on it, sends it in the mail. Chris takes the box from Bob’s letterbox, opens it, reads it, then puts one of Bob’s real padlocks on it, and locks it up again. Bob opens the box using his key unaware of what has happened. Alice is also unaware of what has happened. The issue here, is that the key that Bob has, doesn’t correspond to the lock Alice has. Alice actually has Chris’s padlock, which Chris has made look like it was Bobs.

To prevent this type of attack, we need an extra step. We need to first confirm that the padlock, that is, the public key we have, is actually from the person we think it is from. Alice should first check with the people who created the locks that she has the right ones before trusting them.

For PGP, we must do the same thing with the public keys we collect. Before we can trust a key, we must first verify that we have the right key and that the private key part is held by the person we believe should be holding it. Luckily OpenPGP has a solid method for taking care of this.

Each public key has a ‘fingerprint’, which appears as a long sequence of characters. The fingerprint is calculated from the public key, and is unique for each key. It is not possible to create a key of your own which has the same fingerprint as someone else. The idea, is that if the fingerprint displayed for Alice’s copy of Bob’s public key, matches the fingerprint Bob has for his copy, then Alice can be sure she has the right key. She can then be sure, that only Bob can decrypt. If the fingerprint’s don’t match, something has happened and the key cannot be trusted. The key can only really be trusted once the fingerprints have been confirmed to match, and most PGP programs will prevent use of keys until this verification is done. While it is possible to skip this verification, and use the key regardless, this opens you up to potential attack through counterfeit keys. As stated before, PGP is only as secure as you make it.

Validating, or verifying a key is simple. Lets say Alice gets Bob’s key by e-mail, or Messenger or even by USB stick in the mail. She can’t be 100% sure it is from Bob. If there was someone who hacked his account, or forged an e-mail, or send a CD, how would she know? The message could have been tampered with in transit. Alice could ask via e-mail or Messenger for the fingerprint, but again, how can she be sure its Bob, or that information is not being altered by a middle man? Even if she asks personal questions, it could be an attacker who knows Bob. In order to be sure, she needs to be SURE she is speaking to Bob and get the fingerprint that way. If she knows Bob’s voice well, then she can call Bob, or preferably, meet Bob in person. Meeting Bob or speaking to him over the phone, she can be without any doubt that she is speaking to Bob. Bob will give her the fingerprint for his public key and Alice will check it against the fingerprint her software displays. If it matches, then she can sign the key. Signing the key adds Alice’ s digital signature to her copy of Bob’s key. With Alice’s signature, her version of PGP will now consider the key valid. Bob will probably want to verify Alice’s public key the same way.

If Alice has never actually met Bob, then they must meet in person and perhaps show photo ID, as neither Alice or Bob would be sure, even over the phone, whether they are speaking to the right person. In this case, because they are not at their computers, they can just give each other a slip of paper with their name and fingerprint after they have verified identities. They can take the paper home and then sign the keys. Ideally, if a small group of people are using PGP, they can all meet at once and swap key fingerprints. What is more, the signatures stay with the key. Alice signs Bob key, and if she send her copy of Bobs key to Bob, or anyone else, it has Alice’s signature with it.

The key signing is important as it establishes true ownership. It means that you can be sure that this persons digital signatures were created by them, and that messages encrypted using this key, can be decrypted just by them.

Web of Trust

Signing keys like this works well for people who have known in person for some time. But what about people who haven’t met in person? What if you want to use PGP with someone interstate, who perhaps is part of your organisation, but you haven’t actually met? Electronic communication to verify the fingerprints is out, but so is doing it over the phone, or even video conference. You haven’t met them, so you can’t be sure you’re not speaking to an imposter? How can you sign their key? The answer is, you can’t.

This is why OpenPGP has a ‘web of trust’. Earlier we mentioned that when a key is signed, the signature stays with the key. Over time, a key will collect a number of signatures from people who have vouched for the authenticity of the public key. You may not be able to check the keys fingerprint with the owner satisfactorily, but perhaps someone else you know and trust already has. There is a way you can tell PGP to trust a key if someone you trust has verified it. The OpenPGP standard allows you to set each public key an ‘ownertrust’ level. By default, this is “Unknown”, but you can set it to “None” (don’t trust), “Marginal” or “Full”. This tells PGP how much faith you have in that person to sign keys and properly check identities. If you have someone set as “Full”, then any key which bears their signature, will then be trusted by PGP and considered valid, even if you haven’t signed it. “Marginal” means that the signature won’t make a key valid, but a second “Marginal” will. “None” and “Unknown” mean that the presence of their signatures on a key won’t make it valid.

So for example, while Alice may not know John who lives interstate, Bob may know him very well and has signed Johns key. Because Alice trusts Bob’s careful key checking abilities and has set Bobs ‘ownertrust’ to Full, the presence of Bob’s signature or Johns key means that Alice’s copy of PGP will consider that key valid. Of course, Bob’s signature itself needs to be considered valid by PGP first (either by Alice signing it, or by being signed by another valid key from someone who has ‘ownertrust’ set to a level of trust).

PGP takes care of which keys to trust or not, so all you really need to worry about is making sure that you take care signing keys, and only set a public keys ‘ownertrust’ for people you know personally well enough to be able to make an educated judgment on how carefully they check keys. The ‘ownertrust’ is kept private and is not stored with the key. This is your own personal opinion and will not be revealed to anyone.

What PGP does NOT do.

We’ve covered what PGP can offer, which is encryption and digital signatures. It is important also to know what the system cannot do.

  • PGP cannot ensure trustworthiness of people. You may be able to verify someone’s identity and trust that they key is theirs, but PGP cannot protect you if they have hidden motives. You can encrypt mail and be sure that only the intended recipient gets it, but PGP cannot help you if they are a snitch, mole or spying. Also, PGP cannot help if the holder of decrypted data mishandles it, or accidentally transmits it. As stated before, simply using PGP is not enough. If data is sensitive, then PGP only takes care of transmitting data (electronically or via USB or disk). You will still need a method for handling and storing the data before and after transmission.
  • PGP cannot stop the person who you send encrypted information to forwarding it to others. You will need to have a way of assuring the integrity of the persons character and their intentions. Once a recipient has decrypted the e-mail or file, PGP cannot stop them forwarding it decrypted to others.
  • PGP cannot be used to hide data which may be required in court. Unfortunately in Australia, unlike other freer countries, the law can ask you for decryption keys and punish you for not handing them over.i Fortunately, PGP does offer a way to allow someone to decrypt an e-mail or file WITHOUT giving them your private key, thereby ensuring the integrity of your other messages. If you are in a situation where you are legally required to do so, do not do anything without legal advice first. Refer to the “Advanced PGP” article for information on how to give a key to decrypt an e-mail or file. However, as the most direct privacy threat comes from the private sphere (activists, crackers, political opponents), this isn’t as big of a problem as it appears as they don’t have the right to demand keys.
  • PGP can only ensure that only the holder of the private key can decrypt an e-mail or file, if no one else has a copy of the private/secret key. PGP provides means to protect your private key, but it someone else has a copy and can use it, they can decrypt all your e-mails. The onus is on the holder of the secret key to ensure it stays secret.

In part 2, we will look at how to install, set up and use the software effectively.

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

Please enter CAPTCHA *