Spaces:
Runtime error
Runtime error
Update crypt.py
Browse files
crypt.py
CHANGED
@@ -300,7 +300,10 @@ def generate_keys():
|
|
300 |
|
301 |
def encrypt_trans(data,pub_key):
|
302 |
#pub_key = decode(pub_im)
|
|
|
|
|
303 |
data=str(data)
|
|
|
304 |
data = data.encode("utf-8")
|
305 |
recipient_key = RSA.import_key(pub_key)
|
306 |
session_key = get_random_bytes(16)
|
|
|
300 |
|
301 |
def encrypt_trans(data,pub_key):
|
302 |
#pub_key = decode(pub_im)
|
303 |
+
#data = eval(data)
|
304 |
+
#print (data)
|
305 |
data=str(data)
|
306 |
+
pub_key = pub_key.strip('"')
|
307 |
data = data.encode("utf-8")
|
308 |
recipient_key = RSA.import_key(pub_key)
|
309 |
session_key = get_random_bytes(16)
|