AES encryption for zipfile.
Project description
Modification of Python’s zipfile to read and write AES encrypted zip files.
Installation
pip install pyzipper
Usage
import pyzipper
secret_password = b'lost art of keeping a secret'
with pyzipper.AESZipFile('bla_new.zip',
'w',
compression=pyzipper.ZIP_LZMA,
encryption=pyzipper.WZ_AES) as zf:
zf.pwd = secret_password
zf.writestr('test.txt', "What ever you do, don't tell anyone!")
with pyzipper.AESZipFile('bla_new.zip') as zf:
zf.pwd = secret_password
my_secrets = zf.read('test.txt')
AES Strength
The strength of the AES encryption can be configure to be 128, 192 or 256 bits. By default it is 256 bits. Use the setencryption() method to specify the encryption kwargs:
import pyzipper
secret_password = b'lost art of keeping a secret'
with pyzipper.AESZipFile('bla_new.zip',
'w',
compression=pyzipper.ZIP_LZMA) as zf:
zf.pwd = secret_password
zf.setencryption(pyzipper.WZ_AES, nbits=128)
zf.writestr('test.txt', "What ever you do, don't tell anyone!")
with pyzipper.AESZipFile('bla_new.zip') as zf:
zf.pwd = secret_password
my_secrets = zf.read('test.txt')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyzipper-0.1.0.tar.gz
(144.7 kB
view hashes)
Built Distribution
pyzipper-0.1.0-py2.py3-none-any.whl
(154.8 kB
view hashes)
Close
Hashes for pyzipper-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c0280635bb378db21df52a6ed9b54f3ca90b7d22ac8744a309790d725948660 |
|
MD5 | 573c0975f84752ee44b39c1add8af060 |
|
BLAKE2b-256 | 4df811fb2fdefaf33f8f14c1accc8a30c5f3ac13af91528ded84b3d1cbfeba53 |