# DCT Steganograhy

I'm trying to implement a simple steganography algorithm (similar to JSteg algorithm) for hiding data in LSB of DCT coefficients in Matlab, and I ran into a problem.

a. I apply DCT.

b. modify LSB of coefficients different than 1 and 0 except the first

c. apply inverse dct

Now I have to save the result block to the output image file, and in the rounding process from double to int some coefficients are lost and I don't obtain the exact coefficients at extraction phase.

I looked at the C sources of JSteg and its DCT implementation is based on an algorithm described by C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT Algorithms with 11 Multiplications". This program works correctly, so I'm wondering if implementing this will also solve my problem?

And if there's another way to deal with the rounding problem?

Thank you