(actual_text)
| 34 | |
| 35 | |
| 36 | def message(actual_text): |
| 37 | HillCipherText = " " |
| 38 | sect = [] |
| 39 | matrix = [] |
| 40 | for i in range(3): |
| 41 | sect.append(actual_text[i]) |
| 42 | for i in range(3): |
| 43 | cur.execute(f"select lid from loalpha where lchar = '{sect[i]}'") |
| 44 | l = cur.fetchone() |
| 45 | for i in l: |
| 46 | matrix.append(i) |
| 47 | l = [4, 15, 24, 9, 17, 0, 15, 6, 17] |
| 48 | h = hill_cipher(matrix, l) |
| 49 | |
| 50 | for i in h: |
| 51 | r = mod(i) |
| 52 | cur.execute(f"select lchar from loalpha where lid = {r + 1}") |
| 53 | t = cur.fetchone() |
| 54 | |
| 55 | HillCipherText += t[0] |
| 56 | |
| 57 | return HillCipherText |
| 58 | |
| 59 | |
| 60 | if __name__ == "__main__": |
no test coverage detected