PC HELP Forum  

Go Back   PC HELP Forum > PCHELP Forum > Software & Hardware

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 07-26-2009, 02:05 AM
mixdev's Avatar
mixdev mixdev is offline
Administrator
 
Join Date: Jul 2009
Location: Bangalore
Posts: 33
Send a message via Yahoo to mixdev Send a message via Skype™ to mixdev
Default Verifying file integrity using md5/SHA1 checksums

Every file is different from another. But with a md5 or SHA1 checksum of the original file, legitimate copies can be verified easily. This is possible because even changing one byte from the original file will make the file hash change. Checking the file integrity like this can avoid possibilities of getting affected by spywares or viruses.

Ok. Now you have the md5 checksum and the file to be verified for integrity. Now what? How to verify the checksum?
  • Windows
    Download Microsoft Checksum Integrity Verifier utility OR
    Download HashTab
  • Mac
    Download HashTab for Mac
  • Linux
    Use md5sum utility like
    Code:
    md5sum KNOPPIX_V5.2.1CD-2009-07-04-EN.iso
  • Webservers using PHP
    All the above mentioned methods work thtter when you have direct desktop/console access to the concerned machines. But if it is a webserver (used as a HTTP file proxy, most probably), you can use PHP to easily get the file hash.
    PHP Code:
    <?php
    echo hash_file('md5''KNOPPIX_V5.2.1CD-2009-07-04-EN.iso');
    ?>
    Change 'md5' to 'sha1' to get the SHA1 hash instead.
Hope it helps. Please let me know if you use any other technique to verify checksums.
  #2  
Old 07-26-2009, 03:25 AM
qmonster qmonster is offline
Junior Member
 
Join Date: Jul 2009
Posts: 7
Default What about CRC32?

Isn't CRC32 meant for this purpose? How about that?
  #3  
Old 07-26-2009, 04:56 AM
mixdev's Avatar
mixdev mixdev is offline
Administrator
 
Join Date: Jul 2009
Location: Bangalore
Posts: 33
Send a message via Yahoo to mixdev Send a message via Skype™ to mixdev
Default

Indeed. CRC32 can be used for this. In fact crc32 is way faster than md5 and sha1. But crc32 will have more collisions compared to the others. Means the chance of 2 different files giving the same checksum is more. In our case, accuracy is more important (also mostly it is just one file we need to check) than speed, md5 or SHA1 is preferred.
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
Forum Jump


All times are GMT +5.5. The time now is 03:33 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright © 2009 PCHELP.in. Hosted by HostMe