Metadata-Version: 2.4
Name: lemonade-cryptography
Version: 1.0.0
Summary: Lightweight byte-oriented encryption library.
Author: Vlinho
License: MIT License
        
        Copyright 2026 Vlinho
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the “Software”), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: cryptography,encryption,experimental
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 🍋 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:

```bash
pip install lemonade-cryptography
```

---

# Quick Start

```python
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()`

```python
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:

```python
(
    encrypted_message,
    encryption_key
)
```

Both values are encoded using Base64.

Example:

```python
crypt, key = encrypt("Hello")
```

---

## `decrypt()`

```python
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:

```python
str
```

Example:

```python
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.
