The AES-Python
package is a Python implementation of the Advanced Encryption Standard (AES) using symmetric key cryptography. It supports two different modes of operation (ECB, CBC) and the key lengths 128, 256, 512 bit. This project was originally created as a school project using almost only built in python libraries, but has now been updated and adapted to more heavily really on the NumPy and galois packages. It has also been migrated to a more OOP focused structure. (The original school project can be seen in the legacy branch.)
Warning: This project is not intended to be used in any other use case than experimentation and educational use. No security is guaranteed for data encrypted or decrypted using this library, and it may very well contain multiple unaddressed security vulnerabilities.
- Implementation of the AES encryption and decryption processes.
- Support for two different modes of operation: ECB, CBC.
- Support for the three different key lengths included in the AES standard. (128, 192, 256 bit)
- Key expansion and round key generation.
- Encryption & decryption of individual files.
- Encryption & decryption of python string objects.
The AES-Python
project relies heavily on both the NumPy and galois packages in order to manage integer arrays and preform matrix operations and GF(2^8) finite field multiplication operations. This project would not have been possible without these libraries, so I would like to thank the developers of these projects.
This is a short guide to help you get started.
You can install the latest version of AES-Python
from PyPI using pip.
$ python3 -m pip install AES_Python
Now you can import it and use it in you projects. Below is a short example snippet of how to utilize the package.
from AES_Python import AES
# Initialize the AES object
aes = AES(r_mode="ECB", key="your-encryption-key")
# Encrypt the data
encrypted_data = aes.enc("your-data")
# Decrypt the data
decrypted_data = aes.dec("your-encrypted-data")