Skip to main content

pqbox (Python)

Python bindings of pqbox, a post-quantum crypto toolkit with a Rust core that wraps RustCrypto crates. One abi3 wheel per platform supports CPython 3.10 and later.

pip install pqbox
import pqbox

# Sealed box to a hybrid ML-KEM-1024 + P-384 key (default suite "pqbox-max").
pk, sk = pqbox.kem_keygen()
box = pqbox.seal(pk, b"attack at dawn")
assert pqbox.open(sk, box) == b"attack at dawn"

# Composite ML-DSA-87 + ECDSA P-384 signature: both must verify.
spk, ssk = pqbox.sign_keygen()
sig = pqbox.sign(ssk, b"release v1.0")
assert pqbox.verify(spk, b"release v1.0", sig)

# Symmetric encryption, hashing, passwords.
key = pqbox.generate_key()
ct = pqbox.encrypt(key, b"data", aad=b"header")
assert pqbox.decrypt(key, ct, aad=b"header") == b"data"
digest = pqbox.blake3(b"data")
phc = pqbox.password_hash("correct horse battery staple")
assert pqbox.password_verify("correct horse battery staple", phc)

Suites: "xwing" (compat only), "pqbox-max" (default), "pqbox-paranoid" (adds Classic McEliece and SLH-DSA; large keys; experimental, because slh-dsa is a release candidate). Errors raise pqbox.PqboxError (a ValueError) with a code attribute.

The functions that read keys, ciphertexts, signatures or sealed boxes accept "pqbox-max" objects only. Other suites must be allowed explicitly, or they raise PqboxError with code "SuiteNotAllowed":

pk, sk = pqbox.kem_keygen("xwing")
box = pqbox.seal(pk, b"hi", allow_suites=["xwing"])
assert pqbox.open(sk, box, allow_suites=["xwing"]) == b"hi"

encrypt defaults to XChaCha20-Poly1305 (192-bit random nonce). With algorithm="aes256gcm" the random nonce is 96 bits: encrypt at most about 2**32 messages under one key, then rotate it.

See the main README for the algorithms, the wire format and the security notes.

Metadata

Release files for pqbox 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pqbox 1.0.0
File Size Uploaded Provenance Actions
pqbox-1.0.0.tar.gz 71.3 kB With provenance Details for pqbox-1.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pqbox 1.0.0
File Actions
pqbox-1.0.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for pqbox-1.0.0-cp310-abi3-win_amd64.whl
pqbox-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for pqbox-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pqbox-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for pqbox-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
pqbox-1.0.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for pqbox-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
pqbox-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for pqbox-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 3.1 MB

Release files / pqbox-1.0.0.tar.gz

Download URL pqbox-1.0.0.tar.gz
Size 71.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9637c75437d9f32fdfb9eabe68d1565396e09d1fc9a05620166639dd75b47e44
BLAKE2b-256 checksum
How to use checksums
629bc700791d180d0a015280a74a6f4c17e4457aad43511a67e06f43d3e4597b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / pqbox-1.0.0-cp310-abi3-win_amd64.whl

Download URL pqbox-1.0.0-cp310-abi3-win_amd64.whl
Size 548.1 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9793237f9904c0c66cb6a45efc0246084700075bc023267e33e097368d8b663b
BLAKE2b-256 checksum
How to use checksums
efd8d6228a3adce9d3333056eadb7128c9146a911bee60dc5eed08a6574e1f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / pqbox-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pqbox-1.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 620.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
ee4f9518d328b8f1ba7931cf7d9d774a8086b19f3646f40da8351085d136f2cd
BLAKE2b-256 checksum
How to use checksums
f4481a1c799c079e8500f94360335f0d813bef442737837b58c25950d2f5a299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / pqbox-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pqbox-1.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 643.2 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a945861d83cbac3a0027489c23d86fe7ac11b1563c68a92cd122810dcd4bd573
BLAKE2b-256 checksum
How to use checksums
3e290116545690de5c92e74822b9be78c88502d43172332bc4ff4a7e8d3869eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / pqbox-1.0.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL pqbox-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
Size 597.8 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1c3274348309bcde8ea1ab179b1cfb74b522115c182e096083e24de5f1092fa2
BLAKE2b-256 checksum
How to use checksums
f031b2706742c817bec74e6cc44dd0c7a503638c23705246c79fa1dbb2a12fd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / pqbox-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL pqbox-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 605.5 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ee5afbb96a2784656f0e2b25620972479b10d8e5a12067c7a8197a1ee5d8128c
BLAKE2b-256 checksum
How to use checksums
03b6ae8faa1c12745c26c1c406c3261609b0fe5c63a19ee4deafe05097695c9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Security for pqbox 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for pqbox-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page