From: Nor Aznim on
i am doing image steganography.i have done until quantization, and now i try to encode the hidden image inside the cover image,using LSB. anyone can suggest me the code? my hidden image is in binary already while my cover image was in coefficient, but i have convert them into binary.now a want to change the last bit of cover with the bit of hidden.
thank you
From: Walter Roberson on
Nor Aznim wrote:
> i am doing image steganography.i have done until quantization, and now i
> try to encode the hidden image inside the cover image,using LSB. anyone
> can suggest me the code? my hidden image is in binary already while my
> cover image was in coefficient, but i have convert them into binary.now
> a want to change the last bit of cover with the bit of hidden.

Multiply by 2 to the power of the number of bits of quantization
(presuming that is a constant rather than a variable.) Either floor() or
round() that value, which-ever is consistent with the way the
quantization could handles fractions. Now int32() the results if they
are signed numbers; if so, follow the int32() operation by
typecast() to uint32; if the values were unsigned, just go directly to
uint32(). You now have a vector of unsigned 32 bit integers. Use
bitset() to set the bottom bit of each number according to the
information you are hiding there. If you did have signed values, now
typecast() the uint32 values back to int32() values. Now cast() the
result back to the original data class, and take what you have and
divide it the value you multiplied by originally (Actually some of these
operations really should be done in a slightly different order for some
data classes.) Okay, you now have the values with the information hidden
in the bottom quantization bit.