






'''simple docstring'''





import random
from typing import Any







def      snake_case		(							UpperCAmelCase	:       list   ):
				for _ in range(len(UpperCAmelCase   )   ):
								A	 =      random.randint(0,						len(UpperCAmelCase   ) - 1   )
								A	 =      random.randint(0,						len(UpperCAmelCase   ) - 1   )
								A ,		A	 =      data[b], data[a]
				return data


if __name__ == "__main__":
					lowerCAmelCase_           = [0, 1, 2, 3, 4, 5, 6, 7]
					lowerCAmelCase_           = ['python', 'says', 'hello', '!']
					print('Fisher-Yates Shuffle:')
					print('List', integers, strings)
					print('FY Shuffle', fisher_yates_shuffle(integers), fisher_yates_shuffle(strings))













def      snake_case		(							UpperCAmelCase	:       Optional[int],						UpperCAmelCase	:       Union[str, Any]   ):
				A	 =      ''
				for i in table:
								res += inp[i - 1]
				return res







def      snake_case		(							UpperCAmelCase	:       Union[str, Any]   ):
				return data[1:] + data[0]







def      snake_case		(							UpperCAmelCase	:       Union[str, Any],						UpperCAmelCase	:       Dict   ):
				A	 =      ''
				for i in range(len(UpperCAmelCase   )   ):
								if a[i] == b[i]:
												res += "0"
								else:
												res += "1"
				return res







def      snake_case		(							UpperCAmelCase	:       int,						UpperCAmelCase	:       Optional[Any]   ):
				A	 =      int('0b' + data[0] + data[-1],						2   )
				A	 =      int('0b' + data[1:3],						2   )
				return bin(s[row][col]   )[2:]







def      snake_case		(							UpperCAmelCase	:       Optional[Any],						UpperCAmelCase	:       Any,						UpperCAmelCase	:       Union[str, Any],						UpperCAmelCase	:       Optional[Any],						UpperCAmelCase	:       Optional[int]   ):
				A	 =      message[:4]
				A	 =      message[4:]
				A	 =      apply_table(UpperCAmelCase,						UpperCAmelCase   )
				A	 =      xor(UpperCAmelCase,						UpperCAmelCase   )
				A	 =      apply_sbox(UpperCAmelCase,						temp[:4]   )  # noqa: E741
				A	 =      apply_sbox(UpperCAmelCase,						temp[4:]   )
				A	 =      '0' * (2 - len(UpperCAmelCase   )) + l  # noqa: E741
				A	 =      '0' * (2 - len(UpperCAmelCase   )) + r
				A	 =      apply_table(l + r,						UpperCAmelCase   )
				A	 =      xor(UpperCAmelCase,						UpperCAmelCase   )
				return temp + right


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

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

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

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

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





