From 4835b2a6f4e4ece23a5cc58be8322763351e202e Mon Sep 17 00:00:00 2001 From: tengel Date: Wed, 20 Mar 2024 11:55:03 -0500 Subject: [PATCH] Add 'GnuPG Things' --- GnuPG-Things.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 GnuPG-Things.md diff --git a/GnuPG-Things.md b/GnuPG-Things.md new file mode 100644 index 0000000..d83905b --- /dev/null +++ b/GnuPG-Things.md @@ -0,0 +1,37 @@ +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 +```