Skip to main content

A custom encryption library that compresses data

Project description

ARCHUS

A custom encryption library that compresses data by mapping every 2 bits to a single character, effectively reducing the size of the binary representation.

Installation

You can install the package via pip:

pip install rachus

Usage

Encrypting Text

To encrypt a text string, use the encrypt_text function from the RACHUS package. This function returns the original binary representation of the text and the encrypted string.

from rachus import encrypt_text

s = "he"
binary_text, encrypted_text = encrypt_text(s, r=3)
print(f"Original text: {s}")
print(f"Original binary: {binary_text}")
print(f"Encrypted custom: {encrypted_text}")

Decrypting Text

To decrypt an encrypted string, use the decrypt_text function from the RACHUS package. This function returns the binary representation of the encrypted text and the decrypted original text.

from rachus import decrypt_text

encrypted_text = '1!"#$'
binary_text, decrypted_text = decrypt_text(encrypted_text, r=3)
print(f"Encrypted text: {encrypted_text}")
print(f"Decrypted binary: {binary_text}")
print(f"Decrypted text: {decrypted_text}")

How It Works

Encryption

  1. Text to Binary Conversion: The text is converted to its binary representation. Permutation: The binary string is permuted randomly multiple times. Mapping: Each pair of bits is mapped to a specific character according to a predefined mapping.

  2. Permutation: The binary string is permuted randomly multiple times.

  3. Mapping: Each pair of bits is mapped to a specific character according to a predefined mapping.

Decryption

  1. Reverse Mapping: Each character in the encrypted string is mapped back to its original pair of bits.

  2. Reverse Permutation: The binary string is permuted back to its original order (assuming the same permutation was used in reverse).

  3. Binary to Text Conversion: The binary string is converted back to the original text.

License

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

Author

Rey - rey@cock.lu

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

rachus-0.1.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

RACHUS-0.1.0-py3-none-any.whl (2.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