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
-
Generate a keypair via the dashboard or API:
keypair = client.generate_keypair() # Save keypair.private_key immediately — never stored by Certivu
-
Register the generator in your dashboard with the public key.
-
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.1.0.tar.gz
(10.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file certivu-1.1.0.tar.gz.
File metadata
- Download URL: certivu-1.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85b2754fc2ad5d5327073b01adebf36a1bf30be84cd7af08a9a7eb04ae4216c1
|
|
| MD5 |
fbd36c015ba2e14f9642ca7144b510c4
|
|
| BLAKE2b-256 |
89c250773db8871931d24389ad4ce5a7d4304d88fa6d5351213021b81e43d9e2
|
File details
Details for the file certivu-1.1.0-py3-none-any.whl.
File metadata
- Download URL: certivu-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b18876fe7564449cd78531fe4a532afbe5a3ec5902beee1bf22b17f089a7fbc
|
|
| MD5 |
710b8b439cdfa9d963aa485b519c72f3
|
|
| BLAKE2b-256 |
7927004ebdeb6b9401ac2bc173abcae90bbdee60eb893963c0c8a6cca525f29b
|