Re: Encryption failing
| From: | Ken Kixmoeller -- reply to ken@kixmoeller.com | Date: | Wed, 16 Jan 2008 17:07:19 +0000 |
| Subject: | Re: Encryption failing | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267404@lists.php.net to get a copy of this message | ||
Many thanks, Mike --- yours works great... 0 errors.
On Jan 16, 2008, at 9:24 AM, mike wrote:
function data_encrypt($data) {if(!$data) { return false; } return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256,$GLOBALS['config']['salt'], $data, 'cbc', md5($GLOBALS['config'][' salt'].$GLOBALS['config']['salt']))); } function data_decrypt($data) {if(!$data) { return false; } return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256,$GLOBALS['config']['salt'], base64_decode(str_replace(' ', '+', $data)), ' cbc', md5($GLOBALS['config']['salt'].$GLOBALS['config']['salt']))); }