Question

How would you do that?

You are sending files which contains many lines.Every line is a record from database.

All files are zipped toggether into one file. Is it enough to send a checksum with this file to ensure that other side received all records and none has disappear?

Was it helpful?

Solution

A checksum would change if any contents of the file were malformed or missing, so by comparing the checksums, the recipient can be sure that the files were received fully and not damaged. After all, that is the entire purpose of the checksum.

If you are worried about attackers, I would not send the checksum with the files, as an attacker could intercept both the file and the checksum, change the file, modify the checksum to allow the modifications to appear valid, and send the file on its way.

Like other posters have said, however, the major packaging formats contain a built-in checksum for validation of the contents.

OTHER TIPS

There's usually a built-in checksum in most packing formats (gzip, zip, ...) so it is not necessary to add one if you only want to check if the file has not been physically damaged during the transfer.

If it's zipped you're sending only one file. If the zip file is not received properly, you would not be able to open it. Internally zipped archives manage their own checksums to ensure the data integrity.

It depends on what kind of "disappear" you are trying to protect against. If it's just random errors, then a checksum is fine. On the other hand, if it's a malicious attacker deliberately disappearing records, then a checksum is insufficient and you need a MAC.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top