Bug #70625 [Opn]: mcrypt_encrypt() : won't return data when no IV was specified under RC4.

From: Date: Fri, 02 Oct 2015 19:41:59 +0000
Subject: Bug #70625 [Opn]: mcrypt_encrypt() : won't return data when no IV was specified under RC4.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196354@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70625&edit=1 ID: 70625 User updated by: jparedes at gmail dot com Reported by: jparedes at gmail dot com Summary: mcrypt_encrypt() : won't return data when no IV was specified under RC4. Status: Open Type: Bug Package: mcrypt related Operating System: Linux PHP Version: 7.0.0RC4 Block user comment: N Private report: N New Comment: Apparently the introduction of zpp checks [1]is in effect what causes the difference in the desired behaviour. This emerged in php-7.0.0beta3. [1] https://github.com/php/php-src/commit/d8ed84e4c4d0bd0bac88d2c0ed6e072a7d7ea49d Previous Comments: ------------------------------------------------------------------------ [2015-10-02 19:14:04] jparedes at gmail dot com Description: ------------ Ommiting $iv in mcrypt_encrypt() under MCRYPT_ARCFOUR cipher returns false. But when "null" parameter is specified it work as expected. Test script: --------------- <?php //This works php<7.0 only $enc_value = mcrypt_encrypt(MCRYPT_ARCFOUR,'secretkey','payload',MCRYPT_MODE_STREAM); var_dump($enc_value); //This work tested under 7.0RC4 $enc_value = mcrypt_encrypt(MCRYPT_ARCFOUR,'secretkey','payload',MCRYPT_MODE_STREAM,null); var_dump($enc_value); Expected result: ---------------- The result of $enc_value should be the result of the encryption. Actual result: -------------- Function returns false. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70625&edit=1

« previous php.bugs (#196354) next »