Metadata-Version: 2.4
Name: zyracrypt
Version: 2.2.0
Summary: Enterprise-grade cryptographic library providing advanced encryption, post-quantum cryptography, key management, threshold signatures, and secure enclaves
Author-email: Abdulaziz Mohammed Alqudimi <abodx1234freey@gmail.com>
Maintainer-email: Abdulaziz Mohammed Alqudimi <abodx1234freey@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/Alqudimi/ZyraCrypt
Project-URL: Documentation, https://github.com/Alqudimi/ZyraCrypt/tree/main/docs
Project-URL: Repository, https://github.com/Alqudimi/ZyraCrypt
Project-URL: Bug Tracker, https://github.com/Alqudimi/ZyraCrypt/issues
Project-URL: Changelog, https://github.com/Alqudimi/ZyraCrypt/blob/main/CHANGELOG.md
Project-URL: PyPI, https://pypi.org/project/zyracrypt/
Keywords: cryptography,encryption,decryption,security,aes,aes-256-gcm,chacha20,post-quantum,pqc,kyber,dilithium,key-management,threshold-signatures,multi-party-computation,secure-enclaves,homomorphic-encryption,steganography,blockchain-crypto,password-hashing,argon2,scrypt,zero-knowledge,crypto,privacy,data-protection
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: Security
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=50.0.0
Requires-Dist: pynacl>=1.5.0
Requires-Dist: argon2-cffi>=23.1.0
Requires-Dist: pillow>=13.0.0; python_version >= "3.11"
Requires-Dist: pillow>=12.3.0; python_version < "3.11"
Provides-Extra: pqc
Requires-Dist: liboqs-python>=0.10.0; extra == "pqc"
Provides-Extra: api
Requires-Dist: flask>=3.0.0; extra == "api"
Requires-Dist: flask-cors>=4.0.0; extra == "api"
Provides-Extra: database
Requires-Dist: flask-sqlalchemy>=3.0.0; extra == "database"
Requires-Dist: psycopg2-binary>=2.9.0; extra == "database"
Provides-Extra: email
Requires-Dist: email-validator>=2.0.0; extra == "email"
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
Provides-Extra: all
Requires-Dist: liboqs-python>=0.10.0; extra == "all"
Requires-Dist: flask>=3.0.0; extra == "all"
Requires-Dist: flask-cors>=4.0.0; extra == "all"
Requires-Dist: flask-sqlalchemy>=3.0.0; extra == "all"
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
Requires-Dist: email-validator>=2.0.0; extra == "all"
Dynamic: license-file

<div dir="ltr">

# ZyraCrypt 🔒

**Enterprise-Grade Cryptography Made Simple — for everyone: beginners, developers, and AI models.**

[![PyPI version](https://img.shields.io/pypi/v/zyracrypt.svg?logo=pypi&label=PyPI)](https://pypi.org/project/zyracrypt/)
[![PyPI downloads](https://img.shields.io/pypi/dm/zyracrypt.svg?label=Downloads)](https://pypi.org/project/zyracrypt/)
[![CI](https://github.com/Alqudimi/ZyraCrypt/actions/workflows/ci.yml/badge.svg)](https://github.com/Alqudimi/ZyraCrypt/actions/workflows/ci.yml)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg?logo=python)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

ZyraCrypt is a comprehensive, production-ready cryptographic library for Python.
It wraps industrial-strength primitives (AES-256-GCM, ChaCha20-Poly1305, RSA,
ECDSA, Argon2, scrypt, Kyber/Dilithium) into **three friendly layers**:

| Layer | For whom | One-liner idea |
|---|---|---|
| 🧩 `SimpleCrypt` | **Everyone** (no crypto knowledge needed) | One password → encrypt text, bytes, or files |
| 🧰 `EncryptionFramework` | **Developers** (full control) | Key-based AES-GCM / ChaCha20 / PQC hybrid encryption |
| ⌨️ `zyracrypt` CLI | **Terminal users & scripts** | `zyracrypt encrypt file.pdf -p PASSWORD` |

> 🇸🇦 **بالعربية؟** اقرأ [README_AR.md](README_AR.md) — الدليل الشامل باللغة العربية.
>
> 🤖 **For AI models / agents:** this README, [docs/00-index.md](docs/00-index.md),
> [AGENTS.md](AGENTS.md) and [docs/ROADMAP.md](docs/ROADMAP.md) are kept
> structured, explicit and complete so that any model (ChatGPT, DeepSeek,
> Copilot, ...) can parse and use ZyraCrypt correctly without guessing.

---

## Table of contents

1. [Why ZyraCrypt?](#-why-zyracrypt)
2. [Installation](#-installation)
3. [Quick start — the easy way (SimpleCrypt)](#-quick-start--the-easy-way-simplecrypt)
4. [Quick start — the classic way (EncryptionFramework)](#-quick-start--the-classic-way-encryptionframework)
5. [Command-line interface](#%EF%B8%8F-command-line-interface)
6. [Feature matrix](#-feature-matrix)
7. [Complete documentation](#-complete-documentation)
8. [Examples](#-examples)
9. [Security](#%EF%B8%8F-security)
10. [FAQ](#-faq)
11. [Contributing](#-contributing)
12. [Support](#-support)
13. [Author & license](#-author--license)

---

## 🎯 Why ZyraCrypt?

Most crypto libraries force you to choose between **easy but weak** or
**strong but complicated**. ZyraCrypt refuses that trade-off:

- ✅ **Safe by default.** Random salt + fresh nonce for every message, AES-GCM
  authenticated encryption, memory-hard key derivation. There is no code path
  that silently reuses keys or IVs.
- ✅ **Beginner-first API.** `SimpleCrypt("password").encrypt_text("hi")` —
  that is genuinely all it takes. No modes, no padding, no IV handling.
- ✅ **Expert-grade depth.** Post-quantum hybrid encryption, threshold
  signatures, MPC, secure enclaves, steganography, blockchain cryptography.
- ✅ **A real CLI.** Encrypt files from the terminal or from shell scripts —
  no Python needed.
- ✅ **Verified quality.** Every release passes the automated test suite on
  Python 3.10–3.13 via GitHub Actions before it reaches PyPI.
- ✅ **Honest documentation.** 18 guides covering 100% of the surface, from
  "what is encryption?" to threshold multisig internals.

## 📦 Installation

```bash
# The standard way — from PyPI
pip install zyracrypt

# Optional extras
pip install "zyracrypt[pqc]"     # post-quantum crypto (Kyber, Dilithium)
pip install "zyracrypt[api]"     # group end-to-end encryption web API
pip install "zyracrypt[all]"     # everything
pip install "zyracrypt[dev]"    # development tools (pytest, black, ...)
```

<details>
<summary>From source / development install</summary>

```bash
git clone https://github.com/Alqudimi/ZyraCrypt.git
cd ZyraCrypt
pip install -e .            # editable install
pip install -e ".[dev]"     # with development tools
```

</details>

**Requirements:** Python **3.10+** (3.10, 3.11, 3.12, 3.13 supported and CI-tested).
Core dependencies (`cryptography`, `pynacl`, `argon2-cffi`, `pillow`) are installed
automatically.

## 🚀 Quick start — the easy way (SimpleCrypt)

One password, three calls. The container format is self-describing and carries
its own random salt and nonce for every message.

```python
from zyracrypt import SimpleCrypt

crypt = SimpleCrypt("my-very-strong-password")

# 1) Text (armored as base64 — safe to store anywhere)
blob = crypt.encrypt_text("Top secret message")
assert crypt.decrypt_text(blob) == "Top secret message"

# 2) Raw bytes
data = crypt.encrypt_bytes(b"\x00\x01\x02")
assert crypt.decrypt_bytes(data) == b"\x00\x01\x02"

# 3) Files (original is left untouched; result gets a .zc suffix)
crypt.encrypt_file("report.pdf")       # -> report.pdf.zc
crypt.decrypt_file("report.pdf.zc")    # -> report.pdf
```

Wrong password? Tampered data? You get a clear exception — never silent
garbage:

```python
from zyracrypt.simple import WrongPasswordError, CorruptedDataError
```

Full guide: **[docs/17-simplecrypt-guide.md](docs/17-simplecrypt-guide.md)**

## 🧰 Quick start — the classic way (EncryptionFramework)

You control the key, the algorithm, and the associated data:

```python
from zyracrypt import EncryptionFramework

framework = EncryptionFramework()
key = b"your-32-byte-key-here-for-aes256"   # 32 bytes = AES-256
data = b"Sensitive information"

algo, iv, ciphertext, tag = framework.encrypt(data, key, "AES-GCM")
recovered = framework.decrypt(algo, key, iv, ciphertext, tag)
assert recovered == data
```

Let ZyraCrypt choose the algorithm for you (`"auto"`), or force ChaCha20:

```python
algo, nonce, ct, _ = framework.encrypt(data, key, "ChaCha20")
```

Keys from passwords (Argon2id / scrypt / PBKDF2), secure storage, rotation and
envelope encryption: **[docs/03-key-management.md](docs/03-key-management.md)**

## ⌨️ Command-line interface

The `zyracrypt` command is installed automatically with the package:

```console
$ zyracrypt encrypt secret.pdf -p "my password"      # -> secret.pdf.zc
Encrypted -> secret.pdf.zc

$ zyracrypt decrypt secret.pdf.zc -p "my password"    # -> secret.pdf
Decrypted -> secret.pdf

$ zyracrypt encrypt-text "hello" -p pw                # base64 blob on stdout
$ zyracrypt decrypt-text "<blob>" -p pw                # plaintext on stdout

$ zyracrypt keygen                                    # 256-bit hex key
$ zyracrypt generate-password --length 32             # strong random password
$ zyracrypt hash file.bin --algo sha256               # file digest
$ zyracrypt info                                      # version + capabilities
```

If you omit `-p`, the CLI prompts for the password with hidden input.
Full guide (all 8 commands, exit codes, examples): **[docs/16-cli-guide.md](docs/16-cli-guide.md)**

## 📊 Feature matrix

| Area | What you get | Where |
|---|---|---|
| **Core encryption** | AES-256-GCM, AES-192/128, ChaCha20-Poly1305, RSA-2048/4096, ECDSA (P-256/384/521), ECDH | core_cryptography |
| **Post-quantum (PQC)** | Kyber KEM, Dilithium signatures, hybrid classical+PQC (HKDF-bound) | post_quantum_cryptography, advanced_features |
| **Key management** | Generation, Argon2id/scrypt/PBKDF2 derivation, encrypted key store, rotation, envelope encryption, KMS provider, HSM hooks | key_management |
| **Threshold & MPC** | Shamir secret sharing, threshold ECDSA/multisig, secure multi-party computation | advanced_features |
| **Data protection** | Secure memory zeroing, compression, obfuscation, data type manager | data_protection |
| **Specialized security** | File encryption, secure sessions, secure deletion, steganography (images) | specialized_security |
| **Advanced research** | Homomorphic encryption, IBE, group E2E, white-box crypto, side-channel protection, tamper-resistant structures, audit log | advanced_features |
| **Everyone API** | `SimpleCrypt` (password → encrypted text/bytes/files) | zyracrypt.simple |
| **CLI** | `zyracrypt` command: encrypt/decrypt/keygen/hash/info | zyracrypt.cli |

## 📚 Complete documentation

The `docs/` folder is the full manual — 18 guides written to be readable by
humans **and** parseable by AI models. Start at the index:
**[docs/00-index.md](docs/00-index.md)**

| # | Guide | What it covers |
|---|---|---|
| 00 | [Index](docs/00-index.md) | Map of all documentation |
| 01 | [Getting started](docs/01-getting-start.md) | Install, first encryption, troubleshooting install issues |
| 02 | [Basic encryption](docs/02-basic-encryption.md) | SimpleCrypt + framework basics, keys, IVs, tags |
| 03 | [Key management](docs/03-key-management.md) | Generate, derive, store, rotate, envelope encryption, KMS |
| 04 | [Advanced features](docs/04-advanced-features.md) | Threshold, MPC, enclaves, homomorphic |
| 05 | [Post-quantum crypto](docs/05-post-quantum.md) | Why PQC, Kyber/Dilithium, hybrid mode |
| 06 | [Examples](docs/06-examples.md) | Copy-paste recipes for common tasks |
| 07 | [API reference](docs/07-api-reference.md) | Every class and method |
| 08 | [Security best practices](docs/08-security-best-practices.md) | Passwords, key hygiene, what NOT to do |
| 09 | [Data protection](docs/09-data-protection.md) | Memory handling, compression, obfuscation |
| 10 | [Specialized security](docs/10-specialized-security.md) | Sessions, deletion, steganography |
| 11 | [Blockchain crypto](docs/11-blockchain-crypto.md) | Hashing, signatures, addresses |
| 12 | [Troubleshooting](docs/12-troubleshooting.md) | Every common error and its fix |
| 13 | [FAQ](docs/13-faq.md) | Frequently asked questions |
| 14 | [Deployment guide](docs/14-deployment-guide.md) | Servers, containers, CI/CD |
| 15 | [Performance](docs/15-performance-optimization.md) | Benchmarks and tuning |
| 16 | [CLI guide](docs/16-cli-guide.md) | The `zyracrypt` command, all subcommands |
| 17 | [SimpleCrypt guide](docs/17-simplecrypt-guide.md) | The easy API in depth (beginner-friendly) |
| 18 | [Code analysis](docs/18-comprehensive-code-analysis.md) | Architecture deep-dive |

Extras: [CHANGELOG.md](CHANGELOG.md) · [docs/ROADMAP.md](docs/ROADMAP.md) ·
[AGENTS.md](AGENTS.md) (for AI coding agents) · [README_AR.md](README_AR.md) (العربية)

## 💡 Examples

Runnable, commented scripts live in [examples/](examples/):

```bash
python examples/quickstart.py          # SimpleCrypt in 20 lines
python examples/file_encryption.py     # encrypt/decrypt any file
python examples/key_management_demo.py # keys, derivation, storage
bash   examples/cli_demo.sh            # full CLI walkthrough
```

## 🛡️ Security

- ZyraCrypt uses **audited primitives** from the `cryptography` and `pynacl`
  projects — it never rolls its own low-level ciphers.
- All encryption is **authenticated** (GCM/Poly1305): tampering is detected,
  never silently decrypted.
- Please read [SECURITY.md](SECURITY.md) before handling real secrets, and
  report vulnerabilities only through the private GitHub channel described
  there.
- Never hardcode passwords in source code; use environment variables or a
  secrets manager (see [docs/08-security-best-practices.md](docs/08-security-best-practices.md)).

## ❓ FAQ

<details>
<summary><b>Is ZyraCrypt safe for production / real secrets?</b></summary>

The cryptographic primitives come from the industry-standard `cryptography`
library. ZyraCrypt's job is to combine them correctly (fresh salt+nonce per
message, authenticated modes, memory-hard KDFs). For highly sensitive data
always follow [docs/08-security-best-practices.md](docs/08-security-best-practices.md)
and keep the library updated. Full FAQ: [docs/13-faq.md](docs/13-faq.md).

</details>

<details>
<summary><b>Which Python versions are supported?</b></summary>

Python 3.10, 3.11, 3.12 and 3.13 — all tested in CI on every push.

</details>

<details>
<summary><b>What is the .zc file produced by encrypt_file?</b></summary>

A versioned container: magic `ZC1` + version + 16-byte salt + 12-byte nonce +
AES-256-GCM ciphertext (tag included). It is fully documented in
[docs/17-simplecrypt-guide.md](docs/17-simplecrypt-guide.md).

</details>

<details>
<summary><b>Do I need liboqs installed?</b></summary>

Only for the optional post-quantum features: `pip install "zyracrypt[pqc]"`.
Everything else works without it, and tests auto-skip.

</details>

## 🤝 Contributing

Contributions are welcome — bug reports, fixes, docs, new features. Read
[CONTRIBUTING.md](CONTRIBUTING.md) (setup, style, tests, PR checklist) and
open a pull request. Every PR must keep the test suite green.

## 💬 Support

- 🐛 Bugs & features: [GitHub Issues](https://github.com/Alqudimi/ZyraCrypt/issues)
- 🔒 Vulnerabilities: see [SECURITY.md](SECURITY.md) (private disclosure)
- 📖 Answers: [docs/12-troubleshooting.md](docs/12-troubleshooting.md) & [docs/13-faq.md](docs/13-faq.md)

## 👤 Author & license

**Abdulaziz Mohammed Alqudimi** — [GitHub: @Alqudimi](https://github.com/Alqudimi) — abodx1234freey@gmail.com

- PyPI: <https://pypi.org/project/zyracrypt/>
- Source: <https://github.com/Alqudimi/ZyraCrypt>

Released under the **MIT License** — see [LICENSE](LICENSE).
Copyright © 2025-2026 Abdulaziz Mohammed Alqudimi.

</div>
