liboqs-python
Python bindings for liboqs, providing post-quantum public key cryptography algorithms
What it is and what it does
liboqs-python is a Python 3 wrapper around the Open Quantum Safe project's liboqs C library, exposing post-quantum cryptographic algorithms for key encapsulation and digital signatures. It provides three main classes—KeyEncapsulation, Signature, and StatefulSignature—each supporting multiple quantum-resistant mechanisms that can be enumerated at runtime. The package is designed for prototyping and evaluating quantum-resistant cryptography rather than production deployment of cryptographically proven algorithms.
The wrapper handles the complexity of interfacing with the underlying C library, including automatic downloading and building of liboqs on first import if no system-wide installation is found. It requires Python 3.10 or later and has minimal Python dependencies. The project is actively maintained, tested on Linux, macOS, and Windows, and includes examples and unit tests demonstrating key encapsulation, signature, and random number generation workflows.
Use it for:
- Prototype quantum-resistant key exchange and signature schemes in Python applications before production deployment.
- Evaluate the performance and correctness of post-quantum cryptographic algorithms in research or academic settings.
- Build hybrid cryptographic systems that combine classical and quantum-resistant algorithms for forward secrecy.
- Generate deterministic key pairs from seeds for reproducible testing or key derivation workflows.
- Integrate post-quantum signatures into existing Python cryptographic pipelines as the algorithms mature.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python 3 wrapper for the liboqs C library, providing post-quantum cryptographic algorithms including key encapsulation and digital signatures.
Yes, if you are prototyping or researching post-quantum cryptography. The package is actively maintained, has low install friction, and provides a straightforward Python interface to quantum-resistant algorithms. However, do not use for production security-critical systems yet—the documentation explicitly states this is for prototyping, and the security of the underlying algorithms may change as research advances. Verify that the specific algorithms you need are suitable for your use case.
Install
liboqs-python on PyPI
pip
pip install liboqs-pythonuv
uv add liboqs-pythonpoetry
poetry add liboqs-pythonInstalling liboqs-python
Before you install
Low install friction; pure Python wheel with a single runtime dependency. Active maintenance with recent release 22 days old.
License in practice
MIT License permits unrestricted use, modification, and distribution in commercial and private projects with minimal obligations—only attribution and license inclusion required.
Quickstart
pip install liboqs-python
import oqs
# Enumerate available mechanisms
kems = oqs.get_enabled_kem_mechanisms()
sigs = oqs.get_enabled_sig_mechanisms()
# Create a key encapsulation instance
kem = oqs.KeyEncapsulation('ML-KEM')
public_key = kem.generate_keypair()
Requires liboqs C library; on first import, liboqs-python will automatically download and build it if not found system-wide. Requires git, CMake, and C compiler. Python 3.10 or later required.
Verify before relying
- Whether the automatic liboqs build on first import succeeds reliably across all target platforms without manual intervention.
- Performance characteristics and memory overhead of the Python wrapper compared to direct C library usage.
- Maturity and cryptographic validation status of the quantum-resistant algorithms exposed by version 0.16.0.
- Production readiness of the algorithms; documentation states security may change as research advances.
Package facts
| License | MIT License Copyright (c) 2018-2025 Open Quantum Safe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — tomli |
| Maintenance | actively maintained — 22 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 114,021/month — #12,317 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: liboqs_python-0.16.0-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
pqcryptoProvides Python bindings to post-quantum…
permissive · top 15,000 on PyPI
openfermionOpenFermion compiles and analyzes quantum…
permissive · top 15,000 on PyPI
PGPy13PGPy13 is a Python library for OpenPGP…
permissive · top 15,000 on PyPI
cirq-coreCirq-core provides the foundational framework…
permissive · top 15,000 on PyPI
dilithium-pyA pure-Python implementation of ML-DSA (FIPS…
permissive · top 15,000 on PyPI
qiskit-algorithmsQiskit Algorithms provides a library of quantum…
permissive · top 15,000 on PyPI
cirq-aqtCirq-AQT provides a Cirq integration that lets…
permissive · top 15,000 on PyPI
PGPyPGPy implements OpenPGP (RFC 4880) in pure…
permissive · top 5,000 on PyPI
cirq-pasqalCirq-Pasqal is a Cirq integration module that…
permissive · top 15,000 on PyPI
SLH-DSAPure Python implementation of the SLH-DSA…
copyleft · top 15,000 on PyPI