We see that this code performs the "encodeSecret" function on our input, and compares it with the already encoded $encodedSecret variable. Therefore, we can perform the inverse of the encodeSecret function on our already encoded secret value to obtain the original value.

There are a couple of things to note:

We must do the operations in reverse order since this is the inverse function.

The hex2bin function is only available in PHP >= 5.4.0. Since I had a Backtrack R3 instance available that had PHP 5.3.2, I had to resort to the documentation to find the alternative: pack ("H*", $str)