-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: AES-2 encryption #94
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
6 times, most recently
from
January 3, 2024 16:51
47203b9
to
8f48f53
Compare
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
23 times, most recently
from
January 3, 2024 23:06
864cb08
to
65f4c92
Compare
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
11 times, most recently
from
January 4, 2024 13:11
b70201b
to
5d3a1c3
Compare
Without this for some reason the following error can happen if when we add other dependencies in later commits: > ImportError: cannot import name 'Config' from 'pytest' (Specifically the dependencies of pycryptodome and pyzipper) Have to admit I'm not really sure why, and haven't spent that long trying to work out why, but I think it's reasonable to use a more recent version even without this issue and not really worth the time investigating it. We're not using the most recent version of pytest because I don't think it can be installed with Python 3.6.7 that we're still testing on. Will like to maintain support for older Python for as long as possible to not cause annoyances for people that are restricted to older Python but want the latest stream-zip.
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
3 times, most recently
from
January 4, 2024 13:38
4d57095
to
44f6b3b
Compare
This reduces a little big of duplication for each mode - the flags are now defined in a single line. Also, the flags are defined as a 2-byte unsigned integer rather than a 2-byte bytes array. This changes allow for the flags to be more easily dynamic for each mode - set in a single place and then use binary or | to combine flags. This will be useful in the upcoming chnage that adds AES encryption for each mode that will require the first bit of the flags to be set if encryption is enabled.
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
2 times, most recently
from
January 4, 2024 13:54
802c2d8
to
d37b9c9
Compare
This reduces a bit of duplication, and more easily allows the compression type of "99" to be set in a later commit, which is one of the things that indicates that AES encryption is used.
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
from
January 4, 2024 14:59
d37b9c9
to
666dc16
Compare
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
4 times, most recently
from
January 4, 2024 15:47
47b4f34
to
7c0defb
Compare
This adds AES-2 encryption as requested/discussed in #93 and defined at https://www.winzip.com/en/support/aes-encryption/ For now, AES-2 is used over AES-1 to prevent leakage of information via CRC-32 for small files, at the price of not having a checksum on the uncompressed plain text data (although there is an HMAC check on the encrypted compressed data as part of AES-2). In a later change, we should be able to make it AES-1 for larger files as recommended at https://www.winzip.com/en/support/aes-encryption/, but not doing this now to keep this change reasonably small.
michalc
force-pushed
the
feat/encrpyt-with-aes-2
branch
from
January 4, 2024 16:05
7c0defb
to
28287a3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds AES-2 encryption as requested/discussed in #93 and defined at https://www.winzip.com/en/support/aes-encryption/
For now, AES-2 is used over AES-1 to prevent leakage of information via CRC-32 for small files, at the price of not having a checksum on the uncompressed plain text data (although there is an HMAC check on the encrypted compressed data as part of AES-2). In a later change, we should be able to make it AES-1 for larger files as recommended at https://www.winzip.com/en/support/aes-encryption/, but not doing this now to keep this change reasonably small.