Question,
How do I enable mhash on PHP ?
Solution.
Follow the steps.
1. wget http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz/download
# tar -zxvf mhash-0.9.9.9.tar.gz
# cd mhash-0.9.9.9 && make && make install
4. Recompile php with the
"<strong>--with-mhash</strong>"
option
How to verify the installation
Place this php file one the web and execute. It will result will be like this.
n”;
$hash = mhash(MHASH_MD5, $input, “Jefe”);
echo “The hmac is ” . bin2hex($hash) . “
n”;
?>
The hash is d03cb659cbf9192dcd066272249f8412
The hmac is 750c783e6ab0b503eaa86e310a5db738
Leave a Reply