Re: [PHP] mcrypt warning
Hi, Thursday, July 10, 2003, 12:41:28 AM, you wrote: DJ Hi All, DJ I have the following function: DJ function encrypt ($x) { DJ $ini = parse_ini_file ($GLOBALS['INI_PATH']); DJ $td = mcrypt_module_open ('tripledes', '', 'ecb', ''); DJ $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), DJ MCRYPT_RIJNDAEL_256); DJ mcrypt_generic_init ($td, $ini[key], $iv); DJ $encrypted_data = mcrypt_generic ($td, $x); DJ mcrypt_generic_deinit ($td); DJ mcrypt_module_close ($td); DJ return bin2hex($encrypted_data); DJ } DJ I get the following PHP Warning in my logs, however, the code executes ok: DJ [Wed Jul 9 10:25:49 2003] [error] PHP Warning: mcrypt_generic_init(): Iv DJ size incorrect; supplied length: 0, needed: 8 in DJ /usr/local/apache/htdocs-uat-retail/include/nocheck.iostream.class.php on DJ line 87 DJ I have read into mcrypt, tried a couple things, but nothing will get rid of DJ that error. Could someone show me what I've done wrong? DJ -Dan Joseph I use this to set iv to null so I don't need to worry about it :) $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mcrypt warning
Hi, I use this to set iv to null so I don't need to worry about it :) $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); Ahh ok, I'll give that a try and let you know how it comes out. Thanks! -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mcrypt warning
Hi All, I have the following function: function encrypt ($x) { $ini = parse_ini_file ($GLOBALS['INI_PATH']); $td = mcrypt_module_open ('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RIJNDAEL_256); mcrypt_generic_init ($td, $ini[key], $iv); $encrypted_data = mcrypt_generic ($td, $x); mcrypt_generic_deinit ($td); mcrypt_module_close ($td); return bin2hex($encrypted_data); } I get the following PHP Warning in my logs, however, the code executes ok: [Wed Jul 9 10:25:49 2003] [error] PHP Warning: mcrypt_generic_init(): Iv size incorrect; supplied length: 0, needed: 8 in /usr/local/apache/htdocs-uat-retail/include/nocheck.iostream.class.php on line 87 I have read into mcrypt, tried a couple things, but nothing will get rid of that error. Could someone show me what I've done wrong? -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php