6 Caching Passphrases

Typing passphrases is a troublesome task if you frequently open and close the same file. GnuPG and EasyPG Assistant provide mechanisms to remember your passphrases for a limited time. Using these, you only need to re-enter the passphrase occasionally. However, the configuration is a bit confusing since it depends on your GnuPG installation (see GnuPG Version Compatibility), encryption method (symmetric or public key), and whether or not you want to use GnuPG Agent. As an additional constraint, use of the GnuPG Agent is mandatory for GnuPG 2.0 and later. Here are some questions:

  1. Do you use GnuPG version 2.0 or later instead of GnuPG version 1.4?
  2. Do you use symmetric encryption rather than public key encryption?
  3. Do you want to use GnuPG Agent?

Here are configurations depending on your answers:

YesYesMustSet up GnuPG Agent.
YesNoMustSet up GnuPG Agent.
NoYesYesSet up elisp passphrase cache.
NoYesNoSet up elisp passphrase cache.
NoNoYesSet up GnuPG Agent.
NoNoNoYou can’t, without GnuPG Agent.

To set up GnuPG Agent, follow the instruction in Invoking GPG-AGENT in Using the GNU Privacy Guard.

To set up elisp passphrase cache, set epa-file-cache-passphrase-for-symmetric-encryption. See Encrypting and Decrypting gpg Files.