# CTF challenge 2. Steganography: splitting the single "hair" into four

The enhanced version of

, based on a similar concept but harder.
And again, the flag starts with "CTF_", total length = 21.

The message is slightly volatile

Challenge project: CTF_STEG.2

Spoiler

Oooooooh...

Spoiler

When you load the project, no stage is selected.

wrong.

Why don't you go look for your self?

Spoiler

Wrong.

The sprite is selected,

I did. thats how I know your wrong.

Spoiler

@helicoptur Its the stage. Look for yourself.

Time for the clues:
1. Only the current state of the Stage is meaningful
2. What's split can be linked together ...
3. The title is not that random as it looks

Another bit of information. See what happens here. You should see something familiar ...

That C...

If that "C" is the only thing familiar
the more specific hint can be useful

Solution
The main idea is to spread bits of the unicode of the letter into of a single pixel.

Encoding

1. Code of the letter is splitted into 2-bit packets.

2. With this hyperized expression, 2-bit packets are applied to rgba pixel data.
3. Now the pixel data contains encoded letter data

Decoding

1. Extract the two lowest bits from every element of the pixel
2. Combine bits into a byte
3. Abstract, whole procedure for the single pixel/letter

Complete, real decode script

Project

It was too hard for me I'm afraid

So, I'm lucky that I do not teach for a living ...

I will try to explain the general idea once again. I assume that binary notation and bit manipulation is known to the reader

1. Basic assumptions:
encoding letter "C" , code 67
into gray pixel

Expressed as binary:
"C" => 67 =>
pixel r = g = b = 100,
pixel alpha=255,

2. Bits of the letter "C" are spread into the lowest bits of the pixel elements

3. Pixel elements become (binary then converted to decimal):

4. New pixel values are stored into the original image.

It's worth noting that depending on the pixel, changes to the original image are almost invisible by the "naked eye".

My implementation of this idea is based on the observation that:
modulo 4, extracts the 2 lowest bits of a number
clears lowest bits