Metadata-Version: 2.4
Name: cyclecore-pq
Version: 0.2.0
Summary: Python SDK for CycleCore PQ — Post-Quantum Cryptography as a Service
Author-email: CycleCore Technologies <hi@cyclecore.ai>
License-Expression: MIT
Project-URL: Homepage, https://cyclecore.ai/pq
Project-URL: Documentation, https://cyclecore.ai/pq/docs
Keywords: post-quantum,cryptography,dilithium,kyber,pqc
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Security :: Cryptography
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Dynamic: license-file

# 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)
