| Crates.io | gen_passphrase |
| lib.rs | gen_passphrase |
| version | 0.2.0 |
| created_at | 2023-04-09 22:06:44.723104+00 |
| updated_at | 2025-12-15 22:49:11.65916+00 |
| description | A secure, simple yet customizable passphrase generator. Use provided dictionaries or bring your own! |
| homepage | |
| repository | https://github.com/deadbaed/gen_passphrase |
| max_upload_size | |
| id | 834556 |
| size | 230,864 |
A secure, simple yet customizable passphrase generator (in Rust). Use provided dictionaries or bring your own!
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.
let dictionary = &["hello", "bonjour", "hola", "ciao"];
// Example of generated passphrase: "bonjour-hello"
let passphrase = gen_passphrase::generate(&[dictionary], 2, Some("-"));
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);
A small program to generate dictionaries is provided in create_dictionary_from_file.
Use cargo-rdme to generate part of the readme from lib.rs. For nix users, a nix shell file is included in this repository.