Skip to content

Instantly share code, notes, and snippets.

@meicookies
Created September 8, 2022 03:28
Show Gist options
  • Save meicookies/59822fedb6cf6f377863e886a32355ba to your computer and use it in GitHub Desktop.
Save meicookies/59822fedb6cf6f377863e886a32355ba to your computer and use it in GitHub Desktop.
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