MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / main

Function main

ciphers/vigenere_cipher.py:4–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4def main() -> None:
5 message = input("Enter message: ")
6 key = input("Enter key [alphanumeric]: ")
7 mode = input("Encrypt/Decrypt [e/d]: ")
8
9 if mode.lower().startswith("e"):
10 mode = "encrypt"
11 translated = encrypt_message(key, message)
12 elif mode.lower().startswith("d"):
13 mode = "decrypt"
14 translated = decrypt_message(key, message)
15
16 print(f"\n{mode.title()}ed message:")
17 print(translated)
18
19
20def encrypt_message(key: str, message: str) -> str:

Callers 1

vigenere_cipher.pyFile · 0.70

Calls 2

encrypt_messageFunction · 0.70
decrypt_messageFunction · 0.70

Tested by

no test coverage detected