Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,9 +60,6 @@ def encrypt_text(data,in2,address):
|
|
| 60 |
pub_key = stegan2.decode(in2)
|
| 61 |
|
| 62 |
data = data.encode("utf-8")
|
| 63 |
-
#data = "I met aliens in UFO. Here is the map.".encode("utf-8")
|
| 64 |
-
|
| 65 |
-
#recipient_key = RSA.import_key(open("receiver.pem").read())
|
| 66 |
recipient_key = RSA.import_key(pub_key)
|
| 67 |
|
| 68 |
session_key = get_random_bytes(16)
|
|
@@ -85,6 +82,19 @@ def encrypt_text(data,in2,address):
|
|
| 85 |
print (f'file_data::{file_data}')
|
| 86 |
qr_link="test"
|
| 87 |
trans_im1=qr.make_qr(txt=qr_link, color_b="#ECFD08")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
#trans_im1.save("trans_im.png")
|
| 89 |
enc_qr = stegan.conv_im(trans_im1,data=file_data)
|
| 90 |
|
|
|
|
| 60 |
pub_key = stegan2.decode(in2)
|
| 61 |
|
| 62 |
data = data.encode("utf-8")
|
|
|
|
|
|
|
|
|
|
| 63 |
recipient_key = RSA.import_key(pub_key)
|
| 64 |
|
| 65 |
session_key = get_random_bytes(16)
|
|
|
|
| 82 |
print (f'file_data::{file_data}')
|
| 83 |
qr_link="test"
|
| 84 |
trans_im1=qr.make_qr(txt=qr_link, color_b="#ECFD08")
|
| 85 |
+
trans_im1.save("trans_im.png")
|
| 86 |
+
hash_1 = calculate_hash(public_key, hash_function="sha256")
|
| 87 |
+
hash_2 = calculate_hash(hash_1, hash_function="ripemd160")
|
| 88 |
+
address = base58.b58encode(hash_2)
|
| 89 |
+
add_label = str(address)
|
| 90 |
+
add_label = add_label.strip("b").strip("'")
|
| 91 |
+
#address_im = "address_im.png"
|
| 92 |
+
private_key_im = overlay.textover("trans_im.png", "Transaction",add_label)
|
| 93 |
+
private_key_im.save("private_key_im.png")
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
|
| 98 |
#trans_im1.save("trans_im.png")
|
| 99 |
enc_qr = stegan.conv_im(trans_im1,data=file_data)
|
| 100 |
|