I'm trying to use EasyPG to store secrets that I need to set in my init file. To set up, I did the following:
- Created a secrets.el file that has a couple of declaration like:
(setq SOME_SECRET "<the secret>")
- I then used
epa-encrypt-file
to create an encrypted filesecrets.el.gpg
. - Then I load this file in my init.el
(load-library "~/secrets.el.gpg")
This works after one load, but then later when I restart Emacs, I get an error message on load that it can't find the key:
File error: Opening input file, Decryption failed, No secret key: ***********
The key definitely exists, though, as I can verify that with GPG at the commandline, and the whole flow works once.
Does anyone know what be wrong here?
UPDATE
I realized that if I use gpg
at the console to decrypt the file once, at which point I am prompted for the passphrase, that then emacs is able to decrypt the file. So I'm wondering if EasyPG is just not prompting for the passphrase.
Is there more setup I need to do to get it to promote for the passphrase?