intechfs
asked on
PHP and Perl different Whirlpool hashes
I have a user password that is hashed using Whirlpool in PHP to check it matches the password stored in the database.
The code to do this is below.
I have the same user password that is hashed using Whirlpool in Perl to check it matches the password stored in the database.
The code to do this is also below.
The problem I have is that the PHP and the Perl string are always different despite the original passwords being identical.
Can someone please tell me why this is and how I can get them both to return the same hash.
The code to do this is below.
I have the same user password that is hashed using Whirlpool in Perl to check it matches the password stored in the database.
The code to do this is also below.
The problem I have is that the PHP and the Perl string are always different despite the original passwords being identical.
Can someone please tell me why this is and how I can get them both to return the same hash.
PHP:
$v_salted_password = hash ( 'whirlpool' , $v_password );
PERL:
my $whirlCrypt = Digest -> new( 'Whirlpool' );
$whirlCrypt -> add( $uPwd );
$uPwd = $whirlCrypt -> hexdigest;
Use MD5 or SHA256 hash.
ASKER
I have already written a large amount of code relying on whirlpool and would like to continue using it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for that.
The problem was actually elsewhere in the code but testing that helped me find it.
The problem was actually elsewhere in the code but testing that helped me find it.