#password-generator #token #crypto-resistant #library #generator

passgen-lib

Library for generating cryptographically secure passwords/tokens and other sets and sequences

8 stable releases

Uses new Rust 2024

1.2.1 Jul 10, 2025
1.2.0 Feb 21, 2025
1.1.0 Jan 5, 2025
1.0.4 Dec 8, 2024
1.0.3 Nov 30, 2024

#420 in Authentication

Download history 7/week @ 2025-08-26 23/week @ 2025-09-02 25/week @ 2025-09-09 3/week @ 2025-09-16 6/week @ 2025-09-23 1/week @ 2025-09-30 52/week @ 2025-12-09

52 downloads per month
Used in 2 crates

MIT license

340KB
206 lines

alt text

Latest version Download docs.rs MIT Build Status made-with-rust

Readme in different languages: EN RU

⚙ Passgen-lib

Library for generating cryptographically secure passwords/tokens and other sets and sequences.

CSPRNGs Isaac64Rng and Hc128Rng are used.

alt text

Usage

Include library to your project Cargo.toml:

[dependencies]
passgen-lib = "1.2.1"

You can create a token that includes lowercase letters and numbers up to 30 characters long:

let result = Passgen::new().set_enabled_letters(true).set_enabled_numbers(true).generate(30);

You can create a default strong password including all literals, numbers and symbols:

let result = Passgen::default().generate(12);

You can create a strong and usability password with 8 characters long.

Including all characters, but the first position in the password is a capital or small letter, the last position is the symbol.

🔸 Excluded ambiguous characters "0oOiIlL1".

let result = Passgen::default_strong_and_usab().generate(8);

You can create a set from your custom charset 12 characters long:

let result = Passgen::new().set_custom_charset("abcABC123⭕➖❎⚫⬛п₼⁂🙂").generate(12);

Example of library integration in the passgen-cmd tool and passgen-telegram service.

Library doc.

License

MIT

Our other passgen projects:

passgen-desktop

passgen-console-linuxwin

passgen-cmd

passgen-telegram

Dependencies