PGP has been around for a while, and there are a LOT of different versions out there. Old versions (2.6) sometimes can't exchange messages with new versions (5, 6, GPG). There are still a lot of people who use 2.6 because that 's the only version that runs on their hardware or operating system.
Every body who uses PGP creates their own unique digital ID which is called a key pair. This key pair is built from of two large prime numbers which are related to each other by very clever math. One half of the key is called the public key, which is like the safe number in the example above. In order to have people send you encrypted messages, they will need to have a copy of your public key.
The other half is called the private key or the secret key. It's the same as the key the owner uses to unlock the safe. Messages are scrambled with the recipient's public key. Because of the clever math, nothing but the recipient's private key will be able to unscramble the message. Note that this means that the private key has to remain a secret. If you leave that key around, anybody will be able to unlock your mail.
Go look at the cryptography FAQ for a in-depth version.
gpg --genkey.
You can go along with most of the default choices. When it asks you how long the key should be good for, pick some date about 6 weeks out. You're probably going to make mistakes with your first key, and it's nice to have them lapse quickly. When it asks for a passphrase, you should type in a 4 or 5 word sentence. Effectively, this passphrase is your signature. Go to The Passphrase FAQ if you want a lot more information on passphrases.
gpg -a --export yourname@youremail.com
gpg --import , then paste in the public key.
---- BEGIN (lots of random text) BLOCK----. If you don't see that, you need to try again. Make sure that you don't still see the unencrypted message. Send the mail when all seems well.
gpg -ear recipient1@example.com -r your-email@yourcompany.com >message.asc and paste in the message. Then you can attach the message.asc file, or paste it into the email. If gpg doesn't finish after you paste in the email, type CTRL-D.
pgp -kvc gpg -kc Sooner or later, you're going to receive a public key that's been signed by a couple friends of yours. If you've already signed your friends keys, PGP will automatically trust the newcomer's key.
gpg -ks
Once you've signed someone's key, you should give it back to them, so that they can use your signature as a reference. You can send their public key using the same techniques you used to give them your public key.
What is a keyserver?
A keyserver is a database of people's public keys put up on the Internet to make it simpler to download other people's keys. There really great, except for one thing: There is no way to remove a key from a keyserver. ( But you do get most of that effect by revoking the key )
If you lose your PGP passphrase & have to generate a new key, there are going to be 2 keys on the keyserver, and people are going to have trouble picking the right one. Since you're likely to make some mistakes as you start, don't put your keys on a key server until you're confident.
GPG does support keyservers, but in an irritating way. It will only ask for or send key ids, not user names. So you have to look up your key id before sending. ( gpg -kc yourname ) Then you can send the key with gpg --keyserver www.tenhand.com --send-keys 0xkeyid . You have to add 0x onto the front of the keyid name.
PGP 5 through 7 make sending keys almost too easy, since they use some very public keyservers by default. ( This is good if you know what you're doing).
To send keys in PGP, Open PGP Keys, click on the public key you want to send, then click on the Server menu and select the server you want to send to on the Send To sub menu.
For PGP 5 through 7, open PGP keys, Click on the Server menu, and then select Search. Choose the server you want to search on, and type in what you want to search for (username, keyid) , then click on Search. To import the keys, drag them onto the PGPkeys main window.
Revoking a key
If you lose your private key, it would be nice to be able to force people to stop sending mail with it.
You can do this, but only if you've created a key revocation certificate in advance.
If you send the key revocation to a keyserver, it will prevent other people from continuing to use that key.
When you want to revoke your key, import the revocation certificate (just like anybody else's public key). This will then modify your keypair. Send the modified public key to the keyserver, and everyone will be able to see that your key has been revoked.
Generating a revocation certificate for GPG is simple: just type
gpg -a --gen-revoke username > revoke.asc . Then save the revoke.asc file someplace safe.
For PGP , generating a revocation is actually a big hassle. You have to back up your pgp keyrings, then revoke the key. Then backup the revoked key someplace, then restore your working keys. You can revoke the key by clicking on the key you want to revoke, then choosing Revoke from the Keys menu.
gpg -a --detach-sign [filename]