generated from sigpwny/ctf-chal-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
chals/crypto/hidden-runes/challenge.yml → chals/crypto/hidden_runes/challenge.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "Hidden Runes" | ||
name: "XOR 101" | ||
author: Sophia | ||
category: Crypto | ||
description: |- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sigpwny{alphabets_are_very_fun} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sigpwny{code_br3aker_!} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sigpwny{seals_like_x0r} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
07060a110301100806030601001a13301e15151d1d160539052a11440612 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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')) |