|
@@ -120,8 +120,9 @@ async function getRandomString16() {
|
|
|
return result;
|
|
|
}
|
|
|
export async function AES_CBC_ENCRYPT(val) {
|
|
|
+ // 生成16字节(128位)的随机IV
|
|
|
const IV = await getRandomString16();
|
|
|
- const KEY = window.android.getGlobalParam('key');
|
|
|
+ const KEY = await window.android.getGlobalParam('key');
|
|
|
const secretKey = CryptoJS.enc.Utf8.parse(KEY);
|
|
|
const ivk = CryptoJS.enc.Utf8.parse(IV);
|
|
|
let ivHex = CryptoJS.enc.Base64.stringify(ivk);
|