Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

md5deep utility gives different result when calculating hashes. I have used several online tools to calculate hash and they give same result but md5sum or md5deep program on linux gives different output. Any ideas what I am doing wrong?

Website        = http://hash.online-convert.com/whirlpool-generator 
string         = foobar
whirlpool hash = 9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9

Website        = http://www.sha1-online.com/
string         = foobar
whirlpool hash = 9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9

md5deep tool on Linux Mint x64 KDE i5 processor
string = foobar
whirlpool = 37b100ba4d775e394c6db6062e2ca0cc8431948f7aea03c0a07991bcd139599735bdcac9dc0b4ae3c91912f93dd0f736a8c0c7a44996c2bd2e16939ac37c44a7
share|improve this question

1 Answer 1

I bet you are using echo foobar: this will add a new line at the end of the word, changing the hash to what you get. The proper way is:

$ printf foobar | whirlpooldeep
9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9

Using echo (or vim without the binary mode -b enabled, as you seem to do in your test) returns the hash you get:

$ echo foobar | whirlpooldeep
37b100ba4d775e394c6db6062e2ca0cc8431948f7aea03c0a07991bcd139599735bdcac9dc0b4ae3c91912f93dd0f736a8c0c7a44996c2bd2e16939ac37c44a7
share|improve this answer
    
I was actually storing "foobar" in a.txt. This I did using vim to ensure no newline was created. $ whirlpooldeep a.txt. Why is this giving different output? –  linuxfreak Aug 2 at 7:34
1  
Because vim adds a new line ;) –  ntd Aug 2 at 7:41
    
In fact I'm showing the data provided as input to the different programs is not the same. –  ntd Aug 2 at 11:47
    
Ohwait. Too early for me to be posting. You proved that md5deep ẃorks the same with intended input. Duh. You might also provide output with the newline to demonstrate for OP how that output looks. –  atk Aug 2 at 12:25
    
@atk: seems logic: added wrong example. –  ntd Aug 2 at 12:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.