QbitShield Python SDK — quantum-safe key distribution via Prime Harmonic Modulation
Project description
QbitShield SDK v1.0.0
Python client for QbitShield's quantum-safe key distribution API.
Installation
pip install qbitshield-sdk
Quick Start — Patent-Aligned PB-QKD
The generate_key / verify_key functions call the /api/qkd/v1/ endpoints backed by the prime_basis library (patent NPA-N417, 2025).
from qbitshield import generate_key, verify_key, report_usage
from qbitshield.pb_qkd import print_result
# Generate a prime-basis QKD key
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",
)
# Pretty-print the result in the terminal
print_result(result)
# Verify the key
check = verify_key(
{
"final_key": result["final_key"],
"key_material": "...", # from your session store
"entropy_digest": result["entropy_digest"],
},
api_key="YOUR_API_KEY",
)
print("Valid:", check["valid"])
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 ║
╚══════════════════════════════════════════════════════════════╝
Encryption Helpers (QbitShieldClient)
from qbitshield.client import QbitShieldClient
client = QbitShieldClient(
base_url="https://qbitshield-api.railway.app/api",
api_key="YOUR_API_KEY"
)
latest = client.get_latest_key(token="AUTH0_ID_TOKEN")
ciphertext = client.encrypt_message("classify this datum", latest["key"], strength=256)
plaintext = client.decrypt_message(ciphertext, latest["key"], strength=256)
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
- User Guide — full reference including error handling, retries, best practices
- API Reference
- Enterprise Portal
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qbitshield-2.1.0.tar.gz.
File metadata
- Download URL: qbitshield-2.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77be8ee18b10d853c10cbcdef09a417df8c8c9223a51f45f9559feb231de1361
|
|
| MD5 |
17d10c99ba4bd78b4902f68dcf9a1958
|
|
| BLAKE2b-256 |
99b3074a67a6472cb30ea7036b72a9df188744537c64644d94a26225e4b50068
|
File details
Details for the file qbitshield-2.1.0-py3-none-any.whl.
File metadata
- Download URL: qbitshield-2.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8995a40602c17c3024a7b7b41cc64ba92a44ed1104285c1276c0bda99c49abc
|
|
| MD5 |
fb6b28298192d84c5b3eb6d0727aabee
|
|
| BLAKE2b-256 |
b14f00288ea0421874179bec4a80a64d6a610c710469e4b51849c0f1d042879d
|