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:
Here are configurations depending on your answers:
1 | 2 | 3 | Configuration |
Yes | Yes | Must | Set up GnuPG Agent. |
Yes | No | Must | Set up GnuPG Agent. |
No | Yes | Yes | Set up elisp passphrase cache. |
No | Yes | No | Set up elisp passphrase cache. |
No | No | Yes | Set up GnuPG Agent. |
No | No | No | You 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.