# Preventing decryption on Emacs startup

**URL:** <https://org-roam.discourse.group/t/preventing-decryption-on-emacs-startup/582>\
**Category:** Troubleshooting\
**Created:** [July 29, 2020, 6:27pm UTC](https://org-roam.discourse.group/t/preventing-decryption-on-emacs-startup/582 "2020-07-29T18:27:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcncm](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mcncm](https://org-roam.discourse.group/u/mcncm)\
**Post date:** [July 29, 2020, 6:27pm UTC](https://org-roam.discourse.group/t/preventing-decryption-on-emacs-startup/582/1 "2020-07-29T18:27:01Z")

</div>

Hi everyone,

I’m getting started using Org-roam, and really quite liking it so far! I’ve had one problem with it, though, that may be coming from one of a few places, and I’m not an experienced-enough Emacs user to know right away how to diagnose the problem.

I’ve elected to encrypt my Org-roam files, but it seems that Org-roam prefers to decrypt them “eagerly” rather than “lazily,” in the following way: every time I start Emacs, I’m prompted to enter a passphrase for a GPG key, and immediately after I see under my mode line that all my Org-roam files are being decrypted in sequence. Unfortunately, this not only takes time (and will take more and more time as I add more notes), it also prevents me from using emacsclient, since I can’t enter the passphrase on startup.

Does anyone have any ideas about why this might be, and how to ensure that only files I actually open are decrypted? If it helps, I’m using Spacemacs (yes, sorry, I’m an Emacs newbie! 🙂 )

Thanks very much!

EDIT: I’m also not quite sure what purpose this round of decryption serves, since each file appears to be individually re-decrypted when I open it.

---

<div class="post-metadata">

**Author:** ![zaeph](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/zaeph/32/764_2.png) [@zaeph](https://org-roam.discourse.group/u/zaeph)\
**Post date:** [July 29, 2020, 6:46pm UTC](https://org-roam.discourse.group/t/preventing-decryption-on-emacs-startup/582/2 "2020-07-29T18:46:19Z")

</div>

Hi there,

I think this might have been due to the first-pass we need to run to compute the links. Have you tried restarting Emacs after the initial database-build? I’d assume it’d only load files as you need them afterwards.

---

<div class="post-metadata">

**Author:** ![mcncm](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mcncm](https://org-roam.discourse.group/u/mcncm)\
**Post date:** [July 29, 2020, 6:52pm UTC](https://org-roam.discourse.group/t/preventing-decryption-on-emacs-startup/582/3 "2020-07-29T18:52:54Z")

</div>

Hi zaeph, thanks for answering. Yes, it loads _every_ file every time I restart Emacs, as if it were rebuilding the database on startup (which it may well be doing!).

---

<div class="post-metadata">

**Author:** ![zaeph](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/zaeph/32/764_2.png) [@zaeph](https://org-roam.discourse.group/u/zaeph)\
**Post date:** [July 29, 2020, 6:56pm UTC](https://org-roam.discourse.group/t/preventing-decryption-on-emacs-startup/582/4 "2020-07-29T18:56:08Z")

</div>

Neither @jethro nor me work with GPG-encrypted files, which means that we haven’t spent a whole lot of time testing it, and I don’t see this changing in the near future. We’re still working on a lot of core features, and it’s hard to justify time on hardly-used features such as file-encryption right now.

Could you open an issue for this on GitHub? If it’s trivial, we’ll address it when we get a minute. If it’s more involved, you’ll probably have to wait and use non-encrypted files instead.

---

<div class="post-metadata">

**Author:** ![mcncm](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mcncm](https://org-roam.discourse.group/u/mcncm)\
**Post date:** [July 29, 2020, 6:57pm UTC](https://org-roam.discourse.group/t/preventing-decryption-on-emacs-startup/582/5 "2020-07-29T18:57:03Z")

</div>

Sure thing; thanks very much, zaeph!
