Skip to main content

Encrypt and decrypt files in AES Crypt format (version 2)

Project description

https://travis-ci.org/marcobellaccini/pyAesCrypt.svg?branch=master

About pyAesCrypt

pyAesCrypt is a Python 3 file-encryption module and script that uses AES256-CBC to encrypt/decrypt files.

pyAesCrypt is compatible with the AES Crypt file format (version 2).

The script is Free Software, released under the Apache License, Version 2.0.

pyAesCrypt is brought to you by Marco Bellaccini - marco.bellaccini(at!)gmail.com.

IMPORTANT SECURITY NOTE: version 2 of the AES Crypt file format does not authenticate the “file size modulo 16” byte. This implies that an attacker with write access to the encrypted file may alter the corresponding plaintext file size by up to 15 bytes.

NOTE: there is no low-level memory management in Python, hence it is not possible to wipe memory areas were sensitive information was stored.

Module usage example

Here is an example showing encryption and decryption of a file:

import pyAesCrypt
# encryption/decryption buffer size - 64K
bufferSize = 64 * 1024
password = "foopassword"
# encrypt
pyAesCrypt.encryptFile("data.txt", "data.txt.aes", password, bufferSize)
# decrypt
pyAesCrypt.decryptFile("data.txt.aes", "dataout.txt", password, bufferSize)

Script usage examples

Encrypt file test.txt in test.txt.aes:

pyAesCrypt -e test.txt

Decrypt file test.txt.aes in test.txt:

pyAesCrypt -d test.txt.aes

Encrypt file test.txt in test2.txt.aes:

pyAesCrypt -e test.txt -o test2.txt.aes

Decrypt file test.txt.aes in test2.txt:

pyAesCrypt -d test.txt.aes -o test2.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

pyAesCrypt-0.3.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

pyAesCrypt-0.3.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file pyAesCrypt-0.3.1.tar.gz.

File metadata

  • Download URL: pyAesCrypt-0.3.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyAesCrypt-0.3.1.tar.gz
Algorithm Hash digest
SHA256 28f1ccb515edbdc9badcdb504005e317a82f90c7c8a39aa26a03876e6db1997e
MD5 d6e80aab5dc1f9c5f9feb9bc5e9bbb8f
BLAKE2b-256 22666960724e0030a1cfba4a08dbfc44a217e5739d8ce23ddc253b7f6272cd3d

See more details on using hashes here.

File details

Details for the file pyAesCrypt-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyAesCrypt-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d53ac8dd9ff1af96fb00a7295caaa8e1ea1520caf4fb9f69b594373bc23fd530
MD5 ef4e5c3945d96e204e93dc06ab6be5cb
BLAKE2b-256 2ec7414e7f517386b88558731509a4b4f3d4f62e10b853c5ebb08a06542120a0

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