UXSP (Universal Exchange Security Protocol) is an enterprise-grade, hybrid post-quantum security framework. It provides application-layer zero-trust encryption, progressive protocol negotiation with automatic fallback, multi-gigabyte streaming in constant memory, and framework middlewares—all designed to protect APIs, data pipelines, messaging, and live media against classical eavesdroppers and future quantum supercomputers.
Imagine you want to send a secret drawing to your friend Bob across a playground full of snoopy kids:
Alice's Drawing Locked Safe Bob Reads Drawing
┌─────────────────┐ ┌───────────────────────────┐ ┌─────────────────┐
│ │ │ [Lock 1: Classical] │ │ │
│ "Top Secret │ ──(Sealed)─▶│ X25519 + Ed25519 │──(Opened)──▶│ "Top Secret │
│ Playground │ │ [Lock 2: Quantum-Proof] │ │ Playground │
│ Plan!" │ │ ML-KEM-768 + ML-DSA-65 │ │ Plan!" │
└─────────────────┘ └───────────────────────────┘ └─────────────────┘
- The Classical Lock (Today's Security): Standard internet encryption (like RSA and ECC) is like a good metal padlock. Normal computers today cannot pick it.
- The Quantum Monster (Tomorrow's Threat): Mathematicians have proven that future Quantum Computers will be able to pick all classical locks instantly! Even worse, bad actors are collecting encrypted internet traffic right now ("Harvest Now, Decrypt Later") to unlock it once their quantum computers are ready.
- The UXSP Double Safe: UXSP puts your message inside a safe with TWO different locks:
- Lock 1: Modern classical cryptography (X25519 ECDH and Ed25519 digital signatures).
- Lock 2: Quantum-proof lattice mathematics standardized by NIST (ML-KEM-768 / CRYSTALS-Kyber and ML-DSA-65 / CRYSTALS-Dilithium).
- Unbreakable Guarantee: An attacker must break BOTH locks at the same time to read your message or impersonate the sender. If either lock remains intact, your data is 100% safe!
- 🔄 Autonomous Protocol-Switching HTTP Client (
uxsp.client):UXSPClient(sync) andAsyncUXSPClient(async) automatically probe remote servers using negotiation headers (X-UXSP-Accept,X-UXSP-Version,X-UXSP-Identity).- Automatic Encryption: If the server speaks UXSP, the client automatically seals the request and decrypts the response.
- Automatic Plaintext Fallback: If the server is standard HTTP/REST (like Stripe, GitHub, or legacy microservices), the client seamlessly communicates in standard plaintext HTTP without errors.
- Zero-Trust Enforcement: Set
allow_fallback=False/force_uxsp=Trueto immediately reject any unencrypted endpoints. - Pluggable Capability Caching: Cache server capabilities in Memory, Redis, or PostgreSQL to avoid per-request discovery round-trips.
- 🛡️ 1-Line Polymorphic Cryptography (
uxsp.secure):- Direct 1-line operations across 14 polymorphic data types:
Text,File,JSON,Binary,PDF,Document,Voice,Video,Photo,Location,Contact,HTML,Archive, andLiveVoiceCall.
- Direct 1-line operations across 14 polymorphic data types:
- 🌐 Web Framework Middlewares (
uxsp.contrib):- Drop-in middlewares and route decorators (
@protect,@protect_route) for FastAPI, Django, and Flask with opportunistic negotiation headers.
- Drop-in middlewares and route decorators (
- 📦 Ultra-Low Memory Streaming (
SendStream/ReceiveStream):- Encrypt and transfer 100GB+ files chunk-by-chunk in a fixed
O(chunk_size)RAM footprint without event loop blocking.
- Encrypt and transfer 100GB+ files chunk-by-chunk in a fixed
- ⏱️ Durable Replay Protection (
NonceStore):- Sliding-window sequencing, timestamp bounds (≤ 300s freshness), and TTL noncestores backed by Memory, Redis, or PostgreSQL.
- 🎥 Live Media & WebRTC (
LiveSession/LiveVoiceSession):- High-performance real-time video, voice calls, and CCTV feed protection with ratcheting directional session keys.
- 💻 Cross-Platform CLI (
uxsp):- Terminal utility for key management, identity generation, sealing/opening envelopes, and
uxsp clientfor probing and querying remote endpoints.
- Terminal utility for key management, identity generation, sealing/opening envelopes, and
- 📜 Formal Standards & Exact Wire Format (
docs/):- Complete RFC 2119 mathematical specifications (
docs/protocol_specification.md) and bit-level binary wire format manuals with hex vectors (docs/wire_format.md).
- Complete RFC 2119 mathematical specifications (
- 💎 100% Strict Type Safety & Test Coverage:
- Verified
mypystrict mode (strict = true) across all 78 source files with 0 errors. - Verified 100% test coverage (7,084 / 7,084 statements) across 1,758 tests with 0 warnings.
- Verified
flowchart TD
subgraph AppLayer["Application Layer"]
APP["Web App / Microservice / CLI"]
CLIENT["UXSPClient / AsyncUXSPClient"]
MW["FastAPI / Django / Flask Middleware"]
end
subgraph ProtoLayer["Protocol Switching & Negotiation"]
PROBE{"Server Supports UXSP?"}
PROBE -->|"Yes"| UXSP_PATH["Seal into SecurePackage"]
PROBE -->|"No (Fallback)"| PLAIN_PATH["Standard HTTP / REST"]
CACHE[("HostCapabilityCache<br/>Memory / Redis / DB")]
CLIENT <--> CACHE
end
subgraph CoreLayer["UXSP Secure Core"]
DISPATCH["Polymorphic Dispatcher<br/>14 Data Types"]
STATE["Session State Machine<br/>Monotonic Seq + Sliding AD"]
REPLAY["ReplayGuard + NonceStore<br/>Timestamp Window + TTL"]
CRYPTO["Hybrid Cryptographic Engine<br/>X25519 + ML-KEM-768<br/>Ed25519 + ML-DSA-65<br/>AES-256-GCM + HKDF"]
end
APP --> CLIENT
APP --> MW
CLIENT --> PROBE
UXSP_PATH --> DISPATCH
DISPATCH --> STATE
STATE --> REPLAY
REPLAY --> CRYPTO
# Base package
pip install uxspUXSP is highly modular. You only need to install the dependencies required for your specific framework and storage needs.
| Installation Command | Included Components & Dependencies |
|---|---|
pip install uxsp |
Base uxsp.secure (cryptography, liboqs-python, argon2-cffi) |
pip install uxsp[aio] |
uxsp.secure + uxsp.aio (Asynchronous capabilities) |
pip install uxsp[django] |
uxsp.secure + Django Integrations |
pip install uxsp[flask] |
uxsp.secure + Flask Integrations |
pip install uxsp[fastapi] |
uxsp.secure + FastAPI, Starlette, HTTPX2 Integrations |
pip install uxsp[postgres] |
uxsp.secure + Postgres (psycopg2-binary) |
pip install uxsp[redis] |
uxsp.secure + Redis (redis) |
pip install "uxsp[aio, django]" |
uxsp.secure + uxsp.aio + Django |
pip install "uxsp[aio, postgres]" |
uxsp.secure + uxsp.aio + Postgres |
pip install "uxsp[aio, redis]" |
uxsp.secure + uxsp.aio + Redis |
pip install "uxsp[aio, django, postgres]" |
uxsp.secure + uxsp.aio + Django + Postgres |
pip install "uxsp[aio, django, redis]" |
uxsp.secure + uxsp.aio + Django + Redis |
pip install uxsp[all-django] |
uxsp.secure + uxsp.aio + Django + Postgres + Redis |
pip install uxsp[all-flask] |
uxsp.secure + uxsp.aio + Flask + Postgres + Redis |
pip install uxsp[all-fastapi] |
uxsp.secure + uxsp.aio + FastAPI + Postgres + Redis |
pip install uxsp[all] |
Complete stack with all web frameworks and storage backends |
UXSP utilizes liboqs for C-native Post-Quantum Cryptography acceleration. You must install the required build tools for your platform:
- Ubuntu / Debian / Mint:
sudo apt update && sudo apt install -y build-essential cmake ninja-build libssl-dev git - Fedora / RHEL / CentOS:
sudo dnf groupinstall -y "Development Tools" && sudo dnf install -y cmake ninja-build openssl-devel git
- macOS:
brew install cmake ninja openssl@3
- Windows:
Requires Visual Studio Build Tools (C++), CMake, and Git. (Note: Windows support is experimental and falls back to
msvcrtfor certain operations).
Note
Automatic Pure-Python Fallback: If liboqs fails to compile on your system, UXSP will automatically fall back to its built-in pure Python Post-Quantum Cryptography implementations, ensuring it always runs!
For cryptographers, security auditors, and engineers implementing UXSP in other languages (Rust, Go, C/C++, Swift, Zig):
- Documentation Index (
docs/index.md): Standards portal and architecture map. - Formal Protocol Specification (
docs/protocol_specification.md): RFC 2119 specification, threat models, canonical serialization, trust anchor hierarchy, and error codes (0x0001-0x0015). - Exact Wire Format & Byte-Level Encoding (
docs/wire_format.md): Bit-by-bit framing, binary header offsets (0x00-0x3A), variable records, and annotated hex dumps.
For software engineers building applications with UXSP:
- Tutorials Portal (
tutorial/index.md): Navigation hub for all practical tutorials. - End-to-End Fullstack Integration (
tutorial/fullstack_integration.md): Complete React/Next.js/JS frontend + FastAPI/Django/Flask backend setup with zero-trust encryption. - Autonomous HTTP Client & Protocol Switching (
tutorial/client.md): In-depth guide onUXSPClient, fallback mechanisms, and capability caching. - High-Level APIs (
tutorial/high_level_api.md): 1-line cryptographic operations across 14 polymorphic data types. - Low-Level APIs (
tutorial/low_level_api.md): Envelope, Identity, Session primitives, and key derivation. - Asynchronous Engine (
tutorial/async_api.md): High-throughput async pipelines (uxsp.aio). - Streaming & Live Media (
tutorial/streaming_and_media.md): Streaming files, voice calls, and CCTV feeds. - WebRTC Integration (
tutorial/webrtc_integration.md): Real-time secure video calls. - Web Framework Middlewares (
tutorial/frameworks/): Setup guides for FastAPI, Django, and Flask. - Replay Protection (
tutorial/noncestore.md): Persistent NonceStores (Memory, Redis, Postgres). - CLI Reference (
tutorial/cli.md): Command-line identity management anduxsp curl. - Browser SDK (
tutorial/web_frontend.md): Client-side encryption with@siva_raja/uxsp.
We take security seriously. Please report any potential vulnerabilities privately to sivaraja5401@gmail.com with subject [UXSP SECURITY]. See SECURITY.md for our coordinated vulnerability disclosure policy.
UXSP is licensed under the MIT License.
UXSP v1.3.2
Maintained by SIVA RAJA S