






from __future__ import annotations

from typing import Any
def   lowerCamelCase      (		*a_			)			->    list[list[int]]:
							if all(_check_not_integer(a_			) for m in matrix_s			):
														for i in matrix_s[1:]:
																					_verify_matrix_sizes(matrix_s[0]				,		a_			)
														return [[sum(a_			) for t in zip(*a_			)] for m in zip(*a_			)]
							raise TypeError('Expected a matrix, got int/list instead'			)
def   lowerCamelCase      (		a_				,		a_			)			->    list[list[int]]:
							if (
							    _check_not_integer(a_			)
							    and _check_not_integer(a_			)
							    and _verify_matrix_sizes(a_				,		a_			)
							):
														return [[i - j for i, j in zip(*a_			)] for m in zip(a_				,		a_			)]
							raise TypeError('Expected a matrix, got int/list instead'			)
def   lowerCamelCase      (		a_				,		a_			)			->    list[list[float]]:
							return [[x * n for x in row] for row in matrix]
def   lowerCamelCase      (		a_				,		a_			)			->    list[list[int]]:
							if _check_not_integer(a_			) and _check_not_integer(a_			):
														lowerCAmelCase_		,     lowerCAmelCase_       		=  _verify_matrix_sizes(a_				,		a_			)

							if cols[0] != rows[1]:
														lowerCAmelCase_       		=  (
														    'Cannot multiply matrix of dimensions '
														    F'''({rows[0]},{cols[0]}) and ({rows[1]},{cols[1]})'''
														)
														raise ValueError(a_			)
							return [
							    [sum(m * n for m, n in zip(a_				,		a_			)			) for j in zip(*a_			)] for i in matrix_a
							]
def   lowerCamelCase      (		a_			)			->    list[list[int]]:
							lowerCAmelCase_       		=  int(a_			)
							return [[int(row == column			) for column in range(a_			)] for row in range(a_			)]
def   lowerCamelCase      (		a_				,		a_ = True			)			->    list[list[int]] | map[list[int]]:
							if _check_not_integer(a_			):
														if return_map:
																					return map(a_				,		zip(*a_			)			)
														else:
																					return list(map(a_				,		zip(*a_			)			)			)
							raise TypeError('Expected a matrix, got int/list instead'			)
def   lowerCamelCase      (		a_				,		a_				,		a_			)			->    list[list[int]]:
							lowerCAmelCase_       		=  matrix[:row] + matrix[row + 1 :]
							return [row[:column] + row[column + 1 :] for row in minor]
def   lowerCamelCase      (		a_			)			->    Any:
							if len(a_			) == 1:
														return matrix[0][0]

							return sum(
							    x * determinant(minor(a_				,		0				,		a_			)			) * (-1) ** i
							    for i, x in enumerate(matrix[0]			)			)
def   lowerCamelCase      (		a_			)			->    list[list[float]] | None:
							lowerCAmelCase_       		=  determinant(a_			)
							if det == 0:
														return None

							lowerCAmelCase_       		=  [
							    [determinant(minor(a_				,		a_				,		a_			)			) for j in range(len(a_			)			)]
							    for i in range(len(a_			)			)
							]

							lowerCAmelCase_       		=  [
							    [x * (-1) ** (row + col) for col, x in enumerate(matrix_minor[row]			)]
							    for row in range(len(a_			)			)
							]
							lowerCAmelCase_       		=  list(transpose(a_			)			)
							return scalar_multiply(a_				,		1 / det			)
def   lowerCamelCase      (		a_			)			->    bool:
							return not isinstance(a_				,		a_			) and not isinstance(matrix[0]				,		a_			)
def   lowerCamelCase      (		a_			)			->    tuple[int, int]:
							return len(a_			), len(matrix[0]			)
def   lowerCamelCase      (		a_				,		a_			)			->    tuple[tuple[int, int], tuple[int, int]]:
							lowerCAmelCase_       		=  _shape(a_			) + _shape(a_			)
							if shape[0] != shape[3] or shape[1] != shape[2]:
														lowerCAmelCase_       		=  (
														    'operands could not be broadcast together with shape '
														    F'''({shape[0], shape[1]}), ({shape[2], shape[3]})'''
														)
														raise ValueError(a_			)
							return (shape[0], shape[2]), (shape[1], shape[3])
def   lowerCamelCase      (		)			->    None:
							lowerCAmelCase_       		=  [[12, 10], [3, 9]]
							lowerCAmelCase_       		=  [[3, 4], [7, 4]]
							lowerCAmelCase_       		=  [[11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34], [41, 42, 43, 44]]
							lowerCAmelCase_       		=  [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
							print(F'''Add Operation, {add(a_				,		a_			) = } \n'''			)
							print(
							    F'''Multiply Operation, {multiply(a_				,		a_			) = } \n'''				,		)
							print(F'''Identity: {identity(5			)}\n'''			)
							print(F'''Minor of {matrix_c} = {minor(a_				,		1				,		2			)} \n'''			)
							print(F'''Determinant of {matrix_b} = {determinant(a_			)} \n'''			)
							print(F'''Inverse of {matrix_d} = {inverse(a_			)}\n'''			)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		main()











from __future__ import annotations

from string import ascii_letters
def   lowerCamelCase      (		a_				,		a_				,		a_ = None			)			->    str:
							lowerCAmelCase_       		=  alphabet or ascii_letters

							# The final result string
							lowerCAmelCase_       		=  ''

							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
																					lowerCAmelCase_       		=  (alpha.index(a_			) + key) % len(a_			)

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

							return result
def   lowerCamelCase      (		a_				,		a_				,		a_ = None			)			->    str:
							key *= -1

							return encrypt(a_				,		a_				,		a_			)
def   lowerCamelCase      (		a_				,		a_ = None			)			->    dict[int, str]:
							lowerCAmelCase_       		=  alphabet or ascii_letters

							# To store data on all the combinations
							lowerCAmelCase_       		=  {}

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

							return brute_force_data


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

				# get user input
				lowerCamelCase_		  =						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":
						lowerCamelCase_		  =						input("""Please enter the string to be encrypted: """)
						lowerCamelCase_		  =						int(input("""Please enter off-set: """).strip())

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

						print(decrypt(input_string, key))
				elif choice == "3":
						lowerCamelCase_		  =						input("""Please enter the string to be decrypted: """)
						lowerCamelCase_		  =						brute_force(input_string)

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

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



