MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / message

Function message

projects/hill_cipher/decryption.py:36–57  ·  view source on GitHub ↗
(actual_text)

Source from the content-addressed store, hash-verified

34
35
36def 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
60if __name__ == "__main__":

Callers 1

decryption.pyFile · 0.70

Calls 3

hill_cipherFunction · 0.70
modFunction · 0.70
executeMethod · 0.45

Tested by

no test coverage detected