Hidden Cipher 2

Published: March 20, 2026

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

  1. Step 1Solve the math problem
    The program presents a math question. Solving it correctly produces a number, which is then used as the decryption key for the hidden cipher.
    ./binary
    cat problem.txt
  2. Step 2Use the math answer as the cipher key
    The 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.py
    cat source.c
  3. Step 3Decrypt the ciphertext with the derived key
    Apply 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.