Of Public Keys and Private Washrooms
Cryptography has been around for centuries, used mainly to secure communication between governments or military officials. For cryptography to work, both the sending and receiving party must use the same process to encode and decode the data. Cryptographers refer to this as "symmetric key cryptography."
The keys used for cryptography must be guarded closely, because anyone who has the key has the ability to decrypt the data. Keys are therefore usually transferred "out-of-band," meaning they are not sent via the medium (in our instance the Internet) they are meant to protect. Transmission of the keys usually would be done via a telephone conversation, the postal system, or some other physical means, such as a floppy disk.
Immediately you can see several problems with symmetric key cryptography. Any data guarded by the key is at risk if the key is compromised. Dealing with large numbers of people, such as those within a company, much less the Internet, makes managing the keys impractical. Changing the keys often to protect the transmission of data does not scale well.
A new approach to encryption was needed, and in 1976 two cryptographers changed the world of cryptography. Whitfield Diffie and Martin Hellman developed a public-key cryptosystem outlined in their paper "New Directions in Cryptography."
This new method of cryptography uses a pair of unique keys to encrypt and decrypt information. Both keys are assigned to an individual person, company, or system. One key is kept private, known only to that individual. The other key is public, to be shared and known by anyone who wants to communicate with the person/company that owns the corresponding private key. Data encrypted with one key can be decrypted only by the other key in a pair.
Public keys can be used to encrypt data for a specific individual, because only that individual has access to the private key. Likewise encrypted data sent by that individual can be decrypted only by using his specific public key.
The Diffie-Hellman key exchange then uses the public/private key pairing to securely exchange a secret symmetric key without the need of an out-of-band channel.
X.509 certificates are electronic documents that bind information such as a person's name to her public key. The distinguished name embedded in the X.509 certificate could represent an individual, an individual server, or a whole organization.
After the X.509 certificate is created with the appropriate information, it is then digitally signed by a trusted third party, known as a Certificate Authority.
Now the authenticity and integrity of the third party must be verified. There are several ways to accomplish this; companies such as Verisign and Entrust have set themselves up as global Certificate Authorities. They provide various classes of Certifications depending on the credentials provided proving your identity. Many software vendors have preinstalled the public keys for those certificate authorities in their software products.
Additionally, if your company plans to run its own certificate authority (CA), you can have your CA's public key signed by a trusted CA. This allows you to sign your own employee certificates with your CA's public key, which can be verified by validating the trusted CA's public key signature.
You can also manually install the public key of your company's CA into your software's trusted list of certificate authorities.
The big difference between public-key and normal symmetric key cryptography is that you only need to get one public key of a trusted system out-of-band, and most X.509 capable software has the major CAs preinstalled.
The following are some common uses of X.509 certificates:
Web servers use X.509 certificates to authenticate themselves and the organization they belong to for clients connecting to them. X.509 certificates are used primarily in e-commerce applications and other transactions that require security. The HTTP session is encrypted between the client and server via SSLv2.
Web browsers use X.509 certificates to authenticate individual users to Web servers. This is a more secure authentication than the default HTTP BASIC authentication using an account and password. The HTTP session is encrypted between client and server via SSLv3.
Email clients use X.509 certificates for both authentication and encryption. Authentication is handled via digital signing, and message confidentiality is handled by encryption. S/MIME is a version of MIME designed specifically to address security related issues. MIME, RFC 1521, is a message-based format designed to structure messages for client interoperability. Any S/MIME-capable mail client should be able to handle both digital signatures and encrypted email. S/MIME actually uses the document structure defined in Public-Key Cryptography Standard (PKCS) #7, an industry standard on secure information exchange.
Java software run from remote servers can be signed with an X.509 certificate. This authenticates the author or vendor of the software. Authenticated software executed within a Web browser can be granted additional capabilities such as full network and file access.
Pretty Good Privacy (PGP) Keys
Pretty Good Privacy is a variation of the public-key cryptosystem developed by Philip R. Zimmermann in 1991. PGP is available both as a commercially supported program, and as a freeware program. Additionally, there are open-source versions that adhere to the OpenPGP standard. PGP has been very popular to use for digitally signing and encrypting email on the Internet.
PGP is different than normal public-key cryptography in that it uses a faster symmetric key to encrypt the message, and then the slower PGP key is used to encrypt the shorter symmetric key.
Digital signatures with PGP are done similarly to X.509 digital signatures. A hash or message digest of the message is computed, and then encrypted with the sender's private key. People who receive the message must compute the hash and compare it to the decrypted value sent with the message.
PGP differs from X.509 in its trust model. PGP imposes no hierarchical structure for authenticating signatures. PGP allows users to sign other people's certificates. That way if you receive a PGP key that has been signed by a number of people you trust, you can then trust that signature is valid.
Although it might not seem at first that this "Web of trust" model scales as well as its hierarchical competitor, the Web of trust model can be made to emulate the hierarchical trust model.
Currently no major software vendors ship email clients that have native support for PGP, the PGP software itself has plug ins for many of the major email software programs. Email messages are formatted using PGP/MIME, which is different and non-interoperable with S/MIME.
PGP could also be used to encrypt or sign individual files, thus ensuring that even if someone gained access to your private data, its confidentiality would be maintained.
Network Associates, the people who now own the original PGP software, have expanded the original capabilities of the PGP client. They have added the ability to encrypt whole volumes of data transparently via their PGPdisk feature. You can also encrypt network traffic using the PGPnet feature. PGPnet uses the Internet standard IPsec protocol to encrypt traffic on the wire. IPsec encrypts all traffic between peers, not just a specific protocol such as SSL.