Skip to content

Commit 8663333

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a3756da commit 8663333

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ciphers/hill_cipher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def encrypt(self, text: str) -> str:
131131
# Convert characters to numerical values
132132
vec = [self.replace_letters(char) for char in batch]
133133
batch_vec = np.array([vec]).T
134-
134+
135135
# Matrix multiplication with encryption key
136136
batch_encrypted = self.modulus(self.encrypt_key.dot(batch_vec)).T.tolist()[
137137
0
@@ -156,7 +156,7 @@ def make_decrypt_key(self) -> np.ndarray:
156156
if det < 0:
157157
det = det % len(self.key_string)
158158
det_inv = None
159-
159+
160160
# Find modular inverse of determinant
161161
for i in range(len(self.key_string)):
162162
if (det * i) % len(self.key_string) == 1:
@@ -189,7 +189,7 @@ def decrypt(self, text: str) -> str:
189189
# Convert characters to numerical values
190190
vec = [self.replace_letters(char) for char in batch]
191191
batch_vec = np.array([vec]).T
192-
192+
193193
# Matrix multiplication with decryption key
194194
batch_decrypted = self.modulus(decrypt_key.dot(batch_vec)).T.tolist()[0]
195195
# Convert numerical results back to characters

0 commit comments

Comments
 (0)