chbs_password_checker

Crates.iochbs_password_checker
lib.rschbs_password_checker
version0.1.0
sourcesrc
created_at2021-05-17 02:15:31.478966
updated_at2021-05-17 02:15:31.478966
descriptionPassword Strength Checker
homepagehttps://github.com/induane/chbs
repository
max_upload_size
id398429
size19,445
Induane (induane)

documentation

README

CHBS Password Strength Checker

A simple password strength checker using raw entropy values written in Rust.

Inspired by: https://github.com/wagslane/go-password-passwordvalidator and this XKCD

Benefits

  • While uppercase, numbers, special characters, etc... all count towards the final score, none are required

  • Does not contact any external API's

  • Includes command line tool in addition to a library so it can be used in bash scripts

⚙️ Installation

cargo install chbs

Use in code::

use chbslib::get_entropy;

let test_1: String = String::from("boring");
let score: i16 = get_entropy(&test1);
println!("Score: {}", score);

>>> 1

What is a good minimum value?

That's a judgement call. I would suggest something in the range of 5 to 7 or so.

Caveats

Attackers commonly use passwords they have scraped from leaked data. Entropy checks will NOT protect your users from using leaked passwords.

How It Works

The password is stripped of repeating characters, palindrome portions, and common password sequences like qwerty or asdfghjkl as well as the set of the 10 most commonly used passwords (according to wikipedia). The remaining length accounts for the initial score. Additional points are awarded for mixing case, adding numbers, and adding special characters.

After that we do some maths which calculates the approximate total guesses and reduces this to a integer score.

Commit count: 0

cargo fmt