My Profile Photo


I'm Jason, a web applications developer in the San Francisco Bay area.


Back to Cheat Sheets

Pretty Good Privacy (PGP)

See Introduction to GnuPG for more detail.

# install using homebrew
brew install gpg

# generate your personal key
gpg --gen-key

# list keys
gpg --list-keys

# list secret keys
gpg --list-secret-keys

# encrypt a file (requires specifying recipient)
gpg -e -r secret.txt

# decrypt and view encrypted file contents
gpg -d secret.txt.gpg

# decrypt and save file contents to a new file
gpg -d -o secret.txt secret.txt.gpg

# import a persons public key
gpg --import publickey.txt

# get ASCII-armored public key
gpg --output publickey.txt --armor --export