I get the following warning when I turn on logging...
Warning: attempt to use an empty IV, which is NOT recommend in
/home/local/apache/htdocs/encrypt.php on line 21
Here is the code
$key = "testing";
$input = "Secret data";
$encrypted_data = mcrypt_ecb (MCRYPT_DES, $key, $input, MCRYPT_ENCRYPT);
print "The CypherText in DES ECB is <BR>".bin2hex
($encrypted_data)."\n<br>";
$encrypted_data = mcrypt_ecb (MCRYPT_TWOFISH, $key, $input,
MCRYPT_ENCRYPT);
print "The CypherText in TWOFISH ECB is <BR>".bin2hex
($encrypted_data)."\n<br>";
$encrypted_data = mcrypt_cbc (MCRYPT_TWOFISH, $key, $input,
MCRYPT_ENCRYPT);
print "The CypherText in TWOFISH CBC is <BR>".bin2hex
($encrypted_data)."\n<br>";
?>
How do I prevent this error?
Regards
Terrence
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]