Search code examples
javasocketsgzipchecksumgzipstream

Do I need to have a checksum if I am using GZIP?


I am using GZIP compression to send a payload via sockets.

Should I also send a md5 checksum with that or does GZIP handle the checksum for me and my checksum would just add unneeded size?


Solution

  • gzip decompression verifies the decompressed data with both a CRC-32 and the length of the decompressed data (modulo 2^32). So there is already a check. If that's not strong enough for you, you can add an MD5, SHA-2, or whatever.