A Python Package for Quantum Key Distribution
Project description
QKDpy: Quantum Key Distribution Library
QKDpy is a comprehensive Python library for Quantum Key Distribution (QKD) simulations, implementing various QKD protocols, quantum simulators, and cryptographic tools. It provides an intuitive API similar to NumPy, TensorFlow, and scikit-learn, making quantum cryptography accessible to developers and researchers.
Features
- Quantum Simulation: Simulate qubits, quantum gates, and measurements
- QKD Protocols: Implementations of BB84, E91, SARG04, and more
- Key Management: Error correction and privacy amplification algorithms
- Cryptographic Tools: One-time pad encryption and authentication using quantum keys
- Visualization: Tools to visualize quantum states and protocol execution
- Extensible Design: Easy to add new protocols and features
- Performance: Efficient implementations for simulations
Installation
QKDpy requires Python 3.10 or higher. We recommend using uv for package management:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone the repository
git clone https://github.com/yourusername/qkdpy.git
cd qkdpy
# Install in development mode
uv pip install -e .
Quick Start
Here's a simple example of using the BB84 protocol to generate a secure key:
from qkdpy import BB84, QuantumChannel
# Create a quantum channel with some noise
channel = QuantumChannel(loss=0.1, noise_model='depolarizing', noise_level=0.05)
# Create a BB84 protocol instance
bb84 = BB84(channel, key_length=100)
# Execute the protocol
results = bb84.execute()
# Print the results
print(f"Generated key: {results['final_key']}")
print(f"QBER: {results['qber']:.4f}")
print(f"Is secure: {results['is_secure']}")
For more examples, see the examples directory.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
License
QKDpy is licensed under the Apache License 2.0. See LICENSE for the full license text.
Citation
If you use QKDpy in your research, please cite it as described in CITATION.cff.
Code of Conduct
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code.
Contact
For questions, suggestions, or issues, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
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 qkdpy-0.1.5.tar.gz.
File metadata
- Download URL: qkdpy-0.1.5.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3103a8201febd9c826929dc85fb94d40c687456f0597f1b958d3ba47b08cdd70
|
|
| MD5 |
028ae01a31587576ff2037d587b66bee
|
|
| BLAKE2b-256 |
c688f117c5f84df2df92181ab6ba7f58a5f1901d8796274daf48041fb57074ca
|
Provenance
The following attestation bundles were made for qkdpy-0.1.5.tar.gz:
Publisher:
release.yml on Pranava-Kumar/qkdpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qkdpy-0.1.5.tar.gz -
Subject digest:
3103a8201febd9c826929dc85fb94d40c687456f0597f1b958d3ba47b08cdd70 - Sigstore transparency entry: 385626102
- Sigstore integration time:
-
Permalink:
Pranava-Kumar/qkdpy@fa2a842ec876721dec3f15b92a864d85bbe3eecb -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Pranava-Kumar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fa2a842ec876721dec3f15b92a864d85bbe3eecb -
Trigger Event:
push
-
Statement type:
File details
Details for the file qkdpy-0.1.5-py3-none-any.whl.
File metadata
- Download URL: qkdpy-0.1.5-py3-none-any.whl
- Upload date:
- Size: 43.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ffb15f4247a84b0aee90ebdc262591f461bc741b53d209e4bf8937f69538d9e
|
|
| MD5 |
9397db983ebfcf3809d93db2c55b6ed2
|
|
| BLAKE2b-256 |
f26824ce2150593643f419c455468ee10cc335a2e01c36d9ad1279969976ad44
|
Provenance
The following attestation bundles were made for qkdpy-0.1.5-py3-none-any.whl:
Publisher:
release.yml on Pranava-Kumar/qkdpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qkdpy-0.1.5-py3-none-any.whl -
Subject digest:
0ffb15f4247a84b0aee90ebdc262591f461bc741b53d209e4bf8937f69538d9e - Sigstore transparency entry: 385626130
- Sigstore integration time:
-
Permalink:
Pranava-Kumar/qkdpy@fa2a842ec876721dec3f15b92a864d85bbe3eecb -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/Pranava-Kumar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fa2a842ec876721dec3f15b92a864d85bbe3eecb -
Trigger Event:
push
-
Statement type: