






import random




class 							snake_case_       :

						"""simple docstring"""



						@staticmethod
						def        UpperCAmelCase__					(__UpperCAmelCase:					str   )    ->     tuple[list[int], list[int]]:




											'''simple docstring'''



											__a					:						Any      =					[ord(__UpperCAmelCase   ) for i in text]
											__a					:						Optional[Any]      =					[]
											__a					:						Union[str, Any]      =					[]
											for i in plain:
																__a					:						int      =					random.randint(1 ,					300   )
																__a					:						Any      =					(i + k) * k
																cipher.append(__UpperCAmelCase   )
																key.append(__UpperCAmelCase   )
											return cipher, key



						@staticmethod
						def        UpperCAmelCase__					(__UpperCAmelCase:					list[int] ,					__UpperCAmelCase:					list[int]   )    ->     str:




											'''simple docstring'''



											__a					:						List[str]      =					[]
											for i in range(len(__UpperCAmelCase   )   ):
																__a					:						Dict      =					int((cipher[i] - (key[i]) ** 2) / key[i]   )
																plain.append(chr(__UpperCAmelCase   )   )
											return "".join(__UpperCAmelCase   )


if __name__ == "__main__":
			UpperCAmelCase__			,							UpperCAmelCase__      			=						Onepad().encrypt('''Hello''')
			print(c, k)
			print(Onepad().decrypt(c, k))













UpperCAmelCase__      			=						'''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''







def     a_   ()				->						None:



					"""simple docstring"""
					__a					:						Dict      =					input("Enter message: "      )
					__a					:						Dict      =					input("Enter key [alphanumeric]: "      )
					__a					:						str      =					input("Encrypt/Decrypt [e/d]: "      )

					if mode.lower().startswith("e"      ):
										__a					:						List[str]      =					"encrypt"
										__a					:						Union[str, Any]      =					encrypt_message(__A				,       __A      )
					elif mode.lower().startswith("d"      ):
										__a					:						int      =					"decrypt"
										__a					:						List[str]      =					decrypt_message(__A				,       __A      )

					print(f'\n{mode.title()}ed message:'      )
					print(__A      )







def     a_   (__A				,       __A      )				->						str:



					"""simple docstring"""
					return translate_message(__A				,       __A				,       "encrypt"      )







def     a_   (__A				,       __A      )				->						str:



					"""simple docstring"""
					return translate_message(__A				,       __A				,       "decrypt"      )







def     a_   (__A				,       __A				,       __A      )				->						str:



					"""simple docstring"""
					__a					:						Union[str, Any]      =					[]
					__a					:						Tuple      =					0
					__a					:						Dict      =					key.upper()

					for symbol in message:
										__a					:						Dict      =					LETTERS.find(symbol.upper()      )
										if num != -1:
															if mode == "encrypt":
																				num += LETTERS.find(key[key_index]      )
															elif mode == "decrypt":
																				num -= LETTERS.find(key[key_index]      )

															num %= len(__A      )

															if symbol.isupper():
																				translated.append(LETTERS[num]      )
															elif symbol.islower():
																				translated.append(LETTERS[num].lower()      )

															key_index += 1
															if key_index == len(__A      ):
																				__a					:						List[str]      =					0
										else:
															translated.append(__A      )
					return "".join(__A      )


if __name__ == "__main__":
			main()





