pyAesCrypt
Encrypt and decrypt files and streams in AES Crypt format (version 2)
What it is and what it does
pyAesCrypt is a Python 3 module for encrypting and decrypting files and binary streams using AES256-CBC. It implements the AES Crypt file format (version 2) and can be used as both a library and a command-line tool. The module provides three main interfaces: file-level encryption/decryption, stream-oriented operations for handling large data, and in-memory encryption/decryption via BytesIO.
The package depends only on cryptography and installs with low friction. Maintenance is dormant—the last release was in November 2023. The documentation includes important security caveats: the AES Crypt format version 2 does not authenticate file size metadata, allowing potential tampering with plaintext length, and Python's lack of low-level memory management means sensitive data cannot be securely wiped from RAM.
Use it for:
- Encrypt sensitive files before storing them in untrusted locations or cloud storage.
- Decrypt files encrypted by the AES Crypt tool or other compatible implementations.
- Build a file encryption feature into a Python application using password-based encryption.
- Process large files or streams with custom buffer sizes to manage memory usage.
- Perform in-memory encryption/decryption of binary data using BytesIO without touching the filesystem.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encrypts and decrypts files and binary streams using AES256-CBC, compatible with the AES Crypt file format (version 2).
Yes, if you need straightforward AES256-CBC file encryption compatible with the AES Crypt format and can accept dormant maintenance. The package is stable with no known vulnerabilities and handles the common case well. Install it if you are not expecting active security updates or bug fixes; avoid it if you require ongoing support or are encrypting data where file-size tampering is a threat model.
Install
pyaescrypt on PyPI
pip
pip install pyaescryptuv
uv add pyaescryptpoetry
poetry add pyaescryptInstalling pyAesCrypt
Before you install
Low install friction with a single runtime dependency (cryptography). Maintenance is dormant—last release was in November 2023—so expect no active bug fixes or security updates, though the repository remains public and unarchived.
License in practice
Released under Apache License 2.0 (permissive), so you can use it freely in commercial and private projects with minimal legal constraints.
Quickstart
import pyAesCrypt
password = "please-use-a-long-and-random-password"
pyAesCrypt.encryptFile("data.txt", "data.txt.aes", password)
pyAesCrypt.decryptFile("data.txt.aes", "dataout.txt", password)
Version 2 of the AES Crypt file format does not authenticate the file size modulo 16 byte, so an attacker with write access to the encrypted file may alter the plaintext file size by up to 15 bytes. Python has no low-level memory management, so sensitive information cannot be wiped from memory.
Verify before relying
- Whether dormant maintenance status poses a practical risk for your use case, given no known vulnerabilities are currently recorded.
- Performance characteristics and suitability for large files or high-throughput scenarios.
- Current real-world adoption and whether the AES Crypt format version 2 limitations are acceptable for your threat model.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — cryptography |
| Maintenance | dormant — 1,007 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 215,839/month — #9,392 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyAesCrypt-6.1.1-py3-none-any.whl
Keywords: AES, Crypt, encrypt, decrypt
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ansible-vaultReads and writes Ansible vault-encrypted YAML…
copyleft · top 15,000 on PyPI
cryptoProvides command-line tools to encrypt and…
permissive · top 5,000 on PyPI
kasa-cryptProvides fast encryption and decryption…
permissive · top 15,000 on PyPI
pyaesPure-Python implementation of AES encryption…
permissive · top 5,000 on PyPI
pyzipperpyzipper replaces Python's standard zipfile…
permissive · top 5,000 on PyPI
pyragepyrage provides Python bindings to the Rust…
permissive · top 15,000 on PyPI
pyscryptA pure-Python implementation of the scrypt…
permissive · top 15,000 on PyPI
aes-pkcs5Provides AES encryption and decryption with…
permissive · top 15,000 on PyPI
msoffcrypto-toolDecrypts and encrypts Microsoft Office files…
permissive · top 5,000 on PyPI
pylibsrtppylibsrtp encrypts and decrypts Secure…
permissive · top 5,000 on PyPI