mdflow-crypt
v1.0.2
Published
Encrypt and decrypt MDflow documents locally (mdflow-enc:v1). A standalone, zero-dependency CLI you run on your own machine — plaintext and password never leave it.
Maintainers
Readme
mdflow-crypt
Encrypt and decrypt MDflow documents locally, from the command line.
MDflow lets you encrypt a document's body in your browser; the server only ever stores ciphertext (mdflow-enc:v1:…). This tool does the same crypto on your own machine, so you can take an encrypted document out of MDflow and read or write it offline — your plaintext and your password never leave your computer, and never go to a server or an AI model.
Zero dependencies. One file. Works on Node ≥ 18.
Usage
# decrypt: mdflow-enc:v1 file → <name>_decrypted.md
npx mdflow-crypt decrypt notes.md
# encrypt: markdown file → <name>_encrypted.md (paste the result into MDflow)
npx mdflow-crypt encrypt notes.md
# password from a file (first line; keep it chmod 600) instead of the prompt
npx mdflow-crypt encrypt notes.md --password-file ~/.secrets/notes.pwPassword — resolved in this order (first match wins):
--password <pw>— an inline flag--password-file <path>— read from a file (the first line; spaces preserved, a trailing newline ignored)- the
[password]positional argument - otherwise you're prompted (hidden;
encryptasks twice to confirm)
--password and the positional argument are visible to other processes and land in your shell history — for anything sensitive prefer the hidden prompt or a chmod 600 --password-file.
The output file is written next to the input, with the original extension dropped:
| Command | report.md → |
|---|---|
| encrypt | report_encrypted.md |
| decrypt | report_decrypted.md |
Install it as a permanent command instead of using npx:
npm install -g mdflow-crypt
mdflow-crypt encrypt notes.mdBehavior
- decrypt requires an
mdflow-enc:file; a wrong password or corrupted data exits non-zero and writes nothing. - encrypt refuses a file that is already encrypted, and asks for the password twice (there is no recovery — a forgotten password means the document is unrecoverable; store it in a password manager).
- Exit codes:
0ok ·1usage / unreadable / wrong-shape input ·2no or mismatched password ·3decrypt failed.
Security notes
- This is a local tool by design. The point is that decrypting never exposes your content to a server or a model — so don't pipe it through a remote runner; install it (or
npx) and run it on your own machine. - For a security tool, pin a version you trust —
npx [email protected] …— rather than always pulling the latest. - There is no password recovery and no backdoor. The format is
PBKDF2-HMAC-SHA256(600k iterations) →AES-256-GCM, matching MDflow's in-browser encryption exactly.
License
MIT
