(self)
| 70 | self.break_key = encrypt_key.shape[0] |
| 71 | |
| 72 | def checkDeterminant(self): |
| 73 | det = round(numpy.linalg.det(self.encrypt_key)) |
| 74 | |
| 75 | if det < 0: |
| 76 | det = det % len(self.key_string) |
| 77 | |
| 78 | req_l = len(self.key_string) |
| 79 | if gcd(det, len(self.key_string)) != 1: |
| 80 | raise ValueError("discriminant modular {0} of encryption key({1}) is not co prime w.r.t {2}.\nTry another key.".format(req_l, det, req_l)) |
| 81 | |
| 82 | def processText(self, text): |
| 83 | text = list(text.upper()) |