最近再抓包时发现返回值为一个奇怪的字符串,都是由H4sIAAAA开头,例如:
H4sIAAAAAAAACqtWKkotLs0pUbKqViouSSwpLVayMtBRKi3IyU9McUxJAcoCRfJKc3JAgimJJak++ekwgcy8ktSissSckMzcVLC2stSi4sz8PL9EEB+kplZHKSmxOBNoRLVSbjFQo9Kzyb1P9s551jHhadd8JR2l4sz0PJhxMPuNDAxqawGSwLdymQAAAA==
加解密代码如下
import gzip
import base64
# 密文
pText = "H4sIAAAAAAAACqtWKkotLs0pUbKqViouSSwpLVayMtBRKi3IyU9McUxJAcoCRfJKc3JAgimJJak++ekwgcy8ktSissSckMzcVLC2stSi4sz8PL9EEB+kplZHKSmxOBNoRLVSbjFQo9Kzyb1P9s551jHhadd8JR2l4sz0PJhxMPuNDAxqawGSwLdymQAAAA=="
text = gzip.decompress(base64.b64decode(pText))
print(f'明文: {text}')
import gzip
import base64
# 明文
text = '{"result":{"status":0,"uploadAddress":null,"updateLog":null,"intervalTime":0,"versionName":null},"basis":{"msg":"操作成功","sign":null,"status":200}}'
text = text.encode('utf-8')
pText = base64.b64encode(gzip.compress(ptext)).decode('utf-8')
print(f'密文: {pText}')
标签:H4sIA,python,text,base64,gzip,密文,pText,import,null
From: https://www.cnblogs.com/wstong2052/p/17653990.html