Created
July 5, 2025 13:06
-
-
Save robyfirnandoyusuf/37dc794a6b1bef0728d3849e1ad3f419 to your computer and use it in GitHub Desktop.
uuiiae cipher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import streamlit as st | |
| # Mapping dari huruf ke cipher (hanya huruf kecil dan spasi) | |
| cipher_map = { | |
| 'a': 'uu', 'b': 'ui', 'c': 'ua', 'd': 'ue', 'e': 'iu', | |
| 'f': 'ii', 'g': 'ia', 'h': 'ie', 'i': 'au', 'j': 'ai', | |
| 'k': 'aa', 'l': 'ae', 'm': 'eu', 'n': 'ei', 'o': 'ea', | |
| 'p': 'ee', 'q': 'uuu', 'r': 'uui', 's': 'uua', 't': 'uue', | |
| 'u': 'iuu', 'v': 'iui', 'w': 'iua', 'x': 'iue', 'y': 'aau', | |
| 'z': 'aai', ' ': 'aaa' | |
| } | |
| reverse_map = {v: k for k, v in cipher_map.items()} | |
| def encode(text): | |
| result = '' | |
| for char in text.lower(): | |
| result += cipher_map.get(char, '?') + ' ' | |
| return result.strip() | |
| def decode(text): | |
| chunks = text.strip().split() | |
| result = '' | |
| for chunk in chunks: | |
| result += reverse_map.get(chunk, '?') | |
| return result | |
| st.title("uiia ie ia io ai Cipher") | |
| st.image("https://images.jammable.com/voices/oiiaoiia-cat-842sl/c2556cbf-106e-4fc6-87f0-07fc6693a0ba.png", width=200) | |
| mode = st.radio("Mode:", ["Encode (Text → Cipher)", "Decode (Cipher → Text)"]) | |
| user_input = st.text_area("Input Text:") | |
| if st.button("Process"): | |
| if mode.startswith("Encode"): | |
| result = encode(user_input) | |
| st.success("Encode Result:") | |
| st.code(result) | |
| else: | |
| result = decode(user_input) | |
| st.success("Decode Result:") | |
| st.code(result) | |
| st.markdown( | |
| "<hr style='margin-top: 50px;'><p style='text-align: center; font-size: 0.9em;'>Built by <a href='https://robyfirnando.0xffsec.co/' target='_blank'>Aaron</a> © 2025</p>", | |
| unsafe_allow_html=True | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment