Decrease file size of GIF steganograms
A steganogram of a GIF image has an increased file size. This is because the color palette of the carrier image is ordered in such a way that most used colors come first, which improves the performance of GIF's internal compression algorithm. In order to decrease the file size, we would need to re-sort the color palette for the steganogram.
The only downside of doing this that I can think of is that when the attacker has both the carrier image and the steganogram, both visually looking the same to him, he might notice that the color palettes of the two images are completely different when using an image editor or the like.
I realize this is rather unlikely to happen. Is there anything I missed? If there isn't, I'll be adding this to our
When an attacker has the carrier image, you lost anyway. He could just compare the hashes of both images. However a steganogram-only attack could check if the color palette is properly sorted. If not, it could be a steganogram. So, I agree we should sort it.
That brings me to the idea that we could implement exactly this attack as part of our analysis-module. :D
You're right, good point. I should have used "innocent viewer" instead of attacker. For someone who isn't suspecting one of the two visually identical images to be a steganogram, the different color palettes might be a reason for him to raise his eyebrows.
Anyway, I implemented re-sorting of the color palette and then did some tests with the sunflower.gif and it seems the GIF encoder in Java's
javax.imageio.*classes doesn't do a particularly good job when compressing the image:
Image File size in bytes Carrier 740.325 Steganogram 778.995
The payload is 48 bytes. I opened both of them with IrfanView and saved them as GIF again:
Image resaved with IrfanView File size in bytes Carrier (byte identical to original carrier) 740.325 bytes Steganogram 740.717 bytes
Maybe I should keep an eye out for a different encoder who performs better at compression.