Encryption With Emacs

Of course it would be nice to encrypt/decrypt files from Emacs.

EasyPG comes with GNU Emacs since Emacs23 (source file: epa-file.el). Simply add to your init file:

1
2
(require 'epa-file)
(epa-file-enable)

Visit anyfile.gpg and it will be encrypted when you save the buffer.

If you’re running X and you prefer a non-graphical keyphrase prompt, include in your config:

1
(setenv "GPG_AGENT_INFO" nil)

References

EasyPG Home Page.

EmacsWiki EasyPG Entry. Configuration and troubleshooting info.