gen_passphrase

Crates.iogen_passphrase
lib.rsgen_passphrase
version0.2.0
created_at2023-04-09 22:06:44.723104+00
updated_at2025-12-15 22:49:11.65916+00
descriptionA secure, simple yet customizable passphrase generator. Use provided dictionaries or bring your own!
homepage
repositoryhttps://github.com/deadbaed/gen_passphrase
max_upload_size
id834556
size230,864
Philippe Loctaux (deadbaed)

documentation

README

gen_passphrase

CI status crates.io version docs.rs

A secure, simple yet customizable passphrase generator (in Rust). Use provided dictionaries or bring your own!

Generate passphrase

This crate allows to [generate] passphrases easily and securely.

Choose the source of words to use in passphrases: either use built-in dictionaries or provide your own dictionary!

By default, the crate does not come with any built-in dictionaries in order to keep the crate small. Built-in dictionaries can be added through the usage of features in the crate.

Custom dictionary

let dictionary = &["hello", "bonjour", "hola", "ciao"];

// Example of generated passphrase: "bonjour-hello"
let passphrase = gen_passphrase::generate(&[dictionary], 2, Some("-"));

Built-in dictionary

To enable built-in dictionaries, you need to enable the feature corresponding to the requested dictionary.

Dictionary Feature to enable
Eff Short Wordlist 2 eff_short_2
Eff Short Wordlist 1 eff_short_1
Eff Large Wordlist eff_large
BIP39 English bip39_english
BIP39 French bip39_french

Then, use the dictionary like you would use a custom dictionary:

use gen_passphrase::dictionary::EFF_SHORT_2;

let passphrase = gen_passphrase::generate(&[EFF_SHORT_2], 1, None);

Prepare new built-in dictionary

A small program to generate dictionaries is provided in create_dictionary_from_file.

Development

Use cargo-rdme to generate part of the readme from lib.rs. For nix users, a nix shell file is included in this repository.

Commit count: 0

cargo fmt