Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ import json
|
|
| 21 |
import re
|
| 22 |
import os
|
| 23 |
from Crypto.Hash import RIPEMD160, SHA256
|
| 24 |
-
import pickle
|
| 25 |
|
| 26 |
def calculate_hash(data, hash_function: str = "sha256") -> str:
|
| 27 |
if type(data) == str:
|
|
@@ -88,9 +88,15 @@ def encrypt_text1(data,in2,address):
|
|
| 88 |
ciphertext, tag = cipher_aes.encrypt_and_digest(data)
|
| 89 |
[ file_out.write(x) for x in (enc_session_key, cipher_aes.nonce, tag, ciphertext) ]
|
| 90 |
file_out.close()
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
out = output
|
| 96 |
output.close()
|
|
|
|
| 21 |
import re
|
| 22 |
import os
|
| 23 |
from Crypto.Hash import RIPEMD160, SHA256
|
| 24 |
+
#import pickle
|
| 25 |
|
| 26 |
def calculate_hash(data, hash_function: str = "sha256") -> str:
|
| 27 |
if type(data) == str:
|
|
|
|
| 88 |
ciphertext, tag = cipher_aes.encrypt_and_digest(data)
|
| 89 |
[ file_out.write(x) for x in (enc_session_key, cipher_aes.nonce, tag, ciphertext) ]
|
| 90 |
file_out.close()
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
out_string = f'{enc_session_key}+++aaa+++{cipher_aes.nonce}+++bbb+++{tag}+++ccc+++{ciphertext}+++ddd+++'
|
| 94 |
+
|
| 95 |
+
#output=open("encrypted_data.bin", "rb")
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
#output1 = pickle.dumps(output)
|
| 99 |
+
enc_qr = stegan.conv_im(qr_link=address,data=outstring)
|
| 100 |
|
| 101 |
out = output
|
| 102 |
output.close()
|