22 lines
569 B
Python
22 lines
569 B
Python
|
# https://realpython.com/python-sockets/
|
||
|
# echo-client.py
|
||
|
import socket
|
||
|
|
||
|
HOST = "150.254.79.26"
|
||
|
PORT = 65432 # The port used by the server
|
||
|
|
||
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||
|
s.connect((HOST, PORT))
|
||
|
klucz_publiczny = s.recv(16384)
|
||
|
print(klucz_publiczny)
|
||
|
do_podpisania = b"Hello, world"
|
||
|
s.sendall(do_podpisania)
|
||
|
podpis = s.recv(4096)
|
||
|
|
||
|
print(f"Received {podpis}")
|
||
|
p, q, g, y = klucz_publiczny_DSA
|
||
|
m = do_podpisania
|
||
|
r, s = podpis
|
||
|
weryfikacja_DSA = ver_DSA(p, q, g, y, m, r, s)
|
||
|
print(weryfikacja_DSA)
|