Spaces:
Runtime error
Runtime error
Commit
·
20140eb
1
Parent(s):
c272058
app
Browse files
app.py
CHANGED
|
@@ -348,27 +348,27 @@ if __name__ == "__main__":
|
|
| 348 |
scan_result = gr.Textbox(label="Scan Result:")
|
| 349 |
|
| 350 |
# Button for key generation
|
| 351 |
-
b_gen_key.click(keygen
|
| 352 |
|
| 353 |
# Button to extract vector
|
| 354 |
b_extract.click(
|
| 355 |
-
encode_quantize
|
| 356 |
-
inputs=[],
|
| 357 |
outputs=[extracted_vector],
|
| 358 |
)
|
| 359 |
|
| 360 |
# Button to encrypt file
|
| 361 |
b_encrypt_file.click(
|
| 362 |
-
encrypt_encoded_quantize
|
| 363 |
-
inputs=[],
|
| 364 |
outputs=[encrypted_file],
|
| 365 |
)
|
| 366 |
|
| 367 |
# Button to run FHE-based malware scan
|
| 368 |
-
b_run_fhe_scan.click(run_fhe
|
| 369 |
|
| 370 |
# Button to decrypt the scan result
|
| 371 |
-
b_decrypt_result.click(decrypt_prediction(
|
| 372 |
|
| 373 |
gr.Markdown(
|
| 374 |
"ClairVault is built using advanced Fully Homomorphic Encryption techniques to ensure your data remains private and secure throughout the entire malware scanning process."
|
|
|
|
| 348 |
scan_result = gr.Textbox(label="Scan Result:")
|
| 349 |
|
| 350 |
# Button for key generation
|
| 351 |
+
b_gen_key.click(fn=keygen, inputs=[eval_key], outputs=[evaluation_key])
|
| 352 |
|
| 353 |
# Button to extract vector
|
| 354 |
b_extract.click(
|
| 355 |
+
fn=encode_quantize,
|
| 356 |
+
inputs=[file_input, eval_key, encodings],
|
| 357 |
outputs=[extracted_vector],
|
| 358 |
)
|
| 359 |
|
| 360 |
# Button to encrypt file
|
| 361 |
b_encrypt_file.click(
|
| 362 |
+
fn=encrypt_encoded_quantize,
|
| 363 |
+
inputs=[encodings],
|
| 364 |
outputs=[encrypted_file],
|
| 365 |
)
|
| 366 |
|
| 367 |
# Button to run FHE-based malware scan
|
| 368 |
+
b_run_fhe_scan.click(fn=run_fhe, inputs=[eval_key[1]], outputs=[encrypted_scan_result])
|
| 369 |
|
| 370 |
# Button to decrypt the scan result
|
| 371 |
+
b_decrypt_result.click(fn=decrypt_prediction(), inputs=[eval_key[1]], outputs=[scan_result])
|
| 372 |
|
| 373 |
gr.Markdown(
|
| 374 |
"ClairVault is built using advanced Fully Homomorphic Encryption techniques to ensure your data remains private and secure throughout the entire malware scanning process."
|