12

I have a git repository where some org-mode files live. Some of them have a private nature and the server where the git repository lives can be accessed by some untrusted third party. Thatswhy I want to encrypt the private org files.

What I'd like to achieve is the following: In the beginning the file is encrypted. This can be either a symmetric key with a password or it can also be my GnuPG key. When I open the file, Emacs asks for the passphrase and opens the file (if pw entered correct). I can now work with the org file like with any other org file. When I save or close the file, it should be encrypted again. Also the git commit should be encrypted.

How can I do something like that with GNU/Emacs?

Jens Kubieziel
  • 681
  • 10
  • 26
  • 3
    For the Emacs & file encryption part, I guess, you've already been [there](http://orgmode.org/worg/org-tutorials/encrypting-files.html) and [there](http://www.emacswiki.org/emacs/AutoEncryption) right? – Nsukami _ Jan 10 '15 at 02:54

1 Answers1

14

You just need to add ".gpg" at the end of the file name (for example, you could use "private.org.gpg" for an org file), and put at the end

# Local Variables:
# epa-file-encrypt-to: "someone@somwhere.org"
# End:

where someone@somwhere.org identify a gpg key you use for encrypting this file.

Rémi
  • 1,607
  • 11
  • 13