Skip to content

Commit

Permalink
small edit
Browse files Browse the repository at this point in the history
  • Loading branch information
s0phialiu committed Mar 18, 2024
1 parent 98baaf4 commit 094e48c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
1 change: 1 addition & 0 deletions chals/crypto/safe_cracking/challenge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions chals/crypto/safe_cracking/note.txt
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 2 additions & 18 deletions chals/crypto/safe_cracking/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 094e48c

Please sign in to comment.