I have base64 encoded, deflated (RFC1951) hex binary data. 01 01 64 03 47 33 14 64 50 31 64 50 31 is the original binary data, and "Y2RMYWZwNxZhSAkwBGEA" is this data base64 encoded and deflated. I've been trying to get back the original data using both the zlib and gzip libraries with no luck. The error "incorrect header check" shows up. Here are my attempts:
# import gzip and decompress
import base64, zlib, binascii, gzip
base64_message = "Y2RMYWZwNxZhSAkwBGEA"
base64_bytes = base64_message.encode('latin_1')
message_bytes = base64.b64decode(base64_bytes)
ss = binascii.hexlify(message_bytes)
b = bytearray.fromhex(str(ss)[2:44])
z = zlib.decompress(b, zlib.MAX_WBITS|32)
print(z)
This website decompresses the compressed string correctly (but as utf text) and I have yet to figure out how