Skip to main content

Python SDK for CycleCore PQ — Post-Quantum Cryptography as a Service

Project description

CycleCore PQ — Python SDK

PyPI version Python License: MIT

Post-quantum cryptography as a service. Dilithium3 signing, Kyber768 encryption, AES-256-GCM — one API call. NIST-standardized (FIPS 204, FIPS 203, FIPS 197).

Try it now — no signup, no install, no API key.

Install

pip install cyclecore-pq

Quick Start

from cyclecore_pq import CycleCoreClient

client = CycleCoreClient("pq_live_YOUR_KEY")

# Sign a message with Dilithium3 (FIPS 204)
result = client.sign(b"hello world")
print(f"Signature: {result.signature[:40]}...")
print(f"Latency: {result.latency_us:.1f} us")

# Verify
verified = client.verify(b"hello world", result.signature_bytes)
print(f"Valid: {verified.valid}")  # True

# Encrypt with Kyber768 + AES-256-GCM (FIPS 203/197)
encrypted = client.encrypt(b"sensitive data")
decrypted = client.decrypt(encrypted.ciphertext_bytes)
print(decrypted.plaintext_bytes)  # b"sensitive data"

Get a free API key (1,000 ops/day): Register

Zero-Exposure Signing (ZES)

Sign and verify without exposing plaintext to the API. Your data is hashed client-side with SHAKE-256 — the API only sees a 32-byte digest.

from cyclecore_pq import CycleCoreClient, zes_sign, zes_verify

client = CycleCoreClient("pq_live_YOUR_KEY")

# API never sees your original data — only a SHAKE-256 hash
result = zes_sign(client, b"sensitive medical record")
print(f"Signature: {result.signature[:40]}...")

# Verify (also uses ZES — hashes before checking)
verified = zes_verify(client, b"sensitive medical record", result.signature_bytes)
print(f"Valid: {verified.valid}")  # True

Batch signing — send 32 bytes per item instead of full payloads:

from cyclecore_pq import zes_sign_batch

records = [record.encode() for record in patient_records]
batch = zes_sign_batch(client, records)  # up to 1,000

When to use ZES:

  • Regulated data (HIPAA, PCI, GDPR) — sign without sending PII to a third party
  • Large documents — send 32 bytes instead of 10MB
  • Zero-trust architectures — use CycleCore without trusting us with your content
  • Blockchain/DeFi — sign transaction digests without exposing full tx data

ZES uses SHAKE-256 (recommended for Dilithium synergy). The double-hash chain (SHAKE-256 client, SHA-256 server, Dilithium3 sign) is cryptographically sound and does not weaken NIST security properties. See examples/zes_privacy_signing.py for full examples.

Note: ZES applies to signing and verification only. Encryption requires actual plaintext.

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
zes_sign(client, data) Zero-Exposure Sign — hash locally, sign the digest
zes_verify(client, data, sig) Zero-Exposure Verify — hash locally, verify the digest
zes_sign_batch(client, data_list) Zero-Exposure Batch — hash + sign up to 1,000
zes_digest(data) Compute SHAKE-256 digest for custom workflows
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")

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

cyclecore_pq-0.3.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

cyclecore_pq-0.3.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file cyclecore_pq-0.3.0.tar.gz.

File metadata

  • Download URL: cyclecore_pq-0.3.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cyclecore_pq-0.3.0.tar.gz
Algorithm Hash digest
SHA256 50c0cbe8a29f4f50978025aa28373957de593bcdfc839c0c90716d43fa0fcfbd
MD5 1fc92b78135eacae19ec570ddb5d50cb
BLAKE2b-256 59541636a8ec468770bc1de14610172417ee8e2805c6adee089032369fb4c1d3

See more details on using hashes here.

File details

Details for the file cyclecore_pq-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cyclecore_pq-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for cyclecore_pq-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bec11073ad7a3f624f60fb4c46a3326c7545d65b9125041d120f885c7d2e6bb
MD5 3fc0b27ca97b0748e43fd50e36c418b5
BLAKE2b-256 59569159b42af93d24b7df5aa44d372b82c4dbea71f972d94f778eedcfe39d55

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