Encrypt notes and whole folders with a vault password or their own password. Locked notes keep their names and links, lock again automatically, and can be decrypted for good at any time.
An Obsidian plugin that encrypts your notes and folders on disk.
A locked note's contents are unreadable to anything outside Obsidian: sync services, backups, file browsers, other apps. Inside Obsidian you unlock it with a password, edit it as usual, and it locks itself again when you're done. Locked notes keep their names, so they still show up in the file explorer, in links and in the graph.
[!WARNING] There is no password recovery. If you forget a password, the notes locked with it are gone. Keep a backup of anything you can't afford to lose.
Enclave needs Obsidian 1.13 or later.
From the community plugins (recommended)
Or open Enclave in the Obsidian community directory.
With BRAT (new versions before they reach the directory)
flo-wolf/obsidian-enclave.Manually
main.js, manifest.json and styles.css from the
latest release.<your-vault>/.obsidian/plugins/enclave/.If your vault syncs through iCloud, or through Obsidian Sync with "Installed community plugins" turned on, the plugin reaches your other devices, including iOS, with the vault.
Remember passwords for the session in the settings changes this: Vault password only (default), Vault and separate passwords, or Don't remember, which asks for every password every time. Remembered passwords are never written to disk.
You choose the vault password the first time you lock a note with it. After that, a mistyped vault password is rejected right away instead of locking notes under a password you didn't mean. The same goes for a folder's separate password. Enclave remembers a small encrypted check for each, never the password itself (see Password checks).
Right-click a note in the file explorer:
| Menu item | What it does |
|---|---|
| Enclave: lock note | Encrypts the note with the vault password. |
| Enclave: lock with separate password | Encrypts the note with a password of its own. |
| Enclave: unlock note | Decrypts the note so you can read and edit it. It locks again when you leave it. |
| Enclave: permanently decrypt note | Removes the encryption for good and turns it back into a normal note. |
The lock icon in the left ribbon turns orange while any note is unlocked; clicking it then locks them all again, each with its own password. When nothing is unlocked, it unlocks the current note if it's locked, or locks it with the vault password if it isn't.
Right-click a folder → Enclave: lock folder (vault password) or Enclave: lock folder with separate password (one password for the whole folder). This locks every note in it, including subfolders, and keeps the folder locked:
Each note keeps its own password, so a folder can mix both kinds: lock one note with a separate password, then lock the folder, and the folder lock leaves that note alone.
Unlocking a folder (right-click → Enclave: unlock all notes in folder) is temporary, like unlocking a note: the folder stays locked and its notes lock again when you leave them. Enclave asks for the vault password if any notes use it, then for a separate password if any notes use one. Every note that password opens is unlocked; notes with a different password stay locked and are listed in the summary. Cancel the separate-password prompt to skip them.
Permanently decrypting a folder (right-click → Enclave: permanently decrypt folder) removes the encryption from its notes and stops keeping it locked.
Select several notes, right-click, and choose lock selected notes or lock selected notes with separate password (one password for all of them). This locks just those notes; unlike a folder, nothing is kept locked afterwards.
All actions are also in the command palette:
| Command | |
|---|---|
| Lock note (vault password) | Current note |
| Lock note with a separate password | Current note |
| Unlock note | Current note |
| Permanently decrypt note (remove encryption) | Current note |
| Lock all currently-unlocked notes | Re-locks everything you have open right now |
| Lock every note in the vault (vault password) | Whole vault |
| Unlock every locked note in the vault | Whole vault |
| Permanently decrypt every locked note in the vault | Whole vault |
| Forget remembered passwords | Clears the vault password and any remembered separate passwords from memory |
| Secure notes left exposed (after a crash) | Only shown when needed, see below |
While notes are unlocked, the status bar shows how many (for example "1 unlocked"). Click it to lock them all. It disappears once everything is locked.
| Encrypted | Not encrypted |
|---|---|
| The note's text | The note's file name |
| The note's own properties (frontmatter) | Folder names |
| Attachments: images, PDFs and any other non-Markdown file | |
| Notes while they are unlocked (see below) |
Enclave only encrypts Markdown notes. Locking a folder does not touch the other files in it.
Locking replaces the note's contents with this, in the same .md file:
---
locked: true
lock-scope: vault
---
```enclave
{"v":1,"alg":"AES-GCM","kdf":"PBKDF2","hash":"SHA-256","iterations":310000,"salt":"…","iv":"…","ct":"…","scope":"vault"}
```
locked marks the note as encrypted. lock-scope says which password it
needs: vault or note (separate).ct holds the entire original note, properties included, encrypted.Unlocking writes the plain text back to the file so you can edit it normally. That means an unlocked note is readable on disk and by your sync service until it is locked again. Enclave keeps that window short:
If Obsidian crashes while notes are unlocked, Enclave notices on the next start and offers Secure notes left exposed to encrypt them again.
To recognise a mistyped password, Enclave keeps a check for the vault password
and for each separate-password folder in its settings file
(.obsidian/plugins/enclave/data.json). A check is a short fixed text encrypted
with the password, exactly like a note, so it is just as hard to brute-force as
any locked note and reveals nothing more. The passwords themselves are never
stored.
If you already had vault notes before checks existed, the vault check is created the first time the vault password successfully unlocks one of them.
Settings → Vault password → Forget lets you choose a new vault password the next time you lock a note. Notes locked with the old one still open with the old one: if the new password doesn't open a note, Enclave asks for the earlier password. When that note locks again while you're using the new vault password, it's re-encrypted with the new one, so old notes move over as you use them.
Permanently decrypting a note restores it as a normal note and removes it from Enclave's tracking. It will not be locked again unless you lock it yourself.
Settings are stored in the vault and sync with it. Phones and tablets can have their own values for remembering passwords and auto-locking (see Use different settings on phones and tablets); both sets sync, so you can change the mobile values from your desktop.
| Setting | Default | |
|---|---|---|
| Lock when leaving a note | On | Re-lock a note when you switch to another note. |
| Hide properties of locked notes | On | Hide the properties box on locked notes, which only shows Enclave's own locked and lock-scope properties. |
| Lock when Obsidian is hidden | On | Desktop only: re-lock unlocked notes when you minimize Obsidian or switch to another space or full-screen app. On mobile, notes always re-lock when the app goes to the background. |
| Auto-lock after inactivity | 5 min | Re-lock idle unlocked notes. 0 turns it off. |
| Remember passwords for the session | Vault password only | Which passwords stay in memory after you've entered them: the vault password only, the vault and separate passwords, or none. Never written to disk. |
| Forget passwords after | 30 min | How long remembered passwords stay in memory without being used. 0 keeps them until Obsidian quits. |
| Use different settings on phones and tablets | Off | Give phones and tablets their own remember passwords, forget passwords after and auto-lock after inactivity values; the regular ones then apply to desktop only. |
| Key derivation iterations | 310,000 | PBKDF2 iterations for newly locked notes. Higher is slower to unlock and slower to brute-force. |
| Verify before overwriting | On | The round-trip check described above. Roughly doubles the time a lock takes. |
| Vault password | Not set | Whether the vault password has been chosen. Forget lets you choose a new one the next time you lock a note; see Changing the vault password. |
| Locked folders | None | Folders you've locked, with their kind of password. Deleting one from the list stops locking new notes there; its notes stay as they are. |
npm install # install dependencies
npm run dev # rebuild main.js on every change
npm run build # type-check and build a production bundle
npm run deploy # build and copy the plugin into $OBSIDIAN_VAULT
npm test # run the test suite
To try a change before releasing it, run
OBSIDIAN_VAULT=/path/to/vault npm run deploy, then turn Enclave off and on
again under Settings → Community plugins (or run Reload app without saving).
This overwrites the copy BRAT installed; BRAT puts the released version back the
next time it updates.
To publish a release, set the version in manifest.json, package.json and
versions.json, then push a tag with exactly that version (for example
1.0.1, no v). A GitHub Action builds the plugin and attaches main.js,
manifest.json and styles.css to the release, which is what BRAT installs.
Enclave is a fork of Locky by boinkdevteam, which is itself a fork of Lockbox by Danzar.
Licensed under the GNU General Public License v3.0 or later, like both projects
it is based on. See LICENSE.