Lightweight byte-oriented encryption library.
Project description
🍋 Lemonade Cryptography
Lemonade Cryptography is a lightweight byte-oriented encryption library based on modular arithmetic and symmetric key transformations.
Lemonade transforms readable messages into encrypted data by converting text into bytes and applying mathematical operations using a cryptographic key.
The core concept is:
Each byte of the message is encrypted by subtracting it from a corresponding byte of a secret key.
The original message can be recovered by applying the reverse operation using the same key.
Installation
Install Lemonade Cryptography using pip:
pip install lemonade-cryptography
Quick Start
from lemonade import encrypt, decrypt
message = "Hello. We are looking for highly intelligent individuals."
crypt, key = encrypt(message)
print("Encrypted:")
print(crypt)
print("\nKey:")
print(key)
original = decrypt(crypt, key)
print("\nDecrypted:")
print(original)
Output:
Encrypted:
<encrypted data>
Key:
<secret key>
Decrypted:
Hello. We are looking for highly intelligent individuals.
Features
- Symmetric key encryption
- Byte-oriented processing
- UTF-8 message support
- Random cryptographic key generation
- Base64 encoded output
- Simple Python API
- Lightweight implementation
API Reference
encrypt()
encrypt(msg: str) -> tuple[str, str]
Encrypts a message and generates a random key.
Arguments
| Argument | Type | Description |
|---|---|---|
msg |
str |
Message to encrypt |
Returns
A tuple containing:
(
encrypted_message,
encryption_key
)
Both values are encoded using Base64.
Example:
crypt, key = encrypt("Hello")
decrypt()
decrypt(crypt: str, key: str) -> str
Decrypts a Lemonade encrypted message using its key.
Arguments
| Argument | Type | Description |
|---|---|---|
crypt |
str |
Encrypted message in Base64 |
key |
str |
Encryption key in Base64 |
Returns
The original message:
str
Example:
message = decrypt(crypt, key)
How It Works
Lemonade operates directly on byte values.
Example:
A = 65
B = 66
C = 67
The encryption operation is:
C = (M - K) mod 256
Where:
| Symbol | Meaning |
|---|---|
C |
Encrypted byte |
M |
Original message byte |
K |
Key byte |
The decryption operation reverses the transformation:
M = (C + K) mod 256
More technical details can be found in:
docs/algorithm.md
Security Notice
Lemonade Cryptography is an experimental encryption library created for educational purposes and lightweight applications.
It is not intended to replace modern cryptographic standards such as AES or ChaCha20 in security-critical systems.
Always protect your encryption keys. Without the correct key, encrypted messages cannot be recovered.
License
Lemonade Cryptography is licensed under the MIT License.
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
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 lemonade_cryptography-1.0.0.tar.gz.
File metadata
- Download URL: lemonade_cryptography-1.0.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf8070983821dee84eb0b2b9948725269bfe92e1302af9ded223503f5c27e0c7
|
|
| MD5 |
e93d04e368b11e277d0d5c4042e8274c
|
|
| BLAKE2b-256 |
74cd584350d83f463b3ab325de59747f64610ca4b03ab4a1b024c287632a1c73
|
File details
Details for the file lemonade_cryptography-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lemonade_cryptography-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15e4b2be7f3ae6725c682cc240986cfa55bdb6fc2ac70893a4553ee619a07098
|
|
| MD5 |
cd771d19209dd513f90c9ede8d7b82b4
|
|
| BLAKE2b-256 |
bafe7de40f92d6613674b8a3d93cbd30d73d75c69d1ae59ba812672a37ae1a4a
|