note 108668 added to function.mcrypt-encrypt
| From: | anupamchakma at gmail dot com | Date: | Wed, 16 May 2012 10:55:20 +0000 |
| Subject: | note 108668 added to function.mcrypt-encrypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188006@lists.php.net to get a copy of this message | ||
below is my encryption function, it is working well with php5.3 but when i try to use the same in
php5.1, it doesnt work the program terminates before encrypting...Its neither giving a syntax error
while compiling...please suggest where i am going wrong.....
function encrypt($string)
{
//Key
$key = "xxxxxxxx";
//Encryption
$cipher_alg = MCRYPT_DES; //MCRYPT_TRIPLEDES;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg,MCRYPT_MODE_ECB), MCRYPT_RAND);
$encrypted_string = mcrypt_encrypt($cipher_alg, $key, $string, MCRYPT_MODE_ECB, $iv);
return base64_encode($encrypted_string);
return $encrypted_string;
}
----
Server IP: 69.147.83.197
Probable Submitter: 202.54.181.143
----
Manual Page -- http://www.php.net/manual/en/function.mcrypt-encrypt.php
Edit -- https://master.php.net/note/edit/108668
Del: integrated -- https://master.php.net/note/delete/108668/integrated
Del: useless -- https://master.php.net/note/delete/108668/useless
Del: bad code -- https://master.php.net/note/delete/108668/bad+code
Del: spam -- https://master.php.net/note/delete/108668/spam
Del: non-english -- https://master.php.net/note/delete/108668/non-english
Del: in docs -- https://master.php.net/note/delete/108668/in+docs
Del: other reasons-- https://master.php.net/note/delete/108668
Reject -- https://master.php.net/note/reject/108668
Search -- https://master.php.net/manage/user-notes.php