Revert "Use shorter passphrase words, make them less than 32-characters long"

This reverts commit fdf8ae9201.

This is reverted because the password length limit is now set much
higher, see: https://github.com/timvisee/send/pull/147
This commit is contained in:
timvisee 2023-02-14 13:59:41 +01:00
parent b2b287e34f
commit 6661a58770
No known key found for this signature in database
GPG key ID: B8DB720BC383E172

View file

@ -1,11 +1,8 @@
use chbs::{config::BasicConfig, prelude::*, word::WordList};
use chbs;
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 {}
@ -13,10 +10,7 @@ impl ArgGenPassphrase {
/// Generate a cryptographically secure passphrase that is easily
/// remembered using diceware.
pub fn gen_passphrase() -> String {
let mut config = BasicConfig::default();
config.words = PASSPHRASE_WORDS;
config.word_provider = WordList::builtin_eff_general_short().sampler();
config.to_scheme().generate()
chbs::passphrase()
}
}