Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Easily verify md5 checksums on files UNIX
I've found an easier way to check an md5 sum, or any other checksum for that matter. Just use this command:
md5 file_to_check | grep checksum_of_file
If there is an error, it will show the file name and the real checksum of the file. If there aren't any errors, then nothing will show up. You can do this for mutliple files by putting a semicolon (;) between the above code for each file.
    •    
  • Currently 3.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[43,261 views]  

Easily verify md5 checksums on files | 6 comments | Create New Account
Click here to return to the 'Easily verify md5 checksums on files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easily verify md5 checksums on files
Authored by: merlyn on Mar 16, '06 07:31:22AM

I think you mean "grep -v", not "grep".



[ Reply to This | # ]
Easily verify md5 checksums on files
Authored by: fungus on Mar 16, '06 08:45:33AM

In general most files that come with md5 checksums have them in a file either named filename.md5 or in a file called MD5SUM.

This might be easier. md5 -r * | diff MD5SUM - or md5 -r filename | diff filename.md5 - Any output will indicate a problem.



[ Reply to This | # ]
Easily verify md5 checksums on files
Authored by: boredzo on Mar 16, '06 09:38:15AM

grep -f would be faster.

yes, I really do care about the speed of grepping the output of grep. ☺



[ Reply to This | # ]
Easily verify md5 checksums on files
Authored by: merlyn on Mar 17, '06 06:53:32AM

Actually, "-f" means "fixed", as in "not a regex", not "fast".

I've seen demonstrations of when it is actually *slower* in some versions of grep, because the "normal" grep has had a lot of optimizations over time, while people ignore the grep-f branch which takes a whole separate codepath.

Yes, counter-intuitive, like many things in life.



[ Reply to This | # ]
Easily verify md5 checksums on files
Authored by: LeeH on Mar 16, '06 09:53:38AM

To me, the simplest way is to instal the free MD5 Checksum automator action available at http://www.apple.com/downloads/macosx/automator/md5checksum.html



[ Reply to This | # ]
Check out md5deep
Authored by: macubergeek on Mar 19, '06 04:49:55AM

It is available as a Fink package.
In addition to md5 and sha1 hashing it also offers sha256 tiger and whirlpool hashing. Not sure what the last two hashes give you but sha256 is 256 bit long sha hash. Given that md5 and sha1 have both been broken, I'd consider at least using sha256 if you need to hash a recovered disk for forensics purposes.

Here is additional data on the tiger hash
http://www.cs.technion.ac.il/~biham/Reports/Tiger/

Here is additional data on the whirlpool hash
http://paginas.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html



[ Reply to This | # ]