pgen – Passphrase Generator

xkcd: Password Strength

Generate passphrases using the wordlists for random passphrases made by the EFF.

By default, generated passphrases consist of twelve words randomly selected from the autocomplete-optimized wordlist. Be sure to read the article to learn about the difference between the wordlists.

Table of Contents

Usage

pgen [--dice] [-l | -s] [-e] [-n <n>] pgen -h | --help

Options

-l Use long wordlist instead of autocomplete-optimized short wordlist. Recommended for the creation of memorable passphrases since the increased number of words as well as the greater effective word length allows for good entropy with a lower amount of words compared to the autocomplete-optimized short wordlist. Mutually exclusive with option -s.

-s Use non-optimized short wordlist instead of autocomplete-optimized short wordlist. Mutually exclusive with option -l.

-e Print the entropy of the generated passphrase to stderr.

-n Specify the number of words to use n. Default value:

--dice Use physical six-sided dice instead of letting the computer pick words. Useful in case you distrust the ability or willingness of your computer to generate "sufficiently random" numbers. Even though pgen will do the right thing and use /dev/urandom by default on Unix platforms [1], what if the hardware source(s) for the entropy that the /dev/urandom CSPRNG is collecting is/are rigged? With the --dice option you need not worry about that at least. (But have you considered the risk of undetectable malware? [2], [3])

-h, --help Show help and exit.

-V, --version Print version information and exit.

Installation

Build from source (see the Building section below) and copy the target/release/pgen binary into your ~/bin/ or whatever.

Building

  1. Install Rust.
  2. Issue cargo build --release in the root directory of the cloned repo.