whitehat101/apr1-md5
Composer 安装命令:
composer require whitehat101/apr1-md5
包简介
Apache's APR1-MD5 algorithm in pure PHP
README 文档
README
There is no way that the best way to generate Apache's apr1-md5 password hashes is from a 7-year-old comment on php.net. Only a n00b would trust a crypto algorithm from a non-security website's forum. Sadly, that is how the PHP community has accessed this algorithm, until now.
Here is a tested, referenced, documented, and packaged implementation of Apache's APR1 MD5 Hashing Algorithm in pure PHP.
Install
composer.json:
{
"require": {
"whitehat101/apr1-md5": "~1.0"
}
}
Use
use WhiteHat101\Crypt\APR1_MD5; // Check plaintext password against an APR1-MD5 hash echo APR1_MD5::check('plaintext', '$apr1$PVWlTz/5$SNkIVyogockgH65nMLn.W1'); // Hash a password with a known salt echo APR1_MD5::hash('PASSWORD', '__SALT__'); // Hash a password with a secure random salt echo APR1_MD5::hash('PASSWORD'); // Generate a secure random salt echo APR1_MD5::salt();
The ideal __SALT__ is an 8 character string. Valid salts are alphanumeric and . or /. Shorter salts are allowed. Longer salts are truncated after the 8th character.
Generate Hashes via Other Tools
htpasswd
$ htpasswd -nmb apache apache apache:$apr1$rOioh4Wh$bVD3DRwksETubcpEH90ww0 $ htpasswd -nmb ChangeMe1 ChangeMe1 ChangeMe1:$apr1$PVWlTz/5$SNkIVyogockgH65nMLn.W1 $ htpasswd -nmb WhiteHat101 WhiteHat101 WhiteHat101:$apr1$HIcWIbgX$G9YqNkCVGlFAN63bClpoT/
openssl
$ openssl passwd -apr1 -salt rOioh4Wh apache $apr1$rOioh4Wh$bVD3DRwksETubcpEH90ww0 $ openssl passwd -apr1 -salt PVWlTz/5 ChangeMe1 $apr1$PVWlTz/5$SNkIVyogockgH65nMLn.W1 $ openssl passwd -apr1 -salt HIcWIbgX WhiteHat101 $apr1$HIcWIbgX$G9YqNkCVGlFAN63bClpoT/
Testing
composer install vendor/bin/phpunit
whitehat101/apr1-md5 适用场景与选型建议
whitehat101/apr1-md5 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.88M 次下载、GitHub Stars 达 34, 最近一次更新时间为 2015 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「MD5」 「apr1」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 whitehat101/apr1-md5 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 whitehat101/apr1-md5 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 whitehat101/apr1-md5 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A filter for twig to hash a string with MD5
This symfony user provider reads user from the htpasswd file.
Laravel package to use unsecured MD5 for password hash
A pure PHP implementation of an MD5-hashsum-based implementation of the crypt routine, which can be used to generate hashs for Apache's passwd files
Laravel md5 hash support
Yii2 JS md5_file Asset Bundle
统计信息
- 总下载量: 9.88M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 34
- 点击次数: 30
- 依赖项目数: 11
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-11