()
| 191 | |
| 192 | |
| 193 | def main() -> None: |
| 194 | n = int(input("Enter the order of the encryption key: ")) |
| 195 | hill_matrix = [] |
| 196 | |
| 197 | print("Enter each row of the encryption key with space separated integers") |
| 198 | for _ in range(n): |
| 199 | row = [int(x) for x in input().split()] |
| 200 | hill_matrix.append(row) |
| 201 | |
| 202 | hc = HillCipher(np.array(hill_matrix)) |
| 203 | |
| 204 | print("Would you like to encrypt or decrypt some text? (1 or 2)") |
| 205 | option = input("\n1. Encrypt\n2. Decrypt\n") |
| 206 | if option == "1": |
| 207 | text_e = input("What text would you like to encrypt?: ") |
| 208 | print("Your encrypted text is:") |
| 209 | print(hc.encrypt(text_e)) |
| 210 | elif option == "2": |
| 211 | text_d = input("What text would you like to decrypt?: ") |
| 212 | print("Your decrypted text is:") |
| 213 | print(hc.decrypt(text_d)) |
| 214 | |
| 215 | |
| 216 | if __name__ == "__main__": |
no test coverage detected