tqsd / QuNetSim

A quantum network simulation framework.
https://tqsd.github.io/QuNetSim/
MIT License
115 stars 51 forks source link

[unitaryHACK] Added BB84 protocol example using QuNetSim #90 #102

Closed RamAIbot closed 3 years ago

RamAIbot commented 3 years ago

Issue: #90
I have added the BB84 protocol example using the QuNetSim components. Here we have two host which can communicate with each other (Alice and Bob). They have bidirectional classical and quantum communication network. Their communication is intercepted by Eve host and retransmitted so that the packets looks normal. The BB84 protocol helps to find out whether there is an interceptor. The protocol is implemented and when there is no interception ,it then encodes and sends the message which can be decoded at other end. If there is an interception it stops without sending the message and we can start the protocol once again and check.

If you want to discuss any of this, feel free to reach out to me on the Unitary Fund Discord server.

RamAIbot commented 3 years ago

Hi, I have edited the network as mentioned and linted using PEP8. The modified network now has Eve in between Bob and Alice and the simulation routes through Eve. Unfortunately I am not able to add Sniffing option available in the QuNetSim using the function 'q_relay_sniffing' as once I measure in the Eve's side the Qubit is destroyed in the Bob Side and I am not able to resend it. I have committed the modification in the same PR. Please check and confirm.

stephendiadamo commented 3 years ago

In the qubit measure, you can use the flag 'non_destructive=True' so they qubit isn't destroyed.

stephendiadamo commented 3 years ago

Thanks! I'll review the code this week if you want to make that change mentioned above.

RamAIbot commented 3 years ago

Hi, I have added the Eve's eavesdropping using Sniffing function which is prebuilt in the QuNetSim. Please check and confirm.