A modular Python toolkit for quantum-safe cryptography - post-quantum key exchange, digital signatures and authenticated encryption behind a clean, validated API.
Quantum computers threaten classical public-key cryptography. qrpt wraps post-quantum primitives from liboqs behind a small, safety-first API so applications can adopt quantum-resistant key exchange and signatures today.
The design favours correctness and maintainability: strict input and nonce-length validation, slotted dataclasses to cut object overhead, and a repeatable benchmark runner to catch performance regressions.
Requires Python 3.11+. AEAD works out of the box; post-quantum features pull in the optional oqs binding.
# AEAD only pip install . # with post-quantum primitives (liboqs / oqs) pip install .[pqc]
from qrpt import encrypt_with_shared_secret, decrypt_with_shared_secret # shared_secret comes from the post-quantum KEM exchange nonce, ciphertext = encrypt_with_shared_secret(plaintext, shared_secret, aad=context) # aad must match on both sides or decryption fails recovered = decrypt_with_shared_secret(nonce, ciphertext, shared_secret, aad=context)