Skip to main content

Quantum-safe cryptography utilities built on top of liboqs-python

Project description

qcrypto

Version: 0.1.2

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.

Coming Soon

  • Key Serialization
  • High-level Encryption API
  • Falcon, SPHINCS+

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

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

qcrypto-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

qcrypto-0.1.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file qcrypto-0.1.2.tar.gz.

File metadata

  • Download URL: qcrypto-0.1.2.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

Hashes for qcrypto-0.1.2.tar.gz
Algorithm Hash digest
SHA256 17505bd280682c360768f3e7655b2fdbc353008a232808d1f09678dbf27b2272
MD5 3ca1f37ea583e04cabbab2e681b098b5
BLAKE2b-256 95f71d9b55e776b5470b293c5f88172bdc917e41aa269a6d680d1bac04c3efe9

See more details on using hashes here.

File details

Details for the file qcrypto-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: qcrypto-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for qcrypto-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c182dbf1664fab0d681d9c742a8ced41e0592a7bc352b315c99b77e07e6935c7
MD5 bcfd9934d31171afe98eec93ed57cdff
BLAKE2b-256 278da59e05ba251ac99d5f3bf8d13c97949f3b6d52b03dd7d81f233bd485d063

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