View Single Post
  #3  
Old 11th December 2009, 13:28
reduzent reduzent is offline
Junior Member
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
On a second question can anyone tell me why these two commands result in a different hash?

Command: echo '<?php print sha1("password")."\n"; ?>' | php
Result: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8

Command: echo 'password' | sha1sum
Result: c8fed00eb2e87f1cee8e90ebbe870c190ac3848c
You would need to do this as the second command:

Code:
echo -n 'password' | sha1sum
5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
Otherwise the 'echo'-command adds a trailing newline character.

R.
Reply With Quote