DC10003  Editorial
PROBLEM
Link to the Practice Question can be found: https://www.codechef.com/DECI2020/problems/DC10003
PREREQUISITE
Steganography
DIFFICULTY
Hard
PROBLEM
Extract the secret text message hidden in the stegoimage.
EXPLANATION

Extract all three imagematrices for red, green, and bluechannels from the stegoimage. Let us call them srmatrix, sgmatrix and sbmatrix.

Extract all three imagematrices for red, green, and bluechannels from the coverimage. Let us call them crmatrix, cgmatrix and cbmatrix.

Convert all the metrics in 1D array in a rowmajor order

The secretmessage is of 27X7 = 189 bits.

Hence, make loop for 189 times (I = 1 to 189). Let gi and bI are the indices in gmatrix and bmatrix. gi:= 1, bi:= 1
6.1 Find out the LSB bit value for ith pixel of rmatrix, which can be either 0 or 1.
[Thetricky part is it is not told in the problem statement for 0 which matrix and for 1 which matrix need to be chosen between sbmatrix and sgmatrix to get the secret bit. So we need to try both the option. Actually for 0, we have chosen sgmatrix and for 1, we have chosen sbmatrix. Hence we do as follows:]
6.2 if LSB is 0
6.2.1 Do bitwise XOR between sgmatrix and cgmatrix, gi := gI + 1.
Else
6.2.2 Do bitwise XOR between sbmatrix and cbmatrix, bi :=bI + 1.
6.3 If the XORresult is 0, then the secretbit is 0; else secretbit is 1.
 Convert the binary stream to secretmessage.
Solution:
https://drive.google.com/file/d/1IkPfgl6iUdq2zhnovuOrTLyqZkLv7FUH/view?usp=sharing