pyaes
Pure-Python Implementation of the AES block-cipher and common modes of operation
What it is and what it does
pyaes is a pure-Python implementation of the AES block cipher and its standard modes of operation. It provides no external dependencies and works by accepting keys of 128, 192, or 256 bits and encrypting/decrypting data using CBC, CFB, CTR, ECB, or OFB modes. The package includes low-level block cipher access for custom implementations and higher-level APIs (BlockFeeder, Encrypter/Decrypter, stream functions) to handle variable-length data and file I/O without manual padding.
The library is useful when you need AES encryption in pure Python without compiled dependencies, such as in restricted environments or for educational purposes. However, the package has been dormant since 2017 with no recent security updates or maintenance, making it a legacy choice. For new projects requiring cryptographic guarantees, modern alternatives with active maintenance are generally preferred.
Use it for:
- Encrypt sensitive configuration files or credentials in Python applications where external C libraries cannot be installed
- Implement custom encryption workflows using low-level block cipher access or specific AES modes not available in other libraries
- Decrypt legacy data encrypted with pyaes in existing systems that cannot be easily migrated
- Educational exploration of AES and block cipher modes of operation in a readable, pure-Python implementation
- Stream encryption of large files using the built-in Encrypter/Decrypter or stream APIs without loading entire files into memory
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pure-Python implementation of AES encryption with support for all key sizes and common modes of operation (CBC, CFB, CTR, ECB, OFB), plus stream and block-level APIs for encrypting and decrypting data.
No, unless you are maintaining legacy code already using pyaes or working in a constrained environment where compiled cryptography libraries are unavailable. The package is dormant (last release 2017-09-20) with no active security maintenance. For new projects, use a maintained alternative like cryptography or PyCryptodome, which offer active security updates and better performance. The lack of recent updates creates risk if vulnerabilities are discovered.
Install
pyaes on PyPI
pip
pip install pyaesuv
uv add pyaespoetry
poetry add pyaesInstalling pyaes
Before you install
High install friction: the package is dormant (last release 2017-09-20, last commit 2024-01-17) with no runtime dependencies but a source distribution only. Maintenance status suggests no active development or security updates.
License in practice
MIT license (permissive) imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
import pyaes
key = b'This_key_for_demo_purposes_only!'
aes = pyaes.AESModeOfOperationCTR(key)
plaintext = b'Text may be any length you wish'
ciphertext = aes.encrypt(plaintext)
aes = pyaes.AESModeOfOperationCTR(key)
decrypted = aes.decrypt(ciphertext)
Keys must be exactly 16, 24, or 32 bytes; input must be bytes, not strings in Python 3. Modes like CBC require an initialization vector (IV) of 16 bytes.
Verify before relying
- Whether the package has received any security audits or is suitable for production cryptographic use
- Current compatibility with modern Python versions (3.10+) given the dormant maintenance status
- Whether pure-Python performance is acceptable for high-throughput encryption workloads
Package facts
| License | License :: OSI Approved :: MIT License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 3,250 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,364,960/month — #2,649 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyaes-1.6.1.tar.gz
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
aes-pkcs5Provides AES encryption and decryption with…
permissive · top 15,000 on PyPI
pyAesCryptEncrypts and decrypts files and binary streams…
permissive · top 15,000 on PyPI
pyscryptA pure-Python implementation of the scrypt…
permissive · top 15,000 on PyPI
pywidevineImplements Widevine Content Decryption Module…
copyleft · top 15,000 on PyPI
py3rijndaelpy3rijndael provides a pure-Python…
permissive · top 15,000 on PyPI
twofishProvides Python bindings to the Twofish block…
permissive · top 15,000 on PyPI
xxteaxxtea is a Python extension that implements the…
permissive · top 15,000 on PyPI
pyDesPure Python implementation of DES and Triple…
permissive · top 15,000 on PyPI
http-eceImplements encrypted content encoding for HTTP…
permissive · top 5,000 on PyPI
miscreantProvides misuse-resistant authenticated…
permissive · top 5,000 on PyPI