Skip to main content
Share Your Experience: Take the 2024 Developer Survey
30 votes
Accepted

Enabling minibuffer pinentry with Emacs 25 and GnuPG 2.1 on Ubuntu Xenial

You also have to Explicitely enable loopback mode for pinentry in your gpg-agent.conf. Configure epa to use loopback for pinentry. Start the pinentry server in emacs, 1. Enable Emacs pinentry and ...
Oliver Scholz's user avatar
22 votes

Unable to decrypt .gpg file using emacs but command line gpg works

You do not say which OS nor version of emacs you have. I solved yesterday exactly the same problem in OSX and emacs 25.1 using information from this link: http://colinxy.github.io/software-...
Heikki's user avatar
  • 3,076
14 votes

Emacs failing to save encrypted file

Downgrade to GnuPG 2.4.0 should help. There is an issue registered in gnupg and numerous reports in other resources: https://dev.gnupg.org/T6481 It is still not fixed as of GnuPG 2.4.3, unfortunately.
Maxim Kim's user avatar
  • 1,766
11 votes
Accepted

How to force Emacs or pinentry to forget wrong GPG password?

Pinentry is only an interface, it doesn't keep any passphrase or permission, and neither does Emacs. It's GPG-agent that manages the ropes. For example, if the time expires or the process dies, you'll ...
Muihlinn's user avatar
  • 2,634
7 votes
Accepted

How do I remove passwords and usernames from my emacs .init file?

Took quite a bit of trial and error, but here was the eventual solution: Create .authinfo.gpg file in a directory of your choice Add the following to the .authinfo.gpg file (for IRC login) machine ...
SeaDude's user avatar
  • 355
6 votes

gpg password entry in minibuffer, not popup

Have you tried installing gpg version greater than 2.1, and then (setq epa-pinentry-mode 'loopback)? This should prompt for the password in the minibuffer. Edit: epa-pinentry-mode has been marked ...
InHarmsWay's user avatar
  • 1,329
6 votes

Enabling minibuffer pinentry with Emacs 25 and GnuPG 2.1 on Ubuntu Xenial

For setups with GnuPG >= 2.1, pinentry package is not needed anymore. Quote from the Emacs News.26 file: ** The pinentry.el library has been removed. That package (and the corresponding change in ...
Y. E.'s user avatar
  • 767
6 votes
Accepted

gpg fails to find key to elpa archive

I encountered this issue. I solved it using the following steps in order: Installing Gpg4win Make sure that the folder c:/Progra~2/GnuPG/bin is on your path before any other installed versions of the ...
preetpalS's user avatar
5 votes

How to get gpg-agent to cache the passphrases I enter when reading/saving *.gpg files?

https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html#Agent-Options In this documentation, the options you might be interested in default-cache-ttl n, Set the time a cache entry is ...
junnu's user avatar
  • 780
5 votes

gpg fails to find key to elpa archive

I solved this issue using above solutions in tandem. I changed the package-gnupghome-dir as suggested. This got me partway there. I then got a different error, Can't check signature: No public key. So,...
naugiedoggie's user avatar
5 votes

How to configure EasyPG with Gpg4win or any other Windows GPG version?

I had this problem and got it to work. Needed to spelunk through the code in epg.el and epg-config.el to determine what to fiddle with. This is what worked for me: (custom-set-variables '(epg-gpg-...
Cheeso's user avatar
  • 245
5 votes

Emacs failing to save encrypted file

If downgrading gnupg is not an option one can also set this in the Emacs config: (fset 'epg-wait-for-status 'ignore) ; this is dangerous see below After that Emacs is able to write the *.gpg file ...
zzantares's user avatar
  • 267
4 votes

Cannot run melpa package refresh due to gpg errors

I had the same problem. It seems like gpg is not able to locate a key server. To fix it, in the ~/.emacs.d/elpa/gnupg directory, create a file named gpg.conf with the following line: keyserver hkp://...
Justin N's user avatar
  • 141
3 votes

Using auth-source with magit and bitbucket

The prompt I see without any configuration is: Password for 'https://[email protected]': this corresponds to the used remote url: https://[email protected]/tarsius/foobar.git I then added ...
tarsius's user avatar
  • 25.8k
3 votes
Accepted

how to use minibuffer instead of pop-up window for GPG files?

I am moving my comment to an answer explaining how pinentry-emacs works because of formatting pinentry-emacs stops the window from popping up that asks for your password and insteads asks for your ...
Jules's user avatar
  • 1,225
3 votes
Accepted

How to GPG-sign a commit when reverting in Magit?

I've just added --gpg-sign to the revert popup. Since it sounds like you are signing all commits anyway, you might also just set the Git variable commit.gpgSign. And you can always add your own ...
tarsius's user avatar
  • 25.8k
3 votes
Accepted

Cache symmetric encryption passphrase for a session or some amount of time

I cannot comment on Emacs 24, but here's how I solved this for Emacs 25: By default epa in Emacs 25 uses gpg2 (GnuPG 2.x). According to the Epa manual, caching with gpg2 requires gpg-agent. For some ...
Oliver Scholz's user avatar
3 votes

GPG No Public Key

I had the same problem, on msys2, with the mingw64 version of emacs, which is 27.1, incidentally. The problem I've found comes from emacs's package.el not agreeing (in msys2's context) with gpg on ...
julio's user avatar
  • 53
3 votes
Accepted

Emacs failing to save encrypted file

This issue is now fixed with the latest gnupg 2.4.4 (I upgraded and am able to encrypt .org.gpg files) https://dev.gnupg.org/T6481
Sankalp's user avatar
  • 156
2 votes
Accepted

Do not automatically sign emails directed to mailing lists and such

The following will prevent messages to email addresses in blacklist-addresses from invoking mml-secure-message-sign. (defvar blacklist-addresses nil "List of email addresses (as strings) to ...
Dan's user avatar
  • 33.1k
2 votes
Accepted

Emacs opens gpg file without asking for passphrase

How can you be sure that GNOME is not caching the passphrase? If you are starting emacs in non-terminal mode, and if it is not asking for passphrase, you must have checked the option for "...
ksinkar's user avatar
  • 546
2 votes
Accepted

org-crypt key in .init file?

org-crypt-key is the GPG key identifier, normally an email address. Your GPG secret key resides in the secret ring in your .gnupg directory, and is protected by your passphrase. From the source code ...
Juancho's user avatar
  • 5,465
2 votes
Accepted

Include .org.gpg files in org-agenda

Override org-agenda-file-regexp as shown to include .org.gpg files, then set org-agenda-files as usual. (unless (string-match-p "\\.gpg" org-agenda-file-regexp) (setq org-agenda-file-regexp ...
Aaron Jensen's user avatar
2 votes

gpg fails to find key to elpa archive

Emacs' package infrastructure uses its own variable for GPG, package-gnupghome-dir. For me (and, obviously, you here) it failed because Emacs' filename functions don't see the path as an absolute ...
Jürgen A. Erhard's user avatar
2 votes

User-friendly setup of Emacs with GPG, mu4e, and mu4e-send-delay

This was intended as a comment, but it's too long, hopefully it will give you some hints. Right now I don't have a mac to try OSX configs, but this is what I have now: pinentry: pinentry-program /...
Muihlinn's user avatar
  • 2,634
2 votes

How to detect programmatically if content under org-mode headline is encrypted or not before a save or commit?

From the commentary at the beginning of org-crypt.el: ;; 4. To automatically encrypt all necessary entries when saving a ;; file, call `org-crypt-use-before-save-magic' after loading ;; org-...
Phil Hudson's user avatar
  • 1,741
2 votes

Cannot open .gpg file in emacs after upgrading to 27.1

As Martin mentioned, this is due to a version problem of the gpg binaries RHEL/CENTOS provides. For this to work, you need to convince emacs that your version is acceptable. Find the .../share/emacs/...
user24201's user avatar
2 votes
Accepted

How to avoid using auth-sources when editing with sudo?

This is the same question as discussed in https://debbugs.gnu.org/46674 In short: Use Tramp 2.5 from GNU ELPA, and apply in your .emacs (connection-local-set-profile-variables 'remote-without-auth-...
Michael Albinus's user avatar
2 votes
Accepted

Storing Database Authentication Details Securely

This is a late answer but hopefully this will help someone. The short answer is that for the entry in ~/.emacs.d/sql-wallet, the machine field needs to be a combination of server and database-name, ...
blenderblunder's user avatar
1 vote

GPG No Public Key

I have been experiencing same issue with GNU's official Emacs install, since Emacs 27.1. For now, the only way I found to fix it is to disable signature checking and verify all packages by hand. In my ...
gsl's user avatar
  • 1,772

Only top scored, non community-wiki answers of a minimum length are eligible