I have the following PHP script to hash a user's password which it does, HOWEVER, when I try to compare the hashed variable to the original password, it returns false.
$hash=hash("whirlpool","hello");
if("hello"===$hash){echo "TRUE";}
else{echo "FALSE";}
Does anyone know what I am doing wrong or what can I do to improve this code to actually work properly? I need the hash to be the same as the variable so I can actually use this.
SIDE NOTE: I want to use a good sized encryption (which is why I'm using the "whirlpool" algorithm) so I would prefer not to use md5, sha1, etc...
Thanks in advance.
Shouldn't you compare the values as