skillfed

liboqs-python

Python bindings for liboqs, providing post-quantum public key cryptography algorithms

liboqs-python v0.16.0 114.0K downloads/30d#12,317 on PyPI242
Permissive 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) Active released

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-python

uv

uv add liboqs-python

poetry

poetry add liboqs-python

Installing 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

post-quantum cryptography pythonquantum-resistant key encapsulationliboqs python bindingsquantum-safe signaturescryptographic algorithms wrapperstateful signature schemesopen quantum safe python
post-quantum-cryptoquantum-safecryptography-research

More Cryptography packages