{"id":24882985,"url":"https://github.com/abdorrahmani/qk","last_synced_at":"2025-03-27T08:21:47.038Z","repository":{"id":274170358,"uuid":"922029652","full_name":"abdorrahmani/QK","owner":"abdorrahmani","description":"BB84 quantum cryptography protocol in Golang","archived":false,"fork":false,"pushed_at":"2025-01-25T11:45:27.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T13:17:13.059Z","etag":null,"topics":["bb84","bb84-protocol","go","golang","qkd"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abdorrahmani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-01-25T06:00:14.000Z","updated_at":"2025-01-25T11:45:31.000Z","dependencies_parsed_at":"2025-01-25T12:35:42.481Z","dependency_job_id":null,"html_url":"https://github.com/abdorrahmani/QK","commit_stats":null,"previous_names":["abdorrahmani/qk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FQK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FQK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FQK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FQK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdorrahmani","download_url":"https://codeload.github.com/abdorrahmani/QK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806459,"owners_count":20675300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bb84","bb84-protocol","go","golang","qkd"],"created_at":"2025-02-01T13:17:15.261Z","updated_at":"2025-03-27T08:21:47.018Z","avatar_url":"https://github.com/abdorrahmani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BB84 Quantum Key Distribution Protocol in Go - Dockerized\n\n![Go Version](https://img.shields.io/badge/Go-1.23-blue?style=flat-square\u0026logo=go)\n![Docker](https://img.shields.io/badge/Docker-Supported-blue?style=flat-square\u0026logo=docker)\n[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)](https://shields.io/)\n\nThis project implements the **BB84 Quantum Key Distribution Protocol** in Go. It is fully containerized using Docker, allowing easy setup and execution in any environment.\n\n---\n\n## 🚀 Features\n\n- **BB84 Quantum Key Distribution Protocol**: Simulates the BB84 protocol for secure key exchange between two parties.\n- **Dockerized Application**: Run the application with Docker and Docker Compose without worrying about setup or dependencies.\n- **Secure Communication**: Simulates quantum key distribution for encryption and decryption of messages.\n\n---\n\n## 📘 What is BB84?\n\nThe BB84 protocol, introduced in 1984 by Charles Bennett and Gilles Brassard, is a quantum key distribution (QKD) protocol. It enables two parties to generate a shared encryption key securely, even in the presence of an eavesdropper.\n\nKey concepts:\n1. **Qubits and Bases**: Alice encodes bits using two types of bases (Z basis and X basis). Bob measures them using randomly chosen bases.\n2. **Transmission**: Qubits are transmitted over a quantum channel.\n3. **Key Sifting**: Alice and Bob compare their bases over a public channel. Bits measured with matching bases are kept for the shared key.\n\n**Why BB84 is secure**: Any eavesdropping (e.g., by Eve) on the quantum channel introduces detectable anomalies in the transmission, enabling Alice and Bob to discard affected qubits.\n\n---\n\n## 🛠️ Prerequisites\n\n- **Docker**: Install Docker and Docker Compose on your machine. Follow the installation guide from [Docker's official site](https://www.docker.com/get-started).\n- **Git**: Clone the repository to your local machine.\n\n---\n\n## 🧑‍💻 Installation and Usage\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/abdorrahmani/QK.git\n    cd QK\n    ```\n2. Build and run the Docker container:\n   ```bash\n   docker-compose up --build\n   ```\n\n3. Run tests to ensure everything is working:\n   ```bash\n   docker exec -it qk go test ./... -v\n   ```\n---\n\n## 📖 How It Works\n\n1. **Protocol Initialization**: The program initializes the BB84 protocol with a specified number of bits (e.g., 128).\n2. **Quantum Transmission**:\n   - Alice prepares random bits and bases.\n   - Qubits are transmitted over the quantum channel.\n   - Bob measures the qubits using random bases.\n3. **Key Sifting**: Alice and Bob compare bases to generate a shared key.\n4. **Secure Communication**:\n   - Alice encrypts a message using the shared key.\n   - Bob decrypts the message using the same key.\n\n---\n\n## 📚 Simulation Details\n\nThe program simulates the entire BB84 protocol without physical quantum systems by:\n- Generating random bits and bases for Alice and Bob.\n- Simulating the quantum channel to transmit qubits.\n- Producing a shared key based on matching bases.\n- Using the shared key to encrypt and decrypt messages.\n\n---\n\n## 🧪 Testing\n\nRun the included tests to verify the protocol and secure communication implementation:\n```bash\ngo test ./... -v\n```\n\nThe tests include:\n- Validation of random bit and basis generation.\n- End-to-end BB84 protocol simulation.\n- Encryption and decryption functionality.\n\n---\n\n## 🤝 Contributions\n\nContributions are welcome! Feel free to submit issues or pull requests to improve the implementation.\n\n---\n\n### ⚡ References\n- [BB84 Protocol on Wikipedia](https://en.wikipedia.org/wiki/BB84)\n- [Quantum Key Distribution](https://www.ibm.com/think/topics/quantum-cryptography)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdorrahmani%2Fqk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdorrahmani%2Fqk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdorrahmani%2Fqk/lists"}