Hi there..some what a new programmer when it comes to all this. I'm 
trying to encrypt some data and then decrypt it. It doesn't have to be 
high bit encryption just something simple like 3DES. But I keep getting 
it wrong. Any help would be greatful. Here's the piece of code:

$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, 

$key = md5("Secret Key");
$sample2 = "Hello";

$lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, 
MCRYPT_MODE_ECB, $iv);            

echo "$lockdata\n";

$text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, MCRPYT_MODE_ECB, 

echo "$text\n";

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to