1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-12-02 17:48:00 +01:00
tgseclib/phpseclib
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
..
Crypt fixed corrupted decrypt() in CTR mode 2013-01-04 14:23:34 +07:00
File Add limited SPKAC support 2012-12-19 00:21:55 -06:00
Math Use !empty('0') instead of strlen('0') 2013-01-03 00:21:09 -06:00
Net SFTP: Make get() work correctly when files are being written to for partial transfers 2012-12-16 02:34:49 -06:00
openssl.cnf - make Crypt_RSA use openssl for key generation (if openssl is available) and make it so File_X509 can create CSRs 2012-07-01 12:07:42 -05:00