phpass 返回不同的结果 [英] phpass returns different results

查看:41
本文介绍了phpass 返回不同的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是将我的项目从 localhost 放到我的主机上,并使用相同的 (phpass) 函数我收到了不同的结果,并且返回的字符串长度也不同.(顺便说一句,一切都在本地主机上运行)

I just put my project from localhost to my host and using the same (phpass) function I receive different results and the length of the returned string is also different. (and everything works on localhost btw)

所以同样的函数在线时返回false.我想知道可能是什么问题.

So the same function returns false when online. I was wondering what the problem might be.

结果如下:

输入:12345

  • 本地主机:$2a$08$t5joFUIbETHylj/IyUVy7.WzMZm8fmKjsy0kZc/YxgqzkbYQWnlre
  • 主持人:$P$9QiKVfJzpRzoToBCJg8FeaDIfcAJJ61
  • localhost:$2a$08$t5joFUIbEThylj/IyUVy7.WzMZm8fmKjsy0kZc/YxgqzkbYQWnlre
  • host: $P$9QiKVfJzpRzoToBCJg8FeaDIfcAJJ61

我打开了 TRUE 标志以使密码可移植,但它似乎仍然不起作用.

I switched on the TRUE flag to make password portable but still it doesn't seem to work.

编辑 2:不适用于 php 4 或 5,我确实打开了便携模式!!

EDIT 2: Doesn't work with php 4 or 5 and I DID switch on the portable mode!!

推荐答案

如果我没记错的话,phpass 使用了最好的方法.在这种情况下,live 主机上可用的模块似乎与 localhost 上的模块不同,因此 phpass 必须选择不同的方法.$2a$"表示bcrypt,$P$"表示phpass的内部hash.即,现场主机似乎没有可用的 bcrypt.

If I'm not mistaken, phpass uses the best method available to it. In this case, it would seem that the modules available on the live host are not the same as those on localhost, and thus phpass has to choose a different method. The "$2a$" indicates bcrypt, and the "$P$" indicates phpass' internal hash. I.e., it appears that the live host doesn't have bcrypt available.

这篇关于phpass 返回不同的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆