agossou/password-level

Check password security level

1.0.1 2022-07-14 18:30 UTC

This package is auto-updated.

Last update: 2024-10-15 00:22:01 UTC


README

Description

Checks password level security, generate secure password.

Feats:

(1)- Password security level checking

Returns a value between 0 and 6. The minimum level is 1 if the password contains 8 characters. The level increases according to the combinations of upper case characters, lower case characters, numbers and symbols in addition to the length of the string. Level 6 is extremely secure.

(2)- Secure password generation

Compatibility

This library requires PHP v4.3 or higher.

Installation

Use the below code to install the wrapper:

composer require agossou/password-level

If you are not using Composer, clone or download this repository that already contains the vendor/autoload.php file. If you encounter an issue, please post it here and not on the mirror repository.

Using Password Level in your project

<?php
// check password security level
use Agossou\PasswordLevel\PasswordLevel;

$password = 'given password';

$level = PasswordLevel::checkLevel($password);

or 

$level = \Agossou\PasswordLevel\PasswordLevel::checkLevel($password);

// generate secure password
use Agossou\PasswordLevel\SecurePassword;

$secure_password = SecurePassword::generate();

or 

$secure_password = \Agossou\PasswordLevel\SecurePassword::generate();