|Classes of John Conde||>||PHP Password Validation Helper||>||README.md||>||Download|
Password Helper (password-helper)
A PHP library that makes using best practices with passwords easy _by default_.
Note: There is a PHP 5 compatible version available.
Simply add a dependency on
Here is a minimal example of a
To use the PHP 5 compatible version, use version 1.*:
To configure your Password Helper to suit your business requirements, you can set your password policy when creating your Password Helper object. There are six factors you can configure be required (or not) and, if required, the minimum criteria for that password characteristic. They are:
If you do not pass any custom policy rules when creating your Password Helper it will default to the values listed above.
is equivalent to:
To modify a policy you can pass it by name, with its custom value, to the constructor. The code below sets all the rules to require two of each type and sets a minimum password length of twelve characters.
You only need to pass a custom value when you change its value from the default value. The code below only changes the
To remove a requirement give it a value of zero.
Generate a new password
Validate a password is acceptable under your password policy
Check the strength of a password
Hash a password
Validate a password
Update the hash of a password
If you require assistance using this library start by viewing the HELP.md file included in this package. It includes common problems and their solutions.
If you need additional assistance, I can be found at Stack Overflow. Be sure when you ask a question pertaining to the usage of this library be sure to tag your question with the PHP and password tags. Make sure you follow their guide for asking a good question as poorly asked questions will be closed, and I will not be able to assist you.
A good question will include all the following: - A description of the problem (what are you trying to do? what results are you expecting? what results are you actually getting?) - The code you are using (only post the relevant code) - Any error message(s) you are getting
Do not use Stack Overflow to report bugs. Bugs may be reported here.