GPG Cheat Sheet

Generate Key

gpg --gen-key

Upload key

gpg --send-keys --keyserver keyserver.ubuntu.com DEADBEEF

Download key

gpg --keyserver keyserver.ubuntu.com --recv-keys DEADBEEF

Export Public Key

gpg -ao something-public.key --export DEADBEEF

Export Private Key

gpg -a --export-secret-keys DEADBEEF | gpg -aco some-private.key.gpg

Import Public Key

gpg --import something-public.key

Import Private Key

gpg --decrypt some-private.key.gpg |gpg --import

Sign Key

gpg --sign-key ABABABAB
gpg --default-key DEADBEEF --sign-key ABABABAB

Sign a file

gpg --default-key DEADBEEF --sign --detach-sign DumbSlides.odp

Verify signature file

gpg DumbSlides.sig

Sign a clear text

gpg --clearsign textfile.txt
gpg --default-key DEADBEEF --clearsign textfile.txt

Create ASCII Armoured key file

gpg --export -a DEADBEEF > mykey.asc

Encrypt a file

# -s sign the file with your key
# -e encrypt the file with a password
# -c encrypt with a symmetric cipher using a passphrase.

gpg --armor --recipient DEADBEEF --encrypt --sign file

Decrypt

gpg -d file.gpg

Tags:

Comments are closed.