Skip to main content

Python SDK for Certivu — quantum-resistant trust infrastructure for AI-generated content

Project description

certivu-python

Python SDK for Certivu — quantum-resistant trust infrastructure for AI-generated content.

Install

pip install certivu          # verify-only (httpx + pydantic)
pip install certivu[signing] # + ML-DSA signing (dilithium-py)

Quick start

from certivu import CertivuClient

client = CertivuClient(
    api_key="ctv_key_abc123",
    generator_id="your-generator-uuid",
    private_key="base64-ml-dsa-private-key",  # requires certivu[signing]
)

# Sign AI-generated content
result = client.sign(content=image_bytes, model="stable-diffusion-xl")
print(result.token)  # ctv_7f3kx9mq2... — embed in XMP metadata

# Verify — no API key needed, always free
result = client.verify(content=image_bytes)
if result.authentic and result.confidence == "high":
    print(result.provenance.org, result.provenance.signed_at)

# Verify without re-uploading the image
status = client.get_token_status("ctv_7f3kx9mq2...")

# Batch verify
results = client.verify_batch([
    {"content": image1_bytes},
    {"content": image2_bytes, "token": "ctv_..."},
])

# Audit log
page = client.get_audit_log(page=1, limit=50)

Async

from certivu import AsyncCertivuClient

async with AsyncCertivuClient(api_key="ctv_key_abc123") as client:
    result = await client.verify(content=image_bytes)
    results = await client.verify_batch([{"content": img} for img in images])

Signing setup

  1. Generate a keypair via the dashboard or API:

    keypair = client.generate_keypair()
    # Save keypair.private_key immediately — never stored by Certivu
    
  2. Register the generator in your dashboard with the public key.

  3. Sign content:

    result = client.sign(
        content=image_bytes,
        model="stable-diffusion-xl",
        generator_id=keypair_id,
        private_key=keypair.private_key,
    )
    

Confidence levels

Confidence Meaning
high Watermark ✓ + Record ✓ + Signature ✓ — full chain intact
medium Record ✓ + Signature ✓ — re-uploaded without watermark
low Partial signals — something is off
none Not signed by Certivu — no claim either way

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

certivu-1.4.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

certivu-1.4.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file certivu-1.4.1.tar.gz.

File metadata

  • Download URL: certivu-1.4.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for certivu-1.4.1.tar.gz
Algorithm Hash digest
SHA256 56fd06445b07b5cd65c6350f54eaedf12f652f8bb21942c0148533cb8cea600b
MD5 2d03a13968d7c2e9d9568e2c1d547c6f
BLAKE2b-256 519c4e5fd0966a69c797eaed5e4bad956c50dac6a343cd67b3bee5208d122fec

See more details on using hashes here.

File details

Details for the file certivu-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: certivu-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for certivu-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bea25a5123a1176e50640f032865fa9d0c5bd2ddbad706a83c337f4b49da5254
MD5 787f58515ec90c4971510785caeffc91
BLAKE2b-256 40699bab7120d29fb9b43de5ffec45d2a048b42f45a2860146a0f2c0e67edbc1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page