We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
密文是原始的base64形式的,js里面不知道哪一步urldecode了一下,把那种有+号的解码成空格了,导致解密失败,我应该改哪个地方- -。
The text was updated successfully, but these errors were encountered:
请展示demo代码
Sorry, something went wrong.
感谢回复!
/**************************************************************************/ var wasSuccessful = phantom.injectJs('../crypto-js-4.0.0/crypto-js.js');
// 加密函数 function js_encrypt(payload){ var key = CryptoJS.enc.Utf8.parse("1234123412ABC!@#"); var newpayload = CryptoJS.AES.encrypt(payload, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }); return newpayload.toString(); }
// 解密函数 function js_decrypt(payload){ //1234445 IT+0ugGnzZ/I788YwiY/lA== //1234777 5zjZV2m6VfMu4PjtmNyKIA== var key = CryptoJS.enc.Utf8.parse("1234123412ABC!@#"); var newpayload = CryptoJS.AES.decrypt(payload, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }); return newpayload.toString(CryptoJS.enc.Utf8);; } /**************************************************************************/
No branches or pull requests
密文是原始的base64形式的,js里面不知道哪一步urldecode了一下,把那种有+号的解码成空格了,导致解密失败,我应该改哪个地方- -。
The text was updated successfully, but these errors were encountered: