Crates.io | cryptirust |
lib.rs | cryptirust |
version | 2.0.2 |
source | src |
created_at | 2024-10-09 13:14:46.881928 |
updated_at | 2024-10-12 12:33:38.092646 |
description | A flexible password generator that creates pronounceable passwords with adjustable entropy and custom patterns. |
homepage | |
repository | https://github.com/francescoalemanno/cryptirust |
max_upload_size | |
id | 1402376 |
size | 163,477 |
Cryptirust is a flexible and efficient Rust library for generating customizable, pronounceable passwords with entropy calculation. It leverages a Markov chain-based approach through its core Generator
struct, allowing you to construct secure passphrases and word-based passwords from predefined or user-defined token lists.
Designed to balance security, usability, and flexibility, Cryptirust offers fine-grained control over the structure and randomness of passwords. Whether you're creating simple, memorable passphrases or complex high-entropy passwords, Cryptirust provides an intuitive API to meet a range of password generation needs.
Use a pattern string to create complex passwords:
c
: Lowercase token.C
: Uppercase token.w
: Lowercase word.W
: Uppercase word.s
: Symbol.d
: Digit.\
: Escape next character.use cryptirust::Generator;
fn main() {
let mut generator = Generator::new();
let (password, entropy) = generator.gen_from_pattern("cccsd");
println!("Generated password: {}", password);
println!("Entropy: {:.2} bits", entropy);
}
use cryptirust::*;
fn main() {
let mut generator = Generator::new_custom(word_list::eff::list(), 2).unwrap();
let (passphrase, entropy) = generator.gen_from_pattern("w.w.w.w");;
println!("Generated passphrase: {}", passphrase);
println!("Entropy: {:.2} bits", entropy);
}
Cryptirust is licensed under the MIT License.