Monday, June 3, 2013

Codegate 2013 :: Misc #2 (200 points)

This was the second challenge under the misc category which was worth 200 points. Two files were provided, an encoded key and a source php file. The challenge was to write a decoder function to decode the encoded key.

Contents of source.php:
Several points were gathered from the encoder function:
  1. $enc_tab, an array, comprised of 91 items.
  2. $var1 contained the (shifted) ASCII value of the input character being processed.
  3. $var2 contained the number of bits to be processed.
  4. $var3 contained the working value of $var1.
  5. If $var1 was between 89 and 8191, and $var2 was more than 13, its value would be shifted right by 13 places, otherwise its value would be shifted right by 14 places. 2 characters would be picked from $enc_tab based on the quotient and remainder from the division operation.
With these points in mind, the decoder function was written to be:
Flag captured! 200 points in the bag!! Yay!!!


Cheers,
Braeburn Ladny

No comments:

Post a Comment