Activities

December 2009
M T W T F S S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

Enabling mhash on php

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

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>