I think my PHP intall might have problems. When I try to do this I get
Warning: mcrypt_decrypt() [function.mcrypt-decrypt]: Module initialization failed
I am writing a small snippet of code that will decrypt the following string encrypted with AES-128 using mode ECB.
Key (encoded in base64): aXJhbmRvbXNlY3VyZWtleQ==
Encrypted string> (encoded in base64): 3l6xiNdgRG+PkBw5M0lawvJ/fmuTZPRhEcbtqAmOpDI=
I keep getting module errors.
This is what I have tried:
<?PHP
$retval = mcrypt_decrypt( "AES-128",
base64_decode( "aXJhbmRvbXNlY3VyZWtleQ=="),
base64_decode( "3l6xiNdgRG+PkBw5M0lawvJ/fmuTZPRhEcbtqAmOpDI") ,
"ECB");
echo $retval;
?>
here is my relevant phpinfo. I dont see AES-128 . Maybe thats the problem.
mcrypt
mcrypt support enabled
Version 2.5.8
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream