Skip to content

Commit

Permalink
New Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
hardope committed Jan 5, 2024
1 parent 66d1e36 commit 19cf5db
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pages/file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import streamlit as st
from utils import request, validate_file

# Title
st.title("Caesar Cipher")

st.markdown("## Coming soon...")
37 changes: 37 additions & 0 deletions pages/text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import streamlit as st
from utils import request

# Title
st.title("Caesar Cipher")

st.markdown("## Text 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))

0 comments on commit 19cf5db

Please sign in to comment.