MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / __init__

Method __init__

ciphers/hill_cipher.py:63–70  ·  view source on GitHub ↗

encrypt_key is an NxN numpy matrix

(self, encrypt_key)

Source from the content-addressed store, hash-verified

61 toInt = numpy.vectorize(lambda x: round(x))
62
63 def __init__(self, encrypt_key):
64 """
65 encrypt_key is an NxN numpy matrix
66 """
67 self.encrypt_key = self.modulus(encrypt_key) # mod36 calc's on the encrypt key
68 self.checkDeterminant() # validate the determinant of the encryption key
69 self.decrypt_key = None
70 self.break_key = encrypt_key.shape[0]
71
72 def checkDeterminant(self):
73 det = round(numpy.linalg.det(self.encrypt_key))

Callers

nothing calls this directly

Calls 1

checkDeterminantMethod · 0.95

Tested by

no test coverage detected