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

Uploaded Source

Built Distribution

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

RACHUS-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file rachus-0.1.0.tar.gz.

File metadata

  • Download URL: rachus-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for rachus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d0baa7aa056f70631d95477d6c21b1c737ba02eec5348b2b9e35a5e2f1426c4
MD5 1032e8abca0a05a39ebad18e6bed8c44
BLAKE2b-256 260576b158f08b72473c7a76c7745e746777e85e728eac9a7ba7128a1510b273

See more details on using hashes here.

File details

Details for the file RACHUS-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: RACHUS-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.2

File hashes

Hashes for RACHUS-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0e37c0e2191d76e4cc4a780b42b04c0e6525242e146649913d81edfcc24e1a
MD5 a9e7a39c555dc2f515361a2983541b75
BLAKE2b-256 eb1430bb8048ae1448517048f99020277362322ff8aa17438a9f04c7011d9ac5

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