diff --git a/src/cmd/arg/gen_passphrase.rs b/src/cmd/arg/gen_passphrase.rs index de110ee..fa311bd 100644 --- a/src/cmd/arg/gen_passphrase.rs +++ b/src/cmd/arg/gen_passphrase.rs @@ -1,8 +1,15 @@ -use chbs; +use chbs::{ + config::BasicConfig, + prelude::*, + word::WordList, +}; use clap::Arg; use super::{CmdArg, CmdArgFlag}; +/// How many words the passphrase should consist of. +const PASSPHRASE_WORDS: usize = 5; + /// The passphrase generation argument. pub struct ArgGenPassphrase {} @@ -10,7 +17,10 @@ impl ArgGenPassphrase { /// Generate a cryptographically secure passphrase that is easily /// rememberable using diceware. pub fn gen_passphrase() -> String { - chbs::passphrase() + let mut config = BasicConfig::default(); + config.words = PASSPHRASE_WORDS; + config.word_provider = WordList::builtin_eff_general_short().sampler(); + config.to_scheme().generate() } }