{"id":25092524,"url":"https://github.com/hk-transfield/python-quantum-key-exchange-simulator","last_synced_at":"2025-04-01T21:42:26.568Z","repository":{"id":152335221,"uuid":"417339766","full_name":"HK-Transfield/python-quantum-key-exchange-simulator","owner":"HK-Transfield","description":"A simple program to simulate a Quantum Key Exchange (QKE) algorithm, written in Python3.","archived":false,"fork":false,"pushed_at":"2021-10-28T06:41:07.000Z","size":212,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T14:18:51.291Z","etag":null,"topics":["cryptography","encryption","python","python3","quantum-computing","quantum-key-distribution","symmetric-cryptography","symmetric-encryption","symmetric-key-cryptography","xor-cipher","xor-encryption"],"latest_commit_sha":null,"homepage":"","language":"Python","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/HK-Transfield.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":"2021-10-15T02:01:44.000Z","updated_at":"2025-01-07T04:21:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8d6432c-a8ae-4111-9d6a-0f1670c9c284","html_url":"https://github.com/HK-Transfield/python-quantum-key-exchange-simulator","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"f86ee46bdf2fa1e47d35deb57eb17142a69cee38"},"previous_names":["hk-transfield/python-quantum-key-exchange-simulator","hk-transfield/quantum-key-exchange"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HK-Transfield%2Fpython-quantum-key-exchange-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HK-Transfield%2Fpython-quantum-key-exchange-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HK-Transfield%2Fpython-quantum-key-exchange-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HK-Transfield%2Fpython-quantum-key-exchange-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HK-Transfield","download_url":"https://codeload.github.com/HK-Transfield/python-quantum-key-exchange-simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246716709,"owners_count":20822507,"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":["cryptography","encryption","python","python3","quantum-computing","quantum-key-distribution","symmetric-cryptography","symmetric-encryption","symmetric-key-cryptography","xor-cipher","xor-encryption"],"created_at":"2025-02-07T14:18:49.794Z","updated_at":"2025-04-01T21:42:26.545Z","avatar_url":"https://github.com/HK-Transfield.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quantum-Key Exchange\n\nSymmetric-key cryptography requires a shared key to be known between the two parties. A simple\nway to encrypt a message is XOR encryption. This method repeatedly applies the XOR operation\non the message using the key. The receiver performs the same operation to decipher the message.\n\nBut how does one transmit a key over an insecure channel? Sending it as plain text means it can\nbe intercepted by a malicious eavesdropper. And we can’t encrypt it because it leads to a chicken-\nand-egg problem, since this operation would also require a key.\n\nA classical solution to this problem is Diffie-Helman key-exchange algorithm. With the advent of\nquantum computing, however, novel technologies have been developed. Quantum computing\nmanipulates quantum bits (qubits), instead of classical bits. Qubits are subject to quantum\nmechanical laws of physics. In this assignment, you’ll implement and test the Quantum Key\nExchange (QKE) algorithm.\n\nQKE assumes the existence of a quantum communication channel over which qubits can be\ntransferred. A qubit can be encoded via a photon’s polarization. For example, we can define\ncounterclockwise polarization ↺ as 1, and clockwise polarization ⟳ as 0. However, this is not the\nonly option, a photon could also be polarized in a linear fashion; thus, we can define an upwards\npolarization ↑ as 1, and a downwards polarization ↓ as 0. Crucially, because of quantum mechanics,\nthe internal state of a qubit can only be measured by interacting with it through a polarization filter\nof a specific type.\n\n|                          | Qubit Value 1 | Qubit Value 2 |\n| ------------------------ | ------------- | ------------- |\n| **Linear Polarization**  | ↑             | ↓             |\n| **Cirular Polarization** | ↻             | ↺             |\n\nThe key quantum mechanical observation is that these two types of polarization (circular vs. linear)\nare orthogonal to each other. This means that if a photon is polarized in a circular manner, it has\nan equal 50-50 chance to be measured as ↑ or ↓ when measured linearly (and vice-versa).\n\n## QKE Algorithm\n\n1. The transmitter sends a stream of qubits and for each, it records the value and polarization\n   type, which are both picked randomly with equal chances.\n\n2. The receiver receives the stream of qubits and for each, it selects a random polarization\n   type to measure it, and records the results\n\n3. The transmitter and receiver exchange the polarization types the used for the stream. The\n   secret key is formed by the recorded qubit values where both happened to use the same\n   polarization type. Thus, for these qubits both have recorded the same value but none but\n   they know what that value actually is\n\n---\n\n## Installing and running the program\n\nTo run program\n\n```\ngit clone https://github.com/HK-Transfield/Quantum-Key-Exchange\ncd Quantum-Key-Exchange\npython3 Main.py\n```\n\nTo run tests\n\n```\ngit clone https://github.com/HK-Transfield/Quantum-Key-Exchange\ncd Quantum-Key-Exchange\npip install -r Requirements.txt\npython3 -m pytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhk-transfield%2Fpython-quantum-key-exchange-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhk-transfield%2Fpython-quantum-key-exchange-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhk-transfield%2Fpython-quantum-key-exchange-simulator/lists"}