Created
September 8, 2022 03:28
-
-
Save meicookies/59822fedb6cf6f377863e886a32355ba to your computer and use it in GitHub Desktop.
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
open_alphabet = "abcdefghijklmnopqrstuvwxyz" | |
plain_text = input("Input plain text: ") | |
keyword = input("Input keyword: ") | |
cipher_alphabet = "" | |
for char in open_alphabet: | |
if char not in keyword: | |
cipher_alphabet += char | |
cipher_alphabet = keyword + cipher_alphabet | |
cipher_text = "" | |
count = 0 | |
while count < len(plain_text): | |
index = open_alphabet.index(plain_text[count]) | |
cipher_text += cipher_alphabet[index] | |
count += 1 | |
print("Result: {}".format(cipher_text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment