Rust crate and CLI for generating strong Diceware passphrases.
brew tap norskeld/tap
brew install norskeld/tap/diceware
Make sure to install Rust toolchain first. After that you can install Diceware via Cargo:
cargo install --locked --git https://github.com/norskeld/diceware
Just invoke diceware --help
. It's really simple.
Generates strong Diceware passphrases.
Usage: diceware [OPTIONS]
Options:
-l, --length <LENGTH> How much words to generate [default: 6]
-w, --wordlist <WORDLIST> Path to a custom wordlist
-e, --entropy Show entropy of the passphrase
-c, --capitalize Capitalize words
-d, --delimiter <DELIMITER> Delimiter to use for joining words
-p, --preset <PRESET> Formatting preset to use [possible values: pascal, kebab, snake]
-h, --help Print help
-V, --version Print version
$ diceware --entropy
probation overdraft debtor ground nintendo sculptor
Possibilities: 7776
Entropy: 77.55 bits
More about entropy at https://theworld.com/~reinhold/dicewarefaq.html#entropy
You can use this crate as a git dependency:
[dependencies]
diceware = { git = "https://github.com/norskeld/diceware" }
Simple example:
use diceware::{Passphraser, Preset};
fn main() {
let passphrase = Passphraser::new(6)
.preset(Preset::KebabCase)
.generate();
println!("{}", passphrase.format())
}
By default CLI uses the EFF long wordlist, which is a little bit better than the one original one.
In short, passphrases are generated by "throwing" a dice five times, joining the numbers into one, and then looking up for the word with the corresponding number in the wordlist. This process repeats N times (default is 6) until all words are found. You can find more information about that technique on the official Diceware page or on the Diceware FAQ page.
MIT.