Next commited on
Commit
208a1c4
1 Parent(s): fa27016

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -93,7 +93,7 @@ def rsa_keys():
93
  return private_key, public_key
94
 
95
  # Gradio Blocks interface
96
- with gr.Blocks() as demo:
97
  gr.Markdown(
98
  """
99
  ### Simple Gradio Demo of encryption and decryption process, using Caesar Chiper, Advanced Encryption Standard (AES), and Rivest–Shamir–Adleman (RSA) method.
@@ -101,27 +101,24 @@ with gr.Blocks() as demo:
101
  """
102
  )
103
  with gr.Tab("Caesar Cipher"):
104
- with gr.Row():
105
- caesar_text = gr.Textbox(label="Text")
106
- caesar_shift = gr.Number(label="Shift")
107
- caesar_mode = gr.Radio(["Encrypt", "Decrypt"], label="Mode")
108
  caesar_output = gr.Textbox(label="Output")
109
  gr.Button("Submit").click(caesar_encrypt_decrypt, [caesar_text, caesar_shift, caesar_mode], caesar_output)
110
 
111
  with gr.Tab("AES"):
112
- with gr.Row():
113
- aes_key = gr.Textbox(label="Key")
114
- aes_text = gr.Textbox(label="Text")
115
- aes_mode = gr.Radio(["Encrypt", "Decrypt"], label="Mode")
116
  aes_output = gr.Textbox(label="Output")
117
  gr.Button("Submit").click(aes_encrypt_decrypt, [aes_key, aes_text, aes_mode], aes_output)
118
 
119
  with gr.Tab("RSA"):
120
- with gr.Row():
121
- rsa_key = gr.Textbox(label="Key (Public/Private)")
122
- rsa_text = gr.Textbox(label="Text")
123
- rsa_mode = gr.Radio(["Encrypt", "Decrypt"], label="Mode")
124
- rsa_key_type = gr.Radio(["Public Key", "Private Key"], label="Key Type")
125
  rsa_output = gr.Textbox(label="Output")
126
  gr.Button("Submit").click(rsa_encrypt_decrypt, [rsa_key, rsa_text, rsa_mode, rsa_key_type], rsa_output)
127
 
 
93
  return private_key, public_key
94
 
95
  # Gradio Blocks interface
96
+ with gr.Blocks(theme=applio) as demo:
97
  gr.Markdown(
98
  """
99
  ### Simple Gradio Demo of encryption and decryption process, using Caesar Chiper, Advanced Encryption Standard (AES), and Rivest–Shamir–Adleman (RSA) method.
 
101
  """
102
  )
103
  with gr.Tab("Caesar Cipher"):
104
+ caesar_text = gr.Textbox(label="Text")
105
+ caesar_shift = gr.Number(label="Shift")
106
+ caesar_mode = gr.Radio(["Encrypt", "Decrypt"], label="Mode")
 
107
  caesar_output = gr.Textbox(label="Output")
108
  gr.Button("Submit").click(caesar_encrypt_decrypt, [caesar_text, caesar_shift, caesar_mode], caesar_output)
109
 
110
  with gr.Tab("AES"):
111
+ aes_key = gr.Textbox(label="Key")
112
+ aes_text = gr.Textbox(label="Text")
113
+ aes_mode = gr.Radio(["Encrypt", "Decrypt"], label="Mode")
 
114
  aes_output = gr.Textbox(label="Output")
115
  gr.Button("Submit").click(aes_encrypt_decrypt, [aes_key, aes_text, aes_mode], aes_output)
116
 
117
  with gr.Tab("RSA"):
118
+ rsa_key = gr.Textbox(label="Key (Public/Private)")
119
+ rsa_text = gr.Textbox(label="Text")
120
+ rsa_mode = gr.Radio(["Encrypt", "Decrypt"], label="Mode")
121
+ rsa_key_type = gr.Radio(["Public Key", "Private Key"], label="Key Type")
 
122
  rsa_output = gr.Textbox(label="Output")
123
  gr.Button("Submit").click(rsa_encrypt_decrypt, [rsa_key, rsa_text, rsa_mode, rsa_key_type], rsa_output)
124