PHPBB3的用户密码
来源:互联网 发布:软件著作权简历 编辑:程序博客网 时间:2024/04/29 15:45
google中搜索无数中文网页,未找到任何有用的内容.无奈,English之.终于找到一点线索,说是密码的加密方式是includes/functions.php中的phpbb_hash(),研究此方式数日,无法与自己的项目良好的结合,后查阅
phpBB3 Sourcecode Documentation
看到注释里写着(functions.php中也有,只是没引起注意.罪过,罪过.):phpbb_hash (line 285)
version:
Version 0.1 / slightly modified for phpBB 3.0.x (using $H$ as hash type identifier)
Portable PHP password hashing framework.
Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in the public domain.
There's absolutely no warranty.
The homepage URL for this framework is:
http://www.openwall.com/phpass/
Pleasebe sure to update the Version line if you edit this file in any way. Itis suggested that you leave the main version number intact, butindicate your project name (after the slash) and add your own revisioninformation.
Please do not change the "private" password hashingmethod implemented in here, thereby making your hashes incompatible.However, if you must, please change the hash type identifier (the"$P$") to something different.
Obviously, since this code is in the public domain, the above are not requirements (there can be none), but merely suggestions.
这里提到了
The homepage URL for this framework is:
http://www.openwall.com/phpass/
上去一看,子啊!我这么折腾干什么啊.
下载phpass 0.1回来,修改一下,把$P$改成$H$.
在程序里调用的时候,要先去数据库里查出用户名对应的user_password,这是个hash过的值.
再用phpass 0.1 中的CheckPassword($correct, $hash)验证,返回值是boolean类型.
下面是个小例子:
- require "PasswordHash.php";
- // 先从数据库里查询用户名对应的user_password,这个值已经是hash过的.
- // 假设存为 $pwdhash.
- $pwdhash = '你查来的user_password';
- $t_hasher = new PasswordHash(8, FALSE);
- // $_POST['password']是从表单传来的密码明文.
- $result = $t_hasher->CheckPassword($_POST['password'], $pwdhash);
- if ($result) {
- echo '密码正确';
- }else{
- echo '密码不正确';
- }
现在,可以使用phpbb3的users表了.
- PHPBB3的用户密码
- Joomla与phpbb3的桥接
- Joomla与phpbb3的样式整合
- phpBB3风格的模板文件列表
- joomla1.5与Phpbb3的桥接
- PHPBB3获取最近发表的文章
- phpbb3 学习
- Oracle的默认用户密码
- 用户密码的保护
- 修改tomcat的用户密码
- javaweb用户密码的封装
- 用户密码的加密方式
- 修改MySQL的用户密码
- 记住用户密码的登陆
- 安装phpbb3论坛中文语言包 出现的-bash: syntax error near unexpected token `('错误
- PhpBB3安装(完整)
- phpbb3 风格定制
- [教學] PhpBB3 簡易安裝教學 (圖片教學)
- nginx日志管理
- [数据结构]链表创建、打印、反转
- FreeRadius 1.1.7 + Postgresql 8.1.5 (FreeBSD 6.1系统)
- T-sql 学习(2) - join与group by
- OracleJOB的建立,定时执行任务
- PHPBB3的用户密码
- #pragma data_seg介绍
- Android大赛首轮获奖作品解析
- 超级入门:JAVA从零开始到HelloWorld
- 运行新进程
- was安装的小tip
- 关于Designer_v6.0.0_for_Eclipse3.2破解
- WinCE应用程序检测SD卡的插拔
- linux头文件说明