Skip to main content

crovia-seal (Python reference)

Reference implementation of Crovia Seal v1.

Install

pip install -e .
# for tests
pip install -e ".[test]"

Smoke test (reproduces a signed Seal end-to-end)

python examples/demo_hp.py

Test suite

pytest -v

Covers:

  • test_canonical.py — CSC-1 canonicalization determinism, every edge case: controls, non-ASCII, supplementary-plane code points, JS-safe integer bounds, float rejection, duplicate-key detection, UTF-16 key sort order.
  • test_seal.py — happy path: structural shape, round-trip verify, pinned vs unpinned verification, chain composition, optional fields (checks, anchor).
  • test_tamper.py — adversarial vectors: every field tamper must be detected, downgrade attempts on version/algorithm/domain must be detected, cross-protocol signature replay must fail, key substitution with signature rewrite is detected only by pinned verification (as specified).

Public API

from crovia_seal import (
    generate_issuer_key, load_issuer_key, load_public_key,
    emit_seal, verify_seal,
    compute_payload, compute_seal_hash,
    canonicalize,
    VerifyResult,
    CroviaSealError, CanonicalizationError, SchemaError, VerificationError, ChainError,
)

Dependencies

  • cryptography — for Ed25519. Widely audited, maintained by PyCA.
  • Python stdlib only otherwise (hashlib, base64, secrets, re, dataclasses).

No network, no file I/O, no randomness outside key and nonce generation.

Threat model

See ../../SPEC.md §9 for the full threat model. Summary:

  • Signature replay across protocols: prevented by domain separation.
  • JSON malleability: eliminated by CSC-1.
  • Field tampering: all non-signature fields are covered by the signature.
  • Version downgrade: seal_version is inside the signed payload.
  • Key substitution: mitigated by pinned-key verification (issuer_pubkey_hex).
  • Chain rollback: issuer hash chain is append-only and fork-detectable.

License

Apache 2.0. Specification text is additionally CC0 (see ../../LICENSE).

Release files for crovia-seal 0.6.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 crovia-seal 0.6.0
File Size Uploaded
crovia_seal-0.6.0.tar.gz 33.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crovia-seal 0.6.0
File Interpreter ABI Platform
crovia_seal-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 58.2 kB

Release files / crovia_seal-0.6.0.tar.gz

Download URL crovia_seal-0.6.0.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
adc2abf472fbf138f3b7c071716937c33c37f6218630b78e8b302e7bd6057838
BLAKE2b-256 checksum
How to use checksums
da53bc9db3f2797035dd482169b1a55f17beff2dcfb4f83d72c9fc7cf9d9b45e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release files / crovia_seal-0.6.0-py3-none-any.whl

Download URL crovia_seal-0.6.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d2b14e0c9dab031ad551b28357ccf5f032dc51cb1cd487ed54ce20ed5f8c26c
BLAKE2b-256 checksum
How to use checksums
dd1cf7062b307f719eb41d1591f2a58ea49712db364ec502dc1565832340f580
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.1.0

2 release files

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