Quantum-safe cryptography utilities built on top of liboqs-python
Project description
qcrypto
Version: 0.1.0
qcrypto is a lightweight Python library providing simple, Pythonic wrappers around post-quantum cryptography (PQC) algorithms using the official liboqs-python bindings from the Open Quantum Safe project.
The library currently includes:
- Kyber Key Encapsulation Mechanism (KEM)
- Dilithium digital signatures
- A hybrid PQC + AES-GCM encryption scheme
- Clean utility classes and exception handling
qcrypto is suitable for learning PQC, research, prototyping, and experiments involving quantum-safe primitives.
Features
Kyber KEM
- Public/secret key generation
- Encapsulation (ciphertext + shared secret)
- Decapsulation (recover shared secret)
- Supports Kyber512, Kyber768, Kyber1024
Dilithium Signatures
- Keypair generation
- Message signing
- Signature verification
- Supports Dilithium2, Dilithium3, Dilithium5
Hybrid PQC + AES Encryption
A simple hybrid model where:
- Kyber encapsulates a symmetric key
- AES-256-GCM encrypts the message
- Result is
(kem_ciphertext, aes_ciphertext)
Installation
Requires Python 3.8+.
pip install qcrypto
This installs liboqs-python automatically.
Usage (brief) Example
from qcrypto import KyberKEM
kem = KyberKEM("Kyber768")
keys = kem.generate_keypair()
ciphertext, ss1 = kem.encapsulate(keys.public_key)
ss2 = kem.decapsulate(ciphertext)
print("Shared secret match:", ss1 == ss2)
More complete usage examples are available in the examples/ directory
Implementation Notes
- Uses
liboqs-python, which bundles OQS C library implementations. - Hybrid encryption uses AES-256-GCM.
- Pure Python package, no compiled extensions.
- Modern PEP 621
src/layout.
Disclaimer
This library is for educational, experimental, and research use.
It is not a production security component and has not undergone cryptographic review.
License
MIT License.
Resources
- Open Quantum Safe Project: https://openquantumsafe.org
- liboqs-python: https://github.com/open-quantum-safe/liboqs-python
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 qcrypto-0.1.1.tar.gz.
File metadata
- Download URL: qcrypto-0.1.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f603b558541e631ffc4ace44bb188e5686a57ebaab022101fcda0fd3d77767d
|
|
| MD5 |
9e0f58b8bd94223c7d4e42fa8eda3a6a
|
|
| BLAKE2b-256 |
b09bd702b58c043a0385347dd8669ecea5d8a85efea9f511cd90e49a3b8e2bdb
|
File details
Details for the file qcrypto-0.1.1-py3-none-any.whl.
File metadata
- Download URL: qcrypto-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cd4e9ee435a6f826ac506cce6ca89d09f81c0c96864fb973be2f735a17d1467
|
|
| MD5 |
62fc068a6890485c140dd3fa06b98bba
|
|
| BLAKE2b-256 |
0959570d8e25dd969dd13dba9f7c336dae97bf0c293a9b2100d7d0eac208fab6
|