qcrypto¶
Post-quantum cryptography for Python — simple, Pythonic, and ready for the quantum era.
What is qcrypto?¶
qcrypto is a lightweight Python library that provides simple wrappers around post-quantum cryptography (PQC) using the official liboqs-python bindings from the Open Quantum Safe project.
from qcrypto import KyberKEM, encrypt, decrypt
# Generate a quantum-safe keypair
kem = KyberKEM("Kyber768")
keys = kem.generate_keypair()
# Encrypt a message
ciphertext = encrypt(keys.public_key, b"Hello, quantum world!")
# Decrypt it
plaintext = decrypt(keys.private_key, ciphertext)
Features¶
🔐 Hybrid Encryption¶
Kyber KEM + HKDF + AES-256-GCM for authenticated encryption that's secure against both classical and quantum attacks.
✍️ Digital Signatures¶
Support for Dilithium, Falcon, and SPHINCS+ — all NIST-selected PQC signature algorithms.
🔑 Key Management¶
ASCII-armored keys, passphrase protection, fingerprints, and sensible default paths like ~/.qcrypto/.
💻 Full CLI¶
Complete command-line toolkit for key generation, encryption, decryption, signing, and verification.
Supported Algorithms¶
Key Encapsulation (KEM)¶
| Algorithm | Security Level | Status |
|---|---|---|
| Kyber (512, 768, 1024) | 128–256 bit | ✅ NIST Standard |
| Classic McEliece | 128–256 bit | ✅ NIST Finalist |
Digital Signatures¶
| Algorithm | Security Level | Status |
|---|---|---|
| Dilithium (2, 3, 5) | 128–256 bit | ✅ NIST Standard |
| Falcon (512, 1024) | 128–256 bit | ✅ NIST Standard |
| SPHINCS+ | 128–256 bit | ✅ NIST Standard |
Quick Install¶
That's it — liboqs-python and all dependencies install automatically.
Quick Start¶
Generate Keys¶
Encrypt a File¶
Sign a Document¶
Why Post-Quantum?¶
Quantum computers threaten today's encryption. Algorithms like RSA and ECC can be broken by Shor's algorithm running on a sufficiently powerful quantum computer.
qcrypto uses NIST-standardized algorithms designed to resist both classical and quantum attacks:
- Kyber — Lattice-based KEM, fast and compact
- Dilithium — Lattice-based signatures, efficient and small
- Falcon — Lattice-based signatures, very compact
- SPHINCS+ — Hash-based signatures, conservative security
Start protecting your data today for the quantum future.
Disclaimer¶
For Research & Experimentation
This library is for educational, experimental, and research use. It has not undergone formal security review and should not be used in production systems requiring certified cryptographic implementations.
Resources¶
- Open Quantum Safe — The PQC project behind liboqs
- liboqs-python — Python bindings
- NIST PQC — Standardization project