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.1

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

Built distributions (wheels)

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

Total release size: 3.7 MB

Release files / pqbox-1.1.1.tar.gz

Download URL pqbox-1.1.1.tar.gz
Size 79.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8151922f6de17dc29a10737109504726a743aacfd31650b389c7e3d22f91e853
BLAKE2b-256 checksum
How to use checksums
04e92fcb2420e7acda153bcc0e42415bf7cce8207bc7358d14b2545c305fbf17
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 4, 2026.

Transparency log

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

Download URL pqbox-1.1.1-cp310-abi3-win_amd64.whl
Size 672.6 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
db33d1d0198b616da9fa131fc7a1dffbbdd2cd99326c847408c9176d596da003
BLAKE2b-256 checksum
How to use checksums
121b4c9034a240c45f9b762b538c769bdf1675ac82effdfb43de80dedd862060
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 4, 2026.

Transparency log

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

Download URL pqbox-1.1.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 744.9 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
9a226b7ebd7915fa5d25e2db66f134c6491198c1262bf799654611ac2e4c0059
BLAKE2b-256 checksum
How to use checksums
6c2b68e5ac1d604f3b69e50097a9d32cd87ae412eff08d6debd558293e1b449c
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 4, 2026.

Transparency log

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

Download URL pqbox-1.1.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 776.5 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4285c752eb863de5eca6fcbc39e529b5dca67615012ff8a351a29d9f9301a40c
BLAKE2b-256 checksum
How to use checksums
6d8ea82bbb010aeb35f4c07cb113494a9cace466ec41d11cfb9e1378f4fcab93
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 4, 2026.

Transparency log

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

Download URL pqbox-1.1.1-cp310-abi3-macosx_11_0_arm64.whl
Size 706.5 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9ad2a416ec37cc36429a8d1abe79fd7c186f7b098b15061978194a0ede8f3063
BLAKE2b-256 checksum
How to use checksums
c914175c2efa3c0c972e5f0a00cd8bf4e27750ea74895870d856d2936805e4b1
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 4, 2026.

Transparency log

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

Download URL pqbox-1.1.1-cp310-abi3-macosx_10_12_x86_64.whl
Size 749.9 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f3bc32568ebc994f9d0d85842cd4a3353f512d1643f3379b0ad57f334a40cb66
BLAKE2b-256 checksum
How to use checksums
acaecbde0e17d5f9442ad7fd701565e0e4951242fbb248a5ccef8d2c72d86bdb
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 4, 2026.

Transparency log

Security for pqbox 1.1.1

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.1.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 4, 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