Master passphrase

Generate the same passphrase every time, derived from a single master passphrase.

Normally, every run of Passgen produces completely random output from your machine's source of secure randomness. In master-passphrase mode, the output is deterministic instead: the same inputs always give the same passphrase.

This means you only need to remember a single master passphrase. You can regenerate the passphrase for any account from it whenever you need it, without storing any passphrases.

Setting up

A master passphrase is set up once, with --master-setup. Passgen asks for a name, a level and whether to use a seed, and then for the master passphrase, twice. It prints a block for your configuration file, which you can append to it directly:

$ passgen --master-setup >> ~/.config/passgen/config.toml

The block looks like this:

[master.main]
version = 1
level = 2
hash = "ceece14b"

The master passphrase itself is not stored anywhere, and cannot be recovered.

KeyMeaning
versionHow passphrases are derived. Only 1 exists so far.
levelHow much effort it takes to derive a key from the master passphrase.
hashA short hash that catches a mistyped master passphrase. Optional.
seedA random value that is needed along with the master passphrase. Optional.

Levels

The level decides how much memory deriving the key takes. More memory makes it slower for you, and much more expensive for someone who tries to guess your master passphrase.

LevelMemory
164 MiB
2256 MiB. This is the default.
31 GiB

Hash

The hash is the start of a hash of the key that is derived from your master passphrase. If you mistype the master passphrase, the hash does not match, and Passgen reports an error instead of generating a wrong passphrase.

Seed

Without a seed, the master passphrase alone is enough to generate your passphrases, on any computer. With a seed, both are needed. Someone who learns your master passphrase cannot do anything with it unless they also have your configuration.

Usage

Give Passgen the name of the master passphrase with --master, and say what the passphrase is for with --domain and --user. The user is typically your login on the website, and can be left out. Passgen then asks for the master passphrase, without showing what you type:

$ passgen -m main -d example.com -u username -p apple2
master passphrase:
eINh6m-RhafGJ-JgiKM0

Running this again gives the same result. The domain is used exactly as you write it, so example.com and Example.com give different passphrases.

If the pattern uses a wordlist, the passphrase also depends on the contents of the wordlist. Give the wordlist a hash in the configuration to make sure it does not change unnoticed. Patterns with Markov chains may generate something else in another version of Passgen, so avoid them here.

Changing a passphrase

Sometimes a passphrase has to be replaced, for example after a breach. Use --offset for this. Every offset gives a different passphrase. The first one is 0, which is the default:

$ passgen -m main -d example.com -u username -p apple2 --offset 1
master passphrase:
2olsP6-5FUJxt-2Tzog5

You have to remember which offset an account uses. A login can do that for you.

Logins

A login stores which master passphrase, preset or pattern, and offset an account uses. Add one to the configuration for every account:

[[login]]
domain = "example.com"
user = "username"
master = "main"
preset = "apple2"
offset = 1

The domain and the user are then enough:

$ passgen -d example.com -u username
master passphrase:
2olsP6-5FUJxt-2Tzog5
KeyMeaning
domainThe domain. Required.
userThe user. Optional.
masterThe name of the master passphrase. Optional if there is only one.
preset or patternThe preset or the pattern to use. Without either, give one on the command line.
offsetThe offset. Optional, and 0 by default.

Without --user, Passgen uses the login for the domain that has no user. If there is none, it uses the only login for the domain. Anything you give on the command line overrides what the login says.

Logins contain no secrets, but they do list where you have accounts.

How it works

Passgen derives a key from your master passphrase with Argon2id, using the memory of the level and three passes. The seed, if there is one, goes into this as well. This step is slow on purpose, which makes guessing the master passphrase expensive.

From that key, it derives a second key for the domain and the user with keyed BLAKE2b. The second key is used with the ChaCha20 stream cipher as a pseudorandom number generator, which takes the place of the system randomness generator.

The manual page has the exact parameters.