Crypto++ library gzip issue -
Crypto++ library gzip issue -
i having issue gzip class of crypto++ library. working on server client app. client app written in c++. encrypt info using gzip class follows:
#include <gzip.h> gzip zipper(1); // 1 fast, 9 slow zipper.put(pdata,dwlen); zipper.close(); byte* pcompressed = new byte[zipper.maxretrieveable()]; zipper.get(pcompressed,zipper.maxretrieveable()); the info hex encoded , transferred python utilize decodes , attempts decompress these gzip streams follows:
import gzip import stringio fio = stringio.stringio(gzip_data) f = gzip.gzipfile(fileobj=fio) f.read() 'test' f.close() and have tried next as:
fh = gzip.open('abc.gz', 'rb') cdata = fh.read() fh.close() this seems simple enough, not working correctly , gives me errors during decompression process on python end. there separate way decompress streams vs actual files utilizing python module class?
if else has had issue, assistance appreciated.
update
thank reply jww. fyi, got work today decompressing received stream, c++ software utilizing cryptopp library, follows within python client:
compressedstream = stringio.stringio(data2) gzipper = gzip.gzipfile(fileobj=compressedstream) f = gzipper.read() i not sure why works. appears though must process/decompress gzip streams , gzip files differently. in case, stream decompression method using python gzip.gzipfile method works nicely.
update
thank reply jww. fyi, got work today decompressing received stream, c++ software utilizing cryptopp library, follows within python client:
compressedstream = stringio.stringio(data2) gzipper = gzip.gzipfile(fileobj=compressedstream) f = gzipper.read() i not sure why works. appears though must process/decompress gzip streams , gzip files differently. in case, stream decompression method using python gzip.gzipfile method works nicely.
gzip crypto++
Comments
Post a Comment