Skip to content

Instantly share code, notes, and snippets.

@Erodotos
Created December 23, 2023 20:10
Show Gist options
  • Save Erodotos/5ae95677e12f6de9f49403c376484e2a to your computer and use it in GitHub Desktop.
Save Erodotos/5ae95677e12f6de9f49403c376484e2a to your computer and use it in GitHub Desktop.
PGP Cheat Sheet

List Current Keys

$ pgp -K

Export public key

$ gpg --export --armor <email>

Import a public key

$ gpg --import public.gpg

Sign doc.txt without encryption

$ gpg --clearsign doc.txt

Encrypt and sign doc.txt for alice@example.com and bob@example.com

$ gpg --encrypt --sign --recipient alice@example.com --recipient bob@example.com doc.txt

Decrypt doc.txt.gpg. If singed will verify as well.

$ gpg --decrypt doc.txt.gpg

Verify signature

$ gpg --verify doc.txt.gpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment