Sunday, 7 October, 2007

Checking the Integrity of a Transfer

There are situations in which we have to check the integrity after atransfer. This could be from the network, a CD/DVD, USB or hard disk.In such cases, errors can creep in and partial transfer or corruptedtransfer is possible. When faced with the necessity to ensure theintegrity of critical data, one could use one of these approaches.


$ sha1sum

Executing this command at both ends should result in identicaloutputs. This works for all files, text or binary. You could also dothe same thing with OpenSSL or GNU Privacy Guard.

$ openssl -sha1

or

$ gpg --print-md sha1


You could also use diff or cksum for this but the above approach isbetter. Or if you have the luxury to execute sha512sum at both sides,it is even better!

No comments: