






def    __magic_name__    (	SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				)     ->    Any:
							_lowercase							:   List[Any] 							=   """"""
							for i in table:
														res += inp[i - 1]
							return res






def    __magic_name__    (	SCREAMING_SNAKE_CASE				)     ->    Any:
							return data[1:] + data[0]






def    __magic_name__    (	SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				)     ->    List[Any]:
							_lowercase							:   Union[str, Any] 							=   """"""
							for i in range(len(SCREAMING_SNAKE_CASE				)				):
														if a[i] == b[i]:
																					res += "0"
														else:
																					res += "1"
							return res






def    __magic_name__    (	SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				)     ->    Optional[Any]:
							_lowercase							:   Optional[int] 							=   int('0b' + data[0] + data[-1]     ,     2				)
							_lowercase							:   Any 							=   int('0b' + data[1:3]     ,     2				)
							return bin(s[row][col]				)[2:]






def    __magic_name__    (	SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				)     ->    List[str]:
							_lowercase							:   Any 							=   message[:4]
							_lowercase							:   int 							=   message[4:]
							_lowercase							:   int 							=   apply_table(SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				)
							_lowercase							:   str 							=   xor(SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				)
							_lowercase							:   Union[str, Any] 							=   apply_sbox(SCREAMING_SNAKE_CASE     ,     temp[:4]				)  # noqa: E741
							_lowercase							:   str 							=   apply_sbox(SCREAMING_SNAKE_CASE     ,     temp[4:]				)
							_lowercase							:   Union[str, Any] 							=   """0""" * (2 - len(SCREAMING_SNAKE_CASE				)) + l  # noqa: E741
							_lowercase							:   Union[str, Any] 							=   """0""" * (2 - len(SCREAMING_SNAKE_CASE				)) + r
							_lowercase							:   int 							=   apply_table(l + r     ,     SCREAMING_SNAKE_CASE				)
							_lowercase							:   int 							=   xor(SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				)
							return temp + right


if __name__ == "__main__":
							UpperCamelCase								=		input("Enter 10 bit key: ")
							UpperCamelCase								=		input("Enter 8 bit message: ")

							UpperCamelCase								=		[6, 3, 7, 4, 8, 5, 10, 9]
							UpperCamelCase								=		[3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
							UpperCamelCase								=		[2, 4, 3, 1]
							UpperCamelCase								=		[2, 6, 3, 1, 4, 8, 5, 7]
							UpperCamelCase								=		[4, 1, 3, 5, 7, 2, 8, 6]
							UpperCamelCase								=		[4, 1, 2, 3, 2, 3, 4, 1]
							UpperCamelCase								=		[[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
							UpperCamelCase								=		[[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

							# key generation
							UpperCamelCase								=		apply_table(key, paa_table)
							UpperCamelCase								=		temp[:5]
							UpperCamelCase								=		temp[5:]
							UpperCamelCase								=		left_shift(left)
							UpperCamelCase								=		left_shift(right)
							UpperCamelCase								=		apply_table(left + right, pa_table)
							UpperCamelCase								=		left_shift(left)
							UpperCamelCase								=		left_shift(right)
							UpperCamelCase								=		left_shift(left)
							UpperCamelCase								=		left_shift(right)
							UpperCamelCase								=		apply_table(left + right, pa_table)

							# encryption
							UpperCamelCase								=		apply_table(message, IP)
							UpperCamelCase								=		function(expansion, sa, sa, keya, temp)
							UpperCamelCase								=		temp[4:] + temp[:4]
							UpperCamelCase								=		function(expansion, sa, sa, keya, temp)
							UpperCamelCase								=		apply_table(temp, IP_inv)
							print("Cipher text is:", CT)

							# decryption
							UpperCamelCase								=		apply_table(CT, IP)
							UpperCamelCase								=		function(expansion, sa, sa, keya, temp)
							UpperCamelCase								=		temp[4:] + temp[:4]
							UpperCamelCase								=		function(expansion, sa, sa, keya, temp)
							UpperCamelCase								=		apply_table(temp, IP_inv)
							print("Plain text after decypting is:", PT)











"""simple docstring"""


def      UpperCamelCase							(SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE     ):
						UpperCamelCase				:		List[Any]				   =			""""""
						for i in table:
												res += inp[i - 1]
						return res

def      UpperCamelCase							(SCREAMING_SNAKE_CASE     ):
						return data[1:] + data[0]

def      UpperCamelCase							(SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE     ):
						UpperCamelCase				:		Union[str, Any]				   =			""""""
						for i in range(len(SCREAMING_SNAKE_CASE     )     ):
												if a[i] == b[i]:
																		res += "0"
												else:
																		res += "1"
						return res

def      UpperCamelCase							(SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE     ):
						UpperCamelCase				:		Optional[int]				   =			int("""0b""" + data[0] + data[-1]							,     2     )
						UpperCamelCase				:		Any				   =			int("""0b""" + data[1:3]							,     2     )
						return bin(s[row][col]     )[2:]

def      UpperCamelCase							(SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE     ):
						UpperCamelCase				:		Any				   =			message[:4]
						UpperCamelCase				:		int				   =			message[4:]
						UpperCamelCase				:		int				   =			apply_table(SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE     )
						UpperCamelCase				:		str				   =			xor(SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE     )
						UpperCamelCase				:		Union[str, Any]				   =			apply_sbox(SCREAMING_SNAKE_CASE							,     temp[:4]     )  # noqa: E741
						UpperCamelCase				:		str				   =			apply_sbox(SCREAMING_SNAKE_CASE							,     temp[4:]     )
						UpperCamelCase				:		Union[str, Any]				   =			"""0""" * (2 - len(SCREAMING_SNAKE_CASE     )) + l  # noqa: E741
						UpperCamelCase				:		Union[str, Any]				   =			"""0""" * (2 - len(SCREAMING_SNAKE_CASE     )) + r
						UpperCamelCase				:		int				   =			apply_table(l + r							,     SCREAMING_SNAKE_CASE     )
						UpperCamelCase				:		int				   =			xor(SCREAMING_SNAKE_CASE							,     SCREAMING_SNAKE_CASE     )
						return temp + right


if __name__ == "__main__":
		__magic_name__       :					Union[str, Any]						=			input("""Enter 10 bit key: """)
		__magic_name__       :					Union[str, Any]						=			input("""Enter 8 bit message: """)

		__magic_name__       :					Dict						=			[6, 3, 7, 4, 8, 5, 1_0, 9]
		__magic_name__       :					str						=			[3, 5, 2, 7, 4, 1_0, 1, 9, 8, 6]
		__magic_name__       :					Optional[Any]						=			[2, 4, 3, 1]
		__magic_name__       :					Tuple						=			[2, 6, 3, 1, 4, 8, 5, 7]
		__magic_name__       :					str						=			[4, 1, 3, 5, 7, 2, 8, 6]
		__magic_name__       :					str						=			[4, 1, 2, 3, 2, 3, 4, 1]
		__magic_name__       :					Any						=			[[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
		__magic_name__       :					Any						=			[[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

		# key generation
		__magic_name__       :					Dict						=			apply_table(key, paa_table)
		__magic_name__       :					Union[str, Any]						=			temp[:5]
		__magic_name__       :					Optional[Any]						=			temp[5:]
		__magic_name__       :					str						=			left_shift(left)
		__magic_name__       :					List[str]						=			left_shift(right)
		__magic_name__       :					Tuple						=			apply_table(left + right, pa_table)
		__magic_name__       :					Dict						=			left_shift(left)
		__magic_name__       :					Union[str, Any]						=			left_shift(right)
		__magic_name__       :					List[Any]						=			left_shift(left)
		__magic_name__       :					str						=			left_shift(right)
		__magic_name__       :					List[str]						=			apply_table(left + right, pa_table)

		# encryption
		__magic_name__       :					List[str]						=			apply_table(message, IP)
		__magic_name__       :					str						=			function(expansion, sa, sa, keya, temp)
		__magic_name__       :					str						=			temp[4:] + temp[:4]
		__magic_name__       :					Optional[Any]						=			function(expansion, sa, sa, keya, temp)
		__magic_name__       :					Any						=			apply_table(temp, IP_inv)
		print("""Cipher text is:""", CT)

		# decryption
		__magic_name__       :					Tuple						=			apply_table(CT, IP)
		__magic_name__       :					List[str]						=			function(expansion, sa, sa, keya, temp)
		__magic_name__       :					Dict						=			temp[4:] + temp[:4]
		__magic_name__       :					int						=			function(expansion, sa, sa, keya, temp)
		__magic_name__       :					Any						=			apply_table(temp, IP_inv)
		print("""Plain text after decypting is:""", PT)



