我已经在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密码,我才能验证我的登录密码是否匹配,我才能继续。我试图加密我的node-js登录密码,但密码不匹配。。
在magento中,如果客户使用密码注册,则使用md5 salt密钥值对密码进行加密。
这里有很多东西要打开。
- Magento应该使用bcrypt,而不是MD5
- MD5不是加密
- 什么是"salt键值"
如果我使用crypto-node-js模块来解密magento密码,那就是抛出错误。
你不能解密MD5,因为MD5不是加密。
MD5是一个散列函数。哈希函数不是加密函数。
哈希函数是加密的!但并不是所有的加密算法都是加密的。
阅读本文以了解差异。