skillfed

pyaes

Pure-Python Implementation of the AES block-cipher and common modes of operation

pyaes v1.6.1 3.4M downloads/30d#2,649 on PyPI471
Permissive license License :: OSI Approved :: MIT License DORMANT released

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 pyaes

uv

uv add pyaes

poetry

poetry add pyaes

Installing 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

License :: OSI Approved :: MIT LicenseTopic :: Security :: Cryptography

Tags

AES encryption pythonpure python cryptographyblock cipher modes CBC CTRstream encryption libraryAES key derivationsymmetric encryption no dependenciespython encryption algorithm
legacy-cryptopure-pythonno-dependencies

More Cryptography packages