Search code examples
asciirgbpuzzlesteganographyctf

Hidden message in a picture


I'd like to read a hidden message in the following picture: enter image description here

The message is supposed to look like CTF{Something}. I've tried to find out how to read it for hours without success.

So far, I've tried to read the RGB values of each cell. For instance, first cell (1, 1) is rgb(88, 101, 114) or #586572. First three cells would give: Xer, ddnc which obviously makes non sense.

Last cell #587c00 rgb(88, 124, 0) is then supposed to be a }.

The only clue I have to solve that is RGB is a kind of ASCII.

Could you help me to solve that ?


Solution

  • This is an absolute spoiler for the puzzle, but here goes. I did truncate the actual flag out of the message, though, so you'll have some work to do.

    With the original image 6x7 image in hand (the 192x224 image in the original post can be losslessly downscaled down to that), convert it to an uncompressed format such as Netpbm PPM, then simply look at the raw data (as the clue says).

    $ convert 9TwkJ-6x7.png 9t.ppm
    $ cat 9t.ppm
    P6
    6 7
    255
    Yes, decoding the colors as ASCII characters was the solution. [...]
    

    You can get to the same result with e.g. Python with

    >>> from PIL import Image
    >>> im = Image.open("9TwkJ-6x7.png")
    >>> im.tobytes()
    b'Yes, decoding the colors as ASCII characters was the solution. [...]
    

    A more devilish CTF would have e.g. rotated the source 90 degrees...

    As for

    For instance, first cell (1, 1) is rgb(88, 101, 114) or #586572. First three cells would give: Xer, ddnc which obviously makes non sense.

    that smells like a different color profile wreaking havoc on your data; Yes, deco and Xer, ddnc are all just 1 RGB value here or there...