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.3.0.tar.gz (15.1 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.3.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for qbitshield-2.3.0.tar.gz
Algorithm Hash digest
SHA256 621c34fad267b884b118957a7a93b5bf581f44e56bff1e7dbd9fffd9cf232d7c
MD5 337b136359557b112760aa1b012d535c
BLAKE2b-256 a17812179b49ac42458cc136b8a8edc10b60f6615027b3f884c539c07badf87f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qbitshield-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0688e05f096527c89dbad99b9358b7b23fb595d7774d1a0cf802b0b38a737c64
MD5 540107a84765c7f53ef96e677512af70
BLAKE2b-256 5ad551930a5a12ac09ef73a6f8fe11101b22b84a8ab6474812660d19821b5c6f

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