Skip to content

Instantly share code, notes, and snippets.

@mayurah
Created March 31, 2017 03:51
Show Gist options
  • Save mayurah/e48a22dbbb797718b17c59c1691c3d8d to your computer and use it in GitHub Desktop.
Save mayurah/e48a22dbbb797718b17c59c1691c3d8d to your computer and use it in GitHub Desktop.
GPG Cheatsheet / PGP Encryption
# Brew Software
brew install gpg
# GNU PG Config Directory
ls -lah ~/.gnupg
# In case of stdout/tty password input issue / keybase issue
export GPG_TTY=`tty`
# Generate new key
gpg --gen-key
# Import previously exported private key.
gpg --import ~/path/to/exported/dir/priv.key
# List GPG Key
gpg --list-keys
gpg2 --list-secret-keys
# Misc.
gpg2 --no-tty --with-colons --fingerprint -K
# Encrypt
gpg --output encrypted_file.txt.gpg --encrypt --recipient [email protected] plaintext_file.txt
# Decrypt
gpg --output plaintext_file.txt --decrypt encrypted_file.txt.gpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment