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.2.0.tar.gz (9.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.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: certivu-1.2.0.tar.gz
  • Upload date:
  • Size: 9.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.2.0.tar.gz
Algorithm Hash digest
SHA256 8c2e5e12293b326b71a32473e01b297eaef3c7c5755f1c6f2459baaf23e0c307
MD5 97a10760032cee71b5c844e715f573ae
BLAKE2b-256 e079e1790f709924fe4fee4d5f6d3cd80456708d0b27e87c43def15fa063dd71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: certivu-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b08323125e680175588fba63506377819649169539fb40274b79e440398ae51
MD5 a8df5653eeda3e583bcfc16f343596a2
BLAKE2b-256 c3047f4c765ff518b632835964c68fd580184b2283391c16a3b22953d5f72ba6

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