Skip to main content
API reference

Encryption types

Both the stream_unzip.stream_unzip and stream_unzip.async_stream_unzip functions take an allowed_encrpytion_types parameter specifies what encryption types are allowed. The parameters must be a Container of zero or more of the following types.

If a member file is encounted with an encryption type that is not in, a subclass of the stream_unzip.EncryptionMechanismNotAllowed exception is raised. See Exception hierarchy for the specific exceptions.

stream_unzip.NO_ENCRYPTION

Allow non-encrypted member files.


stream_unzip.ZIP_CRYPTO

Allow member files encrypted with ZipCrypto.

Warning ZipCrypto is not secure enough for most uses

stream_unzip.AE_1

Allow member files encrypted with AES according to the WinZip AE-1 specification. For this to function you must also pass at least one of stream_unzip.AES_128, stream_unzip.AES_192, or stream_unzip.AES_256.


stream_unzip.AE_2

Allow member files encrypted with AES according to the WinZip AE-2 specification. For this to function you must also pass at least one of stream_unzip.AES_128, stream_unzip.AES_192, or stream_unzip.AES_256.


stream_unzip.AES_128

Allow member files encrypted with AES using a 128 bit encryption key. For this to function you must also pass at least one of stream_unzip.AE_1 or stream_unzip.AE_2.


stream_unzip.AES_192

Allow member files encrypted with AES using a 192 bit encryption key. For this to function you must also pass at least one of stream_unzip.AE_1 or stream_unzip.AE_2.


stream_unzip.AES_256

Allow member files encrypted with AES using a 256 bit encryption key. For this to function you must also pass at least one of stream_unzip.AE_1 or stream_unzip.AE_2.