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-2.0.0.tar.gz
(11.1 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-2.0.0.tar.gz.
File metadata
- Download URL: certivu-2.0.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f154dd58c35ecc1632d1cb02d00355a152d72cd628548f124b9bc02ee71d3a05
|
|
| MD5 |
7a7ad4c034122948c897e67209547e14
|
|
| BLAKE2b-256 |
fb2d309b871232c5d4ea74dd0f7857d7c162247246ccb58990ad6416cbdb27e8
|
File details
Details for the file certivu-2.0.0-py3-none-any.whl.
File metadata
- Download URL: certivu-2.0.0-py3-none-any.whl
- Upload date:
- Size: 9.6 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 |
de1b7e086d40cfff6049bc1af1856c3cc57717426d54bd9757c942149d76bb78
|
|
| MD5 |
bf9bdc1a7f1e7e64dad87053693e556b
|
|
| BLAKE2b-256 |
0c34dd0094a8d257a9bdcf2ba164fc7405cd452460706c8f7abe2b2d990c93a9
|