Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 963 Bytes

gnupg.md

File metadata and controls

64 lines (42 loc) · 963 Bytes

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