Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,10 @@ def rsa_generate():
|
|
| 39 |
print(f"Private key: (n={hex(pubKey.n)}, d={hex(keyPair.d)})")
|
| 40 |
privKeyPEM = keyPair.exportKey()
|
| 41 |
print(privKeyPEM.decode('ascii'))
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
def rsa_encrypt(msg,pubKey):
|
| 45 |
pubKey=pubKey.encode()
|
|
@@ -288,7 +291,7 @@ with gr.Blocks() as app:
|
|
| 288 |
rsa_enc_btn.click(rsa_encrypt,[rsa_to_enc,out2],rsa_enc_mes)
|
| 289 |
rsa_dec_btn.click(rsa_decrypt,[rsa_enc_mes,out1],rsa_dec_mes)
|
| 290 |
|
| 291 |
-
gen_wal_btn.click(
|
| 292 |
dec_qr_btn.click(decode_qr,[dec_qr_im,pass_out],[dec_qr_im_out,dec_qr_txt,d_json])
|
| 293 |
en_btn.click(encrypt,[pass_in,send,rec,am],[enc_out,enc_qr_out,dec_qr_im])
|
| 294 |
url_btn.click(fn=predict, inputs=[text_input,url_params],outputs=[text_output,url_params], _js=get_window_url_params)
|
|
|
|
| 39 |
print(f"Private key: (n={hex(pubKey.n)}, d={hex(keyPair.d)})")
|
| 40 |
privKeyPEM = keyPair.exportKey()
|
| 41 |
print(privKeyPEM.decode('ascii'))
|
| 42 |
+
output = re.search('[0-9a-fA-F]{32}', pubKey)
|
| 43 |
+
qr_wal=qrx.make(output)
|
| 44 |
+
qr_wal.save("qr_wal_tmp.png")
|
| 45 |
+
return keyPair,pubKey,"qr_wal_tmp.png",output
|
| 46 |
|
| 47 |
def rsa_encrypt(msg,pubKey):
|
| 48 |
pubKey=pubKey.encode()
|
|
|
|
| 291 |
rsa_enc_btn.click(rsa_encrypt,[rsa_to_enc,out2],rsa_enc_mes)
|
| 292 |
rsa_dec_btn.click(rsa_decrypt,[rsa_enc_mes,out1],rsa_dec_mes)
|
| 293 |
|
| 294 |
+
gen_wal_btn.click(rsa_create,None,[out1,out2,out3,img3,seed])
|
| 295 |
dec_qr_btn.click(decode_qr,[dec_qr_im,pass_out],[dec_qr_im_out,dec_qr_txt,d_json])
|
| 296 |
en_btn.click(encrypt,[pass_in,send,rec,am],[enc_out,enc_qr_out,dec_qr_im])
|
| 297 |
url_btn.click(fn=predict, inputs=[text_input,url_params],outputs=[text_output,url_params], _js=get_window_url_params)
|