Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -349,6 +349,14 @@ def decrypt_json(im,enc_in=None):
|
|
| 349 |
mes5=mes15.split("+ddd+",1)[0]
|
| 350 |
mes5=mes5.strip("b'").strip("'")
|
| 351 |
json_bytes = bytes(mes5,'utf-8')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
|
| 353 |
private_key = RSA.import_key(open("private.pem").read())
|
| 354 |
cipher_rsa = PKCS1_OAEP.new(private_key)
|
|
|
|
| 349 |
mes5=mes15.split("+ddd+",1)[0]
|
| 350 |
mes5=mes5.strip("b'").strip("'")
|
| 351 |
json_bytes = bytes(mes5,'utf-8')
|
| 352 |
+
file_out = open("encrypted_data.bin", "wb")
|
| 353 |
+
[ file_out.write(x) for x in (json_bytes) ]
|
| 354 |
+
file_out.close()
|
| 355 |
+
file_in = open("encrypted_data.bin", "rb")
|
| 356 |
+
json_bytes = \
|
| 357 |
+
[ file_in.read(x) for x in (-1) ]
|
| 358 |
+
file_in.close()
|
| 359 |
+
|
| 360 |
|
| 361 |
private_key = RSA.import_key(open("private.pem").read())
|
| 362 |
cipher_rsa = PKCS1_OAEP.new(private_key)
|