Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] AES decryption support in ZipInputStream #381

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Aug 29, 2019

I started looking at this and then haven't had time to try to finish it yet, so here it is in case anyone has any ideas.

The basic decryption seems to be ok, but the auth code checking is disabled as it doesn't work. I think the issue is the way that inflater input buffer runs all its data through the crypto transform rather than just the part which is actually encrypted, so the auth code calculation in the AES transform gets the wrong result.
Not sure of the best way to handle it - might need changes in the input buffer, or a different approach to calculating the value?

The changes also have a couple of more minor changes in separate commits, in case they're useful on their own.

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

@Numpsy Numpsy mentioned this pull request Dec 4, 2019
11 tasks
@Numpsy
Copy link
Contributor Author

Numpsy commented Jan 1, 2020

@piksel any interest in 1e0bc14 as a seperate PR (add constants for a couple more AES related things)?
I'd started looking at AES encryption support in ZipFile around the time as looking at this one (Numpsy@7ffb073), and that could benefit from the shared definitions.

81445e2 could also be useful seperately (removes some int casts on the compression method), though using entry.CompressionMethod without something like the last part of the change in #333 might alter the way reading (unsupported) AES encrypted entries is handled)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant