Skip to main content

AES (Advanced Encryption Standard) implementation in Python-3

Project description

AES-Python: A Python implementation of the Advanced Encryption Standard (AES)

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.

Features

  • 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.

Acknowledgements

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.

Getting started

This is a short guide to help you get started.

Installation

You can install the latest version of AES-Python from PyPI using pip.

$ python3 -m pip install AES_Python

Usage

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")

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

aes_python-1.5.5.tar.gz (21.4 kB view hashes)

Uploaded Source

Built Distribution

AES_Python-1.5.5-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page