Skip to main content

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, and Byte are 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:

  1. Install pytest if not already installed:

    pip install pytest
    
  2. 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:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix:
    git checkout -b feature-name
    
  3. Commit your changes with descriptive messages.
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aes_package-0.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aes_package-0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

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

Hashes for aes_package-0.2.tar.gz
Algorithm Hash digest
SHA256 06c89804a471e4a02fb76b369ce49864ab3d421ec06e6aceb6cfd9a2696348fb
MD5 41dcf96753e0a0cdfa6e2637ce373673
BLAKE2b-256 c1caf73ebb07a6f434cd4da4be5a5f31e70fc83aea72e96a586b1e7096f0b551

See more details on using hashes here.

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

Hashes for aes_package-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9a0711f29f4ae9b978dc6daab0ecf5a68b0108268587e03fefa1238af6a7379d
MD5 8e70fb6f52d305ba300e48b4f64fec3a
BLAKE2b-256 44e85413d8998369403342f382e087e8d57994fe3be0e7c56d91cc9a16c6da55

See more details on using hashes here.

Supported by

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