Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import crypt
|
| 3 |
+
|
| 4 |
+
with gr.Blocks() as app:
|
| 5 |
+
with gr.Row():
|
| 6 |
+
gr.Column()
|
| 7 |
+
with gr.Column():
|
| 8 |
+
rsa_to_enc = gr.Textbox(label="txt to encrypt")
|
| 9 |
+
pub_key_in = gr.Image(label="Public Key", type="filepath")
|
| 10 |
+
priv_key_in1 = gr.Image(label="Private Key(sig)", type="filepath")
|
| 11 |
+
rsa_enc_btn = gr.Button("RSA Encrypt")
|
| 12 |
+
rsa_enc_mes = gr.Textbox(label="encoded", max_lines=4)
|
| 13 |
+
qr_enc_mes = gr.Image(type="filepath")
|
| 14 |
+
|
| 15 |
+
gr.Column()
|
| 16 |
+
rsa_enc_btn.click(crypt.encrypt_text,[rsa_to_enc,pub_key_in,priv_key_in1,out3],[rsa_enc_mes,qr_enc_mes]).then(crypt.test_fn,qr_enc_mes,mes_in)
|
| 17 |
+
app.launch()
|