Metadata-Version: 2.4
Name: umay-crypto
Version: 1.0.1
Summary: AES-256-GCM and Argon2id encryption library with Orhun rune encoding and in-memory script execution
Author: Görkem Güler
Project-URL: Homepage, https://github.com/gorkemguler/umaycrypt
Project-URL: Bug Tracker, https://github.com/gorkemguler/umaycrypt/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=42.0.0
Dynamic: license-file

# UmayCrypto

`umay-crypto` is a Python library for AES-256-GCM encryption with Argon2id key derivation, Orhun (Old Turkic) rune encoding, an interactive function security decorator, and in-memory execution of encrypted Python scripts.

## Installation

```bash
pip install umay-crypto
```

## Quick Start

### Basic Encryption & Decryption

```python
import umay_crypto

# Encrypt data
ciphertext = umay_crypto.encrypt("Sensitive payload", password="SecretPassword123")
print("Encrypted:", ciphertext)

# Decrypt data
plaintext_bytes = umay_crypto.decrypt(ciphertext, password="SecretPassword123")
print("Decrypted:", plaintext_bytes.decode("utf-8"))
```

### Function Security Decorator (`@protect`)

Prompt for passwords interactively before executing critical functions:

```python
import umay_crypto

token = umay_crypto.encrypt("OK", password="SecretPassword123")

@umay_crypto.protect(encrypted_token=token, prompt="Password: ")
def wipe_database():
    print("Database cleared.")

wipe_database()
```

### In-Memory Encrypted Script Execution

Encrypt Python source files and execute them directly in memory without writing decrypted code to disk:

```python
import umay_crypto

# Encrypt script to a .umay payload
umay_crypto.encrypt_python_file("app.py", "app.umay", password="SecretPassword123")

# Execute .umay payload directly in RAM
umay_crypto.run_encrypted_file("app.umay", password="SecretPassword123")
```

## Technical Details

- **Encryption**: AES-256-GCM (Authenticated Encryption with Associated Data).
- **Key Derivation**: Argon2id KDF with OWASP-compliant memory and iteration settings.
- **Encoding**: Permuted Orhun (Old Turkic) rune mapping derived deterministically per key.
- **Execution**: RAM-only dynamic execution via `exec()` for encrypted files.

## License

MIT License
