Skip to content

Commit 260613c

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

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎ciphers/des_ecb.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,18 @@ def decrypt(key: str, cipher_text: str) -> str:
544544
print(f"Generated key: {Des.generate_key()}")
545545
case "e":
546546
key = input("Enter the key: ").strip()
547-
if len(key) != 16 and not all(char in "0123456789abcdef" for char in key):
547+
if len(key) != 16 and not all(
548+
char in "0123456789abcdef" for char in key
549+
):
548550
print("Invalid key. Please try again.")
549551
continue
550552
input_string = input("Enter the string to encrypt: ").strip()
551553
print(f"Encrypted string: {Des.encrypt(key, input_string)}")
552554
case "d":
553555
key = input("Enter the key: ").strip()
554-
if len(key) != 16 and not all(char in "0123456789abcdef" for char in key):
556+
if len(key) != 16 and not all(
557+
char in "0123456789abcdef" for char in key
558+
):
555559
print("Invalid key. Please try again.")
556560
continue
557561
cipher_text = input("Enter the cipher text to decrypt: ").strip()

0 commit comments

Comments
 (0)