Note Lock
pendingby PAN, YUN-HUEI
Password-protect individual notes with per-file idle auto-lock.
Note Lock
Password-protect individual notes in your Obsidian vault. Unlike folder-level protection plugins, Note Lock lets you lock specific files — right-click any markdown file to protect it.
Features
- Per-file protection — Right-click any markdown file to lock/unlock it. Only protected files require password verification.
- Password security — Passwords are stored as SHA-256 hashes using the Web Crypto API. No plaintext is ever saved.
- Idle auto-lock — Configurable timeout (in minutes) that automatically re-locks files after inactivity. Each file has its own independent timer.
- Auto-lock on file switch — Optionally re-lock the previous file when you navigate to a different note.
- Tab close detection — Closing a tab automatically revokes access to that file.
- Cross-platform — Works on both desktop and mobile using only Obsidian API and Web standard APIs.
How to use
- Open Settings → Note Protection and set your password.
- Right-click any markdown file → Encrypt to protect it.
- Opening a protected file will prompt for your password.
- To permanently remove protection, right-click → Decrypt and enter your password.
Settings
| Setting | Description |
|---|---|
| Password | Set or change your global password |
| Idle auto-lock | Minutes of inactivity before files are re-locked (0 to disable) |
| Auto-encrypt on close | Re-lock the previous file when switching to another note |
Supported file types
Currently only Markdown (.md) files are supported. Canvas, Excalidraw, and other non-markdown file types are not supported because protection status is stored in frontmatter, which is only available in markdown files.
How it works
- Protection status is stored in each file's frontmatter (
protected: 'encrypted'). - Access is tracked in memory per session — restarting Obsidian requires re-verification.
- The plugin does not encrypt file contents. It prevents access through Obsidian's UI. Files remain readable via the filesystem.
Development
npm install
npm run build
To run tests:
npm run test
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.