QRCs is an experimental post-quantum cryptographic framework implementing hybrid lattice-based encryption with hash-based digital signatures. The system combines Ring Learning With Errors, standard Learning With Errors, and Merkle signature schemes to provide defense against both classical and quantum cryptanalytic attacks.
The system implements a multi-layer cryptographic approach using:
Ring-LWE encryption for structured lattice problems
Standard LWE encryption for unstructured lattice security
Hash-based signatures using Merkle trees and Winternitz one-time signatures
Advanced Reed-Solomon error correction with Berlekamp-Massey decoding
Constant-time operations for side-channel resistance
Military-grade entropy collection from multiple hardware sources
Key switching and bootstrapping for homomorphic operations
Authenticated encryption with HMAC-SHA3-512
CLASSICAL_128 - 128-bit classical security equivalent
CLASSICAL_192 - 192-bit classical security equivalent
CLASSICAL_256 - 256-bit classical security equivalent
QUANTUM_128 - 128-bit post-quantum security
QUANTUM_192 - 192-bit post-quantum security
QUANTUM_256 - 256-bit post-quantum security
FORTRESS - Maximum security configuration
Python 3.8 or higher required with numpy dependency.
pip install numpy
No additional dependencies required. System uses only Python standard library and numpy.
from QRCs import QRCs, SecurityLevel
# Initialize system
system = QRCs(SecurityLevel.QUANTUM_256)
# Generate keypair
public_key, private_key = system.generate_keypair()
# Encrypt data
plaintext = b"confidential message"
associated_data = b"authentication context"
ciphertext = system.encrypt(plaintext, public_key, associated_data)
# Decrypt data
decrypted = system.decrypt(ciphertext, private_key, associated_data)
# Digital signatures
signature = system.sign(plaintext, private_key)
is_valid = system.verify(plaintext, signature, public_key)
Ring dimension: 1024 to 4096 coefficients depending on security level Lattice dimension: 512 to 2048 vectors Coefficient modulus: Multiple prime moduli up to 30 bits Gaussian parameter: 3.2 to 6.0 standard deviation Error correction: Reed-Solomon with 16 to 64 error correction capacity Hash function: SHA3-512 for all cryptographic hashing Signature tree height: 16 to 32 levels supporting 65536 to 4 billion signatures
Key generation: 50-500ms depending on security level
Encryption: 5-50ms per kilobyte
Decryption: 3-30ms per kilobyte
Signature generation: 10-100ms
Signature verification: 5-50ms
Memory usage: 1-16MB depending on security parameters
Performance scales with security level. FORTRESS configuration provides maximum security at cost of reduced performance.
All arithmetic operations use constant-time implementations to prevent timing attacks. Random number generation combines multiple entropy sources including hardware performance counters, system entropy pools, and cryptographic random generators.
Error correction uses advanced Reed-Solomon codes with polynomial-time Berlekamp-Massey algorithm for optimal error locator computation. The system can correct up to t errors per codeword where t is configurable.
Key switching enables homomorphic operations while maintaining security properties. Bootstrapping allows noise reduction in ciphertext without exposing secret information.
Ring-LWE problem hardness based on shortest vector problem in ideal lattices Standard LWE problem hardness based on shortest vector problem in general lattices Hash-based signatures provide information-theoretic security Number theoretic transforms enable efficient polynomial arithmetic Discrete Gaussian sampling for lattice noise generation Modular arithmetic with precomputed primitive roots
This implementation is suitable for:
Post-quantum cryptography research Lattice-based cryptanalysis studies Hybrid cryptographic system analysis Performance benchmarking of post-quantum algorithms Educational purposes in advanced cryptography
The system has not undergone formal security analysis or peer review. Parameter selection is based on current research but may require adjustment as cryptanalytic techniques advance.
Signature keys support limited number of signatures before requiring regeneration. Performance decreases significantly at maximum security levels.
Implementation focuses on correctness and research utility rather than production optimization. Side-channel protections may be incomplete against sophisticated physical attacks.
This software implements cryptographic algorithms that may be subject to export restrictions in some jurisdictions. Users are responsible for compliance with applicable laws and regulations.
This software is provided for research only. No warranties are made regarding security, correctness, or fitness for any particular purpose. The implementation has not been audited or certified for production use.
Users assume all risks associated with the use of this cryptographic software. The authors disclaim all liability for any damages resulting from use of this system.
This is experimental research software and should not be used to protect sensitive or critical information without extensive additional testing and validation.
Implementation based on current research in post-quantum cryptography including but not limited to lattice-based encryption schemes, hash-based signature systems, and error correction algorithms as published in peer-reviewed cryptographic literature.