You are here: Re: Mcrypt problem on PHP 4.3.1 / FreeBSD 5.3 « PHP Programming Language « IT news, forums, messages
Re: Mcrypt problem on PHP 4.3.1 / FreeBSD 5.3

Posted by Steve on 10/15/47 11:29

> As I said, the data is decrypted fine. But this error keeps popping
> up...

Suggestions:

> $ivector = mcrypt_create_iv(mcrypt_get_iv_size($cipher,$mode),$rand_src);

Break this down into two calls, and check that the size returned from
the first call is what you expect.

$ivsize = mcrypt_get_iv_size($cipher,$mode);
// [ check/debug $ivsize before use ]
$ivector = mcrypt_create_iv($ivsize,$rand_src);

Use <http://www.php.net/manual/en/function.mcrypt-enc-get-iv-size.php>
instead to see if it makes a difference.

$handle = mcrypt_module_open($cipher, '', $mode, '');
if(!$handle) die ("Couldn't locate open mcrypt module.");
$ivsize = mcrypt_enc_get_iv_size($handle);
// [ check/debug $ivsize before use ]
$ivector = mcrypt_create_iv($ivsize,$rand_src);

Or suppress the warning as you suggest, as it seems harmless 8-)

---
Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация