dotfiles/a/eg/.eg_custom/gnupg.md
2022-08-24 04:07:33 -04:00

963 B

GnuPG Cheat Sheet

Listing Key Pairs

gpg --list-keys

For listing keys with the fingerprint, run

gpg --fingerprint

Generate New Key Pair

gpg --gen-key

Encrypt a message on command line

echo "Put message here" | gpg --armor --encrypt --recipient Joshua > FILE.gpg

This will put the encrypted text into FILE.gpg which you can send to someone or keep for later use. For decrypting the message, see the next section.

Decrypt a message from the command line

cat FILE.gpg | gpg

Displays the decrypted text on the command line.

Only display user X's key information

gpg --fingerprint Joshua

Signing Messages

echo "This is a top secret message" | gpg --clearsign

Signing Text Files

gpg --clearsign example.txt

This will create example.txt.asc file.

Verify Signatures

gpg --verifiy example.txt.asc