Protecting passwords with gpg
From dbawiki
Contents
Gnu Privacy Guard
Generate a private/public key pair
gpg --gen-key
(Optional) Keyserver Registration
To enable someone to retrieve your public key without having to contact you directly.
Find the id/fingerprint
gpg --fingerprint <your name used in generation above>
id is 8 hex digit string after the / on the line starting with "pub" fingerprint is the 10 groups of 4 hex digits on the "fingerprint" line!
Register with a key server
There are many available. This example is at MIT
gpg --keyserver pgp.mit.edu --send-keys '<id>' or gpg --keyserver pgp.mit.edu --send-keys '<fingerprint>'
Either method works.
Decrypt a file using your (stored) private key
gpg --decrypt --output /tmp/<readable file> <encrypted file> or gpg -d -o /tmp/<readable file> <encrypted file>
List the public keys on your keyring
gpg --list-keys
List the private key on your keyring
gpg --list-secret-keys
Delete someones public key from your keyring
gpg --list-secret-keys
gpg --armor --output pubic_gpg_key.txt --export '<your name used in generation above>'