quantacipher
Zero-Trust Post-Quantum Encryption SDK for Python
NIST ML-KEM (Kyber-1024) · AES-256-GCM · Native Rust Extension · Dual-Mode
What is this?
quantacipher is the official Python SDK for the QuantaCipher platform — a zero-trust, API-first post-quantum encryption system.
Under the hood, it runs a Rust cryptographic engine compiled to a native Python extension via PyO3. All encryption and decryption happens 100% locally inside your Python process. Plaintext never leaves your runtime. The QuantaCipher API Gateway only ever sees ciphertext.
No external crypto dependencies. No C++ build steps. Pure native performance.
Installation
pip install quantacipher
Requires Python 3.8+. Pre-built wheels are available for Linux, macOS, and Windows.
Initialization
Get an API key from your QuantaCipher Dashboard.
from quantacipher import QuantaCipher
sdk = QuantaCipher(
api_key="qz_live_your_key_here",
# gateway_url is optional — defaults to https://api.quantacipher.com/v1/ingest
)
Mode 1 — Vault Mode (Permanent Sealing)
Seal data forever. No decryption possible. Designed for HIPAA audit logs, compliance records, and tamper-proof audit trails.
How it works:
- An ephemeral Kyber-1024 keypair is generated locally inside the Rust engine
- Data is encrypted using the ephemeral public key (KEM shared secret → AES-256-GCM)
- The private key is immediately and permanently discarded from memory
- The
QZ_VAULT_V1:...ciphertext is returned — undecryptable by anyone, including QuantaCipher
import json
audit_log = json.dumps({
"user_id": "U-00987",
"action": "FUNDS_TRANSFER",
"amount": 50000.00,
"timestamp": "2026-07-25T10:30:00Z",
})
# Encrypt locally — private key is gone the moment this returns
ciphertext = sdk.encrypt_vault(audit_log)
# → "QZ_VAULT_V1:BASE64_KYBER_CT:BASE64_NONCE:BASE64_AES_CT"
print(ciphertext[:60], "...")
Encrypt and send to the gateway in one call:
receipt = sdk.vault_data(audit_log, metadata={"source": "payment_service", "type": "hipaa"})
print(receipt["id"]) # "qz_rcpt_1753429812_abc123"
print(receipt["bytesSecured"]) # 156
print(receipt["encryptionScheme"]) # "Kyber-1024 + AES-256-GCM"
print(receipt["timestamp"]) # ISO 8601
There is no
decrypt_vault. This is the guarantee — not a bug.
Mode 2 — Secure Mode (End-to-End Encryption)
Encrypt data your users need to read back. You hold the keys. QuantaCipher never sees them.
How it works:
- A persistent Kyber-1024 keypair is generated locally — you store the private key
- Data is encrypted using the public key — only the holder of the matching private key can decrypt
- Only ciphertext travels over the network
- Decryption happens locally — private key never leaves your application
Step 1 — Generate a Keypair
keys = sdk.generate_keypair()
# keys["publicKey"] → base64 Kyber-1024 public key (safe to share)
# keys["privateKey"] → base64 Kyber-1024 private key (NEVER share — store securely)
# keys["algorithm"] → "Kyber-1024"
# keys["version"] → "1.0"
print("Store the private key securely. QuantaCipher never has it.")
Step 2 — Encrypt
document = json.dumps({
"patient_id": "P-00123",
"diagnosis": "Confidential Medical Information",
})
ciphertext = sdk.encrypt_secure(document, keys["publicKey"])
# → "QZ_SECURE_V1:BASE64_KYBER_CT:BASE64_NONCE:BASE64_AES_CT"
Step 3 — Decrypt (locally)
plaintext = sdk.decrypt_secure(ciphertext, keys["privateKey"])
doc = json.loads(plaintext)
# doc["diagnosis"] == "Confidential Medical Information"
Wrong key = immediate rejection:
wrong_keys = sdk.generate_keypair()
try:
sdk.decrypt_secure(ciphertext, wrong_keys["privateKey"])
except Exception as e:
print(e) # QuantaCipher Error: Kyber decapsulation failed (wrong key?)
Encrypt + send to gateway:
receipt = sdk.secure_data(document, keys["publicKey"], metadata={"user_id": "U-001"})
# receipt["id"], receipt["bytesSecured"], etc.
Low-Level API (without class)
For simple use cases, you can call the core functions directly without instantiating the class:
from quantacipher import generate_keypair, vault_encrypt, secure_encrypt, secure_decrypt
keys = generate_keypair()
ct = secure_encrypt("Hello, quantum world!", keys["publicKey"])
pt = secure_decrypt(ct, keys["privateKey"])
# pt == "Hello, quantum world!"
API Reference
QuantaCipher(api_key, gateway_url=None)
Instance Methods
| Method | Description |
|---|---|
generate_keypair() |
Generate a Kyber-1024 keypair locally → dict |
encrypt_vault(plaintext) |
Vault Mode encryption (ephemeral key, no decrypt) → str |
encrypt_secure(plaintext, public_key_b64) |
Secure Mode encryption → str |
decrypt_secure(ciphertext, private_key_b64) |
Secure Mode local decryption → str |
vault_data(plaintext, metadata=None) |
Vault Mode + send to gateway → dict (receipt) |
secure_data(plaintext, public_key_b64, metadata=None) |
Secure Mode + send to gateway → dict (receipt) |
send_to_gateway(ciphertext, metadata=None) |
Send any ciphertext for a receipt → dict |
Payload Format
All QuantaCipher ciphertexts are portable string tokens — versionable and cross-runtime compatible:
QZ_VAULT_V1 : <base64 Kyber-1024 CT> : <base64 AES-GCM nonce> : <base64 AES-GCM CT>
QZ_SECURE_V1 : <base64 Kyber-1024 CT> : <base64 AES-GCM nonce> : <base64 AES-GCM CT>
A ciphertext encrypted by the Python SDK can be sent to a JS application or the gateway interchangeably — the format is runtime-agnostic.
License
MIT — see LICENSE
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 quantacipher-0.2.0.tar.gz.
File metadata
- Download URL: quantacipher-0.2.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19aec4e0219307188888305916926cf218804687a5ca3dfd376246f073be7301
|
|
| MD5 |
08bfb6f5c7a389685f45e8f8d00908aa
|
|
| BLAKE2b-256 |
24e45e4f66bb9ffac739bc63d6ae00d87db4a1ce5695c53ee0ef6e3c12b14af0
|
File details
Details for the file quantacipher-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: quantacipher-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 273.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19791beb426340cd05e2e4dfd65614662f0809e5f93d9b31b0b5eb2461f0e954
|
|
| MD5 |
6949c94880e42df0885a8dc4d593c868
|
|
| BLAKE2b-256 |
46d4d65387fa1d0ffe9d1a90b7fd46506342140b18ad7212529110cfa2787e7e
|
File details
Details for the file quantacipher-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: quantacipher-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 304.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fbfdcb91e9744598024da156be565bfb27b67ec4f6d0ac2ea260c12fd02ac97
|
|
| MD5 |
cbe9ae02c0a642a7b72c1a882591f9d1
|
|
| BLAKE2b-256 |
ade8bb4c49de457578f1903da1a6aa7f4b74a1efb0fa3c6f351a8db12f921d1a
|
Provenance
The following attestation bundles were made for quantacipher-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl:
Publisher:
release-please.yml on xaexaex/quantacipher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantacipher-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl -
Subject digest:
3fbfdcb91e9744598024da156be565bfb27b67ec4f6d0ac2ea260c12fd02ac97 - Sigstore transparency entry: 2310698252
- Sigstore integration time:
-
Permalink:
xaexaex/quantacipher@8156939112a4ff65a25c8f06cd9313cb431f3960 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/xaexaex
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@8156939112a4ff65a25c8f06cd9313cb431f3960 -
Trigger Event:
push
-
Statement type: