Encrypted Vault search results

I use VeraCrypt to Encrypt my vault so that I have to type in a security PIN to view/edit my notes each time I use Obsidian. This is to keep my notes private on a shared machine.

I use keyboard shortcuts to quickly mount the volume containing my vault (unlock the vault) and to unmount the volume (lock the vault). I also have it set to unmount after 5mins of inactivity.

The problem I’m having is that when the volume is unmounted, although I can’t open any notes as expected, the search results still show some of the contents of my notes. e.g. even when my vault is fully encrypted searching “password” would bring up results in the search pane. (Presumably this is from the cache file?)

Are there any work arounds for this (other than closing Obsidian each time I want to lock my vault)? Perhaps moving the cache file inside my encrypted volume? Or disabling the cache somehow?

I imagine the encrypted volume includes the .obsidian folder, yes?

Chatted with the devs about this. The workflow for encryption should be:

  • Close the app
  • Encrypt the vault

Otherwise the app will hold some vault data in memory.

Then, when you want to use the vault:

  • Decrypt the vault
  • Launch Obsidian

Just for context, Obsidian remembers some of your last accessed files so when you perform searches, we don’t have to repeatedly load every file from your hard drive (which would be slow). This is what you’re seeing from search.

If you’re encrypting your vault, then you should probably close the app to avoid someone accessing your vault data that’s in memory.

1 Like

Got it. Thanks so much for taking a look.

I’ve now setup an AutoIt script that runs in the background and automatically closes Obsidian after 10mins of inactivity.

Everything seems to be working just how I want now :+1:

2 Likes

Could you share the AutoIt script, please? Thank you.