3

I have installed the termux and app and used it to install emacs on my android phone, i.e.

http://endlessparentheses.com/running-emacs-on-android.html

I then installed gpg via termux, i.e.

$ apt-get install gnupg2

However when I try to open a symmetrically encrypted .gpg file (private key) in emacs (running under termux) I get the following error:

Error while decrypting with "/usr/bin/gpg":

gpg: CAST5 encrypted data
gpg: problem with the agent: Not a typewriter
gpg: encrypted with 1 passphrase
gpg: decryption failed: No secret key

Its as though it doesn't know that I have to provide the decrypt key via the emacs minibuffer in order to open the file

I've tried various permutations of the following elisp in my .emacs file:

(require 'epa)
(epa-file-enable)
(setq epg-gpg-program "/usr/bin/gpg"))
;; Don't display graphic prompt in terminal
(when (not (display-graphic-p))
(setq epg-gpg-program "/usr/bin/gpg"))

but all to no avail thus far

anyone with any pointers/experience in this area gratefully received..

1
  • Does (setq epa-pinentry-mode 'loopback) help?
    – akater
    Commented Dec 12, 2018 at 9:37

1 Answer 1

1

Error while decrypting with "/usr/bin/gpg":

On Termux there is no /usr folder, so you need /data/data/com.termux/files/usr/bin/gpg (or perhaps you can just specify gpg without full path?).

Also, note that you should use gpg2 if you want to use gnupg2 - the gpg program is from gnupg version 1 (and would require apt install gnupg).

1
  • hmm - good spot. I've tried and can run gpg and gpg2 from the termux cmd line. So they're obviously on the PATH. I modified the .emacs file location as you suggested, just using gpg2 rather than /usr/bin/gpg2. Still coming back with same error though..curious
    – bph
    Commented Nov 28, 2016 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .