Closed cyasar closed 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.
Yeah. He's working. Very nice Thank you so much.
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
rmat(len(pulse))) TypeError: a bytes-like object is required, not 'str'
I would like to refer to your work in my thesis. How do you want me to give it?
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
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.
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 ()