rienkimarche

This commit is contained in:
vSpaike 2025-01-21 12:36:42 +01:00
parent 89e7d1c28d
commit d71ca0efbc

View file

@ -1,10 +1,25 @@
from flask import *
import ssl
import requests
from Crypto import RSA
import rsa
data = 'Hello World !'
requests.post('https://localhost:5000',data)
with open("../server/ssl/public.key", "rb") as public_serv_file:
public_serv = public_serv_file.read()
with open("ssl/id_rsa", "rb") as private_key_file:
private_key = private_key_file.read()
public_key_serv = rsa.PublicKey.load_pkcs1(public_serv)
private_key_client = rsa.PrivateKey.load_pkcs1(private_key)
crypt = rsa.encrypt(data.encode(), public_key_serv)
# Afficher le message original (pour vérification)
print(data)
response = requests.post('https://localhost:5000', data={'message': crypt, 'signature': signature}, verify=False)
#print(response.text)