diff --git a/chals/crypto/hidden-runes/challenge.yml b/chals/crypto/hidden_runes/challenge.yml similarity index 96% rename from chals/crypto/hidden-runes/challenge.yml rename to chals/crypto/hidden_runes/challenge.yml index 514faeb..4d43091 100644 --- a/chals/crypto/hidden-runes/challenge.yml +++ b/chals/crypto/hidden_runes/challenge.yml @@ -1,4 +1,4 @@ -name: "Hidden Runes" +name: "XOR 101" author: Sophia category: Crypto description: |- diff --git a/chals/crypto/hidden_runes/flag.txt b/chals/crypto/hidden_runes/flag.txt new file mode 100644 index 0000000..172a94c --- /dev/null +++ b/chals/crypto/hidden_runes/flag.txt @@ -0,0 +1 @@ +sigpwny{alphabets_are_very_fun} \ No newline at end of file diff --git a/chals/crypto/hidden-runes/mysterious_message.txt b/chals/crypto/hidden_runes/mysterious_message.txt similarity index 100% rename from chals/crypto/hidden-runes/mysterious_message.txt rename to chals/crypto/hidden_runes/mysterious_message.txt diff --git a/chals/crypto/hidden-runes/solution.txt b/chals/crypto/hidden_runes/solution.txt similarity index 100% rename from chals/crypto/hidden-runes/solution.txt rename to chals/crypto/hidden_runes/solution.txt diff --git a/chals/crypto/password-cracking/challenge.yml b/chals/crypto/password_cracking/challenge.yml similarity index 100% rename from chals/crypto/password-cracking/challenge.yml rename to chals/crypto/password_cracking/challenge.yml diff --git a/chals/crypto/password_cracking/flag.txt b/chals/crypto/password_cracking/flag.txt new file mode 100644 index 0000000..f36502f --- /dev/null +++ b/chals/crypto/password_cracking/flag.txt @@ -0,0 +1 @@ +sigpwny{code_br3aker_!} \ No newline at end of file diff --git a/chals/crypto/password-cracking/hash.txt b/chals/crypto/password_cracking/hash.txt similarity index 100% rename from chals/crypto/password-cracking/hash.txt rename to chals/crypto/password_cracking/hash.txt diff --git a/chals/crypto/password-cracking/solution.sh b/chals/crypto/password_cracking/solution.sh similarity index 100% rename from chals/crypto/password-cracking/solution.sh rename to chals/crypto/password_cracking/solution.sh diff --git a/chals/crypto/password-cracking/wordlist.txt b/chals/crypto/password_cracking/wordlist.txt similarity index 100% rename from chals/crypto/password-cracking/wordlist.txt rename to chals/crypto/password_cracking/wordlist.txt diff --git a/chals/crypto/xor_101/chal.py b/chals/crypto/xor_101/chal.py new file mode 100644 index 0000000..cc402cd --- /dev/null +++ b/chals/crypto/xor_101/chal.py @@ -0,0 +1,14 @@ +def encrypt(message, key): + return bytes([b ^ key[i % len(key)] for i, b in enumerate(message)]) + +def main(): + passphrase = input("Enter passphrase: ") + key = [ord(char) for char in passphrase] + message = b"sigpwny{fake_flag}" + + # Encrypt + ciphertext = encrypt(message, key) + print("Encrypted message:", ciphertext.hex()) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/chals/crypto/xor_101/challenge.yml b/chals/crypto/xor_101/challenge.yml new file mode 100644 index 0000000..2c16ad1 --- /dev/null +++ b/chals/crypto/xor_101/challenge.yml @@ -0,0 +1,26 @@ +name: "XOR 101" +author: Sophia +category: Crypto +description: |- + Breaking news: Seals have reached a new level of intelligence and can now create their own XOR challenges. + One left a comment on a photo of themself. Can you use that to discover the flag? + + **author**: Sophia +value: 150 +type: dynamic +tags: + - easy +extra: + initial: 150 + decay: 125 + minimum: 100 +flags: + - sigpwny{seals_like_x0r} +files: + - message.txt + - chal.py + - seal1.png +hints: + - Can you use information from the seal photo to decrypt the message? + - Exiftool is helpful. +state: hidden diff --git a/chals/crypto/xor_101/flag.txt b/chals/crypto/xor_101/flag.txt new file mode 100644 index 0000000..9dce13f --- /dev/null +++ b/chals/crypto/xor_101/flag.txt @@ -0,0 +1 @@ +sigpwny{seals_like_x0r} \ No newline at end of file diff --git a/chals/crypto/xor_101/message.txt b/chals/crypto/xor_101/message.txt new file mode 100644 index 0000000..b213103 --- /dev/null +++ b/chals/crypto/xor_101/message.txt @@ -0,0 +1 @@ +07060a110301100806030601001a13301e15151d1d160539052a11440612 \ No newline at end of file diff --git a/chals/crypto/xor_101/seal1.png b/chals/crypto/xor_101/seal1.png new file mode 100644 index 0000000..5b925eb Binary files /dev/null and b/chals/crypto/xor_101/seal1.png differ diff --git a/chals/crypto/xor_101/sol.py b/chals/crypto/xor_101/sol.py new file mode 100644 index 0000000..e9642b6 --- /dev/null +++ b/chals/crypto/xor_101/sol.py @@ -0,0 +1,18 @@ +# Step 1: Inspect "comment" tag in metadata for passphrase (ex: exiftool seal1.png) +passphrase = "tomatoisafruit" + +# Step 2: +def decrypt(ciphertext, key): + return bytes([b ^ key[i % len(key)] for i, b in enumerate(ciphertext)]) + +# Provided from message.txt +input = "07060a110301100806030601001a13301e15151d1d160539052a11440612" + +# Convert hexadecimal string to bytes +b_input = bytes.fromhex(input) + +# Use key to decrypt +key = [ord(char) for char in passphrase] +output = decrypt(b_input, key) + +print("Flag:", output.decode('utf-8'))