



'''simple docstring'''



_lowercase       :						Union[str, Any]						={
    "A": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
    "B": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
    "C": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
    "D": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
    "E": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
    "F": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
    "G": ("ABCDEFGHIJKLM", "XYZNOPQRSTUVW"),
    "H": ("ABCDEFGHIJKLM", "XYZNOPQRSTUVW"),
    "I": ("ABCDEFGHIJKLM", "WXYZNOPQRSTUV"),
    "J": ("ABCDEFGHIJKLM", "WXYZNOPQRSTUV"),
    "K": ("ABCDEFGHIJKLM", "VWXYZNOPQRSTU"),
    "L": ("ABCDEFGHIJKLM", "VWXYZNOPQRSTU"),
    "M": ("ABCDEFGHIJKLM", "UVWXYZNOPQRST"),
    "N": ("ABCDEFGHIJKLM", "UVWXYZNOPQRST"),
    "O": ("ABCDEFGHIJKLM", "TUVWXYZNOPQRS"),
    "P": ("ABCDEFGHIJKLM", "TUVWXYZNOPQRS"),
    "Q": ("ABCDEFGHIJKLM", "STUVWXYZNOPQR"),
    "R": ("ABCDEFGHIJKLM", "STUVWXYZNOPQR"),
    "S": ("ABCDEFGHIJKLM", "RSTUVWXYZNOPQ"),
    "T": ("ABCDEFGHIJKLM", "RSTUVWXYZNOPQ"),
    "U": ("ABCDEFGHIJKLM", "QRSTUVWXYZNOP"),
    "V": ("ABCDEFGHIJKLM", "QRSTUVWXYZNOP"),
    "W": ("ABCDEFGHIJKLM", "PQRSTUVWXYZNO"),
    "X": ("ABCDEFGHIJKLM", "PQRSTUVWXYZNO"),
    "Y": ("ABCDEFGHIJKLM", "OPQRSTUVWXYZN"),
    "Z": ("ABCDEFGHIJKLM", "OPQRSTUVWXYZN"),
}


def 							__UpperCAmelCase				(				UpperCamelCase__				:str			)		->						list[tuple[str, str]]:
				return [alphabet[char] for char in key.upper()]


def 							__UpperCAmelCase				(				UpperCamelCase__				:str   ,				UpperCamelCase__				:str			)		->						str:
				snake_case__      :   Tuple      =    ''''''
				snake_case__      :   Optional[Any]      =    0
				snake_case__      :   Optional[int]      =    generate_table(UpperCamelCase__			)
				for char in words.upper():
								cipher += get_opponent(table[count]   ,				UpperCamelCase__			)
								snake_case__      :   Any      =    (count + 1) % len(UpperCamelCase__			)
				return cipher


def 							__UpperCAmelCase				(				UpperCamelCase__				:str   ,				UpperCamelCase__				:str			)		->						str:
				return encrypt(UpperCamelCase__   ,				UpperCamelCase__			)


def 							__UpperCAmelCase				(				UpperCamelCase__				:tuple[str, str]   ,				UpperCamelCase__				:str			)		->						tuple[int, int]:
				snake_case__      :   Dict      =    0 if char in table[0] else 1
				snake_case__      :   List[Any]      =    table[row].index(UpperCamelCase__			)
				return row, col


def 							__UpperCAmelCase				(				UpperCamelCase__				:tuple[str, str]   ,				UpperCamelCase__				:str			)		->						str:
				snake_case__  ,      snake_case__      :   List[str]      =    get_position(UpperCamelCase__   ,				char.upper()			)
				if row == 1:
								return table[0][col]
				else:
								return table[1][col] if row == 0 else char


if __name__ == "__main__":
				import doctest

				doctest.testmod()  # Fist ensure that all our tests are passing...
				_lowercase       :						Optional[Any]						=input("Enter key: ").strip()
				_lowercase       :						Optional[Any]						=input("Enter text to encrypt: ").strip()
				_lowercase       :						Dict						=encrypt(key, text)

				print(F"Encrypted: {cipher_text}")
				print(F"Decrypted with key: {decrypt(key, cipher_text)}")







'''simple docstring'''







from __future__ import annotations

import math
import random






def 					_SCREAMING_SNAKE_CASE		(						snake_case_							,       snake_case_							,       snake_case_	):
	_lowercase							=     d * e - 1
	_lowercase							=     0
	_lowercase							=     0
	while p == 0:
		_lowercase							=     random.randint(2							,       n - 1	)
		_lowercase							=     k
		while True:
			if t % 2 == 0:
				_lowercase							=     t // 2
				_lowercase							=     (g**t) % n
				_lowercase							=     math.gcd(x - 1							,       snake_case_	)
				if x > 1 and y > 1:
					_lowercase							=     y
					_lowercase							=     n // y
					break  # find the correct factors
			else:
				break  # t is not divisible by 2, break and choose another g
	return sorted([p, q]	)


if __name__ == "__main__":
							import doctest

							doctest.testmod()




