Skip to content

Instantly share code, notes, and snippets.

@tomisme
Last active February 23, 2016 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomisme/93555ed1c402eb700fb9 to your computer and use it in GitHub Desktop.
Save tomisme/93555ed1c402eb700fb9 to your computer and use it in GitHub Desktop.
Handy gpg(1) commands
# encrypt message stored in a file and print to stdout
gpg -a -o - -r RECIPIENT -e INPUT_FILE
# decrypt message from clipboard
xclip -o | gpg -d
# import public/private keys from clipboard
xclip -o | gpg --import
# delete public key
gpg --delete-key NAME
# export a private key to file
gpg -a --export-secret-keys USERNAME > OUTPUT_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment