You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2024. It is now read-only.
For password-protected Zip files, I am finding that I cannot Read accurate data from the CrcCalculatorStream unless the position is a multiple of 16.
To reproduce:
Random rand = new Random();
byte[] buffer = new byte[1048576];
long remaining = ZipEntryStream.Length;
while (remaining > 0)
{
int take = 524288 + rand.Next(524288);
var read = ZipEntryStream.Read(buffer, 0, (int)Math.Min(remaining, take));
if (read == 0)
break;
_outputStream.Write(buffer, 0, read);
remaining -= read;
}
I assume this is related to the block size for the AES encryption. My guess is that the internal Read method is incorrectly starting decryption at the byte actual stream position rather than at the beginning of the block.
I am able to work around this by wrapping it in a BufferedStream with a size divisible by 16 but this is probably something that should be looked at. Thanks!
The text was updated successfully, but these errors were encountered:
legistek
changed the title
Password Protected Files; Cannot Perform Reads with Different Lengths
Password Protected Files; Cannot Perform Reads With Lengths Not Divisible by 16
Mar 20, 2022
legistek
changed the title
Password Protected Files; Cannot Perform Reads With Lengths Not Divisible by 16
Password Protected Files; Cannot Perform Successive Reads of Lengths Not Divisible by 16
Mar 20, 2022
legistek
changed the title
Password Protected Files; Cannot Perform Successive Reads of Lengths Not Divisible by 16
Password Protected Files; Read Fails When Position Not a Multiple of 16
Mar 20, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For password-protected Zip files, I am finding that I cannot
Read
accurate data from theCrcCalculatorStream
unless the position is a multiple of 16.To reproduce:
I assume this is related to the block size for the AES encryption. My guess is that the internal
Read
method is incorrectly starting decryption at the byte actual stream position rather than at the beginning of the block.I am able to work around this by wrapping it in a
BufferedStream
with a size divisible by 16 but this is probably something that should be looked at. Thanks!The text was updated successfully, but these errors were encountered: