|
|
@@ -132,7 +132,7 @@ export const encrypt50 = (plainText: Uint8Array): Uint8Array | null => {
|
|
|
data1.set(macData, 4 + a2.length);
|
|
|
|
|
|
return data1;
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 5.0报文数据解密方法
|
|
|
@@ -151,7 +151,7 @@ export const decrypt50 = (encryptData: Uint8Array, size: number): Uint8Array | n
|
|
|
}
|
|
|
|
|
|
return a.subarray(0, size);
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* AES数据解密方法
|
|
|
@@ -167,8 +167,8 @@ export const decryptAES = (value: string): string | undefined => {
|
|
|
});
|
|
|
|
|
|
const decrytped = CryptoJS.AES.decrypt(cipherParams, uint8ArrayToWordArray(key), aesOption);
|
|
|
- const h = wordArrayToUint8Array(decrytped).subarray(0, decrytped.words.length * 4 - 1);
|
|
|
+ const h = wordArrayToUint8Array(decrytped).subarray(0, decrytped.sigBytes);
|
|
|
const result = new TextDecoder().decode(h);
|
|
|
return result;
|
|
|
-};
|
|
|
+}
|
|
|
|