PHP Secure Communications Library
Go to file
Hans-Jürgen Petrich 359e38b4d4 fixed corrupted decrypt() in CTR mode
$buffer['encrypted'] (which is always empty) should be $buffer['ciphertext'] or buffered stream will get corrupt...

Example:
define('CRYPT_AES_MODE',CRYPT_AES_MODE_INTERNAL);//in MODE_MCRYPT all is fine
$aes = new Crypt_AES(CRYPT_AES_MODE_CTR);
$aes->setKey(':-8');
$aes->enableContinuousBuffer();
$plaintext = ':-):-):-):-):-):-)';
for($i=0; $i<strlen($plaintext); $i++) {
 echo $aes->Decrypt($aes->Encrypt($plaintext[$i]));
}

Output:
:-):-):-):-):-):-(

Expected:
:-):-):-):-):-):-)


After Bugfix, output is:
:-):-):-):-):-):-)
2013-01-04 14:23:34 +07:00
phpseclib fixed corrupted decrypt() in CTR mode 2013-01-04 14:23:34 +07:00
tests [feature/hash-tests] Tests for the MD5 hash algorithm. 2012-08-20 13:55:03 +02:00
.gitattributes added build status and extra lines 2012-06-11 02:30:46 -06:00
.gitignore added build status and extra lines 2012-06-11 02:30:46 -06:00
.travis.yml [feature/phpunit] Add configuration file for travis-ci.org 2012-06-06 13:07:55 +02:00
AUTHORS Add AUTHORS and LICENSE files 2012-12-11 01:16:08 -06:00
composer.json - resolve conflict in composer.json, up required php version to 5.0.0 and suggest pear-pear/PHP_Compat 2012-06-09 19:04:07 -05:00
LICENSE Add AUTHORS and LICENSE files 2012-12-11 01:16:08 -06:00
phpunit.xml.dist [feature/phpunit] Add phpunit configuration and bootstrapping. 2012-06-06 13:07:36 +02:00
README.md Update download link in README.md 2012-11-21 23:03:22 -06:00

phpseclib - PHP Secure Communications Library

Build Status

MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, AES, SSH-1, SSH-2, SFTP, and X.509

PEAR Channel PEAR Channel: [phpseclib.sourceforge.net](http://phpseclib.sourceforge.net/pear.htm)