Skip to main content

quantacipher

Zero-Trust Post-Quantum Encryption SDK for Python
NIST ML-KEM (Kyber-1024) · AES-256-GCM · Native Rust Extension · Dual-Mode

PyPI version PyPI downloads Python Versions License: MIT Built with PyO3

Platform · API Docs · GitHub


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:

  1. An ephemeral Kyber-1024 keypair is generated locally inside the Rust engine
  2. Data is encrypted using the ephemeral public key (KEM shared secret → AES-256-GCM)
  3. The private key is immediately and permanently discarded from memory
  4. 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:

  1. A persistent Kyber-1024 keypair is generated locally — you store the private key
  2. Data is encrypted using the public key — only the holder of the matching private key can decrypt
  3. Only ciphertext travels over the network
  4. 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

quantacipher-0.2.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distributions

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

quantacipher-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (273.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

quantacipher-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (304.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

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

Hashes for quantacipher-0.2.0.tar.gz
Algorithm Hash digest
SHA256 19aec4e0219307188888305916926cf218804687a5ca3dfd376246f073be7301
MD5 08bfb6f5c7a389685f45e8f8d00908aa
BLAKE2b-256 24e45e4f66bb9ffac739bc63d6ae00d87db4a1ce5695c53ee0ef6e3c12b14af0

See more details on using hashes here.

File details

Details for the file quantacipher-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for quantacipher-0.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 19791beb426340cd05e2e4dfd65614662f0809e5f93d9b31b0b5eb2461f0e954
MD5 6949c94880e42df0885a8dc4d593c868
BLAKE2b-256 46d4d65387fa1d0ffe9d1a90b7fd46506342140b18ad7212529110cfa2787e7e

See more details on using hashes here.

File details

Details for the file quantacipher-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for quantacipher-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3fbfdcb91e9744598024da156be565bfb27b67ec4f6d0ac2ea260c12fd02ac97
MD5 cbe9ae02c0a642a7b72c1a882591f9d1
BLAKE2b-256 ade8bb4c49de457578f1903da1a6aa7f4b74a1efb0fa3c6f351a8db12f921d1a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.4

1 file

This release

0.2.0 This release

3 files

0.1.1

2 files

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page