Skip to content

Commit 4817902

Browse files
github-actions[bot]cclausspre-commit-ci[bot]
authored
chore: refresh Hacktoberfest 2026 prep tracker (#15476)
* chore: refresh Hacktoberfest 2026 prep tracker * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updating DIRECTORY.md --------- Co-authored-by: cclauss <cclauss@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
1 parent 157c73d commit 4817902

3 files changed

Lines changed: 164 additions & 164 deletions

File tree

‎DIRECTORY.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,6 @@
14791479
* [Sol1](project_euler/problem_800/sol1.py)
14801480

14811481
## [Quantum](quantum)
1482-
* [Q Fourier Transform](quantum/q_fourier_transform.py)
14831482
* [Shor Algorithm](quantum/shor_algorithm.py)
14841483

14851484
## [Scheduling](scheduling)

‎ciphers/des_ecb.py‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -537,21 +537,22 @@ def decrypt(key: str, cipher_text: str) -> str:
537537
if mode not in ["e", "d", "k", "q"]:
538538
print("Invalid option. Please try again.")
539539
continue
540-
if mode == "q":
541-
break
542-
elif mode == "k":
543-
print(f"Generated key: {Des.generate_key()}")
544-
elif mode == "e":
545-
key = input("Enter the key: ").strip()
546-
if len(key) != 16 and not all(char in "0123456789abcdef" for char in key):
547-
print("Invalid key. Please try again.")
548-
continue
549-
input_string = input("Enter the string to encrypt: ").strip()
550-
print(f"Encrypted string: {Des.encrypt(key, input_string)}")
551-
elif mode == "d":
552-
key = input("Enter the key: ").strip()
553-
if len(key) != 16 and not all(char in "0123456789abcdef" for char in key):
554-
print("Invalid key. Please try again.")
555-
continue
556-
cipher_text = input("Enter the cipher text to decrypt: ").strip()
557-
print(f"Decrypted string: {Des.decrypt(key, cipher_text)}")
540+
match mode:
541+
case "q":
542+
break
543+
case "k":
544+
print(f"Generated key: {Des.generate_key()}")
545+
case "e":
546+
key = input("Enter the key: ").strip()
547+
if len(key) != 16 and not all(char in "0123456789abcdef" for char in key):
548+
print("Invalid key. Please try again.")
549+
continue
550+
input_string = input("Enter the string to encrypt: ").strip()
551+
print(f"Encrypted string: {Des.encrypt(key, input_string)}")
552+
case "d":
553+
key = input("Enter the key: ").strip()
554+
if len(key) != 16 and not all(char in "0123456789abcdef" for char in key):
555+
print("Invalid key. Please try again.")
556+
continue
557+
cipher_text = input("Enter the cipher text to decrypt: ").strip()
558+
print(f"Decrypted string: {Des.decrypt(key, cipher_text)}")

0 commit comments

Comments
 (0)