1

I am using the Jsteg method, but i have a confusion, something i don't quite understand.The steps are:

  1. Get 8x8 pixel block
  2. Discret cosine tranform
  3. Quantization
  4. Replace the Least Significant Bit

What i don't understand is, when i open the image in java using BufferedImage and ImageIO and do these steps, how do i save the changes? if i write:

ImageIO.write(img,"jpg",new_img);

does java recompress the image and then the hidden text is lost, or when it does the compression it doesn't change anything since i did compress manually? or should i save it in another way? Bottom line:After replacing LSB, how to save the encoded image ?

bob
  • 4,282
  • 2
  • 22
  • 30
ilyes hamrouni
  • 148
  • 1
  • 12
  • You're going to have to use a JPEG library and modify it it. – user3344003 Jul 02 '18 at 15:47
  • Possible duplicate of [Steganography in lossy compression (JAVA)](https://stackoverflow.com/questions/29677726/steganography-in-lossy-compression-java) – Reti43 Jul 02 '18 at 15:49
  • Well that doesn't solve the problem i have, all i need to know if after replacing the LSB, how should i save the image ? – ilyes hamrouni Jul 02 '18 at 16:20
  • Read more carefully. The answer on how to save the image is exactly what user3344003 (and I) suggested. You need to use a jpeg library and modify the steps to include your steganographic algorithm in the process. Embedding your secret and then just calling `ImageIO.write()` or any other such function starts the compression process all over again. – Reti43 Jul 02 '18 at 18:30
  • Oh! my bad, thank you, this really helped me . – ilyes hamrouni Jul 02 '18 at 21:17

0 Answers0