Quickstart
Install
brew install madstone-tech/tap/mdstn-cipherOther ways to install are on the Installation page.
1. Encrypt with a file password
No keys needed. Without a method flag, encrypt asks for a file password:
mdstn-cipher encrypt secret.pdf # writes secret.pdf.mdstn
mdstn-cipher decrypt secret.pdf.mdstn # asks for the password, writes secret.pdfdecrypt never replaces an existing file: if secret.pdf is still there, it stops and asks you to
choose a path with -o or to pass --force.
2. Encrypt for yourself
The first time you encrypt for yourself, Cipher creates your default key and shows its 24-word recovery phrase once. Write the phrase down: it is the only way to get the key back if you lose the database.
mdstn-cipher encrypt notes.md --key-passphrase-file key-pass.txt
mdstn-cipher decrypt notes.md.mdstn -o notes-copy.mdThe key passphrase protects your private key on disk. See Keys and recovery.
3. Encrypt for someone else
If the recipient has published their key to the directory, encrypt to their email:
mdstn-cipher encrypt report.pdf --for alice@example.comSeveral recipients, any one of whom can decrypt:
mdstn-cipher encrypt report.pdf --recipient alice@example.com --recipient bob@example.comOr encrypt to a raw X25519 public key (base64 of 32 bytes, or a file that holds it):
mdstn-cipher encrypt report.pdf --recipient-key alice.pubTo let others encrypt to your email, publish your key. See Key discovery (CKD).
4. Back up your keys
mdstn-cipher backup # writes ~/.mdstn/backups/cipher-backup-<timestamp>.jsonIn scripts
Every command runs without a terminal. Read secrets from files or stdin, and use --json for
output a program can parse:
mdstn-cipher encrypt snap.db --recipient-key "$PUB" -o snap.mdstn
mdstn-cipher encrypt big.tar --password-file /run/secrets/pw
mdstn-cipher decrypt snap.mdstn --key-passphrase-file - -o snap.db < pwExit codes tell failures apart: 2 tampered file, 3 not a recipient, 4 wrong file password.
The full list is on the Format and security page.