MyPass

Open source · Rust · Apache-2.0

Your passwords, in one file you can always open.

MyPass is a command line password manager. It keeps everything in a single encrypted file, written in the standard scrypt format, so your vault stays recoverable without MyPass. You will never be locked in.

Small, auditable, and careful with secrets

One encrypted file

All entries live in ~/mypass.scrypt. Back it up, sync it, or copy it to a USB stick. There's no server and no account.

Strong cryptography

scrypt key derivation, AES-256-CTR and HMAC-SHA256, all done in-process. Passwords are generated with ChaCha20, without modulo bias.

No lock-in

The vault is a standard scrypt file. Tarsnap's scrypt dec can decrypt it to plain JSON at any time.

CLI and terminal UI

Use scriptable subcommands, or run plain mypass to browse and edit your entries in an interactive terminal UI.

Clipboard that cleans up

A copied password is cleared after 20 seconds, but only if it's still on the clipboard. Anything you copied in the meantime is kept.

Safe writes

Every save writes a temporary file, syncs it and renames it, and keeps the previous version as .bak. A crash can't leave a truncated vault.

Firefox integration

Fill logins without the clipboard, and without giving Firefox your vault.

A companion program, mypass-browser-host, decrypts the vault outside the browser. It asks for your master passphrase in a pinentry dialog and releases only the one entry that matches the site you are on.

  • Nothing is filled until you click the toolbar button or press Ctrl+Alt+L.
  • Sites match on the entry's url, using the Public Suffix List, so github.com.evil.example gets nothing.
  • The host is read-only. Only you, with your passphrase, decide which sites can receive an entry.
  • Optional HTTP authentication support, with stricter rules: the host must match exactly, and a page can never trigger a passphrase prompt.
Firefox add-on holds no secrets
origin of the active tab
mypass-browser-host pinentry · read-only
decrypts in-process
~/mypass.scrypt one matching entry released

File format and recovery

Readable in ten years, even without MyPass.

The vault uses the scrypt encrypted-data format (version 0), with scrypt parameters N=217, r=8, p=1. Inside it is a small JSON document. Interoperability with the reference scrypt tool is checked in both directions by the test suite.

mypass export prints the same JSON, for backup or for moving to another tool.

recovery
$ scrypt dec ~/mypass.scrypt
Please enter passphrase: 
{"version":1,"entries":[
  {"name":"github.com",
   "username":"alice",
   "password":"…"}]}

Security notes

Zeroized memory

Secrets are wiped from memory once they are no longer needed, and are redacted from debug output.

No core dumps

MyPass disables core dumps at startup. On Linux it also marks itself non-dumpable, which blocks ptrace attaches from other same-user processes.

Private file modes

On Unix, the vault and its backup are created with mode 0600 from the start.

AppArmor templates

Profile templates are included for confining both the CLI and the browser host.

Things MyPass can't control: clipboard history managers may keep their own copy of a password, and secrets in memory can be paged out to swap. Use encrypted swap. See the README for details.

Install

Pre-built Linux binaries

Each release on GitHub has a tarball with mypass and mypass-browser-host for Linux amd64.

Latest release

Build from source

You need a recent stable Rust toolchain.

git clone https://github.com/mikaelstaldal/mypass
cd mypass
cargo install --path .

Quick start

mypass init                      # create an empty vault at ~/mypass.scrypt
mypass add github.com alice      # generate a password and copy it to the clipboard
mypass get github.com            # copy the password to the clipboard again
mypass list                      # show all entries
mypass                           # browse and edit interactively
mypass install-browser           # install the Firefox native-messaging host

For the Firefox integration you also need pinentry and the MyPass add-on; see webextension/README.md for how to install it. Also available as a native Android app. See the README for every command and option.