Opening a .gpg file via emacs under termux 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..
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).