Hi
I tried to adapt the mcrypt example shown on the php.net site:
http://nz.php.net/manual/en/function.mcrypt-decrypt.php
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, dfg98dnfg);
//changed rand
$key = "f98hdrfg98dfkjg";
$text = $email_address;
$encemail = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
I changed MCRYPT_RAND to dfg98dnfg so that I could decrypt it on another page.
I am presuming the decryption would look kind of like:
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, dfg98dnfg);
//changed rand
$key = "f98hdrfg98dfkjg";
$text = $email_address;
$encemail = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
... Only that it does not decrypt it. Could someone please tell me what it is? I get an error saying the iv is too large. What length should I make it?
Thanks