ECE 572 Digital Image Processing: Project #3
ECE 572 Digital Image Processing: Project #3
ECE 572
Digital Image Processing
Project #3
Steganography Implementation
Instructor:
Dr. Qi
Student:
Getao Liang
Abstract:
Steganography is derived from the Greek for covered writing and essentially means
to hide in plain sight. It is the art and science of communicating in such a way that
the presence of a message cannot be detected. As other image processing technologies,
steganography can also be applied on both spatial domain and frequency domain. In
this project, I will discuss the theory and implementation of two simple schemes for
steganography, which are LSB technique and transform domain technique. By
evaluation the techniques with both text and image message, I try to show the
different performance produced by these two algorithm with different parameters.
Besides, I also try to test the robustness against JPEG lossy compression for DCT
scheme to prove the correctness of the theory and my implementation. All the results
from the experiments support my assumption and the theoretical analysis.
I. Introduction
With the rapid development of the world integration in economy and culture,
communication between people in different continents plays an important role. Since
information is the most important thing within the communication, methods are
proposed to secure the confidential content from undesired observer. The technologies
for this purpose can be divided into two main categories, Cryptography and
Steganography. The main difference between these two technologies is the
appearance of the processed data, or results. Cryptography tries to find algorithms to
encode the information into sort of random data that is unknowable to unauthorized
receivers. However any receiver can tell there is hidden information existed within the
object they received from the strange and unreadable appearance, even though no one
can know the exact secret message except the one with decoder.
Steganography is derived from the Greek for covered writing and essentially means
to hide in plain sight. It is the art and science of communicating in such a way that
the presence of a message cannot be detected. That means, different to cryptography,
steganography deals with not only hiding information from undesired receiver, but
also preventing the understand of the very existence of the hiding message from
enemy, who might touches the processed cover by any chance, including passive,
active and malicious receiver.
A few criteria and requirements are used to measure the efficient of a steganographiy
technique. The first one is imperceptibility, which requires the results to be unaware
by receivers with advanced analysis technologies, such as statistical analysis and
high-pass filter analysis. This is the most important, when you are facing active or
malicious attackers, who would have great resource to apply analysis and break to the
cover. Security is another important factor, which concerns more on the difficulties of
perform inverse performance on the cover to get the hidden message. Capacity is used
to describe maximum amount the secure data a cover can hold. The last thing is the
robustness against cover modification, malicious modification or lossy compression.
But it is impossible to satisfy all the requirements at the same time, so it is for the
designer to trade-off between them to find a most optimized scheme for preferred
circumstance.
People have been using different steganographiy technologies for many fields
covering from civilian communication to military secret information exchange, ever
since old ages. The demand of security in modern electrical communication boosts the
development of steganographiy. There are many techniques for steganographiy,
including substitution systems, transformed domain techniques and statistical
steganography. The first one is a most simple method, but it is easy to be decoded or
destroyed. The last two technologies are both applied on the supraliminal channels of
the cover, which makes it harder to be destroyed without great distortion on the cover.
MSB
LSB
and
j n = k n 1 + k n
N 1 N 1
u (2i + 1)
v(2 j + 1)
2
A(u ) A(v) s (i, j ) cos(
) cos(
)
N
2N
2N
i
j
s (u , v) =
2
N
N 1 N 1
u (2i + 1)
2N
) cos(
v(2 j + 1)
2N
1
k =0
where A(u ) = 2
1 otherwise
Just like Fourier Transform, DCT is reversible, so we can first perform DCT to an
cover image, then do apply some kind of algorithm to secret write information on
the significant area of the transform domain, and perform the inverse transform to
the modified data set.
TDT with DCT is designed concerned the specification of JPEG, so the result
produced by TDT with DCT technique can survive JPEG lossy compression
greatly. The following figures (Figure-4 and -5) show the encoder and decoder
procedures of one of the popular steganograpgy techniques using DCT and its
inverse transform.
Cover
Divide into
8x8Divide
blocksinto
Divide into
8x8 blocks
8x8 blocks
DCT to selected
block
Message
Stego-Image
Combine all
blocks
iDCT to each
block
Message embed
algorithm
Knowing the basic procedures of TDT technique, we now focus more on the
embedding and extraction algorithms, that perform core roles of the
steganograpgy, located in encoder and decoder respectively.
To design the algorithms to hide information in the frequency domain, we need to
first understand how DCT coefficients represent the image information, and the
quantization mechanism of JPEG. The knowledge from these fields tell us that, by
switching a few DCT coefficients, which is selected based on the quantization rule,
will not change the carrier appearance a lot. So we can store 1 bit secret
information on one DCT-transformed image block by the relative amount of 2 or
more DCT coefficients. Exchange the coefficients with each other, when it
dis-obeys the designed rule when embedding secret bits. The encoding and
decoding algorithms can be designed as follow, where mi is the i-th message bit,
bi is the selected block for i-th message bit, Bi is bi s CDT, and (u1 , v1 ) &
(u 2 , v 2 ) are the two designed coefficient pair.
Bi = CDT (bi )
if mi <0 then
if Bi (u1 , v1 ) > Bi (u 2 , v 2 ) then
'
mi =1
else
mi =0
end if
end for
The value adjusting of the encoder used to enhance the robust against cover
modification, the higher x is, the higher robust the algorithm gets, but less
imperceptive. Based on the quantization values used in the JPEG compression
scheme, I choose the B(4,1) and B(3,2) to be the coefficient pair used for storage
of hiding message, since the quantization level of these two coefficients are the
same. So this selection performs very well for JPEG compression.
(a)
(b)
(c)
Figure-8. Stego-image for hiding 8, 7 and 2 MSBs
The SNRs for the above 3 cases are around 45.1375 dB. That is because only one
LSB of the cover are replaced by the secret message bit, and another reason is that
the secret message are pretty small in size, only 12 bytes.
The above results prove the implemented program can successfully embedding
and extract short secret text message in to image. Of course, we expect it is also
true for long text message, which will be tested in the following section.
(b)
(a)
Figure-9. (a). Stego-image using simple scheme; (b).Difference between cover and
stego-image;
(a)
(b)
(b)
Figure-11. Other results with different parameters. (a). Diff-image for
2000 displacement of first cover element; (b)-(c). Diff-image using
random interval scheme with key=2 and key=3 ;
Though the histograms of the cover form both cases are pretty the same as that of
the original one, the histograms for HPed-cover for case 2, which is shown in
Figure-11(c) and Figure-12, looks closer to that of the cover than that of the other
case. That contributes to the efficient immunity to Laplasian analysis of the
random interval method, by trading the cost of algorithm complexity and
pre-communication between encoder and decoder for keys and equations. The
SNRs for the above 4 cases are 31.0206 dB, 32.6937 dB, 34.3686 dB and
35.5778dB. You might notice that the SNR is improved greatly from case1 to
case4. Thats also the advantage of the random interval method.
c. Image Message
For better visual interpretation, I used a larger image, 512x512 lena.pgm, for
cover image, and two message images, one with same size of the cover, 512x512
barbara.pgm, and one with smaller size, 97x128 fig1.pgm.
The reason I choose to use 2 message images is mainly to test the full 8-bit data
embedding for lossless image steganography, which makes it impossible to embed
the message into a cover with a size less than 8 times larger than that of message.
From the stego-images of all cases in figure-14, we can find that the quality of
stego-image is getting worse and worse when the number of used LSBs increases.
On the other hand, the decode images are getting more and more matching in
quality compared to the original message. This means that the more LSBs used
for secret writing causes more capacity and accuracy, but less imperceptivity. The
designer should trade-off these parameters for different purpose. To illustrate the
imperceptivity of different cases, the histograms of the stego-images of case1 and
case7 are listed below. The different shape of the 4th picture tells us that the
difference between neighbor pixels in the stego-image is far greater than that of
case1, which means case7 is less imperceptivity than case1. This conclusion
matches the one we derived from observing the stego-images.
------------------------------
From the results image, we can see that it is hardly to find any noticeable changes
between the stego-image and the cover image. And the beautiful mono difference
image again prove the conclusion that, by using transform domain technique, we
can embed secret data into cover without changing too much of the appearance of
the carrier, while providing more robust to other forms of modification.
b. Image Message
Next, lets work on the scheme with image message. The message image (zoomed)
I generated for the test purpose, 16x16 UT.pgm, is shown below.
Again, we cannot tell any difference between the stego-image and the cover
image, and this is also supported by the mono-black difference image between the
cover and the stego-image. You might notice the difference image in this section
is black while that of the previous section is something white. This is caused by
the auto-rescale function from the image library I used and the quantization
process when the c++ program was performing the DCT and IDCT. However, the
monochrome diff-image indicates the small difference between two images.
As we mention before, the DCT scheme has a good performance in surviving the
JPEG lossy compression. Now, I will try to compress the stego-image with 80%,
85%, 90% and 95% JPEG qualities respectively, and then try to recover the secret
image we embedded. And the results are listed below, whose qualities are from
worst to best, when the compression rates rising. We can still easily recognized
the shape from the 3rd and 4th recovered message, but not for the first 2 images.
IV. Conclusion
In this project, I have gone through the comprehensive step on steganography in both
spatial domain and frequency domain. The results indicated the algorithm on bith
domains can finish the steganography task greatly, given there is not active or
malicious attacker involved.
For LSB technique, we can use a few MSBs of the message to substitute the same
length LSBs of the cover. And the number of LSBs to be replace for the secret
message determines the quality of recovered image. This is only true to message in
form of sound or image, but not true for text message. All 8 bits must be embedded
for the successful recovery of message. Besides, the selection algorithm of cover
elements is very important when there are active attackers existed. By choosing the
selection scheme carefully, we can manage to make the distribution of the
stego-image look like the original one.
The transform domain technique is much better than the LSB scheme by higher
imperceptive, more security and more robust to cover modification. But the cost for
this improvement is the algorithm complexity. The result told me that using DCT
scheme for secret writing; the image message can be recovered approximately in
some degree even though the stego-image is compressed by JPEG.
V. Reference
Digital Image Processing Rafael C. Gonzalez & Richard E.Woods