Registry / serialization / pyzipper

pyzipper

JSON →
library0.4.0pypypi✓ verified 27d ago

Pyzipper is a Python library that extends the functionality of Python's built-in `zipfile` module by adding support for AES encryption. Forked from Python 3.7's `zipfile` module, it maintains a similar API while enabling the creation and extraction of password-protected ZIP archives with AES encryption. The current version is 0.3.6, released in July 2022, and it appears to have an infrequent release cadence.

pip install pyzipper
INSTALL
IMPORT
SIG · PYZIPPER
P
pyzipper
serializationpythonv0.4.0
Install
2.2s avg
Import
75ms
Disk
25MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.072s · 26.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.078s · 28MB
25MB installed
● package 25MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AESZipFile
from pyzipper import AESZipFile
import pyzipper
ZipFile
from pyzipper import ZipFile
import pyzipper
is_zipfile
from pyzipper import is_zipfile
import pyzipper

This quickstart demonstrates how to create a new ZIP archive, add a file with AES encryption and LZMA compression, set a password, and then read the content back, using `pyzipper.AESZipFile`.

import pyzipper import os secret_password = b'your_secret_password' zip_filename = 'secure_archive.zip' content_to_write = "This is a secret message that needs to be protected." # Create an AES encrypted zip file with pyzipper.AESZipFile(zip_filename, 'w', compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES) as zf: zf.setpassword(secret_password) zf.writestr('secret.txt', content_to_write) print(f"'{zip_filename}' created with 'secret.txt' encrypted.") # Read content from the AES encrypted zip file with pyzipper.AESZipFile(zip_filename, 'r') as zf: zf.setpassword(secret_password) try: read_content = zf.read('secret.txt').decode('utf-8') print(f"Content read from 'secret.txt': {read_content}") except RuntimeError as e: print(f"Error reading file (incorrect password or corruption): {e}") # Clean up the created zip file if os.path.exists(zip_filename): os.remove(zip_filename) print(f"Cleaned up '{zip_filename}'.")
Debug
Known issues
gotchaPasswords must be provided as byte strings (e.g., `b'yourpassword'`), not regular Python strings. Failing to do so will result in errors during encryption or decryption operations.
fix
Ensure `zf.setpassword()` is called with a bytes object: `zf.setpassword(b'your_password')`.
affects: All versions
breakingPyzipper was forked from Python 3.7's `zipfile` module and therefore lacks support for `pathlib`-compatible wrappers and other new features introduced in Python 3.8 and later versions of the standard `zipfile` module.
fix
Avoid using `pathlib.Path` objects directly with `pyzipper` where `zipfile` in Python 3.8+ would support them. Convert `pathlib.Path` objects to strings if necessary before passing them to `pyzipper` methods.
affects: All versions
gotchaFile metadata, such as filenames, are not encrypted by pyzipper. Only the file contents are protected by AES encryption. This means an attacker could still see the names of the files within the archive.
fix
If filename confidentiality is required, consider an additional layer of encryption or obfuscation for filenames before archiving, or use a different archiving solution that encrypts metadata.
affects: All versions
deprecatedThe AES-2 encryption used by pyzipper, while better than ZipCrypto, has known flaws and may not be suitable for all high-security use cases. Information leakage can occur, especially if the ZIP file can be intercepted and modified.
fix
For applications requiring the highest level of security, evaluate alternatives to the ZIP format or implement additional security measures outside of `pyzipper` to protect sensitive data.
affects: All versions
gotchaThe project's last release was in July 2022, which might indicate infrequent maintenance. Users should be aware that active development, bug fixes, or security patches might not be regularly provided.
fix
Monitor the GitHub repository for updates and consider contributing or forking the project if specific maintenance needs arise. Factor in the maintenance status when planning for long-term usage in critical applications.
affects: 0.3.6 and potentially future versions
Upgrade
Version history
0.4.0latest on PyPI · released May 14, 2026
Audit
Dependencies
pycryptodomexrequiredRequired for AES encryption functionality.
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
pyzipper — pip install pyzipper · libregistry