semvec/pypi-packages huggingface dataset:
cyclecore-pq 0.2.0
Python SDK for CycleCore PQ — Post-Quantum Cryptography as a Service
Requires Python: >=3.9
Keywords: post-quantum, cryptography, dilithium, kyber, pqc

# CycleCore PQ — Python SDK

Post-quantum cryptography as a service. Dilithium3 signing, Kyber768 encryption, AES-256-GCM — one API call.

## Install

```bash
pip install cyclecore-pq
```

## Quick Start

```python
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

```python
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

```python
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](https://cyclecore.ai/pq/docs)