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
-
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.
-
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.
Decryption
-
Reverse Mapping: Each character in the encrypted string is mapped back to its original pair of bits.
-
Reverse Permutation: The binary string is permuted back to its original order (assuming the same permutation was used in reverse).
-
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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d0baa7aa056f70631d95477d6c21b1c737ba02eec5348b2b9e35a5e2f1426c4
|
|
| MD5 |
1032e8abca0a05a39ebad18e6bed8c44
|
|
| BLAKE2b-256 |
260576b158f08b72473c7a76c7745e746777e85e728eac9a7ba7128a1510b273
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a0e37c0e2191d76e4cc4a780b42b04c0e6525242e146649913d81edfcc24e1a
|
|
| MD5 |
a9e7a39c555dc2f515361a2983541b75
|
|
| BLAKE2b-256 |
eb1430bb8048ae1448517048f99020277362322ff8aa17438a9f04c7011d9ac5
|