How DWT can be used in LSB substitution steganography

In steganography, the least significant bit (LSB) method embeds secret bits in place of cover bits, such as image pixels. Some methods take the Discrete Wavelet Transform (DWT) of the image, and the secret bits are embedded in the DWT coefficients, after which the inverse trasform is used to restore the stego image.

However, the DWT creates float coefficients, and the LSB substitution method requires integer values. Most of the articles I read use a 2D Haar wavelet, but they are not well understood in their methodology. I saw that the transformation is defined in terms of low and high transmission filters (float transforms) or it takes the sum and difference of the pair values, or the average and average difference, etc.

More explicitly, both in the direct and inverse transforms (but not necessarily in both, depending on the formulas used), floating-point numbers will eventually appear. I cannot use them for coefficients because the replacement will not work, and I cannot use them for recovered pixels, because the image requires integer values โ€‹โ€‹for storage.

For example, consider a pair of pixels, A and B as a 1D array. The low-frequency coefficient is determined by the sum, i.e. s = A + B , and the high-frequency coefficient is the difference, i.e. d = A - B Then we can restore the original pixels with B = (s - d) / 2 and A = s - B However, after the bit is combined with the coefficients, s - d can be no more, and float values โ€‹โ€‹will appear for the restored pixels.

For the 2D case, 1D conversion is applied separately for rows and columns, so ultimately dividing by 4. This can lead to values โ€‹โ€‹with the remainders float.00, .25, .50 and .75. I just met one document that addresses this issue. The rest are very vague in their methodology, and I'm struggling to reproduce them. However, DWT is widely used for image steganography.

My question is that the piece of literature that I read was not enlightening, how is this possible? How can I use a transform that introduces float values, but the whole steganography method requires integers?

+6
source share
1 answer

One solution that worked for me is to use the Integer Wavelet Transform, which is also called the lifting scheme . For the Haar wavelet, I saw that it is defined as:

 s = floor((A + B) / 2) d = A - B 

And for the opposite:

 A = s + floor((d + 1) / 2) B = s - floor(d / 2) 

All values โ€‹โ€‹in the whole process are integers. The reason this works is because the formulas contain information about the even and odd parts of pixels / coefficients, so there is no loss of information from rounding. Even if one changes the coefficients and then takes the inverse transform, the recovered pixels will still be integers.

Python implementation example:

 import numpy as np def _iwt(array): output = np.zeros_like(array) nx, ny = array.shape x = nx // 2 for j in xrange(ny): output[0:x,j] = (array[0::2,j] + array[1::2,j])//2 output[x:nx,j] = array[0::2,j] - array[1::2,j] return output def _iiwt(array): output = np.zeros_like(array) nx, ny = array.shape x = nx // 2 for j in xrange(ny): output[0::2,j] = array[0:x,j] + (array[x:nx,j] + 1)//2 output[1::2,j] = output[0::2,j] - array[x:nx,j] return output def iwt2(array): return _iwt(_iwt(array.astype(int)).T).T def iiwt2(array): return _iiwt(_iiwt(array.astype(int).T).T) 

Some languages โ€‹โ€‹already have built-in functions for this purpose. For example, Matlab uses lwt2() and ilwt2() for a two-dimensional wavelet transform of the lift circuit.

 els = {'p',[-0.125 0.125],0}; lshaarInt = liftwave('haar','int2int'); lsnewInt = addlift(lshaarInt,els); [cAint,cHint,cVint,cDint] = lwt2(x,lsnewInt) % x is your image xRecInt = ilwt2(cAint,cHint,cVint,cDint,lsnewInt); 

An example article where IWT was used for image steganography, Raja, KB et al. (2008) Reliable adaptive image steganography using whole bursts.

+7
source

All Articles