|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43466 mcrypt_generic_init requires IV in ECB mode
Submitted: 2007-12-01 00:20 UTC Modified: 2007-12-01 13:04 UTC
From: askalski at gmail dot com Assigned:
Status: Not a bug Package: mcrypt related
PHP Version: 5.2.5 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
35 - 16 = ?
Subscribe to this entry?

 [2007-12-01 00:20 UTC] askalski at gmail dot com
mcrypt_generic_init() issues a PHP warning when an empty IV is supplied (good), even in ECB mode (not so good).

From the PHP documentation: "IV is ignored in ECB."

Since the IV is ignored in ECB mode, PHP should not issue any IV-related warnings.

(Also tested php5.2-200711302330)

Reproduce code:
$td = mcrypt_module_open("des", "", "ecb", "");
mcrypt_generic_init($td, "01234567", "");

Expected result:
I expect the code to run without any warnings.

Actual result:
Warning: mcrypt_generic_init(): Iv size incorrect; supplied length: 0, needed: 8 in /tmp/php-5.2.5/ecb-test.php on line 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-01 13:04 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Duplicate of #43143.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 15:01:25 2023 UTC