Metadata-Version: 2.4
Name: securepkt
Version: 2.0.0
Summary: Ultra-Secure, Post-Quantum Resilient Network Protocol & Proxy Tunnel Gateway
Author-email: SecurePkt Core Team <dev@securepkt.org>
License-Expression: MIT
Keywords: network,protocol,post-quantum,cryptography,socks5,proxy,vpn,udp
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: System :: Networking
Classifier: Topic :: Security :: Cryptography
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=41.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"

# SecurePkt v2.0 🔒⚛️

> **Ultra-Secure, Post-Quantum Resilient Network Protocol & SOCKS5 Tunnel Gateway**  
> *بروتوكول شبكة فائق الأمان ومقاوم للحوسبة الكمومية مع بوابة نفق وتمرير بيانات*

---

## 🌟 English Overview / نبذة عن المشروع

**SecurePkt v2.0** is a production-ready, post-quantum resilient network protocol designed according to **Zero-Trust Architecture** principles. It wraps application network traffic (web browsers, SSH, APIs, database streams) into zero-metadata, quantum-safe UDP tunnels.

**SecurePkt v2.0** هو بروتوكول اتصال شبكي عالي السرعة والأمان مصمم وفق معايير **Zero-Trust**. يتيح لك تشغيل خادم نفق (Tunnel Gateway) وتمرير كامل حركة الإنترنت من الأجهزة المتصلة عبر حزم UDP مشفرة خالية من أي تسريب للبيانات الوصفية ومقاومة لكسر التشفير بواسطة الحواسيب الكمومية المستقبلية.

---

## 🛡️ Core Security Architecture / المعمارية الأمنية

| Component / الميزة | Technology / التقنية | Security Goal / الفائدة الأمنية |
| :--- | :--- | :--- |
| **Classical Key Exchange** | `Curve25519 / X25519` | Ephemeral Key Exchange providing **Perfect Forward Secrecy (PFS)**. |
| **Post-Quantum KEM** | `ML-KEM-768 / Kyber768` | NIST Post-Quantum Standard protecting session keys from future quantum decryption. |
| **Digital Identity Auth** | `ML-DSA-65 / Dilithium` | Quantum-Resistant Digital Signatures preventing Man-in-the-Middle (MITM) attacks. |
| **Symmetric Cipher** | `ChaCha20-Poly1305 AEAD` | High-speed authenticated encryption with 96-bit unique nonces. |
| **Anti-Replay Window** | `64-Bit Sliding Window` | Detects and drops duplicate or manipulated sequence numbers. |
| **Traffic Padding** | `Randomized Block Padding` | Aligns packet lengths (128/256B) to thwart Traffic Analysis Attackers. |

---

## 🚀 Quick Start & Installation / الدليل السريع للتشغيل

### 1. Installation / التثبيت

Clone the repository and install `securepkt` locally:

```bash
cd SecurePkt
pip install .
```

To verify installation:

```bash
securepkt --help
```

---

### 2. Step-by-Step Server & Client Deployment / خطوات التشغيل والتنفيذ

#### Step 1: Generate Post-Quantum Identity Keys (إنشاء مفاتيح الهوية)
On your server or master node, generate server signature keypairs:

```bash
securepkt keygen --out-dir ./keys
```

This creates:
- `server_identity.pub` (Public Key for pinning on clients)
- `server_identity.key` (Private Key kept secret on server)

#### Step 2: Start Remote SecurePkt Gateway Server (تشغيل خادم النفق)
On your cloud VPS / remote server:

```bash
securepkt server --bind 0.0.0.0 --port 8443 --pub-key ./keys/server_identity.pub --priv-key ./keys/server_identity.key
```

#### Step 3: Start Local SOCKS5 Client Proxy (تشغيل العميل المحلي)
On your personal computer or client device:

```bash
securepkt client --socks-bind 127.0.0.1 --socks-port 1080 --server YOUR_SERVER_IP --server-port 8443 --trusted-pub ./keys/server_identity.pub
```

Your local device now has a quantum-safe SOCKS5 proxy running on `127.0.0.1:1080`!

---

### 3. Tunneling Real Internet Traffic / توجيه حركة المرور الحقيقية

#### Using `curl` via SecurePkt:
```bash
curl --socks5 127.0.0.1:1080 https://httpbin.org/ip
```

#### Configuring Web Browsers (Firefox / Chrome):
Set Network Proxy -> SOCKS Host: `127.0.0.1`, Port: `1080`, SOCKS v5.

---

## 🐳 Docker Deployment / التشغيل بواسطة Docker

Deploy both server and client using Docker Compose:

```bash
docker-compose up -d
```

---

## ⚡ Performance Benchmarking / اختبار الأداء

Run the built-in crypto and networking benchmark:

```bash
securepkt benchmark
```

Expected Output:
```text
==================================================================
⚡ SecurePkt v2.0 Core Benchmark Suite
==================================================================
1. Hybrid PQ Handshake Rate : 1850.24 handshakes/sec (avg 0.540 ms/handshake)
2. AEAD ChaCha20 + Padding : 420.50 MB/s throughput
3. Packet Processing Rate  : 21500.00 packets/sec
==================================================================
```

---

## 📄 License

MIT License - Open Source & Free for Commercial & Private Use.
