Skip to content

Commit

Permalink
Updated start
Browse files Browse the repository at this point in the history
  • Loading branch information
hardope committed Jan 5, 2024
1 parent 19cf5db commit c0eacc9
Showing 1 changed file with 7 additions and 30 deletions.
37 changes: 7 additions & 30 deletions start.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import streamlit as st
from utils import request
from utils import nav_page

# Title
st.title("Caesar Cipher")
Expand All @@ -8,33 +8,10 @@

st.markdown("### A multiple algorithm encryption and decryption tool")

text = st.button("Text Encryption and Decryption")
file = st.button("File Encryption and Decryption")

text = st.text_area("Enter text to encrypt or decrypt", height=200)

algorithm = st.selectbox("Select algorithm", ("Caesar", "CRot13", "Rot13", "Atbash"))

if algorithm == "Caesar":
shift = st.number_input("Enter shift value", min_value=1, value=3)
action = st.radio("Action", ("Encrypt", "Decrypt"))
action = action.lower()
if st.button("Submit"):
st.markdown("### Output")
st.write(request('caesar', text, shift, action))

if algorithm == "CRot13":
shift = st.number_input("Enter shift value", min_value=1, value=3)
action = st.radio("Action", ("Encrypt", "Decrypt"))
action = action.lower()
if st.button("Submit"):
st.markdown("### Output")
st.write(request('crot13', text, shift, action))

if algorithm == "Rot13":
if st.button("Submit"):
st.markdown("### Output")
st.write(request('rot13', text))

if algorithm == "Atbash":
if st.button("Submit"):
st.markdown("### Output")
st.write(request('atbash', text))
if text:
nav_page("text")
if file:
nav_page("file")

0 comments on commit c0eacc9

Please sign in to comment.