Command-line for Windows Installation
- Download the latest one at http://www.gnupg.org/download/ (at the time of this writing, gnupg-w32cli-1.4.11 was downloaded)
- Install taking all defaults (not required but recommended) during installation
Generating Key-Pair
- Run gpg –gen-key
- Select the type of key desired (sign only, sign and decrypt, etc.)
- 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.
- Select how long the key should be valid
- Enter your real name (first name and last name – e.g. John Doe)
- Enter your email address (e.g. john.doe@example.com)
- Optionally enter comment
- Enter passphrase to protect your private/secret key
Keyrings Management
- Export: Run gpg –armor –export john.doe@example.com > /path/to/john.public.key
- Import: Run gpg –import /path/to/someone/public/key
- Delete: Run gpg –delete-keys /path/to/someone/public/key
- List: Run gpg –list-keys to list installed public keys; gpg –list-secret-keys to list installed private/secret keys
- Moving private key to another computer:
- Run gpg –export-secret-keys –armor > /path/to/john.private.key (make sure nobody gets a hold of this)
- Run gpg –delete-secret-keys john.doe@example.com
- Run gpg –import /path/to/john.private key (from another computer)
Encryption
- Run gpg -r “recipient name” -o /path/to/output/file -e /path/to/file/to/encrypt
- NOTE: Recipient public key must be already installed/imported
Decryption
- Run gpg -d /path/to/file/to/decrypt > /path/to/output/file
- Enter your private key passphrase