Skip to main content

Overview

Another “Input secret” form. The “View sourcecode” link reveals the PHP — including the encoded secret and the function used to encode it.

Hints

The source shows $encodedSecret (the target value) and the encodeSecret() function that transforms input before comparison. Read the function carefully — what three operations does it apply, and in what order?
The encoding order is: base64_encodestrrevbin2hex. To recover the original secret, apply the inverse operations in reverse order:
  1. Hex decode the stored value
  2. Reverse the resulting string
  3. Base64 decode
A tool like CyberChef lets you chain these operations visually.

Solution

1

Start with the encoded secret

2

Step 1 — Hex decode

Decode the hex string:
The == at the start is a giveaway that this is a reversed Base64 string (padding normally appears at the end).
3

Step 2 — Reverse the string

Reverse ==QcCtmMml1ViV3b:
4

Step 3 — Base64 decode

Decode b3ViV1lmMmtCcQ==:
This is the secret.
5

Submit

Enter oubWYf2kBq in the form and submit.

With curl

Password