Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -121,8 +121,10 @@ def decrypt_text(im,in2):
|
|
| 121 |
data = cipher_aes.decrypt_and_verify(ciphertext, tag)
|
| 122 |
return(data.decode("utf-8"))
|
| 123 |
|
| 124 |
-
|
| 125 |
-
|
|
|
|
|
|
|
| 126 |
with gr.Blocks() as app:
|
| 127 |
|
| 128 |
with gr.Row():
|
|
@@ -151,7 +153,9 @@ with gr.Blocks() as app:
|
|
| 151 |
rsa_dec_mes = gr.Textbox(label="decoded")
|
| 152 |
gr.Column()
|
| 153 |
|
| 154 |
-
|
| 155 |
-
|
|
|
|
|
|
|
| 156 |
rsa_dec_btn.click(decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
| 157 |
app.launch()
|
|
|
|
| 121 |
data = cipher_aes.decrypt_and_verify(ciphertext, tag)
|
| 122 |
return(data.decode("utf-8"))
|
| 123 |
|
| 124 |
+
def test_fn(im1,im2):
|
| 125 |
+
return im1,im2
|
| 126 |
+
def test_fn2(im1):
|
| 127 |
+
return im1
|
| 128 |
with gr.Blocks() as app:
|
| 129 |
|
| 130 |
with gr.Row():
|
|
|
|
| 153 |
rsa_dec_mes = gr.Textbox(label="decoded")
|
| 154 |
gr.Column()
|
| 155 |
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
gen_wal_btn.click(generate_keys,None,[out2,out1, img3,out3,img1,img2]).then(test_fn,[img1,img2],[priv_key_in,pub_key_in])
|
| 159 |
+
rsa_enc_btn.click(encrypt_text,[rsa_to_enc,pub_key_in,out3],[rsa_enc_mes,qr_enc_mes]).then(test_fn2,qr_enc_mes,mes_in)
|
| 160 |
rsa_dec_btn.click(decrypt_text,[mes_in,priv_key_in],rsa_dec_mes)
|
| 161 |
app.launch()
|