I'm trying to configure gpg-agent to cache my passkey for encrypted text blocks in emacs. I've gotten org-crypt to work successfully using org-crypt alone, but when I try to set up gpg-agent it fails.

when i put eval $(gpg-agent --daemon) into my .profile (i'm running off of a debian system), emacs gives the error "failed to decrypt: peculiar error". I've also tried adding the following script to my .profile as well:

eval $(gpg-agent --daemon --enable-ssh-support --write-env-file "${HOME}/.gpg-agent-info")
if [ -f "${HOME}/.gpg-agent-info" ]; then
   . "${HOME}/.gpg-agent-info"
   export GPG_AGENT_INFO
   export SSH_AUTH_SOCK
export GPG_TTY

When I run that, emacs prompts for my password with the following string:

+---------------------------------------------------------------------------+| You need a passphrase to unlock the secret key for user:    

This shows up where the minibuffer normally is, but breaks the formatting. Additionally, it locks up my terminal and I need to kill the session entirely (I use Screen to save my session, and even that can't detach)

This sure seems like a misconfiguration somewhere but I'm really not sure how to go about debugging it. What should I do next?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.