GNU Privacy Guard

Command-line for Windows Installation

  1. Download the latest one at http://www.gnupg.org/download/ (at the time of  this writing, gnupg-w32cli-1.4.11 was downloaded)
  2. Install taking all defaults (not required but recommended) during installation

Generating Key-Pair

  1. Run gpg –gen-key
  2. Select the type of key desired (sign only, sign and decrypt, etc.)
  3. Select keysize (the longer the key the more secure; encryption/decryption will be slower as the keysize is increased).  Select the highest supported keysize if security is more important than performance.
  4. Select how long the key should be valid
  5. Enter your real name (first name and last name – e.g. John Doe)
  6. Enter your email address (e.g. john.doe@example.com)
  7. Optionally enter comment
  8. Enter passphrase to protect your private/secret key

Keyrings Management

  1. Export: Run gpg –armor –export john.doe@example.com > /path/to/john.public.key
  2. Import: Run gpg –import /path/to/someone/public/key
  3. Delete: Run gpg –delete-keys /path/to/someone/public/key
  4. List: Run gpg –list-keys to list installed public keys; gpg –list-secret-keys to list installed private/secret keys
  5. Moving private key to another computer:
    1. Run gpg –export-secret-keys –armor > /path/to/john.private.key (make sure nobody gets a hold of this)
    2. Run gpg –delete-secret-keys john.doe@example.com
    3. Run gpg –import /path/to/john.private key (from another computer)

Encryption

  1. Run gpg -r “recipient name” -o /path/to/output/file -e /path/to/file/to/encrypt
  2. NOTE: Recipient public key must be already installed/imported

Decryption

  1. Run gpg -d /path/to/file/to/decrypt > /path/to/output/file
  2. Enter your private key passphrase