pyzipper
AES encryption for zipfile.
What it is and what it does
pyzipper is a drop-in replacement for Python's zipfile module that adds support for reading and writing AES-encrypted zip archives using the WinZip AES encryption specification. It maintains the same API as Python 3.7's zipfile, so existing code using standard zipfile can often switch to pyzipper with minimal changes to add encryption support.
The package depends on pycryptodomex for cryptographic operations and supports AES encryption at 128, 192, or 256 bits (256 bits by default). It handles password-based encryption, CRC32 validation for data integrity, and follows WinZip's AES FAQ recommendations—notably, it excludes CRC32 values from encrypted file headers by default to avoid leaking information about small files, though this can be conditionally enabled for files above a configurable byte threshold.
Use it for:
- Encrypt sensitive files in zip archives for secure distribution or storage with password protection
- Read WinZip-encrypted zip files programmatically without external tools or manual decryption
- Build backup or archival systems that require both compression and AES encryption in a single step
- Migrate from manual encryption workflows to a standard Python API for handling encrypted archives
- Create password-protected zip files for compliance or data protection requirements
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pyzipper replaces Python's standard zipfile module to read and write AES-encrypted zip archives, using the WinZip AES encryption specification.
Yes. pyzipper is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real gap in Python's standard library—AES encryption for zip files. The MIT license is permissive. Use it when you need encrypted zip support; the API is familiar to anyone who has used zipfile, and the single dependency is lightweight.
Install
pyzipper on PyPI
pip
pip install pyzipperuv
uv add pyzipperpoetry
poetry add pyzipperInstalling pyzipper
Before you install
Low install friction; pure Python wheel with a single runtime dependency on pycryptodomex. Actively maintained with a release 92 days ago and ongoing commits.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install pyzipper
import pyzipper
secret_password = b'lost art of keeping a secret'
with pyzipper.AESZipFile('new_test.zip', 'w', compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES) as zf:
zf.setpassword(secret_password)
zf.writestr('test.txt', 'secret content')
with pyzipper.AESZipFile('new_test.zip') as zf:
zf.setpassword(secret_password)
content = zf.read('test.txt')
Verify before relying
- Whether the API surface differs meaningfully from Python 3.7's zipfile beyond the documented lack of pathlib wrappers
- Performance characteristics compared to standard zipfile for non-encrypted archives
- Compatibility of encrypted archives with other AES zip implementations beyond WinZip
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pycryptodomex |
| Maintenance | actively maintained — 92 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,323,147/month — #1,544 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyzipper-0.4.0-py3-none-any.whl
Tags
More Compression packages
Provides Python bindings to the Brotli…
permissive · top 1,000 on PyPI
backports.zstdProvides Zstandard compression support for…
permissive · top 1,000 on PyPI
zopfliZopfli is a Python binding for Google's Zopfli…
permissive · top 1,000 on PyPI
python-snappyPython binding for Google's Snappy compression…
permissive · top 5,000 on PyPI
pyzstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
compressed-rtfCompresses and decompresses Rich Text Format…
permissive · top 5,000 on PyPI
pyAesCryptEncrypts and decrypts files and binary streams…
permissive · top 15,000 on PyPI
pyminizipCreates password-encrypted ZIP files that can…
permissive · top 15,000 on PyPI
stream-unzipStreams unzip operations on ZIP archives…
permissive · top 5,000 on PyPI
zipfile-deflate64Enables extraction of Deflate64-compressed ZIP…
permissive · top 5,000 on PyPI
ansible-vaultReads and writes Ansible vault-encrypted YAML…
copyleft · top 15,000 on PyPI
zipfile-zstdExtends Python's standard zipfile module to…
permissive · top 5,000 on PyPI
android_backupUnpacks and repacks Android backup files (.ab…
permissive · top 15,000 on PyPI
zipfile36Provides a backport of Python 3.6's zipfile…
permissive · top 5,000 on PyPI
stream-zipConstructs ZIP archives on-the-fly without…
permissive · top 15,000 on PyPI
zippProvides a pathlib-compatible wrapper around…
permissive · top 100 on PyPI