Skip to content

Balue: Advanced Multi-Layer Encryption Explore the intricacies of cryptographic techniques with Balu, a Python library implementing a sophisticated multi-layer encryption system. Balu combines substitution, permutation, and XOR ciphers to offer a customizable and educational approach to data security.

License

Notifications You must be signed in to change notification settings

aliezzahn/balue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

balue

Balue is a Python package that implements a multi-layered encryption algorithm for educational purposes. It combines substitution, permutation, and XOR encryption techniques to provide a basic encryption and decryption functionality.

Features

  • Substitution Cipher: Shifts each byte of the plaintext based on a key.
  • Permutation Cipher: Shuffles the bytes of the text.
  • XOR Cipher: XORs the shuffled bytes with the key.

Installation

Using Poetry

  1. Install Poetry if not already installed:

    curl -sSL https://install.python-poetry.org | python3 -
  2. Clone the repository:

    git clone git@github.com:aliezzahn/balue.git
    cd balue
  3. Install the dependencies:

    poetry install

Manual Installation

  1. Clone the repository:

    git clone git@github.com:aliezzahn/balue.git
    cd balue
  2. Install the dependencies using pip:

    pip install -r requirements.txt

Usage

Encryption and Decryption Example

Here's how you can use the ComplexEncryptor class to encrypt and decrypt a message.

  1. Create an encryptor instance with a secret key.
  2. Encrypt a plaintext message.
  3. Decrypt the ciphertext to get back the original message.
from balue.encryptor import ComplexEncryptor

# Initialize the encryptor with a secret key
key = "super_secret_key"
encryptor = ComplexEncryptor(key)

# Define the plaintext to be encrypted
plaintext = "This is a very secret message!"

# Encrypt the plaintext
encrypted = encryptor.encrypt(plaintext)
print("Encrypted:", encrypted)

# Decrypt the ciphertext
decrypted = encryptor.decrypt(encrypted['ciphertext'], encrypted['indices'])
print("Decrypted:", decrypted)

Running the Test Script

To test the encryption and decryption process, you can run the provided test script.

python tests/test_encryptor.py

Project Structure

balue/
│
├── README.md
├── balue/
│   ├── __init__.py
│   └── encryptor.py
└── tests/
    └── test_encryptor.py
├── pyproject.toml

Security Considerations

This package is intended for educational purposes and should not be used for securing sensitive data in production environments. For real-world applications, rely on well-established cryptographic libraries and algorithms such as AES, RSA, and others provided by libraries like cryptography, PyCrypto, or PyCryptodome.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributors

We'd like to thank the following contributors:

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

Acknowledgments

  • Inspired by classical encryption techniques and the need to understand basic cryptographic principles.

About

Balue: Advanced Multi-Layer Encryption Explore the intricacies of cryptographic techniques with Balu, a Python library implementing a sophisticated multi-layer encryption system. Balu combines substitution, permutation, and XOR ciphers to offer a customizable and educational approach to data security.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages