2017 © Pedro Peláez
 

library php-password-verifier

Framework agnostic password strength checker

image

acurrieclark/php-password-verifier

Framework agnostic password strength checker

  • Monday, January 30, 2017
  • by acurrieclark
  • Repository
  • 1 Watchers
  • 2 Stars
  • 5,445 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 36 % Grown

The README.md

Password Checker Build Status

A framework agnostic password checker for PHP., (*1)

Installation

$ composer require acurrieclark/php-password-verifier

Usage

``` php // include autoloader if you haven't already include_once('vendor/autoload.php');, (*2)

use acurrieclark\PhpPasswordVerifier\Verifier;, (*3)

// create an instance $passwordVerifier = new Verifier();, (*4)

// default options are permissive, so each constraint needs to be set as required $passwordVerifier->setMinLength(8);, (*5)

// constraints can also be chained $passwordVerifier->setMaxLength(128)->setCheckContainsNumbers(true);, (*6)

// check the password meets the requirements set (min length 8, max length 128, contains numbers), (*7)

$validPassword = $passwordVerifier->checkPassword("passwordToCheck"); ```, (*8)

Class Methods

Setting Password Constraints

setMinLength(int $length)

Set the minimum required length of the password, (*9)

setMaxLength(int $length)

Set the maximum allowed length of the password, (*10)

setCheckContainsLetters(boolean $value)

Set the flag to check that the password contains at least one letter, (*11)

setCheckContainsCapitals(boolean $value)

Set the flag to check that the password contains at least one capital letter, (*12)

setCheckContainsNumbers(boolean $value)

Set the flag to check that the password contains at least one number, (*13)

setCheckContainsNumbers(boolean $value)

Set the flag to check that the password contains at least one number, (*14)

setCheckContainsSpecialChrs(boolean $value)

Set the flag to check that the password contains at least one special character from {}()[]#,:;^.?!|&_`~@$%/\\=+-*"', (*15)

setCheckBlacklist(boolean $value)

Set the flag to check if the password matches one of the 10000 most popular passwords from https://github.com/danielmiessler/SecLists, (*16)

Checking the Password

checkPassword(string $password)

Verify the password based on the constraints imposed. Returns boolean., (*17)

getErrors()

Returns an array of errors relating to the verified password, (*18)

Utility

getSpecialChrs()

Static: Returns an array of the special characters used to check against when setCheckContainsSpecialChrs(true) has been set. Handy if you want to warn your users which characters they need to include., (*19)

License

The MIT License (MIT). Please see the License File for more information., (*20)

The Versions

30/01 2017

dev-master

9999999-dev

Framework agnostic password strength checker

  Sources   Download

MIT

The Requires

  • php ^5.4.0 || ^7.0

 

The Development Requires

by Alex Currie-Clark

30/01 2017

v0.2.1

0.2.1.0

Framework agnostic password strength checker

  Sources   Download

MIT

The Requires

  • php ^5.4.0 || ^7.0

 

The Development Requires

by Alex Currie-Clark

14/08 2016

v0.2

0.2.0.0

Framework agnostic password strength checker

  Sources   Download

MIT

The Development Requires

by Alex Currie-Clark

13/08 2016

0.1

0.1.0.0

Framework agnostic password strength checker

  Sources   Download

MIT

The Development Requires

by Alex Currie-Clark