Skip to main content

noqtis for Python

Post-quantum signatures, key encapsulation, hashes and sealed file capsules, from the noqtis C library. The library is compiled into the package: no runtime dependencies, and wheels for Linux (glibc and musl), macOS and Windows on x86-64 and arm64, one abi3 wheel per platform for CPython 3.9 and later.

Family Algorithms Standard
Signatures ML-DSA-44/65/87 FIPS 204
SLH-DSA-SHA2 and SLH-DSA-SHAKE, 128/192/256, s and f FIPS 205
Ed25519; hybrids ML-DSA-44/65/87+Ed25519 (both parts must verify) RFC 8032
KEMs ML-KEM-512/768/1024 FIPS 203
HQC-128/192/256 HQC round 4
Hashes SHA-224 ... SHA-512/256, SHA3-224 ... SHA3-512, SHAKE128/256, HMAC FIPS 180-4, FIPS 202
pip install noqtis      # or: uv add noqtis

Signatures

from noqtis import sign

pk, sk = sign.keygen("ML-DSA-65")
sig = sign.sign("ML-DSA-65", sk, b"message", ctx=b"app-v1")
assert sign.verify("ML-DSA-65", pk, b"message", sig, ctx=b"app-v1")
  • keygen(alg, seed=None) returns (pk, sk); a seed gives the standard's deterministic key pair.
  • sign(alg, sk, msg, ctx=b"", deterministic=False, prehash=None): prehash="SHA-512" (or any name from noqtis.hashes()) selects HashML-DSA / HashSLH-DSA; msg is still the message.
  • verify(...) returns True or False; it never raises for a bad or malformed signature.

Key encapsulation

from noqtis import kem

pk, sk = kem.keygen("ML-KEM-768")
ct, ss = kem.encap("ML-KEM-768", pk)
assert kem.decap("ML-KEM-768", sk, ct) == ss

A tampered ciphertext decapsulates to an unrelated secret rather than an error (implicit rejection, as FIPS 203 requires).

Hashes

import noqtis

noqtis.hash("SHA3-256", b"abc")
noqtis.hash("SHAKE256", b"abc", 100)   # 100 bytes of output
noqtis.hmac("SHA-256", b"key", b"data")

Capsules

A capsule is a folder sealed with a manifest of every file in it (noqtis.json) and a post-quantum signature over it (noqtis.sig).

import noqtis

pk, sk = noqtis.sign.keygen("ML-DSA-65")
noqtis.seal("results/", sk, pk, meta={"project": "survey-2026"})

report = noqtis.check("results/", pk)
print(report.ok)            # True only if every check passed
for row in report.rows:     # (check, ok, detail)
    print(row)

Without pk, check trusts the key inside the seal and its report says so. anchors=[der, ...] requires an RFC 3161 timestamp under one of the given TSA certificates.

Format 2, proofs and lineage

seal(..., format=2) adds a Merkle tree over the files to the manifest and signs its head. prove then shows some files to a reader without the names or digests of the others:

noqtis.seal("results/", sk, pk, format=2)
proof = noqtis.prove("results/", ["tables/t1.csv"])    # bytes (JSON)
noqtis.check(proof=proof, pk=pk).ok                    # the proof alone
noqtis.check("results/", pk, proof=proof).ok           # and the files

seal(..., inputs=["raw/", ("cleaned", "clean/")]) records the capsules this one was made from, by id (noqtis.capid(dir), 32 bytes); check(dir, pk, lineage=["raw/", "clean/"]) finds each input among those folders and checks it, to 64 levels. check(dir, pk, only=["a.csv"]) checks just those files (a "partial" row says so). noqtis.files(dir) lists what the manifest holds, File(path, size, sha256), with nothing checked.

Key statements

st = noqtis.rotate(old_sk, old_pk, new_sk, new_pk, reason="yearly")
noqtis.check("results/", old_pk, keys=[st]).ok   # sealed by the new key
rv = noqtis.revoke(old_sk, old_pk, at=1767225600)

A statement (bytes, or a file path) needs pk, the trusted key. With it, check accepts a seal by a key the trusted key was rotated to, and requires a verified timestamp from before a seal key was rotated away or revoked. Ed25519 alone cannot make statements.

DSSE envelopes

from noqtis import dsse

env = dsse.sign("ML-DSA-65", sk, pk, "application/vnd.in-toto+json", stmt)
dsse.verify("ML-DSA-65", pk, env)   # Signed(type, payload), or None

The envelope (in-toto and SLSA's signing wrapper) is canonical JSON with one signature over the pre-authentication encoding; its keyid is the hex SHA-256 of pk. verify returns None when no signature verifies and raises DecodeError for text that is not an envelope.

Key files

noqtis.keyfile reads and writes the text key files noqtis keygen makes (noqtis-key-1 <alg> <pub|sec>, then base64), as strictly as the command-line tool reads them:

from noqtis import keyfile

k = keyfile.read("me", "sec")      # Key(alg, kind, key); "me.pub" for pub
noqtis.sign.sign(k.alg, k.key, b"a message")

pk, sk = noqtis.sign.keygen("ML-DSA-65")
keyfile.write("you", "ML-DSA-65", "sec", sk)      # owner-only, no overwrite
keyfile.write("you.pub", "ML-DSA-65", "pub", pk)
text = keyfile.encode("ML-DSA-65", "pub", pk)     # the same text, as a str
assert keyfile.decode(text).key == pk

write never replaces a file unless force=True. Python's base64 is not constant time: decode secret key files where timing is not observable.

Errors

Every failure raises a subclass of noqtis.NoqtisError, one per library error code: ArgError, BufError, VerifyError, DecodeError, RandError, MemError, FileError, UnsupportedError, LimitError, StateError. Each has .code, the library's NQE* value.

Notes

  • Inputs may be bytes, bytearray or memoryview; outputs are bytes. Python cannot wipe bytes, so secret keys and shared secrets you hold in Python live until the garbage collector frees them.
  • Long operations release the GIL, so threads sign and verify in parallel.
  • The package is typed (py.typed).

Licensed under Apache-2.0 WITH LLVM-exception.

Metadata

Release files for noqtis 0.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 noqtis 0.1.1
File Size Uploaded Provenance Actions
noqtis-0.1.1.tar.gz 242.8 kB With provenance Details for noqtis-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for noqtis 0.1.1
File Actions
noqtis-0.1.1-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details for noqtis-0.1.1-cp39-abi3-win_arm64.whl
noqtis-0.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for noqtis-0.1.1-cp39-abi3-win_amd64.whl
noqtis-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details for noqtis-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
noqtis-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details for noqtis-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
noqtis-0.1.1-cp39-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl CPython 3.9 abi3 Linux glibc 2.39+ RISC-V 64, Linux glibc 2.34+ RISC-V 64 Details for noqtis-0.1.1-cp39-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
noqtis-0.1.1-cp39-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.26+ x86-64 Details for noqtis-0.1.1-cp39-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
noqtis-0.1.1-cp39-abi3-manylinux_2_26_s390x.manylinux_2_28_s390x.whl CPython 3.9 abi3 Linux glibc 2.26+ IBM System/390x, Linux glibc 2.28+ IBM System/390x Details for noqtis-0.1.1-cp39-abi3-manylinux_2_26_s390x.manylinux_2_28_s390x.whl
noqtis-0.1.1-cp39-abi3-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl CPython 3.9 abi3 Linux glibc 2.28+ PowerPC 64-le, Linux glibc 2.26+ PowerPC 64-le Details for noqtis-0.1.1-cp39-abi3-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl
noqtis-0.1.1-cp39-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details for noqtis-0.1.1-cp39-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
noqtis-0.1.1-cp39-abi3-macosx_11_0_x86_64.whl CPython 3.9 abi3 macOS 11.0+ x86-64 Details for noqtis-0.1.1-cp39-abi3-macosx_11_0_x86_64.whl
noqtis-0.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for noqtis-0.1.1-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 3.0 MB

Release files / noqtis-0.1.1.tar.gz

Download URL noqtis-0.1.1.tar.gz
Size 242.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c258a948514f6c2a77ab19f59de55c089c8b484d9bff9388052a9bb4bd0385ac
BLAKE2b-256 checksum
How to use checksums
d41d5517454cc6f8b8ad26d19f7f6aaba61db19882a8c3c44b563cc7416e3402
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-win_arm64.whl

Download URL noqtis-0.1.1-cp39-abi3-win_arm64.whl
Size 208.5 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
946a4fdc8a0257ebdc8b6090968ac67e42314d0bb0c9edd2c76bdfd6246d1c18
BLAKE2b-256 checksum
How to use checksums
a02aa792b304af19ed86cdff0023d26de11e5662665f05113cdd267081a5005d
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-win_amd64.whl

Download URL noqtis-0.1.1-cp39-abi3-win_amd64.whl
Size 228.1 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3efca4da0fab9b952bc83f445737db7b02a6ebb9a7106431b247dcba98678e57
BLAKE2b-256 checksum
How to use checksums
40d1f6f4a39cb77a390aaa9c9838dd2cc23ee2fde84f19520deaf3b722172836
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL noqtis-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
Size 234.3 kB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
f5fe813f34a0211c895147f482e6753189baed0729738d9f76dd09478ca47b8c
BLAKE2b-256 checksum
How to use checksums
2cb86c108e70103412110d6271ad4e0e53c35586f9f5441e0d8715c84870982f
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL noqtis-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
Size 237.5 kB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
08294a82adee1ed630c8b32161f1ffed306c998a781dfe94275d44bc735fed60
BLAKE2b-256 checksum
How to use checksums
97b9dd80d51823efa15c52d7565f6f257633070f278e50d19ca56c2c946fdb89
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl

Download URL noqtis-0.1.1-cp39-abi3-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
Size 223.4 kB
Tags CPython 3.9 Linux glibc 2.34+ RISC-V 64 Linux glibc 2.39+ RISC-V 64 abi3
SHA-256 checksum
How to use checksums
c3f39437ff0c1226130656db5b16570e9cfe93eee2496a3193bd7f90871e3a88
BLAKE2b-256 checksum
How to use checksums
c1c6dd3bd5da8bc9a051e6f7e00d42954d27a61600d9f8f84b29012bc8ca0110
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL noqtis-0.1.1-cp39-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 230.2 kB
Tags CPython 3.9 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
325ce2ca248da5c641d38de8b962d6b249e3b5d83f8d9d64004a03144ea1126e
BLAKE2b-256 checksum
How to use checksums
226977e421e642dea0ddcce4f1323a5706b4d9e3ac317f8a1b0fcf7d1fbd0eeb
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-manylinux_2_26_s390x.manylinux_2_28_s390x.whl

Download URL noqtis-0.1.1-cp39-abi3-manylinux_2_26_s390x.manylinux_2_28_s390x.whl
Size 458.2 kB
Tags CPython 3.9 Linux glibc 2.26+ IBM System/390x Linux glibc 2.28+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
54a0d2b73e33175e9172700587a1becb7ff70de0f13d4819e210ae87a42bacf7
BLAKE2b-256 checksum
How to use checksums
072561d4871c9587113fd40467354479498e016bb66ec8bfca8e9c9c53a7453a
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl

Download URL noqtis-0.1.1-cp39-abi3-manylinux_2_26_ppc64le.manylinux_2_28_ppc64le.whl
Size 307.0 kB
Tags CPython 3.9 Linux glibc 2.26+ PowerPC 64-le Linux glibc 2.28+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
932f184617bf3fba25e2bc4d3d2b8089b2fb135a4b8b7d2510a95a8bc6cd6db5
BLAKE2b-256 checksum
How to use checksums
7c8e846d97b3d7898edc432ce5209ce38f716e42087dd764f42b9f306e2f50ca
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL noqtis-0.1.1-cp39-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 230.5 kB
Tags CPython 3.9 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
76d5abe64e870d39d197caad22a890adb98c9a2d962970f99e5bb12ca478e2d1
BLAKE2b-256 checksum
How to use checksums
4874adfe5e999ffe6610f4c937d284e2070daccf413f8027300750a4dd66578a
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-macosx_11_0_x86_64.whl

Download URL noqtis-0.1.1-cp39-abi3-macosx_11_0_x86_64.whl
Size 222.5 kB
Tags CPython 3.9 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
13f5a5b44b4ec2bb42a8605618f00e229595c581d33df06fa65619a3f118ac0a
BLAKE2b-256 checksum
How to use checksums
35d80b1c6da5049fb2f5c16243265cec56207ba52bf6862516956843329a862a
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 Oct 30, 2026.

Transparency log

Release files / noqtis-0.1.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL noqtis-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Size 219.0 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
082bb4f30278b0fdd3916d5d20d4380d84bb9dd9149065f4f5a2e060474772bd
BLAKE2b-256 checksum
How to use checksums
d8f87370f0e1da9e81726b5d2727fbf77d618fd3a0c723cda22a0f222cf5372a
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 Oct 30, 2026.

Transparency log

Security for noqtis 0.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 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for noqtis-0.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 Oct 30, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

12 release files Full provenance

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