php-encrypted-streams
php-encrypted-streams copied to clipboard
Encrypt or decrypt streaming data of unbounded sizes. Uses PSR-7 compatible streams.
When reading from an Aes*cryptionStream with ```read($length=1)``` and ```$data === "0"```, then ```return $data ? $data : '';``` just gives an empty string.
read() should only return "" after eof() became true.
Sometimes stream is read even after reaching eof. In this case hash_final is called on obsolete hashResource producing warning and destroys hash result. Checking that hash is null prevents this...
When reading from AES encrypting stream with chunk length < block size `eof()` returns `true` too early leaving a part of padding in the buffer.
In the HashingStream class an AES exception in raise. I think it's an error due to a quick copy/paste https://github.com/jeskew/php-encrypted-streams/blob/432b7b918a22fa192d93e3413bf27ec093786d35/src/HashingStream.php#L82-L83
I've upgraded code and dependencies to PHP 8.1+. I decided to not care about PHP 7 as it is unmaintained... So changes are not bc. Although interfaces hasn't changed that...