我想弄清楚默认情况下Drupal 6/7使用哪些安全性来存储密码。它是MD5,AES,SHA吗?我一直无法找到任何东西。什么是Drupal的默认密码加密方法?
回答
Drupal 8和Drupal 7默认使用SHA512和盐。他们通过PHP的hash函数多次运行散列来增加生成密码的最终散列(一种称为stretching的安全技术)的计算成本。
随着Drupal 8,实现是面向对象的。有一个PasswordInterface它定义了一个哈希方法。该接口的默认实现位于PhpassHashedPassword类中。该类'hash方法调用传入SHA512的crypt方法作为哈希算法,密码和生成的盐。该类的crypt方法与Drupal 7的_password_crypt()方法几乎相同。
使用Drupal 7,实现分为几个全局函数:user_hash_password()和_password_crypt()。
Drupal 6使用不含盐的MD5。相关功能是user_save()。
这是MD5,据我所知,没有使用任何腌制。编辑 - 这是Drupal 6.对于Drupal 7,使用了一些更高级的哈希。这里有一篇好文章 - http://joncave.co.uk/2011/01/password-storage-in-drupal-and-wordpress/
下面是从Drupal 7的一个例子的散列:
“通”: “$ S $ Dxl65W9p07LfQU7jvy5CnsyDpMoLujiAgzy123khcg1OJi/P9pKS”
字符0-2是类型($ S $是Drupal的7)
- 字符3是基于该焦炭在这个列表中的位置的log 2轮(X)的数量:所以在我们的例子‘d’将映射到15 “./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz”
- 字符4-11是SALT
- 其余的是使用2^X轮的SHA512哈希。
然后使用base64将二进制结果转换为字符串。
$ count = 1 < < $ count_log2;
$ hash = hash($ algo,$ salt。$ password,TRUE);
do {$ hash = hash($ algo,$ hash。$ password,TRUE);
} while( - $ count);
整个过程可以发现: mydrupalsite \包括\ password.inc
它可以在里面WWW \检查包括\ password.inc
function user_check_password($password, $account) {
if (substr($account->pass, 0, 2) == 'U$') {
// This may be an updated password from user_update_7000(). Such hashes
// have 'U' added as the first character and need an extra md5().
$stored_hash = substr($account->pass, 1);
$password = md5($password);
}
else {
$stored_hash = $account->pass;
}
$type = substr($stored_hash, 0, 3);
switch ($type) {
case '$S$':
// A normal Drupal 7 password using sha512.
$hash = _password_crypt('sha512', $password, $stored_hash);
break;
case '$H$':
// phpBB3 uses "$H$" for the same thing as "$P$".
case '$P$':
// A phpass password generated using md5. This is an
// imported password or from an earlier Drupal version.
$hash = _password_crypt('md5', $password, $stored_hash);
break;
default:
return FALSE;
}
return ($hash && $stored_hash == $hash);
}
它被写清楚“//使用sha512的正常Drupal 7密码。“
drupal的8是使用Phpass(修改后的版本)
Drupal 7的使用SHA-512 +盐
drupal的6和前一版本被使用MD5无盐
- 1. Postgres的默认密码是什么
- 2. 什么是默认密码Jitterbit?
- 3. 什么是joomla 1.5.26中的密码加密方法?
- 4. 在codeigniter中加密密码的最佳方法是什么
- 5. MVC 4加密默认密码
- 6. 什么加密方法默认卷曲使用?
- 7. 保存加密/解密密钥的最佳方法是什么?
- 8. 什么是密码加密位
- 9. JBoss默认密码
- 10. (Kontakt.io)默认密码?
- 11. 密码加密方法
- 12. 密码加密3方法
- 13. 更改默认cassandra用户密码的过程是什么?
- 14. DRONE_ADMIN用户的默认管理员密码是什么?
- 15. 完全安装后,默认的MySQL根密码是什么?
- 16. 什么是OpenSSL中PEM格式的默认密码?
- 17. elasticsearch的默认用户和密码是什么?
- 18. 什么是默认的Amazon EMR配置单元密码?
- 19. phpmyadmin的默认用户名和密码是什么
- 20. 什么是埃尔默密码
- 21. 此Java加密方法的等效PHP解密是什么?
- 22. 这些密码使用什么加密方法?
- 23. Oracle 11g的默认密码?
- 24. MongoDB什么是默认用户和密码?
- 25. 如何加密drupal 7的密码
- 26. dockerhub的官方glassfish docker的默认管理员密码是什么
- 27. Vagrant SSH默认密钥密码?
- 28. 默认密码2008 R2
- 29. Oracle 11g默认密码?
- 30. 默认登录密码
” _I已经无法找到任何东西。“ - 好吧,通常,我不会'你试过谷歌'的评论,但这是荒谬的 - 你甚至找到了什么东西?(提示:将你的问题标题复制并粘贴到谷歌搜索框) – 2011-02-17 18:03:57
我做了,它把我带到了堆栈溢出。:) – 2012-07-26 23:41:42