Keeping a Private Journal in org-mode

May 21, 2019 ยท 3 minute read

Posted in: journal encryption privacy org-mode

Diary with lock

Since I’ve started reading gopher logs, I’ve noticed that a lot of people write very personal journals on their phlogs, where they are perhaps pseudonymous. I really want to write that kind of thing, but it wouldn’t work for me to have it on my blog or phlog. For one thing, my main online identities, like this blog, are tied to my public identity. And for another, I am a very private person. I want to write down thoughts I’m not comfortable sharing with anyone, for my own benefit.

I could keep a journal on paper, and I do love paper journals, especially with a fountain pen. But a paper journal is never really private; someone can always find it and read it. It’s not practical to use a cipher stronger than a monoalphabetic substitution cipher or private alphabet to write your thoughts in your journal, and breaking those is a simple puzzle to do by hand.

That leaves a private, encrypted computer file, and I’m going to talk about the process I’ve settled on. It’s optimized for quick, frequent, short additions to a file.

I use emacs for a lot of my digital life, and I use org-mode for task tracking, note taking, and many other things. Especially with org-capture, it’s a good fit for my use. I’m not going to go too heavily into emacs setup in this post; I’m more interested in the process parts.

First, I’m setting up an org-capture template that looks like this:

 ("j" "Journal Entry" entry
  (file+olp+datetree "~/orgmode/PersonalJournal.org.gpg")
  "* %?
%i
%a
Added: %U")

This isn’t the whole value of org-capture-templates, it’s just one value. And I actually set it up using customize rather than entering that Lisp code by hand.

The effect of this is that when I type C-c c j, emacs will automatically decrypt my personal journal file and add a subheading to it for today’s date. It will put in a line for a title and some context information including the time I started it. After I write an entry and save it, emacs will encrypt it again.

The extension .org.gpg tells emacs to open the file in org-mode, but to use GnuPG to automatically encrypt and decrypt the file. The first time you save it, you will be asked how you want to encrypt it. If you have gpg keys set up, you should encrypt it to your own public key. If you don’t use gpg otherwise, you might just want to use symmetric encryption, which will encrypt it with a passphrase.

You can sync the journal between devices with any sync software you like, like the Nextcloud desktop client, or syncthing. It’s not practical to edit on mobile, but I’ve found that I don’t much like the experience of journaling on a mobile device.

For reviewing my journal, I can just open the file in emacs and browse through it. Org-mode makes folding the journal and opening particular dates easy, which is handy for remembering what I was doing or how I was feeling on a given date.

A word on security: there are probably many attacks against this journaling system. Do not rely on it if your threat model includes keeping secrets from the NSA. This method is for casual privacy only.