Hackfu Challenge 2015 - Solution for Challenge 1

Overview

MWR ran a Security Challenge last April, unfortunately I only found out about it 3 days before the deadline! I still managed to solve 3 out of the 7 challenges and really enjoyed them.

The first challenge was especially interesting, as I like cryptography. This was a tough one!!!

Challenge Instructions

  • You are invited to a game of Poker but must find the password.
  • You find a note with written "Pocket RC4"
  • You find a deck of cards ordered from Ace to King with the following "couple" suits: {Diamond, Club}, {Heart and Spade}. This means AD, AC, 2D, 2C....KH, KS
  • You find a note with the following written on it: "WEMUSTFOLLOWTHEWHITERABBITANHXJRAAZEBYYOMNWPBKGZOGY"

Solution

That's pretty much it! Below is how I solved this challenge and cracked the code:

I used information on PocketRC4 from:

  • HERE
  • HERE to recreate the cipher in a shell script.

Script Explanation

  1. Set IV to “WEMUSTFOLLOWTHEWHITERABBIT"
  2. Convert each IV letter to a numerical value (A=1, ..., Z=26)
  3. Create a deck of cards with pairs of red/black card values:
    • Low values range from 1 to 13 and high values range from 14 to 26.
    • From the instructions provided, the suits order from the rules of poker (Low to High: CDHS) applies.
  4. Initialize deck with IV:
    • Take the value of the first letter from the IV and search for that letter value in the deck.
  5. Decrypting:
    1. Set the cipher text to "ANHXJRAAZEBYYOMNWPBKGZOGY"
    2. For each letter from the cipher text, perform the decryption steps outlined in the original challenge.

Result

Doing all the steps above with the attached shell script produced the following answer:

corvusoculumcorvinoneruit
Which is Latin for: "a crow will not pull out the eye of another crow." It’s essentially the same as "honor amongst thieves."
You can use “corvusoculumcorvinoneruit” as the passphrase to decrypt the file for this challenge.

Additional Information

The script created to solve this challenge is available from the DOWNLOAD SECTION (a shell script, running on Bash 4.2+ only… i.e.: Kali)