1

I want to be able to gpg sign specific files, specifically org-mode file.

However, doing M-x epa-sign-file RET filename.org will create the file filename.org.asc and introduce new text in that file that might disrupt functionality of the file if used as the original file. It seems cumbersome to publish both files.

Is there a way to make sure that the file filename.org.asc can be used as the original file.

Minimal working example

example filename.org:

* Should be loaded

#+begin_src emacs-lisp
(message "hello world")
#+end_src

This will be after M-x epa-sign-file RET filename.org -> filename.org.asc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

* Should be loaded

#+begin_src emacs-lisp
(message "hello world boom")
#+end_src
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJWTNPCAAoJED51s3ZWaq4/D5cH/3ztdd3YZxOu/XCG7bOEZuQa
jcxKrXiwhmLhKoC4a9tmgCJVDryy4tdSci2WUHoIxJ0vN3BFI2txFm7aoxGpIQCk
Dxjczy2RtHeN1+N+wBsxeQq5EeZ0A/7c9+eJQmub2GopAWe6D7rggCAEvnFNFcdN
LcZTo1o/jrKa63Q/KPmN+Y2E2nC4KjICn+SvaVUy2noZzS7c6ofw2dsY7YP915Ng
hs/38aITDMOpapzphQ0/VkJRDAard8U5jGmCIOMGwXyC7NIYVYB69Cdruo8uz/HA
xzl8QpMz/tv7qOLyQJLZYCPAglrt5ZGA19XAuKHqMgfvS563UCmRJdcLuGZaj58=
=3jbG
-----END PGP SIGNATURE-----
  • 1
    Why not create an MD5SUM of your .org file, then create an encrypted signature of the MD5SUM, MD5SUM.sign, and share the 3 files whenever necessary? That way, your .org file will stay the same. – Nsukami _ Nov 19 '15 at 14:47
  • @Nsukami_this is a really great answer. A side effect is that I can sign multiple files in one go and it can be easily done in the dired buffer. Thanks! – Sparx Nov 19 '15 at 23:09
1

Not really an Emacs related problem but, one of the solution could be:

  • create a SUM of your .org file,
  • then create an encrypted signature of the SUM file, named SUM.sign,
  • and finally, share the 3 files whenever necessary

That way, your .org file will stay the same.

| improve this answer | |
  • 1
    sha1 or sha256 would be better than md5. – db48x Nov 20 '15 at 16:19
  • @db48x I was just showing the idea, but yes, answer edited. – Nsukami _ Nov 20 '15 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.