locastic / zxcvbn-password-validator
Realistic Symfony password strength validator based on Zxcvbn PHP
Installs: 1 523
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 3
Open Issues: 0
Requires
- php: ^7.0
- bjeavons/zxcvbn-php: ^0.3.0
- psr/container: ^1.0
- psr/log: ^1.0
- symfony/validator: ^3.3.6 || ^4.0
Requires (Dev)
- guzzlehttp/psr7: ^1.4
- php-http/httplug: ^1.1
- symfony/config: ^3.3.6 || ^4.0
- symfony/console: ^3.3.6 || ^4.0
- symfony/phpunit-bridge: ^3.3.6 || ^4.1
README
Realistic Symfony password strength validator based on Dropbox's zxcvbn project.
Overview
Zxcvbn-PHP is a password strength estimator using pattern matching and minimum entropy calculation. Zxcvbn-PHP is based on the Javascript zxcvbn project from Dropbox and @lowe. "zxcvbn" is bad password, just like "qwerty" and "123456".
More info here.
zxcvbn attempts to give sound password advice through pattern matching and conservative entropy calculations. It finds 10k common passwords, common American names and surnames, common English words, and common patterns like dates, repeats (aaa), sequences (abcd), and QWERTY patterns.
This validator is based on library: Zxcvbn-PHP
Installation
composer require locastic/zxcvbn-password-validator
Options
You can use the Locastic\Component\ZxcvbnPasswordValidator\Validator\Constraints\ZxcvbnPasswordValidator
constraint with the following options.
Annotations
If you are using annotations for validation, include the constraints namespace:
use Locastic\Component\ZxcvbnPasswordValidator\Validator\Constraints as LocasticPassword;
and then add the ZxcvbnPasswordValidator constraint to the relevant field:
/** * @LocasticPassword\ZxcvbnPasswordValidator(minEntropy=50) */ protected $password;
YAML
App\Entity\User: properties: password: - Locastic\Component\ZxcvbnPasswordValidator\Validator\Constraints\ZxcvbnPasswordValidator: minEntropy: 50
Support
Need help at your project? Write us an email on info@locastic.com