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

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

问题描述

我不知道 Joomla 如何加密密码.我的问题是我想在一个简单的 php 页面中使用一个表单并且没有任何 OOP 方法来制作与 Jommla 一样的确切方法.

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

这是我在 Joomla 数据库中作为加密密码的输出:$2y$10$XXrVok3/3Otqg6FmqFzUmObA.rLpLt.BswwSJ7d.iCPoGSJtcqSvm

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

我发现它可能与 BLOWFISH 加密有关,但它需要其他东西(例如:在数据库中我找不到生成的盐或令牌)

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!使用 PhPass.

Joomla! uses PhPass.

root/libraries/phpass/PasswordHash.php

看看这里.您将在此处看到密码是如何生成的.

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

$2ybcrypt hashes 的默认(和首选)前缀.至于代码,您需要查看 JUserHelper's hashPasswordverifyPassword 方法的内部,以了解 Joomla 现在如何处理.

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.

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天全站免登陆