<?php
$salt ='whatever_you_want';
function simple_encrypt($text)
{
return trim(base64_encode(mcrypt_encrypt
(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_ECB,
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),
MCRYPT_RAND))));
}
function simple_decrypt($text)
{
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt,
base64_decode($text), MCRYPT_MODE_ECB,
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),
MCRYPT_RAND)));
}
?>
I'm using XAMPP 1.7.4 with PHP 5.3.5 as well, no problem here. It's
configured "--with-mcrypt=static", Version 2.5.8 is enabled by default.
No need to enable the extension (which I had to do for Fileinfo, though;
just uncomment extension=php_fileinfo.dll in xampp/php/php.ini)
Nice to try....
Tidak ada komentar:
Posting Komentar