Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 05-07-2008, 05:28 PM   #1
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479

Rep: Reputation: 48
md5 hash files

I need to understand something...

Say file X has a md5sum of Y. A slight change in X will cause a completely different value for Y, correct?

Therefore when checking md5sums, eyeballing the first and last 3 digits should be sufficient. Am I understanding hash sums correctly?

Last edited by mattydee; 05-07-2008 at 06:33 PM. Reason: spelling
Old 05-07-2008, 05:37 PM   #2
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
yup, you got it

although i'd either use an md5sum file and then check it against that or still review the entire string although usually a cursory glance of a few characters as you note is sufficient

$cd /tmp
$echo 1 > example
$md5sum example > example.MD5SUM
$echo 2 > example
$md5sum -c example.MD5SUM
Old 05-07-2008, 06:04 PM   #3
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 377Reputation: 377Reputation: 377Reputation: 377
Experience shows that eyeballing a few characters works most of the time, but it's a terrible habit IMHO. Not only is it much more fool-proof to have the md5sum do the checking for you, it's also simpler (since you only have to look for an "OK"). Hence, I second rayfordj's suggestion that you use a checksum file.
md5sum example.txt > example.txt.md5
md5sum -c example.txt.md5
EDIT: Heh, just noticed rayfordj had already posted an example of the -c option.

Last edited by win32sux; 05-07-2008 at 08:13 PM.
Old 05-07-2008, 06:42 PM   #4
Registered: Dec 2006
Location: Vancouver, BC
Distribution: Debian,Ubuntu,Slackware
Posts: 479

Original Poster
Rep: Reputation: 48
Thanks... I'm lazy


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help unpacking hmac-md5 hash into md5 hash lynx5 Programming 3 02-02-2008 04:06 PM
gui md5 hash tool monohouse Linux - Software 1 05-17-2005 06:00 PM
checking MD5 hash issey Linux - Newbie 4 03-31-2005 01:15 AM
mass MD5 hash generation w3man Programming 2 01-31-2005 09:05 PM
MD5 hash value dominant Linux - Newbie 2 05-07-2004 03:52 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:10 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration