2

Below is debugger results. epa does work fwiw.

Debugger entered--Lisp error: (error "Encrypt failed")
  signal(error ("Encrypt failed"))
  error("Encrypt failed")
  org-encrypt-entry()
  funcall-interactively(org-encrypt-entry)
  call-interactively(org-encrypt-entry record nil)
  command-execute(org-encrypt-entry record)
  helm-M-x(nil #("org-encrypt-entry" 0 17 (match-part "org-encrypt-entry")))
  funcall-interactively(helm-M-x nil #("org-encrypt-entry" 0 17 (match-part "org-encrypt-entry")))
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)
  • It probably failed while running gpg or gpg2. Are there any messages about it in the Messages buffer? – db48x May 30 '17 at 13:45
  • Only 'org-encrypt-entry: Encrypt failed' – vv111y May 30 '17 at 17:30
  • That message comes from epg-encrypt-string. Try debugging that function in file epg.el. – Juancho May 30 '17 at 21:42
  • How would I go about doing that? – vv111y Jun 1 '17 at 21:23
2

I had the same problem -- for me the private key set up for the encryption was expired.

# First try whether you can encrpyt anything from the command line
touch /tmp/test.txt
gpg --encrypt --recipient "your_mailaddress@example.org" /tmp/test.txt

This failed for me with /tmp/test.txt: encryption failed: No public key (which I found slightly misleading). But gpg --list-keys showed me that my key was indeed expired. So I changed the expire-date to be in one year:

gpg --quick-set-expire "your_mailaddress@example.org" 1y

Now gpg --encrypt --recipient "your_mailaddress@example.org" /tmp/test.txt worked as well as the org-encrypt-entry. Maybe that is your problem as well?

  • Worked! I had to do even more configuration to get it all going, including installing pinentry-mac (via brew) for decryption. Thanks @ricma – vv111y Oct 2 '18 at 12:31

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.