Click here to Skip to main content
15,893,401 members
Please Sign up or sign in to vote.
3.13/5 (5 votes)
See more:
Is it possible to do steganography on a jpg?

I have tried it on .bmp,.tif,.gif it's successful.

However, when I tried it on jpg after extraction I get wrong data.

Please help me to find if any source code available on c# or vb
Posted
Updated 25-May-11 9:56am
v2
Comments
yesotaso 25-May-11 14:30pm    
I think the key feature is "Lossy Compression" that gets in the way but who knows?
Sergey Alexandrovich Kryukov 25-May-11 15:04pm    
Compression can always be decreased to get better quality of the image. Should work, either JPEG or PNG.
Please see my answer.
--SA
vishnulalr 25-May-11 14:56pm    
yes in .bmp,.tif there output is exact what we given as input but .jpg due to its lossy compression i want to overcome this
Sergey Alexandrovich Kryukov 25-May-11 15:07pm    
Yes, please see my answer.
--SA
Dalek Dave 25-May-11 15:57pm    
Edited for Grammar and Readability.

Just for another view point, I tried to take it a step further and accept the errors while trying one of several Bit Code correction techniques to actually correct the errors. I found dismal results and briefly here is why. Yes, JPG is lossy format but it is worst than you would think. Even with using a Quality setting of 100 the error rate on the lowest bit is very high.

Here is what I did. I tried to use Steganography on a JPG image by changing the lowest bit in the Red, Green, and Blue channels. The document was almost 3 MBytes and the JPG Image was over 20 MPixels. So there was plenty of room.

Upon running a comparison I found that only a dismal 19,939 Bytes were correct. For those that were not correct the average Byte had 3.5 bit errors. This would mean that you would need a bit correction algorithm that could detect and correct up to 4 of 8 bits. Basically it is possible, but way too much data.

I also tried one brute force technique that was proposed. This was to write the data 3X and then take the average as the correct answer. Out of the original 3 MBytes I was still getting about 1.1 MBytes of wrong data.

BTW ... PNG works fine without issues.
 
Share this answer
 
Does this[^] help? It was on the first page of this[^] google search.
 
Share this answer
 
Comments
vishnulalr 25-May-11 14:45pm    
thanks but actually it not about jpg
Marc A. Brown 25-May-11 14:49pm    
Whoops, you are correct. I apologize. I failed to note that on page two they talked about jpeg images but did not implement anything due to data loss. However, other results in the search might help, or CPallini's answer might be of use.
Sergey Alexandrovich Kryukov 25-May-11 15:09pm    
Yes, Marc, I think OP already knows steganography well enough. The only issue is the image format and quality.
Please see my answer.
--SA
Have a look at this page[^].
:-)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-11 15:10pm    
You see, I think OP already knows steganography well enough. You link is probably nothing new. The only issue is the image format and quality.

Please see my answer.
--SA
CPallini 25-May-11 15:29pm    
Please read the info in the posted link, before judging (it looks that steganography on lossy formats it's a bit different than 'standard' one). Please read then following Corinna's comment: http://www.codeproject.com/Messages/2716139/Re-It-doesnt-work-for-jpg-images.aspx.
Sergey Alexandrovich Kryukov 26-May-11 1:11am    
Sure, let me see...
--SA
Sergey Alexandrovich Kryukov 26-May-11 1:18am    
Sure, this article shows non-trivial aspect of lossy format; it shifted my understanding of the problem. Thank you for this note and interesting information.
By the way, I did not actually vote when I put my comment, as I wasn't quite sure if I can "judge" it. I up-voted by 5 later.
--SA
CPallini 26-May-11 1:58am    
Thank you, I guessed the '2' wasn't yours.
:-)
It it works with BMP and TIFF (what compression did you use with TIFF), JPEG should certainly work as well. If not, it needs some investigation. Also, please understand that BMP and TIFF are not acceptable formats to be used with Web, but JPEG and PNG are. Both JPEG and PNG should be good.

Those formats are not lostless. You probably need to reduce the level of compression to improve the image quality. Also, don't re-compress several times, it degrades quality. Always keep original image in some lostless format and compress it only once.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900