{"id":50878971,"url":"https://github.com/jdanielescanez/qkd-sampler","last_synced_at":"2026-06-15T12:03:27.653Z","repository":{"id":363203238,"uuid":"1160339186","full_name":"jdanielescanez/qkd-sampler","owner":"jdanielescanez","description":"A Rust CLI tool for simulating Quantum Key Distribution (QKD) protocols, including BB84, Six-State, and B92. This crate provides a flexible and efficient way to simulate quantum key exchange, analyze security metrics, and evaluate the impact of eavesdropping.","archived":false,"fork":false,"pushed_at":"2026-06-07T21:14:55.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T23:13:20.063Z","etag":null,"topics":["b92","bb84","cryptography","qkd","quantum","six-state"],"latest_commit_sha":null,"homepage":"https://jdanielescanez.github.io/qkd-sampler/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdanielescanez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-17T20:30:22.000Z","updated_at":"2026-06-07T21:14:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jdanielescanez/qkd-sampler","commit_stats":null,"previous_names":["jdanielescanez/qkd-sampler"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jdanielescanez/qkd-sampler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdanielescanez%2Fqkd-sampler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdanielescanez%2Fqkd-sampler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdanielescanez%2Fqkd-sampler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdanielescanez%2Fqkd-sampler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdanielescanez","download_url":"https://codeload.github.com/jdanielescanez/qkd-sampler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdanielescanez%2Fqkd-sampler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34361403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["b92","bb84","cryptography","qkd","quantum","six-state"],"created_at":"2026-06-15T12:03:24.714Z","updated_at":"2026-06-15T12:03:27.645Z","avatar_url":"https://github.com/jdanielescanez.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QKD Sampler: Quantum Key Distribution Simulator in Rust\n\n[![Crates.io](https://img.shields.io/crates/v/qkd-sampler.svg)](https://crates.io/crates/qkd-sampler)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nA Rust CLI tool for simulating **Quantum Key Distribution (QKD)** protocols, including **BB84**, **Six-State**, and **B92**. This crate provides a flexible and efficient way to simulate quantum key exchange, analyze security metrics, and evaluate the impact of eavesdropping.\n\n---\n\n## Features\n\n- **Multiple QKD Protocols**: Simulate BB84, Six-State, and B92 protocols.\n- **Customizable Parameters**: Adjust the number of qubits, interception rate, noise, confidence and repetitions.\n- **Security Metrics**: Calculate Quantum Bit Error Rate (QBER), key length, and Eve's knowledge.\n- **CSV Output**: Export simulation results for further analysis.\n\n---\n\n## Installation\n\n```bash\ncargo install qkd-sampler\n```\n\n---\n\n## Execution\n\nExecute the simulator using the following command:\n\n```\nqkd-sampler --protocol \u003cprotocol\u003e --output \u003cfile_name\u003e [OPTIONS]\n```\n\n#### Options\n\n| Option                     | Description                                                                                     | Default Value                     |\n|----------------------------|-------------------------------------------------------------------------------------------------|-----------------------------------|\n| `--protocol`, `-p`         | Name of protocol to simulate (`BB84`, `SixState`, `B92`) [required]                             | -                                 |\n| `--size`, `-s`             | Number of qubits to send                                                                         | `1000`                            |\n| `--interception-rate`, `-i`| Rate of intercepted qubits by Eve (value between `0.0` and `1.0`)                               | `0.0`                             |\n| `--noise-probability`, `-n`      | Probability of error in the quantum channel                                                    | `0.0`                             |\n| `--confidence`, `-c`            | Confidence level to successfully detect eavesdropping                                          | `0.9999999999`      |\n| `--repetitions`, `-r`      | Number of repetitions by experiment                                                              | `1`                               |\n| `--output`, `-o`           | Output CSV file path [required]                                                                 | -                                 |\n| `--help`, `-h` | Print help |\n| `--version`, `-V` | Print version |\n\n#### Examples\n\nRun the BB84 protocol with default parameters:\n```\nqkd-sampler --protocol BB84 -o output/little_example.csv\n```\n\nThe program generates a file similar to the one of the [specified path](./output/little_example.csv):\n\n```csv\nid,protocol,number_of_qubits,interception_rate,noise,confidence,time_μs,is_considered_secure,key_length,eve_knowledge,measured_qber,final_key_qber\nBB84_1000_0_0_0.9999999999-0,BB84,1000,0,0,0.9999999999,2526,true,245,0,0,0\n```\n---\n\nRun multiple QKD protocols (BB84, SixState, and B92) with different parameters:\n```\nqkd-sampler -p BB84,SixState,B92 -s 100,10000 -i 0.001,0.01,0.1 -o output/mid_example.csv\n```\n\nThe program generates the results similar to the following file (that can be seen in the [specified path](./output/mid_example.csv)):\n\n```csv\nid,protocol,number_of_qubits,interception_rate,noise,confidence,time_μs,is_considered_secure,key_length,eve_knowledge,measured_qber,final_key_qber\nBB84_100_0.001_0_0.9999999999-0,BB84,100,0.001,0,0.9999999999,543,true,25,0,0,0\nBB84_100_0.01_0_0.9999999999-0,BB84,100,0.01,0,0.9999999999,134,true,26,0,0,0\nBB84_100_0.1_0_0.9999999999-0,BB84,100,0.1,0,0.9999999999,130,false,None,0,0.041666666666666664,None\nBB84_10000_0.001_0_0.9999999999-0,BB84,10000,0.001,0,0.9999999999,20905,false,None,0,0.0007858546168958742,None\nBB84_10000_0.01_0_0.9999999999-0,BB84,10000,0.01,0,0.9999999999,14749,false,None,0,0.0012048192771084338,None\nBB84_10000_0.1_0_0.9999999999-0,BB84,10000,0.1,0,0.9999999999,14548,false,None,0,0.026835043409629045,None\nSixState_100_0.001_0_0.9999999999-0,SixState,100,0.001,0,0.9999999999,134,true,15,0,0,0\nSixState_100_0.01_0_0.9999999999-0,SixState,100,0.01,0,0.9999999999,134,true,18,0,0,0.05555555555555555\nSixState_100_0.1_0_0.9999999999-0,SixState,100,0.1,0,0.9999999999,132,false,None,0,0.0625,None\nSixState_10000_0.001_0_0.9999999999-0,SixState,10000,0.001,0,0.9999999999,17563,true,1636,0,0,0\nSixState_10000_0.01_0_0.9999999999-0,SixState,10000,0.01,0,0.9999999999,14613,false,None,0,0.0023432923257176333,None\nSixState_10000_0.1_0_0.9999999999-0,SixState,10000,0.1,0,0.9999999999,14838,false,None,0,0.028605482717520857,None\nB92_100_0.001_0_0.9999999999-0,B92,100,0.001,0,0.9999999999,153,true,14,0,0,0\nB92_100_0.01_0_0.9999999999-0,B92,100,0.01,0,0.9999999999,141,true,10,0,0,0\nB92_100_0.1_0_0.9999999999-0,B92,100,0.1,0,0.9999999999,131,false,None,0,0.07692307692307693,None\nB92_10000_0.001_0_0.9999999999-0,B92,10000,0.001,0,0.9999999999,130613,false,None,0,0.0015785319652722968,None\nB92_10000_0.01_0_0.9999999999-0,B92,10000,0.01,0,0.9999999999,112374,false,None,0,0.0071090047393364926,None\nB92_10000_0.1_0_0.9999999999-0,B92,10000,0.1,0,0.9999999999,115288,false,None,0,0.05657492354740061,None\n```\n\nAnother larger example can be found at [this link](./output/full_example.csv).\n\n---\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/jdanielescanez/qkd-sampler).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdanielescanez%2Fqkd-sampler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdanielescanez%2Fqkd-sampler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdanielescanez%2Fqkd-sampler/lists"}