A simple AES encryption and decryption module
Project description
AES Encryption Package
A Python package for AES (Advanced Encryption Standard) encryption and decryption, supporting AES-128, AES-192, and AES-256 bit encryption. This package is designed with a modular structure to make it easy to integrate into your projects and extend for custom requirements.
Features
- Encryption and Decryption: Securely encrypt and decrypt data using AES with three different key lengths:
- AES-128: 128-bit key size
- AES-192: 192-bit key size
- AES-256: 256-bit key size
- Key Expansion: Implements AES key schedule for efficient key derivation.
- Modular Design: Core components like
State,Word, andByteare reusable, simplifying extension or adaptation. - High Performance: Optimized implementation for fast encryption and decryption.
- Cross-Platform: Works seamlessly across Windows, macOS, and Linux systems.
Installation
Install the package using pip:
pip install aes_package
Usage
This package provides functions to perform encryption and decryption easily. Below are some usage examples:
Encrypting a Message
from aes_module import aes_128_encrypt
# Define your message and key
message = "This is a secret message"
key = "mysecurekey12345" # Must match the required key length
# Encrypt the message
encrypted_message = aes_128_encrypt(message, key)
print("Encrypted:", encrypted_message)
Decrypting a Message
from aes_module import aes_128_decrypt
# Decrypt the message
decrypted_message = aes_128_decrypt(encrypted_message, key)
print("Decrypted:", decrypted_message)
Available Functions
The following functions are provided in the package:
Encryption
aes_128_encrypt(message, key): Encrypt a message using AES-128.aes_192_encrypt(message, key): Encrypt a message using AES-192.aes_256_encrypt(message, key): Encrypt a message using AES-256.
Decryption
aes_128_decrypt(message, key): Decrypt a message encrypted with AES-128.aes_192_decrypt(message, key): Decrypt a message encrypted with AES-192.aes_256_decrypt(message, key): Decrypt a message encrypted with AES-256.
Testing
This package includes test cases to ensure reliability. You can run the tests using pytest:
-
Install
pytestif not already installed:pip install pytest
-
Run the tests:
pytest tests/
Requirements
- Python Version: The package requires Python 3.6 or later.
- Dependencies: No external dependencies are required beyond the Python standard library.
How AES Works
AES is a symmetric block cipher widely used in modern encryption. It works by processing data in fixed-size blocks (128 bits) and applying multiple rounds of substitutions, permutations, and mathematical transformations.
Key Lengths
- AES-128: Uses a 128-bit key (10 rounds of encryption).
- AES-192: Uses a 192-bit key (12 rounds of encryption).
- AES-256: Uses a 256-bit key (14 rounds of encryption).
Contributing
We welcome contributions to improve the package! To contribute:
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
- Commit your changes with descriptive messages.
- Push the branch and submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
Special thanks to all contributors and the cryptography community for their continued development of secure encryption standards.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aes_package-0.2.tar.gz.
File metadata
- Download URL: aes_package-0.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06c89804a471e4a02fb76b369ce49864ab3d421ec06e6aceb6cfd9a2696348fb
|
|
| MD5 |
41dcf96753e0a0cdfa6e2637ce373673
|
|
| BLAKE2b-256 |
c1caf73ebb07a6f434cd4da4be5a5f31e70fc83aea72e96a586b1e7096f0b551
|
File details
Details for the file aes_package-0.2-py3-none-any.whl.
File metadata
- Download URL: aes_package-0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a0711f29f4ae9b978dc6daab0ecf5a68b0108268587e03fefa1238af6a7379d
|
|
| MD5 |
8e70fb6f52d305ba300e48b4f64fec3a
|
|
| BLAKE2b-256 |
44e85413d8998369403342f382e087e8d57994fe3be0e7c56d91cc9a16c6da55
|