Skip to main content

QbitShield Python SDK — quantum-safe key distribution via Prime Harmonic Modulation

Project description

QbitShield SDK v2.1.0

Python client for QbitShield's quantum-safe key distribution API — Prime Harmonic Modulation, patent NPA-N417.

Installation

pip install qbitshield

Quick Start — QbitShieldClient

from qbitshield import QbitShieldClient

client = QbitShieldClient(api_key="YOUR_API_KEY")

# Classic Prime Harmonics v2
res = client.qkd.generate_key(security_level=256)
print(res.key_id, res.key[:16] + "...")

# Patent-aligned PB-QKD (NPA-N417)
pb = client.pbqkd.generate_key(
    primes=[2, 3, 5, 7, 11],
    times=[0.1, 0.2, 0.3, 0.4, 0.5],
    bases=["Z", "X", "Z", "X", "Z"],
)
print(pb.final_key)

# AES-GCM encryption with quantum key material
cipher = client.encrypt_message("top secret", res.key, strength=256)
plain  = client.decrypt_message(cipher, res.key, strength=256)

Quick Start — Functional API (PB-QKD)

from qbitshield import generate_key, verify_key, report_usage
from qbitshield.pb_qkd import print_result

result = generate_key(
    {
        "primes": [2, 3, 5, 7, 11],
        "times":  [0.1, 0.2, 0.3, 0.4, 0.5],
        "bases":  ["Z", "X", "Z", "X", "Z"],
    },
    api_key="YOUR_API_KEY",
    api_base="https://qbitshield-api.railway.app",
)

print_result(result)

Terminal output of print_result():

╔══════════════════════════════════════════════════════════════╗
║           QbitShield  ·  PB-QKD Key Generation              ║
╠══════════════════════════════════════════════════════════════╣
║  Session      7b31afe9b26e437e85179...                       ║
║  Final Key    54de1c58f816d113a3b7c...                       ║
║  Digest       18e57070cf191aac...                            ║
║  Primes       [2, 3, 5, 7, 11]                               ║
║  Patent       NPA-N417-2025                                  ║
║  Runtime      SYMBOLIC                                       ║
╠══════════════════════════════════════════════════════════════╣
║  Status   ✓  KEY GENERATED                                   ║
╚══════════════════════════════════════════════════════════════╝

Key Verification

from qbitshield import verify_key

check = verify_key(
    {
        "final_key":      result["final_key"],
        "key_material":   "...",
        "entropy_digest": result["entropy_digest"],
    },
    api_key="YOUR_API_KEY",
)
print("Valid:", check["valid"])

API Base URL

Environment URL
Production https://qbitshield-api.railway.app
Local http://localhost:8000

Override the default with the QBITSHIELD_API_BASE environment variable.

Resources

License

MIT License. See LICENSE for details.

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

qbitshield-2.1.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

qbitshield-2.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file qbitshield-2.1.1.tar.gz.

File metadata

  • Download URL: qbitshield-2.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for qbitshield-2.1.1.tar.gz
Algorithm Hash digest
SHA256 9aaf8165713862c0b5f595ff8a2de6104585116e0b186f002284b404e1997b93
MD5 ea15f3de102184a989b792667da1baed
BLAKE2b-256 d56a6b2275de086e42b021d1c4b8aaa16f464fe0ba5b634287876306c59e003e

See more details on using hashes here.

File details

Details for the file qbitshield-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: qbitshield-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for qbitshield-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 042c83faf050a1662c80caf8a30b4d5ddb8aeadcdf98ab2c7a0fadff12d9fd32
MD5 e555e5ae243d016ed588e17500f41700
BLAKE2b-256 f6313ad2bc3ef65dc40d722b89eb5858b4d7927ff3cdbfb0ead9bb253baa816d

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