ShellRox / Quantum-Key-Distribution

A modified BB84 protocol utilizing emulated photons for Quantum Key Distribution (QKD).
12 stars 3 forks source link

The work is very nice. #1

Closed cyasar closed 5 years ago

cyasar commented 5 years ago

The work is very nice. I would appreciate it if you explain this with an example. I keep failing. Because from channel import public_channel public_channel.initiate_serv is ()

ShellRox commented 5 years ago

Hello, thank you for the feedback.

README.MD was not completely updated to fit the original model of the code, hence it is incompatible, this will be solved. In the meantime, to initiate a virtual quantum channel, try this code:

from channel import public_channel
public_channel().initiate_channel()

Let me know if it works.

cyasar commented 5 years ago

Yeah. He's working. Very nice Thank you so much. itswork

cyasar commented 5 years ago

I'm so sorry to bother you. I'm very much obliged to you. Connecttion between two computers is ok. Channel.py should be written on line 39 print (self.ip_list). I couldn't find the reason why. Traceback (most recent call last): Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:07:06) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information.

RESTART: C:\Users\COMU\Downloads\Quantum-Key-Distribution-master(2)\Quantum-Key-Distribution-master\test.py Traceback (most recent call last): File "C:\Users\COMU\Downloads\Quantum-Key-Distribution-master(2)\Quantum-Key-Distribution-master\test.py", line 5, in alice.send_photon_pulse(photon_pulse) File "C:\Users\COMU\Downloads\Quantum-Key-Distribution-master(2)\Quantum-Key-Distribution-master\sender.py", line 48, in send_photon_pulse self.socket.send("qpulse:{0}".fo hata1 kod2 sonuc3

rmat(len(pulse))) TypeError: a bytes-like object is required, not 'str'

cyasar commented 5 years ago

I would like to refer to your work in my thesis. How do you want me to give it?

ShellRox commented 5 years ago

I'm so sorry to bother you. I'm very much obliged to you. Connecttion between two computers is ok. Channel.py should be written on line 39 print (self.ip_list). I couldn't find the reason why. Traceback (most recent call last): Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:07:06) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information.

RESTART: C:\Users\COMU\Downloads\Quantum-Key-Distribution-master(2)\Quantum-Key-Distribution-master\test.py Traceback (most recent call last): File "C:\Users\COMU\Downloads\Quantum-Key-Distribution-master(2)\Quantum-Key-Distribution-master\test.py", line 5, in alice.send_photon_pulse(photon_pulse) File "C:\Users\COMU\Downloads\Quantum-Key-Distribution-master(2)\Quantum-Key-Distribution-master\sender.py", line 48, in send_photon_pulse self.socket.send("qpulse:{0}".fo hata1 kod2 sonuc3

rmat(len(pulse))) TypeError: a bytes-like object is required, not 'str'

I'm not completely aware what you mean by your first statement, but the error that you see is caused by incompatibility of code with Python 3.X versions. This library is only tested on Python 2.X versions.

Python 3 takes every object in byte object format, hence in order to pass information by socket in 3.X versions, data must be encoded into bytes object first.

Hence on every string argument socket.send method, you must utilize encode() before you send it. I'll commit updates soon.

By the way, there might be further compatibility issues on Python 3.X for which I'm not aware yet, to quickly solve this you could use Python 2.X version for sender and receiver servers. But I'm going to fix this specific issue soon.