This commit is contained in:
parent
281af0fb2e
commit
9dc4cab674
@ -69,7 +69,8 @@ class NetWrapper:
|
|||||||
ciphertext = cipher.encrypt(message)
|
ciphertext = cipher.encrypt(message)
|
||||||
nonce = b64encode(cipher.nonce).decode('UTF-8')
|
nonce = b64encode(cipher.nonce).decode('UTF-8')
|
||||||
ct = b64encode(ciphertext).decode('UTF-8')
|
ct = b64encode(ciphertext).decode('UTF-8')
|
||||||
sendjson = json.dumps({'type': 'AUT', 'source': self.network.own_addr, 'nonce': nonce, 'message': ct}).encode('UTF-8')
|
sendjson = json.dumps({'type': 'AUT', 'source': self.network.own_addr, 'nonce': nonce, 'message': ct}).encode(
|
||||||
|
'UTF-8')
|
||||||
self.network.send_msg(self.serverAddr, sendjson)
|
self.network.send_msg(self.serverAddr, sendjson)
|
||||||
status, msg = self.network.receive_msg(blocking=True)
|
status, msg = self.network.receive_msg(blocking=True)
|
||||||
if not status:
|
if not status:
|
||||||
@ -99,7 +100,8 @@ class NetWrapper:
|
|||||||
ciphertext = cipher.encrypt(message)
|
ciphertext = cipher.encrypt(message)
|
||||||
nonce = b64encode(cipher.nonce).decode('UTF-8')
|
nonce = b64encode(cipher.nonce).decode('UTF-8')
|
||||||
ct = b64encode(ciphertext).decode('UTF-8')
|
ct = b64encode(ciphertext).decode('UTF-8')
|
||||||
sendjson = json.dumps({'type': 'CMD', 'source': self.network.own_addr, 'nonce': nonce, 'message': ct}).encode('UTF-8')
|
sendjson = json.dumps({'type': 'CMD', 'source': self.network.own_addr, 'nonce': nonce, 'message': ct}).encode(
|
||||||
|
'UTF-8')
|
||||||
self.network.send_msg(self.serverAddr, sendjson)
|
self.network.send_msg(self.serverAddr, sendjson)
|
||||||
|
|
||||||
def recieveMessage(self) -> bytes:
|
def recieveMessage(self) -> bytes:
|
||||||
|
Loading…
Reference in New Issue
Block a user