PDA

View Full Version : Hiding Data in Image



nimrod1989
7th September 2014, 14:44
Hello all,

I would like to know if there is an easy way to implement the Steganography concept using QT.

I should say that "Steganography means hiding one piece of data within another".
For this, I want to use LSB(Least Significant bit) insertion.

I've searched on the web and found some info about this and I want to share:
1) The least significant bit (in other words, the 8th bit) of some or all of the bytes inside an image is changed to a bit of the secret message
2) When using a 24-bit image, a bit of each of the red, green and blue colour components can be used, since they are each represented by a byte.

Also, read that only on .BMP images can be applied as they use lossless compression.
I'm not very familiar with image format ant which is the difference between. Am I only achieve this on .bmp images, or I will succeed with any format, e.g. jpeg.

However, I cannot find a way of implementing/changing the last bit from a byte, using QT.

Can someone help me?

Let's take an example
A grid for 3 pixels of a 24-bit image can be as follows:
(00101101 00011100 11011100)
(10100110 11000100 00001100)
(11010010 10101101 01100011)
When the number 200, which binary representation is 11001000, is embedded into the least significant bits of this part of the image, the resulting grid is as follows:
(00101101 00011101 11011100)
(10100110 11000101 00001100)
(11010010 10101100 01100011)

Hope I'm very clear on what I want to do and I would highly appreciate your help.

If you have any questions about this, please do not hesitate to ask me.

Thanks

Added after 28 minutes:

Ok I found this Qt QImage pixel manipulation problems (http://stackoverflow.com/questions/857962/qt-qimage-pixel-manipulation-problems/858013#858013).

However, it is not working as expected:|.

Can someone help me, please? add the necessary comments, etc

nimrod1989
7th September 2014, 21:56
I'm afraid I cannot find a way to change according my scenario the LSB. Does anyone have an example of how this can be done programmatically?

anda_skoa
8th September 2014, 07:28
What did you try?

Changing the last bit of each byte in QImage::bits() seems pretty straight forward.


Also, read that only on .BMP images can be applied as they use lossless compression.
I'm not very familiar with image format ant which is the difference between. Am I only achieve this on .bmp images, or I will succeed with any format, e.g. jpeg.

There are other loss-less compression using formats, e.g. PNG.

Cheers,
_

nimrod1989
9th September 2014, 15:40
Hi Anda,

Thank you for the tip. I will see what I can do. However, I've read the documentation and it is not so straight forward as you say. (at least for me)

bahtouch
31st July 2015, 14:05
Hi i am working on the same project can you tell me sir the way that you find the RGB code of each pixel?

ChrisW67
1st August 2015, 05:38
QImage::pixel()