ign*_*low 1 security encryption cakephp
我正在尝试使用散列字符串解密
Security::cipher($strHashedPassword, Configure::read('Security.salt'));
Run Code Online (Sandbox Code Playgroud)
似乎没有给出理想的结果.有人对这个有经验么?从文档中看起来应该可行.
请注意,您无法解密散列字符串.根据定义,哈希是不可逆转的.它们无法解密,因为它们一开始就没有加密,它们是经过哈希处理的.如果您真的想要解密密码哈希(由AuthComponent生成?),那你就不走运了.
Security::cipher只能解密它加密的字符串,在这种情况下你要谈的是密文,而不是哈希.
如果你能证明这不打印"测试":
$cipherText = Security::cipher('test', Configure::read('Security.salt'));
echo Security::cipher($cipherText, Configure::read('Security.salt'));
Run Code Online (Sandbox Code Playgroud)
你在Cake中发现了一个bug,很可能是@infinity链接的bug.否则,你正在尝试一些不可能的事情.