Skip to content
SimplyMe
Go back

Secure Inline: Encrypting Secrets Inside Obsidian Notes, Not Around Them

Your vault syncs to a cloud you don’t control. Your notes sit in plain text on every device you own. And somewhere in that vault — let’s be honest — there’s an API key, a recovery code, a password you swore you’d move to a real password manager.

Whole-vault encryption exists, but it’s all-or-nothing: encrypt everything, break search, break backlinks, break half the plugin ecosystem. Most of your notes don’t need protecting. A few lines inside them do.

Secure Inline takes the surgical approach: encrypt the secret, leave the note.

Three Formats

Inline tokens — for short, single-line secrets:

sec:v1:eyJhbGciOi...<base64url-age-ciphertext>

Armored blocks — for longer or multi-line content:

```secure
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOS...
-----END AGE ENCRYPTED FILE-----
```

Secure properties — for structured secrets where the keys should stay readable:

```secure-properties
username: arie
api_key: sec:v1:...
password: sec:v1:...
```

That last one is the pattern I kept wanting: a credential block where api_key: stays greppable, but the value is ciphertext. Keys plain, values encrypted.

Why age, Not Bespoke Crypto

The ciphertext is standard age — the modern, minimal file-encryption format by Filippo Valsorda. No invented scheme, no custom key derivation beyond what age already specifies (X25519 recipients, scrypt passphrase mode).

Practical payoff: interoperability. The armor inside a secure fence is real age ASCII armor. Extract it, and this works:

age -d -i ~/.config/age/keys.txt secret.age

If the plugin disappeared tomorrow, your secrets are recoverable with stock tooling. The sec:v1: tokens are raw age ciphertext in unpadded base64url — decode, decrypt, done. The format is versioned deliberately; if the scheme ever evolves, old tokens stay readable and invalid legacy tokens are rejected instead of silently mis-parsed.

Keys Live Outside the Vault

The whole point is that ciphertext can sync freely while keys can’t. So:

Encrypt with your public recipients; passphrase mode (Encrypt selection with passphrase) is there when recipient keys aren’t available.

The Workflow

Select text → Secure Inline: Encrypt selection. Single-line selections under the limit become sec:v1: tokens; bigger ones become armor blocks. Right-click → Secure selection does the same from the context menu.

The flow that changed how I use it: type plaintext inside an empty secure fence, and when the cursor leaves the block it auto-encrypts in place. Same for secure-properties values. Write the secret like normal text; it never survives in plaintext once the sweep runs. There’s also an explicit command to sweep a note for any pending plaintext fences.

In Reading mode or Live Preview, click to reveal. Relock manually, or let auto-relock handle it. Ctrl/Cmd-click copies plaintext without revealing it on screen — useful when someone’s looking over your shoulder.

Honest Security Boundary

The README has a full threat-model section, because a security tool that oversells itself is worse than none. Short version:

Install

Until it’s in the community plugin browser, manual install is one command:

git clone https://github.com/frizkey/obsidian-secure-inline
cd obsidian-secure-inline
npm install
npm run install:local -- "/path/to/vault"

Restart Obsidian, enable Secure Inline (age) in community plugins, drop your age1... recipients in settings (or point it at your existing keys.txt), and encrypt something.

MIT licensed. Issues and feedback welcome on the repo — especially interop edge cases with the age CLI.


Share this post:

Previous Post
Cassandra Anti-Patterns: The Unbounded Partition Trap in Activity Feeds
Next Post
The Escape Valve: A Coverage Gate That Keeps a Shmup Fair