Python SDK for CycleCore PQ — Post-Quantum Cryptography as a Service
Project description
CycleCore PQ — Python SDK
Post-quantum cryptography as a service. Dilithium3 signing, Kyber768 encryption, AES-256-GCM — one API call.
Install
pip install cyclecore-pq
Quick Start
from cyclecore_pq import CycleCoreClient
client = CycleCoreClient("pq_live_YOUR_KEY")
# Sign
result = client.sign(b"hello world")
print(result.signature)
# Verify
verified = client.verify(b"hello world", result.signature_bytes)
print(verified.valid) # True
# Encrypt / Decrypt
encrypted = client.encrypt(b"sensitive data")
decrypted = client.decrypt(encrypted.ciphertext_bytes)
print(decrypted.plaintext_bytes) # b"sensitive data"
Async
from cyclecore_pq import AsyncCycleCoreClient
async with AsyncCycleCoreClient("pq_live_YOUR_KEY") as client:
result = await client.sign(b"hello world")
Methods
| Method | Description |
|---|---|
sign(message) |
Sign with Dilithium3 |
verify(message, signature) |
Verify a signature |
encrypt(plaintext) |
Encrypt with Kyber768 + AES-256-GCM |
decrypt(ciphertext) |
Decrypt a ciphertext blob |
sign_batch(messages) |
Batch sign (up to 1,000) |
encrypt_batch(plaintexts) |
Batch encrypt (up to 1,000) |
handshake_init() |
Start PQ key exchange |
handshake_respond(...) |
Respond to key exchange |
handshake_finish(...) |
Complete key exchange |
attest(data) |
Add to attestation chain |
attest_verify(chain_id) |
Verify chain integrity |
attest_export(chain_id) |
Export chain for audit |
keys() |
Get your public keys |
rotate_keys() |
Rotate key pairs |
usage_stats() |
Usage statistics |
health() |
API health check |
Errors
from cyclecore_pq import AuthenticationError, RateLimitError, ValidationError
try:
result = client.sign(b"hello")
except AuthenticationError:
print("Invalid API key")
except RateLimitError:
print("Rate limit exceeded")
except ValidationError:
print("Bad request")
Docs
Full API documentation: cyclecore.ai/pq/docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cyclecore_pq-0.2.0.tar.gz
(9.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 cyclecore_pq-0.2.0.tar.gz.
File metadata
- Download URL: cyclecore_pq-0.2.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
005619357466a132c6ea348f5ca6ff9f0773383a89563a3df322f1f8413075cb
|
|
| MD5 |
326a0af992cd2210c23c24569a83dc62
|
|
| BLAKE2b-256 |
03750038c22653c1a309666861f430cc740429afbf19eb6d22463f00a3e1238b
|
File details
Details for the file cyclecore_pq-0.2.0-py3-none-any.whl.
File metadata
- Download URL: cyclecore_pq-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4117873425013fb9a67906ab9bf14db79161dbe21f14cf17c03a908a5afba04e
|
|
| MD5 |
759d3c2b31c28379edf695f08766564c
|
|
| BLAKE2b-256 |
5808cb975f4deed8a4cb1aa757094f853bee35e11c2f964fd89f30765ddbbd40
|