From 094e48c8f0c87eb50d5247883b1af1356d656185 Mon Sep 17 00:00:00 2001 From: Sophia Liu Date: Sun, 17 Mar 2024 22:24:31 -0500 Subject: [PATCH] small edit --- chals/crypto/safe_cracking/challenge.yml | 1 + chals/crypto/safe_cracking/note.txt | 11 +++++++++++ chals/crypto/safe_cracking/server.py | 20 ++------------------ 3 files changed, 14 insertions(+), 18 deletions(-) create mode 100644 chals/crypto/safe_cracking/note.txt diff --git a/chals/crypto/safe_cracking/challenge.yml b/chals/crypto/safe_cracking/challenge.yml index 0333d2c..4913542 100644 --- a/chals/crypto/safe_cracking/challenge.yml +++ b/chals/crypto/safe_cracking/challenge.yml @@ -19,6 +19,7 @@ extra: flags: - sigpwny{is_this_r3@lly_the_m0st_s3cure_s@f3_3ver?} files: + - note.txt hints: - Look up how to perform a Diffie-Hellman key exchange. state: hidden diff --git a/chals/crypto/safe_cracking/note.txt b/chals/crypto/safe_cracking/note.txt new file mode 100644 index 0000000..bd91af0 --- /dev/null +++ b/chals/crypto/safe_cracking/note.txt @@ -0,0 +1,11 @@ +Hints to help me remember the combination to my safe (since I always forget it): +Note that the answer to each problem corresponds to one part of the safe combination. + +1. Anna and Beatrice perform a Diffie-Hellman key exchange where p = 17 and g = 3. + Privately, Anna selects 5 and Beatrice chooses 11. What's their shared secret key? +2. The two perform another key exchange. Now, p = 157 and g = 2. + Anna's new private key is 67, while Beatrice's public key is 73. What is Anna's public key? +3. Anna forgot her private key and wants to solve for it. We know the following: + a. Their shared secret key, s, is equal to 2417097. + b. The values of p and g are 3042161 and 5, respectively. + c. Beatrice's private key is 73. \ No newline at end of file diff --git a/chals/crypto/safe_cracking/server.py b/chals/crypto/safe_cracking/server.py index 23efaed..3801aca 100644 --- a/chals/crypto/safe_cracking/server.py +++ b/chals/crypto/safe_cracking/server.py @@ -14,27 +14,11 @@ def prompt(): print("Please enter a number.") return False return True - -def print_notes(): - print("\nHints to help me remember the combination to my safe (since I always forget it).") - print("The answer to each problem corresponds to one part of the safe combination.") - print("1. Anna and Beatrice perform a Diffie-Hellman key exchange where p = 17 and g = 3. Privately, Anna selects 5 and Beatrice chooses 11. What's their shared secret key?") - print("2. The two perform another key exchange. Now, p = 157 and g = 2. Anna's new private key is 67, while Beatrice's public key is 73. What is Anna's public key?") - print("3. Anna forgot her private key and wants to solve for it. We know the following:\n\tTheir shared secret key, s, is equal to 2417097.\n\tThe values of p and g are 3042161 and 5, respectively.\n\tBeatrice's private key is 73.\n") - print("Get ready to start guessing!") - time.sleep(1) def main(): print("Welcome to my extremely secure safe!") - print("Note to self: Just in case I forget the combination, here's a note that reminds me how to remember it.") - view_notes = input("View notes? If yes, enter 'y' ") - - if (view_notes == "y"): - print_notes() - else: - print("Might want to view the notes...") - time.sleep(1) - print("Get ready to start guessing!") + time.sleep(1) + print("Get ready to start guessing!") if prompt(): print("You have unlocked the safe! Please don't take anything except for this flag:", FLAG) else: