File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments