Req #66650 [NEW]: Support for CTR mode

From: Date: Wed, 05 Feb 2014 21:36:24 +0000
Subject: Req #66650 [NEW]: Support for CTR mode
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184176@lists.php.net to get a copy of this message
From:             clicky at erebot dot net
Operating system: Any
PHP version:      Irrelevant
Package:          mcrypt related
Bug Type:         Feature/Change Request
Bug description:Support for CTR mode

Description:
------------
Please add support for the CTR encryption mode (MCRYPT_MODE_CTR).

See also attached patch against PHP 5.5.x which adds the necessary code
and also defines a deprecated function mcrypt_ctr() (for consistency
with other modes).

Test script:
---------------
<?php

$key      = "FooBar";
$secret   = "PHP Testfest 2008";
$cipher   = MCRYPT_RIJNDAEL_128;
$iv       = mcrypt_create_iv(mcrypt_get_iv_size($cipher,
MCRYPT_MODE_CTR), MCRYPT_RAND);
$enc_data = mcrypt_ctr($cipher, $key, $secret, MCRYPT_ENCRYPT, $iv);
var_dump(bin2hex($enc_data));

?>

Expected result:
----------------
string(34) "5e42855e8236dacdb8fafbdaa12d176f13"

Actual result:
--------------
Bunch of errors due to lack of MCRYPT_MODE_CTR constant and undefined
function mcrypt_ctr().

-- 
Edit bug report at https://bugs.php.net/bug.php?id=66650&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66650&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66650&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66650&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66650&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66650&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66650&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66650&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66650&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66650&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66650&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66650&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66650&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66650&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66650&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66650&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66650&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66650&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66650&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66650&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66650&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#184176) next »