magento - 如何解密magento企业版密码?

标签 magento

我刚刚注意到magento企业版和社区版均使用不同的算法来存储密码。我知道社区版使用md5。谁能告诉我企业版使用哪种机制?如果要迁移到社区版,我们如何解密企业密码?

最佳答案

我认为它在您的Magento EE的app/etc/local.xmlapp/etc/enterprise.xml

Magento企业版上的解密功能

/**
 * Decrypt a string
 *
 * @param string $data
 * @return string
 */
public function decrypt($data)
{
    return str_replace("\x0", '', trim($this->_getCrypt()->decrypt(base64_decode((string)$data))));
}


/**
 * Instantiate crypt model
 *
 * @param string $key
 * @return Varien_Crypt_Mcrypt
 */
protected function _getCrypt($key = null)
{
    if (!$this->_crypt) {
        if (null === $key) {
            $key = (string)Mage::getConfig()->getNode('global/crypt/key');
        }
        $this->_crypt = Varien_Crypt::factory()->init($key);
    }
    return $this->_crypt;
}

企业版社区版上,似乎具有相同的功能。
您应该向gitt_strong询问该加密 key ,并使用CE对其进行解密。很好,因为我要潜入 Magento企业版的代码,并且该代码与社区版相同(用于加密/解密)

在评论1之后添加:
/**
 * Hash a string
 *
 * @param string $data
 * @return string
 */
public function hash($data)
{
    return md5($data);
}

/**
 * Validate hash against hashing method (with or without salt)
 *
 * @param string $password
 * @param string $hash
 * @return bool
 * @throws Exception
 */
public function validateHash($password, $hash)
{
    $hashArr = explode(':', $hash);
    switch (count($hashArr)) {
        case 1:
            return $this->hash($password) === $hash;
        case 2:
            return $this->hash($hashArr[1] . $password) === $hashArr[0];
    }
    Mage::throwException('Invalid hash.');
}

关于magento - 如何解密magento企业版密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13643618/

相关文章:

css - 如何更改magento上的按钮样式

magento - 更改所选 radio 上的文本

php - 在产品 View 页面中向 friend 发送电子邮件不起作用

php - Magento 自定义模块观察者不工作

magento - 优惠券总是在结帐时重新添加

android - 客户信息中的 Magento 密码哈希

magento-1.7 - 从 CSV 导入 Magento 中的可配置产品

Magento - 属性 "input-type"复选框

magento - 在 Solr (Magento Enterprise) 中将默认运算符从 OR 更改为 AND

magento - 在 Magento 中通过分页在主页上显示产品