Skip to main content

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('new_test.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('new_test.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('new_test.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('new_test.zip') as zf:
    zf.pwd = secret_password
    my_secrets = zf.read('test.txt')

Project details


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.2.0.tar.gz (149.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyzipper-0.2.0-py2.py3-none-any.whl (158.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyzipper-0.2.0.tar.gz.

File metadata

  • Download URL: pyzipper-0.2.0.tar.gz
  • Upload date:
  • Size: 149.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pyzipper-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0f5ac837f362b47aad7dbba08f8ab281afb50575d7b98991475d2411bf4a527b
MD5 7832915f91bfd8ad0f47235f0762b37e
BLAKE2b-256 f675c8b3efa19ddecf73860794230cca680dbecd12ae8bdeb8cdc523e45a2e65

See more details on using hashes here.

File details

Details for the file pyzipper-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pyzipper-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 158.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pyzipper-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a80cfd5abd18b474151ba916549da14955f19ab834a8a8f23bf9d855f2be2b7e
MD5 724264efccebbe4ef822a6334e20cb30
BLAKE2b-256 75b9c5afd6243eb8ea5d64e37396f12177c81316363ced9012f54bf4b19415c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page