attempt to use an empty IV with mcrypt

From: Date: Mon, 05 Feb 2001 05:13:33 +0000
Subject: attempt to use an empty IV with mcrypt
Groups: php.general 
Request: Send a blank email to php-general+get-38190@lists.php.net to get a copy of this message
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

« previous php.general (#38190) next »