Stegmeister achieves a wide range of embed degrees and a favoring of bright pixels for embedding, with an algorithm
internally called "guard3", or g3 for short.
We begin by looking for the highest “1” bit in a pixel-color’s byte. As long as we leave that bit and any higher
bits undisturbed, we can modify any less significant bits as we please, then on decrypt we’ll get the same count
(i.e. see the same highest 1 bit) so we won’t get confused as to how many bits to extract.
If we're doing 100% embed, every bit under every pixel-color’s highest 1 bit will be replaced. But suppose we want
to be less obvious: then we come up with an integer ratio, say for example 9 / 17. Now if we could embed 6 bits (into
a byte with brightness 01000000 through 01111111), we ratio that and get 54 / 17, or 3-3/17 bits. This means we’ll
embed 3 bits with a 3/17 chance of embedding 4 bits. There’s a pseudo-random stream running to make that decision,
same for embed and extract, so everything happens in sync: the same 6-bit possible pixels get 3 bits and same get
4 bits.
When we're lightly stuffing, say with a ratio of 1 / 256, a pixel-color that could accept 6 bits of embedding will
get 6 / 256 bits, or 0-3/128: zero bits with a 3/128 chance of getting 1 bit. Without finding the same pseudo-random
stream, an attacker would have no way of knowing which pixel-color bytes have an embedded bit.
The program applies some restriction for very bright pixels, since they’d otherwise get the most bits embedded, but a
washed-out white area, every pixel-color 255, should be left undisturbed or an attacker can infer that the image has
been tampered with. Black pixels have no 1 bit so get nothing embedded, and dark pixels are lucky to get a single bit
stuffed in them.
Return to steg page