phptcloud / password-entropy-bundle
用于计算密码熵的 Symfony 扩展包
v1.0.0
2024-03-08 23:00 UTC
Requires
- php: >=7.4
- doctrine/annotations: ^1.13
- symfony/config: ^5.4
- symfony/dependency-injection: ^5.4
- symfony/http-kernel: ^5.4
- symfony/validator: ^5.4
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2024-09-09 00:01:54 UTC
README
基于两种方法的密码熵计算小工具包
- 计算密码复杂度的比特阈值(NIST);
- 计算密码中字符的频率。
总的来说,这个工具包是实现基于密码复杂度一般推荐的验证限制的一个简单实现。
安装
composer require phptcloud/password-entropy-bundle
示例
密码级别
1 - 非常弱密码 2 - 弱密码 3 - 中等密码 4 - 强密码 5 - 非常强密码
NIST 级别
1 级别 - bits
< 16
2 级别 - bits
< 17-27
3 级别 - bits
< 28-44
4 级别 - bits
< 45-80
5 级别 - bits
> 80,
其中 bits
- 密码复杂度的比特阈值。
字符频率级别
1 级别 - occurrence
> 80%
2 级别 - occurrence
> 50-79%
3 级别 - occurrence
> 35-49%
4 级别 - occurrence
> 10-34%
5 级别 - occurrence
< 9%,
其中 occurrence
- 字符在密码中出现的频率,占总长度的百分比。