python 代码如下:
```
def decrypt_netlog(raw_data):
base64_decoded_data = base64.b64decode(raw_data)
if len(base64_decoded_data) < kIvSize * 2 + kHashSize:
raise DecryptError('Invalid data length.')
if not hmac.compare_digest(hmac.new(hmac_key, base64_decoded_data[:-kHashSize], hashlib.sha256).digest(),
base64_decoded_data[-kHashSize:]):
raise DecryptError('HMAC checking failed.')
iv = base64_decoded_data[:kIvSize]
cipher = AES.new(encryption_key, AES.MODE_CBC, iv)
text = cipher.decrypt(base64_decoded_data[kIvSize:-kHashSize])
return zlib.decompress(text, 16 + zlib.MAX_WBITS)
```
golang 里AES 的block概念是个啥呀。。。。
有疑问加站长微信联系(非本文作者)