2 GnuPG Things
tengel edited this page 2024-09-05 08:27:27 -05:00

Allow unattended passphrases to work, stop a GUI dialog when using a CLI app:

$ cat ~/.gnupg/gpg-agent.conf

pinentry-program /usr/bin/pinentry-tty
allow-loopback-pinentry

Reload the agent running in the background to update the above, as well as to force it to forget passphrases being cached in memory:

gpg-connect-agent reloadagent /bye

Encrypt and decrypt a file then test they match, order matters of CLI flags for decrypting.

gpg -c passwords_backup.csv
gpg -o passwords_restored.csv -d passwords_backup.csv.gpg
diff -uN passwords_backup.csv passwords_restored.csv

Use a keyserver with Let's Encrypt wrapped around it

$ cat ~/.gnupg/dirmngr.conf

hkp-cacert /home/FOO/.gnupg/le.pem
keyserver hkps://keys.openpgp.org

Set a default key to use

$ cat ~/.gnupg/gpg.conf

default-key ABCD1234