Javascript md5加密节点js和magento不匹配。。

Javascript md5加密节点js和magento不匹配。。,javascript,php,node.js,magento,encryption,Javascript,Php,Node.js,Magento,Encryption,我已经在magento和node js中创建了登录服务。在magento中,如果客户使用密码注册,则使用md5 salt密钥值对密码进行加密。 如果我使用crypto node js模块来解密magento密码,则会抛出错误 Error: Unknown cipher at Error (native) at new Decipher (crypto.js:210:16) at Object.Decipher (crypto.js:207:12) at D:\Wo

我已经在magento和node js中创建了登录服务。在magento中,如果客户使用密码注册,则使用md5 salt密钥值对密码进行加密。 如果我使用crypto node js模块来解密magento密码,则会抛出错误

Error: Unknown cipher
    at Error (native)
    at new Decipher (crypto.js:210:16)
    at Object.Decipher (crypto.js:207:12)
    at D:\Workspace\mobileapp\routes\users.js:30:24
    at Layer.handle [as handle_request] (D:\Workspace\mobileapp\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\Workspace\mobileapp\node_modules\express\lib\router\index.js:312:13)
    at D:\Workspace\mobileapp\node_modules\express\lib\router\index.js:280:7
    at param (D:\Workspace\mobileapp\node_modules\express\lib\router\index.js:349:14)
只有解密magento密码,我才能验证我的登录密码是否匹配,然后才能继续。我试图加密我的节点js登录密码,但密码不匹配

在magento中,如果客户使用密码注册,则使用md5 salt密钥值对密码进行加密

这里有很多东西要打开

  • Magento应该使用bcrypt,而不是MD5
  • MD5不是加密
  • 什么是“salt键值”
  • 如果我使用crypto node js模块来解密magento密码,则会抛出错误

    Error: Unknown cipher
        at Error (native)
        at new Decipher (crypto.js:210:16)
        at Object.Decipher (crypto.js:207:12)
        at D:\Workspace\mobileapp\routes\users.js:30:24
        at Layer.handle [as handle_request] (D:\Workspace\mobileapp\node_modules\express\lib\router\layer.js:95:5)
        at trim_prefix (D:\Workspace\mobileapp\node_modules\express\lib\router\index.js:312:13)
        at D:\Workspace\mobileapp\node_modules\express\lib\router\index.js:280:7
        at param (D:\Workspace\mobileapp\node_modules\express\lib\router\index.js:349:14)
    
    您无法解密MD5,因为MD5不是加密

    MD5是一个哈希函数。哈希函数不是加密函数

    散列函数是加密的!但并非所有加密算法都是加密算法


    .

    您无法解密哈希。MD5是一个单向函数。但这并不安全。您需要使用强密码散列,如scrypt、bcrypt和PBKDF2。由于散列函数是单向函数,因此无法“解密”散列。为了对用户进行身份验证,您可以再次通过哈希函数运行密码,以便与存储在数据库中的哈希进行比较。查看更多:无论如何,如果您的代码有问题,那么您需要显示它。