Skip to main content

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:

  1. Generate a random classical shared secret and encrypt it with RSA or ECC.
  2. Use Kyber to encapsulate a PQC shared secret.
  3. Concatenate both secrets:
    combined_secret = classical_secret || pqc_secret
    session_key = SHAKE256(combined_secret)[:32]  # 256-bit
    

๐Ÿ“ค Output:

  • rsa_ciphertext: RSA-encrypted component
  • kyber_ciphertext: Kyber-encrypted component
  • session_key: Final shared key

โœ๏ธ Hybrid Digital Signature

๐Ÿ”ง Inputs:

  • Message (bytes)
  • ECDSA Private Key
  • Dilithium Private Key

๐Ÿ” Process:

  1. Sign message with ECDSA โ†’ sig_classical
  2. Sign message with Dilithium โ†’ sig_pqc
  3. 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 ECDSA
  • oqs-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rights_to_secure_hybrid_crypto-1.0.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file rights_to_secure_hybrid_crypto-1.0.0.tar.gz.

File metadata

File hashes

Hashes for rights_to_secure_hybrid_crypto-1.0.0.tar.gz
Algorithm Hash digest
SHA256 729a371f598ce54d8706eebb4504d9322544f4ca85651f1f8b89d96a9a431b6a
MD5 de3945a39c7528ff61f7a32ad37062bd
BLAKE2b-256 0c8bed64056d312ccf4eecd036b1c1aff06f4572c2461863fd92dfea69cf9457

See more details on using hashes here.

File details

Details for the file rights_to_secure_hybrid_crypto-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rights_to_secure_hybrid_crypto-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a4c3a6d42cd7244720d8ded722ef991f732e3d6581c71f5dd5c4990c75beb4d
MD5 36966caea3b0fa91873a34d8d141fd04
BLAKE2b-256 cd660c73ad4b68ad6560095a5c66e5eac43518fe76eee934d98ee1492337044b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page