LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-22-2009, 05:42 PM   #1
bichonfrise74
LQ Newbie
 
Registered: Jul 2008
Posts: 24

Rep: Reputation: 15
md5sum vs. cksum vs. sha1sum


Hi,

I've been using md5sum to verify the transfer of a file from one server to another. Basically, I take the md5sum on the source server and compare it against the destination server.

Recently, I saw there were other methods to do this 'verification' by using cksum and sha1sum.

Below are some benchmark timings that I've done on a 1.5 GB file:
md5sum - 8.4 sec.
cksum - 8.0 sec.
sha1sum - 14.7 sec.

Correct me if I'm wrong for the following assumptions:
1. All of the checksumming methods are CPU intensive. Would anyone know which is the most CPU intensive?
2. md5sum is the more preferred method (not sure why).

So, if I only want to do a quick checksum, then can I use cksum? Or is there a faster but less reliable method to do checksum?

Thanks in advance.
 
Old 07-22-2009, 07:48 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by bichonfrise74 View Post
md5sum is the more preferred method
...or could it be sha1sum just isn't widely accepted yet as a replacement?


Quote:
Originally Posted by bichonfrise74 View Post
So, if I only want to do a quick checksum, then can I use cksum?
Between two servers you control? Sure, what you want.


Quote:
Originally Posted by bichonfrise74 View Post
Or is there a faster but less reliable method to do checksum?
If hash comparison is done to confirm reliable transfer then why would you be looking for something less reliable?
 
Old 07-22-2009, 07:49 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

The algorithm for 'md5sum' is theoretically the best suited for the security of exchanging files/images such as an 'ISO' or other large files. By the use of the 'md5sum' we can transfer large files without the worry of corruption. Meaning if we have the sum then we compare our received file with the original sum then there is no need to have the original image to compare too. We just use the original sum to compare with. This method does prevent someone from corrupting the original form since it would be impossible to create the same sum as the original.

As for comparison to other hash code methods. I leave that too you as a LQ or Google search then discern the information to close the thread.
 
Old 07-22-2009, 08:27 PM   #4
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
from: http://en.wikipedia.org/wiki/Sha1sum

Quote:
However, sha1sum is still usable for general-purpose file checksumming, and is widely considered more secure than MD5 or a CRC.
And from: http://en.wikipedia.org/wiki/Md5sum

Quote:
md5sum should not be used in situations where security is important
 
  


Reply



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
bad cksum in tcpdump v_fone Linux - Networking 7 06-15-2009 02:16 PM
encode text with md5sum or sha1sum GATTACA Programming 6 01-24-2008 07:24 AM
md5sum .vs. SHA1SUM thelonius Linux - Software 2 07-18-2006 08:44 AM
cksum & md5sum fingerprints change after backup/restore to st cougar694u Linux - Software 3 06-22-2004 09:38 AM
cksum problems Xris718 Linux - General 6 01-11-2004 06:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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