Description
The flag is hidden behind a simple math prompt and one more decoding step. Download `hiddencipher2.zip`, solve the prompt, and trace how the answer becomes the key.
Download and extract hiddencipher2.zip.
Read the source or run the program -- it presents a math problem first.
unzip hiddencipher2.zip
cat *
./binary
Solution
- Step 1Solve the math problemThe program presents a math question. Solving it correctly produces a number, which is then used as the decryption key for the hidden cipher../binarycat problem.txt
- Step 2Use the math answer as the cipher keyThe answer to the math problem becomes the key (e.g. XOR key, Caesar shift amount, or AES key seed). Read the source to understand how the answer maps to a key.cat source.pycat source.c
- Step 3Decrypt the ciphertext with the derived keyApply the cipher to the ciphertext using the key derived from the math answer.python3 << 'EOF' math_answer = 42 # replace with actual answer # If the key is math_answer itself or derived from it: key = math_answer # or bytes([math_answer % 256]) etc. ct = bytes.fromhex("CIPHERTEXT_HEX") pt = bytes(c ^ key for c in ct) print(pt.decode()) EOF
Flag
picoCTF{h1dd3n_c1ph3r_2_...}
The math problem's answer serves as the decryption key -- solve the math, use the answer to decrypt.