我怎样才能使magento存储密码与更好的encryption.Since md5是不健壮的。有没有办法提高magento的安全性?
所以客户的详细信息是安全的。
发布于 2013-03-18 19:02:49
您可以更改自定义的magento加密算法。我的mageto用的是SHA1。我已经为that.Inside创建了一个自定义模块,这个哈希函数可以实现你的任意算法。
magento/app/code/local/My/ShaModule/Model/Encryption.php
public function getHash($password, $salt = false)
{
return $this->hash($password);
}
public function hash($data){
return sha1($data);
}
public function validateHash($password, $hash) {
return $this->hash($password) === $hash;
}
}
?>
magento/app/code/local/My/ShaModule/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : config.xml
Created on : July 26, 2012, 1:12 PM
Author : sanjeewani
Description:
Purpose of the document follows.
-->
<config>
<modules>
<My_ShaModule>
<version>0.1.0</version>
<depends>
<Mage_Core />
</depends>
</My_ShaModule>
</modules>
<global>
<models>
<core>
<rewrite>
<encryption>My_ShaModule_Model_Encryption</encryption>
</rewrite>
</core>
</models>
<helpers>
<core>
<encryption_model>My_ShaModule_Model_Encryption</encryption_model>
</core>
</helpers>
</global>
<frontend>
<routers>
<my_shamodule>
<use>standard</use>
<args>
<module>My_ShaModule</module>
<frontName>shamodule</frontName>
</args>
</my_shamodule>
</routers>
</frontend>
</config>
发布于 2013-03-15 16:59:49
你可以参考一个很好的博客:
http://www.magentogarden.com/blog/how-are-passwords-encrypted-in-magento.html
它使用相同的MD5,但附加了一层额外的安全性。
https://stackoverflow.com/questions/15428214
复制相似问题