微信小程序AES

时间:2021-01-01 10:08:12
【文件属性】:

文件名称:微信小程序AES

文件大小:52KB

文件格式:ZIP

更新时间:2021-01-01 10:08:12

微信小程序 AES

微信小程序AES加密解密:加密: Encrypt :function(word){ var mode = new Crypto.mode.CBC(Crypto.pad.pkcs7); var eb = Crypto.charenc.UTF8.stringToBytes(word); var kb = Crypto.charenc.UTF8.stringToBytes("1234567812345678");//KEY var vb = Crypto.charenc.UTF8.stringToBytes("8765432187654321");//IV var ub = Crypto.AES.encrypt(eb,kb,{iv:vb,mode:mode,asBpytes:true}); return ub; }, 解密: Decrypt:function (word){ var mode = new Crypto.mode.CBC(Crypto.pad.pkcs7); var eb = Crypto.util.base64ToBytes(word); var kb = Crypto.charenc.UTF8.stringToBytes("1234567812345678");//KEY var vb = Crypto.charenc.UTF8.stringToBytes("8765432187654321");//IV var ub = Crypto.AES.decrypt(eb,kb,{asBpytes:true,mode:mode,iv:vb}); return ub; }, 库调用: var Crypto = require('../pages/cryptojs/cryptojs').Crypto;


【文件预览】:
AESTest
----project.config.json(452B)
----pages()
--------logs()
--------.DS_Store(6KB)
--------index()
--------cryptojs()
----.DS_Store(6KB)
----utils()
--------util.js(1KB)
----app.js(755B)
----app.json(259B)
----app.wxss(204B)
----Read()

网友评论