Skip to main content

pqbox (Python)

Python bindings of pqbox, a post-quantum crypto toolkit with a Rust core that wraps RustCrypto crates and Cryspen's libcrux ML-KEM. 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)

# A key derived from a password and a stored salt (Argon2id, 64 MiB, 3 passes by default).
salt = pqbox.password_generate_salt()  # store it with the data
key = pqbox.password_derive_key("correct horse battery staple", salt)  # 32 bytes, same every time

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.1.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.1.0
File Size Uploaded Provenance Actions
pqbox-1.1.0.tar.gz 77.7 kB With provenance Details for pqbox-1.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pqbox 1.1.0
File Actions
pqbox-1.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for pqbox-1.1.0-cp310-abi3-win_amd64.whl
pqbox-1.1.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.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pqbox-1.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for pqbox-1.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
pqbox-1.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for pqbox-1.1.0-cp310-abi3-macosx_11_0_arm64.whl
pqbox-1.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for pqbox-1.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 3.7 MB

Release files / pqbox-1.1.0.tar.gz

Download URL pqbox-1.1.0.tar.gz
Size 77.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8f77def052dcc4753f52d4b65f1fd169072032be4adf6f8e35af3d026790d831
BLAKE2b-256 checksum
How to use checksums
8b821d45ec3c3bd11bc77c46ece1fdddee16a1db5887bb39bc572ed159e82d7f
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.1.0-cp310-abi3-win_amd64.whl

Download URL pqbox-1.1.0-cp310-abi3-win_amd64.whl
Size 666.5 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
986e5b59d984e9d591475ff33b318f2208a9f0444a1a49ff1cc1d3d3637f6a98
BLAKE2b-256 checksum
How to use checksums
9a01076157ee42a947362e52c0be07b06c2aa86fa0b632fb72602dfe117085f4
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.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pqbox-1.1.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 738.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e965aca194df0f5c43c751e29862df059411396a4ca492a83b3f53532173377a
BLAKE2b-256 checksum
How to use checksums
41cf619d899942403f316dc8829e9def685c1afc910fd8e512cf503e596a2ca6
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.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pqbox-1.1.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 749.4 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
92f2aaa5520fdeb547903c43561498a66314a83f3f6d853a3ee703c3f32b7042
BLAKE2b-256 checksum
How to use checksums
732b48d00b3f79ecabd44c7ae30fc9185cc0f3d699ef7e3177ea33c73d733042
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.1.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL pqbox-1.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 683.0 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7f784519cab9f237af669c54cd73299f0d56e03fc9d2f89010975b05c912267e
BLAKE2b-256 checksum
How to use checksums
467290b9095bbaaad99d199d7c69a5616d9e0c720e69ac6d139c9ae27beb3641
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.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL pqbox-1.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 744.3 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
cf85f1acce93a28352a17e820357816921593a6354bf87df31f670d03bd5e04b
BLAKE2b-256 checksum
How to use checksums
c3513af375999a3ea48f89afff403d79635a5bce11af310ff2f196281600eab2
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.1.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.1.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