Explorar el Código

处理Phone号解密问题

zhou.xiaoning hace 4 años
padre
commit
720abe1ae9
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/utils/websocket/crypto/index.ts

+ 3 - 1
src/utils/websocket/crypto/index.ts

@@ -6,6 +6,8 @@ const aeskey: CryptoJS.lib.WordArray = CryptoJS.enc.Utf8.parse('F7A72DE7D6264530
 const macKeyLeft: CryptoJS.lib.WordArray = CryptoJS.enc.Hex.parse('B0FB83E39A5EBFAA'); // 这里要用CryptoJS.enc.Hex.parse,CryptoJS.enc.Utf8.parse返回是16位的
 /** MAC检验码右8字节 */
 const macKeyRight: CryptoJS.lib.WordArray = CryptoJS.enc.Hex.parse('BE471362A58393FF');
+/** Phone AES密钥 */
+const phoneaeskey: CryptoJS.lib.WordArray = CryptoJS.enc.Utf8.parse('0d299ce2d4105282f7471074cb0f9f9d');
 /** MAC检验向量 */
 const iv = new Uint8Array([0xd9, 0x51, 0xdb, 0xe0, 0x37, 0xc8, 0x23, 0x25]);
 
@@ -160,7 +162,7 @@ export const decrypt50 = (encryptData: Uint8Array, size: number): Uint8Array | n
     const cipherParams = CryptoJS.lib.CipherParams.create({
         ciphertext: uint8ArrayToWordArray(encryptData),
     });
-    const decrytped = CryptoJS.AES.decrypt(cipherParams, aeskey, aesOption);
+    const decrytped = CryptoJS.AES.decrypt(cipherParams, phoneaeskey, aesOption);
 
     return wordArrayToUint8Array(decrytped);
 };