static decrypt_user_info(session_key: string, encryptedData: string, iv: string): WxDecryptedUserInfo {
let CryptoJS = (window as any).CryptoJS
var dencryptedData = CryptoJS.enc.Base64.parse(encryptedData)
var dkey = CryptoJS.enc.Base64.parse(session_key);
var div = CryptoJS.enc.Base64.parse(iv);
let o = CryptoJS.AES.decrypt({ ciphertext: dencryptedData }, dkey, { iv: div })
let jsonstr = CryptoJS.enc.Utf8.stringify(o)
logd('用户数据解密 ', o, jsonstr)
return JSON.parse(jsonstr)
}
网友评论