Mail Encryption with PGP

Key generation and management

Software

Key generation

If you use a GUI like the following (GPG Keychain Access for Mac OSX, which is included in GPGTools), just hit "New" and provide some data for your key. If you want others to sign your key later on, make sure to use your real name and mail address.

If you rather want to use the command line gpg--gen-key is your friend which will guide you through the key generation.

Key management

The GUI gives you easy access to all the keys of you and your contacts. You can download keys from the keyserver, change keys (e.g. adding mail addresses), import and export key files and much more. Please notice that when you export one of your keys you can choose to include or not include the private key. Know what you're doing if you want to export the private key to somewhere else!

On the command line the gpg command of course has a lot of options. The most important ones are:

  • gpg --gen-key Generate new keypair
  • gpg -e filename.txt Encrypt a file (will ask you for the recipients interactively)
  • gpg -d filename.txt.gpg Decrypt a file
  • gpg --armor --export Export your public key
  • gpg --armor --export|pbcody Copy your private key to clipboard (Mac OSX only)