Added server script for receiveing aes key
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
import socket
|
||||||
|
|
||||||
|
HOST = "192.168.0.155"
|
||||||
|
PORT = 8092
|
||||||
|
|
||||||
|
s = socket.socket()
|
||||||
|
s.bind((HOST,PORT))
|
||||||
|
print("Listening for upcoming connection")
|
||||||
|
s.listen()
|
||||||
|
conn, addr = s.accept()
|
||||||
|
print(f"Received connection from {addr}")
|
||||||
|
f = open('encrypt.key', 'wb')
|
||||||
|
while True:
|
||||||
|
print("Receiving...")
|
||||||
|
data = conn.recv(1024)
|
||||||
|
if data == b"DONE":
|
||||||
|
break
|
||||||
|
f.write(data)
|
||||||
|
f.close()
|
||||||
|
s.shutdown(2)
|
||||||
|
s.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user