Skip to content

Commit

Permalink
Fix and clean stuff up
Browse files Browse the repository at this point in the history
  • Loading branch information
s0phialiu committed Mar 17, 2024
1 parent 54f3e1d commit 24a575f
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion chals/crypto/easy_rsa/challenge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: |-
4. The private exponent d is calculated as the modular multiplicative inverse of e modulo (p-1)x(q-1).
Read more [here](https://en.wikipedia.org/wiki/RSA_(cryptosystem)).
TODO: some description
You're given n and e - can you use that information to decrypt c?
**author**: Sophia
value: 200
Expand Down
6 changes: 3 additions & 3 deletions chals/crypto/easy_rsa/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
p = 70979368125456165107
q = 62874279226076849807
e = 65539
n = p*q #4462776610810429874302099425257433084349
n = p*q # 4462776610810429874302099425257433084349
totn = int(sympy.totient(n))
d = pow(e,-1,totn) #2524360373456480207131100680183211940587
d = pow(e,-1,totn) # 2524360373456480207131100680183211940587

# Generate public and private keys
pubkey = RSA.construct((n,e))
cipher = PKCS1_v1_5.new(pubkey)
priv = RSA.construct((n,e,d))
ciph = PKCS1_v1_5.new(priv)

# Prints encryption for each flag chunk
# Print encryption for each flag chunk
for flag in flags:
ciphertext = cipher.encrypt(flag.encode('utf-8'))
print(ciphertext)
Expand Down
2 changes: 1 addition & 1 deletion chals/crypto/hidden_runes/mysterious_message.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
☉☾♄♄☿! ♀♂ ♃♆♀☾ ♇♅ ♀♆♃♈♉. ♇ ♄♉☽☾ ♅♊♆♋☾ ♆♃♌ ♆♄♊☉♆♍☾♎♅. ♇ ♏♆♃♎ ♎♉ ♈♉ ♎♉ ♅♊♆♋☾ ♉♃☾ ♌♆♂.
♀♂ ♑♆☽♉♐♇♎☾ ♊♄♆♃☾♎♅ ♆♐☾ ♀♆♐♅, ♅♆♎♒♐♃, ♆♃♌ ♊♄♒♎☿. ♇♅ ♊♄♒♎♉ ♆ ♊♄♆♃☾♎? ♇'♀ ♃♉♎ ♅♒♐☾.
♇ ♏♆♃♎ ♎♉ ♄♇☽☾ ♇♃ ♅♊♆♋☾ ♉♃☾ ♌♆♂. ♇♑ ♇ ☉♆♌ ♎♉ ♋☉☿☿♅☾ ♆ ♊♄♆♃☾♎ ♎♉ ♄♇☽☾ ♉♃, ♇♎ ♏♉♒♄♌ ♍☾ ♀♆♐♅.
♅♇♈♊♏♃♂{♆♄♊☉♆♍☾♎♅_♆♌_♅♊♆♋☾_♆♌_♀♆♐♅_♆♐☾_☽☾♐♂_♑♒♃}
♅♇♈♊♏♃♂{♆♄♊☉♆♍☾♎♅_♆♌_♅♊♆♋☾_♆♌_♀♆♐♅_♆♐☾_☽☾♐♂_♑♒♃}
4 changes: 2 additions & 2 deletions chals/crypto/hidden_runes/solution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Key:

Decoded message:
Hello! My name is Mango. I love space and alphabets. I want to go to space one day.
My favorite planets are Mars, Saturn, and Pluto. Is Pluto a planet? I am not sure.
I also want to live in space one day. If I had to choose a planet to live on, it would be Mars.
My favorite planets are Mars, Saturn, and Pluto. Is Pluto a planet? I'm not sure.
I want to live in space one day. If I had to choose a planet to live on, it would be Mars.
sigpwny{alphabets_and_space_and_mars_are_very_fun}
2 changes: 1 addition & 1 deletion chals/crypto/password_cracking/challenge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extra:
decay: 50
minimum: 50
flags:
- sigpwny{code_br3aker_!}
- sigpwny{cr@ckitnow!26}
files:
- hash.txt
- wordlist.txt
Expand Down
2 changes: 1 addition & 1 deletion chals/crypto/password_cracking/flag.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sigpwny{code_br3aker_!}
sigpwny{cr@ckitnow!26}
2 changes: 1 addition & 1 deletion chals/crypto/password_cracking/hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b9f332efc78f678927bd0fa4b6f8873dfa1555fe171edc7240290f02b375b88a
0cdff644b9d8feff203b4eaa55d280de2d5a0aa9444152394b0ac560151bdc75
6 changes: 3 additions & 3 deletions chals/crypto/safe_cracking/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ def prompt():

def print_notes():
print("\nHints to help me remember the combination to my safe (since I always forget it).")
print("The shared key of each problem corresponds to one part of the safe combination.")
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. However, we know the following:\n\tTheir shared secret key, s, is equal to 605790.\n\tThe values of p and g are 3042161 and 5, respectively.\n\tThe result of Beatrice's private key is 73.\n")
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 {y/n}: ")
view_notes = input("View notes? If yes, enter 'y' ")

if (view_notes == "y"):
print_notes()
Expand Down
2 changes: 1 addition & 1 deletion chals/crypto/safe_cracking/sol.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

p = 3042161
b = 73
shared_secret = 605790
shared_secret = 2417097

def find_base(p, b, shared_secret):
for base in range(1, p):
Expand Down
2 changes: 1 addition & 1 deletion chals/crypto/seal_trouble_1/chal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ def encrypt(message, key):
return bytes([b ^ key[i % len(key)] for i, b in enumerate(message)])

def main():
passphrase = input("Enter secret key: ")
passphrase = input("Enter secret key: ") # Your first task is to figure out what secret key was chosen
key = [ord(char) for char in passphrase]
message = b"sigpwny{not_the_real_flag}"

Expand Down
4 changes: 2 additions & 2 deletions chals/crypto/seal_trouble_2/challenge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ description: |-
Can you help us recover his passphrase and use that to decrypt the message?
**author**: Sophia
value: 150
value: 200
type: dynamic
tags:
- easy
extra:
initial: 150
initial: 200
decay: 50
minimum: 50
flags:
Expand Down

0 comments on commit 24a575f

Please sign in to comment.