Joomla 3.4密码生成方法 [英] Joomla 3.4 password generation method

查看:140
本文介绍了Joomla 3.4密码生成方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道Joomla如何加密密码。我的问题是,我想使用Jommla做的确切的方法在一个简单的php页面与一个表单,没有任何OOP方法。



所以这是我的输入密码:
测试



这是我作为Joomla数据库中的加密密码的输出:
$ 2y $ 10 $ XXrVok3 / 3Otqg6FmqFzUmObA.rLpLt.BswwSJ7d我发现这可能与BLOWFISH加密有关,但它需要其他东西(例如:生成的盐或数据库中的令牌,我可以找不到)

解决方案

Joomla!使用 PhPass

  root / libraries / phpass / PasswordHash.php 

看看这里。你将在这里看到如何生成密码。



$ 2y 是默认(和首选)前缀 bcrypt哈希。至于代码,你需要查看 JUserHelper的 hashPassword verifyPassword 方法来查看Joomla如何处理现在的事情。



某些推介 -



https://github.com /joomla/joomla-cms/blob/3.4.1/libraries/joomla/user/helper.php#L296-L387



https://docs.joomla.org/API15:JUserHelper/getCryptedPassword



https://docs.joomla.org/API15:JUserHelper/getSalt



查看链接,希望你能帮助你;)


I can't find out how Joomla encrypted passwords. My problem is that i want to make the exact method as Jommla does in a simple php page with a form and without any OOP method.

So this is my input as a password: test

and this is my output as an ancrypted password in Joomla database: $2y$10$XXrVok3/3Otqg6FmqFzUmObA.rLpLt.BswwSJ7d.iCPoGSJtcqSvm

I found out that it is maybe in connection with the BLOWFISH encrytion, but it needs something else (for example: generated salt or a token in the database which i couldn't find)

解决方案

Joomla! uses PhPass.

root/libraries/phpass/PasswordHash.php

have a look here. you will see here how the password is generating.

The $2y is the default (and preferred) prefix on bcrypt hashes. As for code, you'll want to look inside JUserHelper's hashPassword and verifyPassword methods to see how Joomla's working with things right now.

Some Referances -

https://github.com/joomla/joomla-cms/blob/3.4.1/libraries/joomla/user/helper.php#L296-L387

https://docs.joomla.org/API15:JUserHelper/getCryptedPassword

https://docs.joomla.org/API15:JUserHelper/getSalt

Check the links, I hope you it will help you ;)

这篇关于Joomla 3.4密码生成方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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