Reputation: 539
I've been interested in image steganography for a while now and have used steghide (Linux) in the past. I was wondering if there was a (reasonably) simple, albeit rough calculator or calculation that can be used to ascertain how big a cover file needs to be for a given embedded file. (Apologies, I'm using the steghide terminology here).
For example, assuming that I have a 1024x768 image (embed file) that I would like to attempt to embed into a file (steg file), I have to find an image (cover file) large enough for steghide to do it's magic with.
I started off with
... and as you can see, it got a little gnarly from this point forward, as (through some testing) I'm clearly able to hide a 316KB image into a file that's 1% of that 24GB file size, so my calculations are already way off.
So was wondering if there was a "general" rule of thumb that could be applied to giving an estimation of the filesize an expected image would need? I do appreciate that it depends on a number of additional factors (color depth etc of both cover image and embedded)...
Upvotes: 0
Views: 2597
Reputation: 9797
First things first, each algorithm hides information in different ways, so there is no generic formula for "steganography" capacity.
In your case, it seems you hide a whole image in the pixels of the cover file at an embedding capacity of 1 bit per pixel. The total amount of bits you have to hide is 1024x768x24 = 18874368. I don't know how you got a result in the order of magnitude 1e13, but that's where you went wrong. By the way, the 24 is the result of assuming an RGB image, where each pixel has 3 colour planes and each colour has 8 bits.
Assuming that both the cover and secret images have the same number of colour planes, the cover image must be at least 8 times bigger than the secret. So, for a secret size of 1024x768, the cover could be 4096x1536, or 8192x768, or 1024x6144, etc.
Embedding the pixel array directly is like embedding a bmp file, which is uncompressed. You could achieve the same by first converting your image to png and embed the bytestream of that file, which should result in a smaller payload. Jpeg should result in even smaller files if you don't mind lossy compression.
Upvotes: 2