|
发表于 2024-5-3 22:31:18
|
显示全部楼层
广东省湛江市
const MD5 = e=>md5(e).toString()
, Crypto = new class {
constructor() {
ae(this, "defaultToken", "814a43980a8952c35b75d1502c61ca84");
ae(this, "token", "");
ae(this, "kk");
ae(this, "iv");
this.setToken(this.defaultToken)
}
setToken(e) {
this.token = e,
this.kk = UTF8.parse(this.token),
this.iv = UTF8.parse(this.token.slice(16, 32))
}
encrypt(e, t) {
this.setToken(t && MD5(t) || this.defaultToken);
const r = AES.encrypt(JSON.stringify(e), this.kk, {
iv: this.iv,
padding: pkcs7
});
return window.btoa(r.toString())
}
} |
|