Hot answers tagged

31 votes
Accepted

How to automatically sign commits with magit?

In Magit commits are created using the committing popup (c). That popup would therefore be a good place to start looking for gpg support. If you do that, then you will find this: =S Sign using gpg (--...
user avatar
  • 24.4k
26 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 ...
user avatar
20 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-...
user avatar
  • 2,813
20 votes

How to automatically sign commits with magit?

Try this in your $HOME/.gitconfig or your .git/config [user] email = YourEmail name = YourName signingkey = XXXXXXXX [commit] gpgsign = true Then just commit as usual.
user avatar
  • 995
16 votes
Accepted

How to type the password of a .gpg file only when opening it

Encryption using password + key This does not save the password directly in the file but does something similar without any security risk and helps you achieve what you want. You need to use ...
user avatar
  • 24.3k
15 votes

How to type the password of a .gpg file only when opening it

Turns out all I had to do was (setq epa-file-cache-passphrase-for-symmetric-encryption t) This solution works on both Linux and Windows, and is a courtesy of Ted and Michael over at help-gnu-emacs.
user avatar
  • 22.4k
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 ...
user avatar
  • 2,376
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 ...
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 ...
user avatar
  • 1,279
6 votes
Accepted

EPA (EasyPG Assistant): How to encrypt for *two* of my own keys? OR How are key-ids used to select keys

# -*- mode:org; epa-file-encrypt-to: ("arthur@ul___dt.com" "foo@bar.baz") -*- When a mail address is associated to several keys switch to the key ids. E.g. a call to epa-file-...
user avatar
  • 2,646
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-...
user avatar
  • 235
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 ...
user avatar
  • 760
5 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 ...
user avatar
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://...
user avatar
  • 141
3 votes

Using auth-source with magit and bitbucket

The prompt I see without any configuration is: Password for 'https://tarsius@bitbucket.org': this corresponds to the used remote url: https://tarsius@bitbucket.org/tarsius/foobar.git I then added ...
user avatar
  • 24.4k
3 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,...
user avatar
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 ...
user avatar
  • 1,245
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 ...
user avatar
  • 24.4k
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 ...
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 ...
user avatar
  • 31
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 ...
user avatar
  • 31.2k
2 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 ...
user avatar
  • 409
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 "...
user avatar
  • 486
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 ...
user avatar
  • 5,055
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 ...
user avatar
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-...
user avatar
  • 1,371
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 /...
user avatar
  • 2,376
1 vote

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 ...
user avatar
1 vote

Emacs not prompting for password when opening gpg file

For gpg version < 2, caching can be from emacs or the gpg-agent To disable caching from emacs, set epa-file-cache-passphrase-for-symmetric-encryption to nil if it is not nil in emacs config file (...
user avatar
  • 760
1 vote
Accepted

Using an advice to set default parameters in a interactive function

You can create your own command to set all variables before starting ERC: (defun my/erc-freenode () (interactive) (let ((erc-plist (car (auth-source-search :host "irc.freenode.net"))) (...
user avatar

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