Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
22be3bdf62
6 changed files with 28 additions and 23 deletions
22
RSA/client/main.py
Normal file
22
RSA/client/main.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from flask import *
|
||||
import ssl
|
||||
import requests
|
||||
from Crypto.PublicKey import RSA
|
||||
|
||||
def resetKeys(privateKeyFile, publicKeyFile):
|
||||
keys = RSA.generate(1024)
|
||||
|
||||
with open("ssl/" + privateKeyFile, 'wb') as privHandle:
|
||||
privHandle.write(keys.export_key())
|
||||
|
||||
with open("ssl/" + publicKeyFile, 'wb') as pubHandle:
|
||||
pubHandle.write(keys.publickey().export_key())
|
||||
|
||||
resetKeys("private.key", "public.key")
|
||||
|
||||
with open("ssl/public.key", 'r') as pubHandle:
|
||||
public_serv = pubHandle.read()
|
||||
|
||||
print(public_serv)
|
||||
|
||||
data = 'Hello World !'
|
Loading…
Add table
Add a link
Reference in a new issue