php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68501 [FR] mcrypt_decrypt need key with specific length
Submitted: 2014-11-25 21:40 UTC Modified: 2014-12-28 17:47 UTC
From: ogarbe at voyageprive dot com Assigned: jeanseb (profile)
Status: Closed Package: Translation problem
PHP Version: 5.6.3 OS: Debian
Private report: No CVE-ID: None
 [2014-11-25 21:40 UTC] ogarbe at voyageprive dot com
Description:
------------
mcrypt_decrypt / encrypt changed between 5.4 and 5.6

in 5.6, and contrary to the doc, the second parameter $key needs to be of sizes 16, 24 or 32 supported, the key should be padded with "\0" to match correct sizes.



Test script:
---------------
        $decryptText = mcrypt_decrypt(
            MCRYPT_RIJNDAEL_256,
            '1234567890ABCDEFGHIJKLM',
            $cryptText,
            MCRYPT_MODE_CBC,
            'aworkingvector'
        );


Expected result:
----------------
Dont throw this error 

mcrypt_encrypt(): Key of size 22 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported

Or fix the documentation 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-25 21:58 UTC] aharvey@php.net
-Status: Open +Status: Not a bug -Type: Bug +Type: Documentation Problem
 [2014-11-25 21:58 UTC] aharvey@php.net
http://php.net/mcrypt_decrypt already notes that requirement both in the parameter documentation and changelog, and the 5.6 migration guide also includes this.
 [2014-11-25 22:05 UTC] ogarbe at voyageprive dot com
Thanks for this quick answer and sorry for this. 

In fact the French documentation is outdated and doesn't include this change.

http://php.net/manual/fr/function.mcrypt-decrypt.php
 [2014-11-25 22:09 UTC] aharvey@php.net
-Summary: mcrypt_decrypt need key with specific length +Summary: [FR] mcrypt_decrypt need key with specific length -Status: Not a bug +Status: Re-Opened -Package: mcrypt related +Package: Translation problem
 [2014-11-25 22:09 UTC] aharvey@php.net
Fair enough; reopening as a translation problem.
 [2014-12-28 17:46 UTC] jeanseb@php.net
Automatic comment from SVN on behalf of jeanseb
Revision: http://svn.php.net/viewvc/?view=revision&revision=335430
Log: Sync with EN (Closing #68501)
 [2014-12-28 17:47 UTC] jeanseb@php.net
-Status: Re-Opened +Status: Closed -Assigned To: +Assigned To: jeanseb
 [2014-12-28 17:47 UTC] jeanseb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 13 20:01:34 2024 UTC