Saturday, December 27, 2008

Verifying file integrity.

This post is all about the checksum, i have a read a lot about this topic in college days.Never had really hand experience how it can be used in daily life.

we download a lot of files from internet, copy files (movies ,songs .text and lot of other things) from friends place to our pen drive.Sometimes it may happen that , the file hasn't copied/downloaded properly :( .We realize this thing when we try to use the copied/downloaded content .
This is where our checksum comes into picture.Just to verify that the files are copied correctly Just use the "sum" Command in linux.
Just as an example:

Remote Host:
------------
$ sum vlc0.8.5test3win32.exe
20311 8132

After copying to pendrive or something.
---------------------------------------
[bash$pradeep@localhost]sum vlc0.8.5test3win32.exe
20311 8132

When you download a file , the checksum apart from verifying the file integrity helps us make sure that , the file we downloaded is not tampered by middle man.And it is virus free.

You can see many sites ,that provide some material to download has MD5/SHA1 signatures for the content they have kept for download.You can use this and verify that the piece of downloaded content is same as what is kept on the site and it is virus free.Sometimes it happens that , even though the content you downloaded works fine.But it is infected with virus.

This tool is very useful ("sum") to me in office .Very often i provide patches of our product to people .And provide them them the sum command output, to check whether the patch they had downloaded is fine. So that they wont come to me again saying , your patch is not proper . :)

No comments: