Skip to main content

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

Project description

QbitShield SDK v2.3.0

Python client for QbitShield's quantum-safe key distribution API — Prime Harmonic Modulation (PHM), patent PCT/US25/39370.

Installation

pip install qbitshield

Quick Start

from qbitshield import QbitShieldClient

client = QbitShieldClient(
    api_key="YOUR_API_KEY",
    base_url="https://api.qbitshield.com"
)

result = client.generate_key(security_level=256, enable_nist_validation=True)

print(result.key_id)            # qbit_1780254071056910
print(result.key[:16] + "...")  # first 16 hex chars
print(result.nist_score)        # 7–15 (NIST SP 800-22 tests passed)
print(result.nist_grade)        # A / B / C
print(result.entropy_bits)      # 255.89
print(result.source)            # "aer_simulator" or "ibm_quantum"
print(result.is_quantum)        # True if generated on IBM hardware
print(result.verification_url)  # https://quantum.ibm.com/jobs/<id> or None

Quantum Hardware Provenance

When IBM Quantum Runtime is active, every key includes a verifiable hardware job ID:

result = client.generate_key(security_level=256)

if result.is_quantum:
    print(f"Verified at: {result.verification_url}")
    # https://quantum.ibm.com/jobs/d8e3v607jphs739k6kig
else:
    print(f"Source: {result.source}")  # aer_simulator

PB-QKD (Patent-Aligned Protocol)

from qbitshield import PBQKDClient

pb_client = PBQKDClient(api_key="YOUR_API_KEY")

result = pb_client.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(result.final_key)
print(result.entropy_digest)

Encryption Helpers

# AES-256-GCM encryption using quantum key material
result = client.generate_key(security_level=256)

ciphertext = client.encrypt_message("top secret", result.key, strength=256)
plaintext  = client.decrypt_message(ciphertext,   result.key, strength=256)

Metrics

metrics = client.get_metrics(hours=24)
print(metrics.total_keys_generated)
print(metrics.average_latency_ms)
print(metrics.nist_compliance_rate)

KeyResult Fields

Field Type Description
key_id str Unique key identifier
key str Hex-encoded cryptographic key
security_level int 128, 256, or 384 bits
latency_ms float Generation latency
source str aer_simulator or ibm_quantum
quantum_hardware bool True if generated on IBM hardware
entropy_job_id str | None IBM Quantum job ID
nist_score float | None NIST SP 800-22 tests passed (0–15)
nist_grade str | None A / B / C / F
entropy_bits float | None Shannon entropy of key material
is_quantum bool Property — alias for quantum_hardware
verification_url str | None Property — IBM job verification link

API Base URL

Environment URL
Production https://api.qbitshield.com
Local http://localhost:8000

Override the default with the QBITSHIELD_API_BASE environment variable.

Research

PHM is backed by 5 peer-reviewed publications:

IBM Quantum hardware experiments (ibm_fez, ibm_kingston) — job IDs verifiable at quantum.ibm.com.

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.1.tar.gz (16.2 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.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qbitshield-2.3.1.tar.gz
  • Upload date:
  • Size: 16.2 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.1.tar.gz
Algorithm Hash digest
SHA256 15f60e906e4e5cf70bf49681ccf60820dd09ace9b3c48fdb805c73e80ae1b1d9
MD5 ab8196d20d6ddc511426f782b00b6a93
BLAKE2b-256 cabad79f41e2ca4cf0b5d8240d0eeae3845c220b0f0c6bd1faa71c8611e2f5a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qbitshield-2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0c90953ad3a9b87e27e234fbcfaa8306f6597075168984f6052f64cdd9ae9be
MD5 0e8020d1ba613c51982cfe065dde81be
BLAKE2b-256 453693c48d3e28dc1dca6837eea16d16477298ccb496f9ff90b0a55aa190f5b7

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