-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (18 loc) · 851 Bytes
/
main.py
File metadata and controls
26 lines (18 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as str
from encryption import encrypt_main
str.markdown("# Python encryption")
str.markdown("""
Encrypting a message with Python involves utilizing cryptographic algorithms to transform plaintext into ciphertext, ensuring confidentiality and security.
""")
str.code("""
removed_spaces_message = remove_spaces_from_string(message)
message_length = get_string_length(removed_spaces_message)
secrete_key_string : str = generate_secret_key(message_length)
encrypted_message : str = encrypt(removed_spaces_message, secrete_key_string)
""")
str.markdown("## Getting started")
message_input = str.text_input("Enter message to encrypt: (Enter when done)", placeholder="e.g. I love python")
str.markdown("### Output")
if (message_input != ""):
output = encrypt_main(message_input)
str.write(f"Encrypted message: {output}")