3

I am working on a Java Steganography project to hide a .txt message in a JPEG image. Broadly speaking, there are 4 steps:

  1. Transform each pixel block into 8x8 DCT coefficients.
  2. Quantitize each block with some complex calculations.
  3. Embed/replace each bit of the message into the LSB of the coefficients of each block.
  4. After embedding, perform the inverse DCT to re-create the JPEG image with the embedded message.

I am stuck on the 3rd step, because I am not sure how I can record what coefficients I have altered with the message, in order to extract it back out?

Can anyone recommend what ways I can embed each coefficient, and to record each embedding, in order to extract it back out?

This would be much appreciated.

(Also I know that 1s and 0s, and the DC value should be left alone).

Douglas Grealis
  • 599
  • 2
  • 11
  • 25
  • It's not clear what's troubling you about that step. The extraction process is the inverse of the embedding process and this knowledge is assumed. For example, if you had arranged it so that you embed in the 3rd and 5th coefficients, that's where you'll look to extract your message. – Reti43 Mar 08 '14 at 03:18
  • That could be done. I simply have it to alter every coefficient (not 1s, 0s or DC), for every block until the end of the message (no more bits to embed). So when I try to extract the LSBs of each coeeficient, it tries to convert all bits together back into ASCII (which does not seem to be correct). Plus your idea, what if the 3rd or 5th coeffs were a 1 or a 0? And how could I tell it not to extract it, due to being a 1 or 0? Thats my problem – Douglas Grealis Mar 08 '14 at 03:30
  • Surely you can check the coefficient with an if statement before reading any LSBs of it. If it's 1 or 0, simply ignore it and move on. Naturally, this goes for both the embedding and extraction procedures. – Reti43 Mar 08 '14 at 03:43

1 Answers1

0

You choose a random path and follow it when going through the cover - you randomly permute the indices of the array (using a key as a seed).

The problem with 1s and 0s when embedding in DCT domain is a well-studied topic. The final solution seems to be nsF5 steganographic embedding which uses wet-paper codes (WPC).

Authors' nsF5 implementation in Matlab won't help you because it is simulation only and does not contain WPC. But it helped me understand how nsF5 works.

WPC allows spreading message bits in a block of cover elements such that some of the cover elements are "wet" (costly to be changed). There exist WPC implementations, such as Daniel Lerch's stegolab in Python. If you want to deeply understand WPC down to the level of being able to implement it, you will have to read related research papers.

Literature

Martin Benes
  • 265
  • 10