Created
March 31, 2017 03:51
-
-
Save mayurah/e48a22dbbb797718b17c59c1691c3d8d to your computer and use it in GitHub Desktop.
GPG Cheatsheet / PGP Encryption
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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