我從這個網站下面的代碼。當我運行它,我得到爲什麼mcrypt_encrypt會給出錯誤?
Warning: mcrypt_encrypt(): Attempt to use an empty IV, which is NOT recommend in C:\web\apache\htdocs\dev\encrypt.php on line 7
我在這裏做什麼錯,我如何得到這個權利?
//Key
$key = 'SuperSecretKey';
//To Encrypt:
$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, 'I want to encrypt this', MCRYPT_MODE_CFB);
//To Decrypt:
$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_CFB);
echo $encrypted;
echo "<br>";
echo $decrypted;
您是否獲得了輸出或僅提到警告..? – 2013-04-29 04:41:38
我收到錯誤的輸出。 – Norman 2013-04-29 04:44:27