|
@@ -150,3 +150,17 @@ export const decrypt50 = (encryptData: Uint8Array, size: number): Uint8Array | n
|
|
|
|
|
|
|
|
return a.subarray(0, size);
|
|
return a.subarray(0, size);
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * AES数据解密方法
|
|
|
|
|
+ * @param encryptData 密文
|
|
|
|
|
+ * @param size 明文长度
|
|
|
|
|
+ */
|
|
|
|
|
+ export const decryptAES = (encryptData: Uint8Array): Uint8Array | null => {
|
|
|
|
|
+ const cipherParams = CryptoJS.lib.CipherParams.create({
|
|
|
|
|
+ ciphertext: uint8ArrayToWordArray(encryptData),
|
|
|
|
|
+ });
|
|
|
|
|
+ const decrytped = CryptoJS.AES.decrypt(cipherParams, aeskey, aesOption);
|
|
|
|
|
+
|
|
|
|
|
+ return wordArrayToUint8Array(decrytped);
|
|
|
|
|
+};
|