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:
- PHM & Riemann Hypothesis Connection — Zenodo 10.5281/zenodo.20476925
- Security Bound Theorem — IACR ePrint 2026/109747
- Atomic Energy Validation — Zenodo 10.5281/zenodo.20477083
- NIST SP 800-22 Implementation — IACR ePrint 2026/109748
- IBM Quantum Hardware Results — Zenodo 10.5281/zenodo.20477312
IBM Quantum hardware experiments (ibm_fez, ibm_kingston) — job IDs verifiable at quantum.ibm.com.
Resources
License
MIT License. See LICENSE for details.
Metadata
Release files for qbitshield 2.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qbitshield-2.3.1.tar.gz | 16.2 kB | Without provenance | Details for qbitshield-2.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qbitshield-2.3.1-py3-none-any.whl | Python 3 | none | any | Details for qbitshield-2.3.1-py3-none-any.whl |
Total release size: 28.0 kB
Release files / qbitshield-2.3.1.tar.gz
| Download URL | qbitshield-2.3.1.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15f60e906e4e5cf70bf49681ccf60820dd09ace9b3c48fdb805c73e80ae1b1d9
|
|
BLAKE2b-256 checksum How to use checksums |
cabad79f41e2ca4cf0b5d8240d0eeae3845c220b0f0c6bd1faa71c8611e2f5a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / qbitshield-2.3.1-py3-none-any.whl
| Download URL | qbitshield-2.3.1-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0c90953ad3a9b87e27e234fbcfaa8306f6597075168984f6052f64cdd9ae9be
|
|
BLAKE2b-256 checksum How to use checksums |
453693c48d3e28dc1dca6837eea16d16477298ccb496f9ff90b0a55aa190f5b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for qbitshield 2.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.