





from __future__ import annotations

from string import ascii_letters







def    UpperCAmelCase				(  _lowerCamelCase   :	List[Any]      , _lowerCamelCase   :	List[Any]      , _lowerCamelCase   :	str = None  ):





						'''simple docstring'''


						SCREAMING_SNAKE_CASE__  :					Dict =       alphabet or ascii_letters

						# The final result string
						SCREAMING_SNAKE_CASE__  :					Any =       """"""

						for character in input_string:
												if character not in alpha:
																		# Append without encryption if character is not in the alphabet
																		result += character
												else:
																		# Get the index of the new key and make sure it isn't too large
																		SCREAMING_SNAKE_CASE__  :					List[Any] =       (alpha.index(_lowerCamelCase  ) + key) % len(_lowerCamelCase  )

																		# Append the encoded character to the alphabet
																		result += alpha[new_key]

						return result







def    UpperCAmelCase				(  _lowerCamelCase   :	Dict      , _lowerCamelCase   :	Any      , _lowerCamelCase   :	int = None  ):





						'''simple docstring'''


						key *= -1

						return encrypt(_lowerCamelCase      , _lowerCamelCase      , _lowerCamelCase  )







def    UpperCAmelCase				(  _lowerCamelCase   :	List[Any]      , _lowerCamelCase   :	List[Any] = None  ):





						'''simple docstring'''


						SCREAMING_SNAKE_CASE__  :					List[str] =       alphabet or ascii_letters

						# To store data on all the combinations
						SCREAMING_SNAKE_CASE__  :					Union[str, Any] =       {}

						# Cycle through each combination
						for key in range(1      , len(_lowerCamelCase  ) + 1  ):
												# Decrypt the message and store the result in the data
												SCREAMING_SNAKE_CASE__  :					int =       decrypt(_lowerCamelCase      , _lowerCamelCase      , _lowerCamelCase  )

						return brute_force_data


if __name__ == "__main__":
				while True:
								print(f"\n{'-' * 10}\n Menu\n{'-' * 10}")
								print(*["1.Encrypt", "2.Decrypt", "3.BruteForce", "4.Quit"], sep="\n")

								# get user input
								__lowercase							:Optional[Any]							=	input("\nWhat would you like to do?: ").strip() or "4"

								# run functions based on what the user chose
								if choice not in ("1", "2", "3", "4"):
												print("Invalid choice, please enter a valid choice")
								elif choice == "1":
												__lowercase							:Tuple							=	input("Please enter the string to be encrypted: ")
												__lowercase							:List[Any]							=	int(input("Please enter off-set: ").strip())

												print(encrypt(input_string, key))
								elif choice == "2":
												__lowercase							:int							=	input("Please enter the string to be decrypted: ")
												__lowercase							:int							=	int(input("Please enter off-set: ").strip())

												print(decrypt(input_string, key))
								elif choice == "3":
												__lowercase							:Optional[Any]							=	input("Please enter the string to be decrypted: ")
												__lowercase							:List[str]							=	brute_force(input_string)

												for key, value in brute_force_data.items():
																print(f"Key: {key} | Message: {value}")

								elif choice == "4":
												print("Goodbye.")
												break







from __future__ import annotations

from typing import Any
class 							__snake_case:



 def __init__(						self : str			,		UpperCAmelCase__ : Any			,		UpperCAmelCase__ : Any						):  # noqa: A002

    """simple docstring"""






    lowercase__    :						Optional[int]       =			item
    lowercase__    :						Union[str, Any]       =			next
class 							__snake_case:



 def __init__(						self : List[Any]						):

    """simple docstring"""






    lowercase__    :						Node | None       =			None
    lowercase__    :						Optional[Any]       =			0



 def     UpperCAmelCase     (						self : List[Any]			,		UpperCAmelCase__ : Any						):

    """simple docstring"""






    lowercase__    :						Any       =			Node(UpperCAmelCase__			,		self.head						)
    self.size += 1



 def     UpperCAmelCase     (						self : Dict						):

    """simple docstring"""






    if self.head is None:
       return None
    else:
       lowercase__    :						List[Any]       =			self.head.item
       lowercase__    :						Optional[Any]       =			self.head.next
       self.size -= 1
       return item



 def     UpperCAmelCase     (						self : Union[str, Any]						):

    """simple docstring"""






    return self.head is None



 def __str__(						self : List[str]						):

    """simple docstring"""






    if self.is_empty():
       return ""
    else:
       lowercase__    :						Optional[Any]       =			self.head
       lowercase__    :						str       =			""""""
       lowercase__    :						list[str]       =			[]
       while iterate:
          item_list.append(str(iterate.item						)						)
          lowercase__    :						List[str]       =			iterate.next

       lowercase__    :						List[str]       =			""" --> """.join(UpperCAmelCase__						)

       return item_str







 def __len__(						self : List[Any]						):

    """simple docstring"""






    return self.size


