Packages / rupm

password-tools 0.1.0

Random password and passphrase generator plus a simple strength estimator

Install

cargo add password-tools --registry rupm

In Ruststudio: Packages, search for password-tools, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-22.

Versions

README

# password-tools

Random password and passphrase generator plus a simple strength estimator

Add it with `rupm add password-tools` (or `cargo add password-tools --registry rupm`).

Randomness comes from /dev/urandom where it exists, otherwise from the standard library's randomly keyed hasher mixed with the clock, with no vetted cryptographic generator behind it. The strength estimate is a rough pool-size heuristic, not a real cracking model. This crate is not meant for security-critical use: for real credentials use your operating system's password manager or an audited crate.

```rust
use password_tools::{estimate, generate, passphrase, Options};
let pw = generate(&Options::default()).unwrap();
assert_eq!(pw.chars().count(), 16);
let words = passphrase(5, "-").unwrap();
assert_eq!(words.split('-').count(), 5);
let s = estimate("correct horse battery staple");
println!("{:.0} bits, {:?}", s.bits, s.level);
```