Hybrid Post-Quantum Cryptography Library combining classical and quantum-resistant algorithms
Project description
๐ RightsToSecure Hybrid Crypto Wrapper
Hybrid Post-Quantum Cryptography Library
Developed by RightsToSecure
Founder: Praveen Naidu
๐ก๏ธ Overview
The RightsToSecure Hybrid Crypto Wrapper is a cryptographic library designed to combine classical cryptography (RSA/ECDSA) with Post-Quantum Cryptography (Kyber, Dilithium). It provides a quantum-resilient security layer compatible with existing systems, ideal for enterprise SaaS integrations, encrypted messaging, secure file sharing, and API protection.
โ Features
- ๐ Hybrid Key Exchange using RSA/ECC + Kyber
- โ๏ธ Hybrid Digital Signatures using ECDSA + Dilithium
- ๐ฆ Compatible with legacy infrastructure (TLS, HTTPS, etc.)
- ๐ง Future-proof against quantum threats
- ๐ Crypto-agile design for algorithm swapping
- โ๏ธ Easy integration as a Python package or API
๐ Project Structure
/rights_to_secure_hybrid_crypto
โ
โโโ /src
โ โโโ hybrid_kem.py # Hybrid Key Exchange logic
โ โโโ hybrid_signature.py # Hybrid Digital Signature logic
โ โโโ utils.py # Shared utilities (hashing, KDF, etc.)
โ
โโโ /examples
โ โโโ demo_key_exchange.py
โ โโโ demo_signing.py
โ
โโโ /tests
โ โโโ test_hybrid_kem.py
โ โโโ test_hybrid_signature.py
โ
โโโ README.md
๐ Hybrid Key Exchange (KEM)
๐ง Inputs:
- RSA or ECC Public Key
- Kyber Public Key
๐ Process:
- Generate a random classical shared secret and encrypt it with RSA or ECC.
- Use Kyber to encapsulate a PQC shared secret.
- Concatenate both secrets:
combined_secret = classical_secret || pqc_secret session_key = SHAKE256(combined_secret)[:32] # 256-bit
๐ค Output:
rsa_ciphertext: RSA-encrypted componentkyber_ciphertext: Kyber-encrypted componentsession_key: Final shared key
โ๏ธ Hybrid Digital Signature
๐ง Inputs:
- Message (bytes)
- ECDSA Private Key
- Dilithium Private Key
๐ Process:
- Sign message with ECDSA โ
sig_classical - Sign message with Dilithium โ
sig_pqc - Combine both:
hybrid_signature = sig_classical || sig_pqc
โ Verification:
- Validate both parts independently using ECDSA and Dilithium public keys
๐งฐ Requirements
Python Dependencies
pip install cryptography oqs hashlib
Libraries Used:
cryptographyโ for RSA, ECC, and ECDSAoqs-pythonโ for Kyber and Dilithium (Post-Quantum)hashlibโ for SHAKE256 hashing
๐ Usage Examples
๐ Key Exchange
from src.hybrid_kem import hybrid_key_exchange, hybrid_key_decrypt
from src.utils import generate_rsa_keys, generate_kyber_keys
rsa_pub, rsa_priv = generate_rsa_keys()
kyber_pub, kyber_priv = generate_kyber_keys()
# Sender side
rsa_ct, kyber_ct, session_key = hybrid_key_exchange(rsa_pub, kyber_pub)
# Receiver side
session_key_reconstructed = hybrid_key_decrypt(rsa_priv, kyber_priv, rsa_ct, kyber_ct)
โ๏ธ Signature
from src.hybrid_signature import hybrid_sign, hybrid_verify
message = b"Confidential data for RightsToSecure"
# Signing
hybrid_signature = hybrid_sign(message, ecdsa_private_key, dilithium_private_key)
# Verifying
valid = hybrid_verify(message, hybrid_signature, ecdsa_public_key, dilithium_public_key)
print("Signature valid:", valid)
๐ฆ Output Format
- Base64 encoding for ciphertexts and signatures
- JSON objects for hybrid signature structure
- Session keys returned as raw 256-bit key (SHAKE256)
๐ง Packaging and Deployment
- Can be published as a Python package:
rights_to_secure_hybrid_crypto - Deployable as a REST API (FastAPI/Flask)
- Docker-compatible for SaaS deployments
๐งช Testing
Run Tests
pytest /tests
Test Coverage:
- RSA + Kyber key encapsulation/decapsulation
- ECDSA + Dilithium hybrid signing/verification
- Key mismatches and edge case validation
๐งฑ Roadmap
| Feature | Status |
|---|---|
| RSA + Kyber Hybrid KEM | โ Completed |
| ECDSA + Dilithium Hybrid Signature | โ Completed |
| Falcon Signature Support | ๐ Planned |
| WASM Module for Web | ๐ Planned |
| REST API as a Service | ๐ Planned |
| TLS Handshake Integration | ๐ Planned |
โ ๏ธ Security Considerations
- Always use cryptographically secure random key generation.
- Use SHAKE256 or HKDF for all KDF operations.
- Never store unencrypted private keys in memory/disk.
- Perform regular audits of custom crypto logic.
- Maintain crypto-agility to support algorithm replacement.
๐ License
MIT License (or custom enterprise license for SaaS deployments).
Contact RightsToSecure for commercial use or security audits.
๐ง About RightsToSecure
RightsToSecure is a cybersecurity firm focused on building quantum-resilient encryption tools and secure SaaS solutions for modern and future internet infrastructure.
๐จโ๐ผ Founder: Praveen Naidu
We are committed to helping companies transition to quantum-safe cryptography with minimal friction.
๐ Website: https://rightstosecure.com quantum proof cyrptoghraphy and secure application development (https://academy.rightstosecure.com) comprehensive real case based scenario based cyber security training
๐ง Email: contact@arkaenterprises.com
Phone : +1 314-624-8101
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rights_to_secure_hybrid_crypto-1.0.0.tar.gz.
File metadata
- Download URL: rights_to_secure_hybrid_crypto-1.0.0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729a371f598ce54d8706eebb4504d9322544f4ca85651f1f8b89d96a9a431b6a
|
|
| MD5 |
de3945a39c7528ff61f7a32ad37062bd
|
|
| BLAKE2b-256 |
0c8bed64056d312ccf4eecd036b1c1aff06f4572c2461863fd92dfea69cf9457
|
File details
Details for the file rights_to_secure_hybrid_crypto-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rights_to_secure_hybrid_crypto-1.0.0-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a4c3a6d42cd7244720d8ded722ef991f732e3d6581c71f5dd5c4990c75beb4d
|
|
| MD5 |
36966caea3b0fa91873a34d8d141fd04
|
|
| BLAKE2b-256 |
cd660c73ad4b68ad6560095a5c66e5eac43518fe76eee934d98ee1492337044b
|