Doc #68501 [Nab]: mcrypt_decrypt need key with specific length

From: Date: Tue, 25 Nov 2014 22:05:22 +0000
Subject: Doc #68501 [Nab]: mcrypt_decrypt need key with specific length
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11702@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68501&edit=1 ID: 68501 User updated by: ogarbe at voyageprive dot com Reported by: ogarbe at voyageprive dot com Summary: mcrypt_decrypt need key with specific length Status: Not a bug Type: Documentation Problem Package: mcrypt related Operating System: Debian PHP Version: 5.6.3 Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2014-11-25 21:58:54] 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 21:40:46] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68501&edit=1

« previous php.doc.bugs (#11702) next »