IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.24 (3) 2011 Color Image Steganography Based on Discrete Wavelet and Discrete Cosine Transforms A. A. Abdul Latef Department of Computer Science ,College of Education Ibn Al- Haitham,University of Baghdad Received in : 1, March , 2011 Accepted in : 10, May, 2011 Abstract The secure data transmission over internet is achieved using Steganography. It is the art and science of concealing information in unremarkable cover media so as not to arouse an observer’s suspicion. In this paper the color cover image is divided into equally four parts, for each part select one channel from each part( Red, or Green, or Blue), choosing one of these channel depending on the high color ratio in that part. The chosen part is decomposing into four parts {LL, HL, LH, HH} by using discrete wavelet transform. The hiding image is divided into four part n*n then apply DCT on each part. Finally the four DCT coefficient parts embedding in four high frequency sub-bands {HH} in cover image. Experiments show that this method gets stego image with perceptual invisibility , and better secrecy. The proposed method was implemented using MATLAB 7.8. Keywords: Steganography, Digital Watermark, Wavelet Transform, DCT. Introduction The development in technology and networking has posed serious threats to obtain secured data communication. This has driven the interest among computer security researchers to overcome the serious threats for secured data transmission. One method of providing more security to data is information hiding. Generally speaking, information hiding relates to both watermarking and steganography. A watermarking system’s primary goal is to achieve a high level of robustness-that is, it should be impossible to remove a watermark without degrading the data object’s quality. Steganography, on the other hand, strives for high security and capacity , which often entails that the hidden information is fragile. Even trivial modifications to the stego medium can destroy it [1]. Generally, the information hiding techniques can fall in two categories: spatial-domain methods and transform domain methods .Many techniques have been proposed in the spatial domain, such as the LSB (least significant bit) insertion method , the patchwork method and the texture block coding method . These techniques process the location and luminance of the image pixel directly. The LSB method has a major disadvantage that the least significant bits may be easily destroyed such as randomly flipping the lower bits or loose compression [2, 3]. A transform-domain method, such as the Fourier Transform, Discrete Cosine Transform, or Discrete Wavelet Transform, are based on special transformations, and processes the coefficients IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.24 (3) 2011 in the frequency domain for hiding data. In these methods the watermark is hidden in the high frequency coefficients or middle frequency coefficients of the protected image. The low frequency coefficients are more likely to be suppressed by filtration as noise. Therefore, the high frequency coefficients of the protected image are used to embed the watermark. How to select the best frequency portions of the image for hiding watermark is an important and difficult topic. The transform-domain method is more robust than the spatial-domain method against compression, cropping, and jittering. The robustness is maintained at the price of imperceptibility in the trans form domain [3, 4]. Wavelet transform Wavelet transform is used to convert a spatial domain into frequency domain. The use of wavelet in image stenographic model lies in the fact that the wavelet transform clearly separates the high frequency and low frequency information on a pixel by pixel basis. A one dimensional DWT is a repeated filter bank algorithm, and the input is convolved with high pass filter and a low pass filter. The result of latter convolution is smoothed version of the input, while the high frequency part is captured by the first convolution. The reconstruction involves a convolution with the synthesis filter and the results of this convolution are added. In two dimensional transform, first apply one step of the one dimensional transform to all rows and then repeat to all columns. This decomposition results into four classes or band coefficients [5]. The Haar Wavelet Transform is the simplest of all wavelet transform. In this the low frequency wavelet coefficient are generated by averaging the two pixel values and high frequency coefficients are generated by taking half of the difference of the same two p ixels. The four bands obtained are approximate band (LL), Vertical Band (LH), Horizontal band (HL), and diagonal detail band (HH) as shown in Figure(1). The approximation band consists of low frequency wavelet coefficients, which contain significant part of the spatial domain image. The other bands also called as detail bands consists of high frequency coefficients, which contain the edge details of the spatial domain image [5, 6]. DCT Transform The discrete cosine transform (DCT) is closely related to the discrete Fourier transform. It is a separable linear transformation; that is, the two-dimensional transform is equivalent to a one- dimensional DCT performed along a single dimension followed by a one-dimensional DCT in the other dimension [7] .The definition of the two-dimensional DCT for an input image A and output image C is ….(1) for u, v = 0,1,2,…,N −1 and α(u) and α(v) are defined as follows: ………..(2) IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.24 (3) 2011 The Proposed Method The proposed method consists of two stages, the first for embedding process and the other for extracting process as shown below: -The embedding algorithm: step1: input the cover image (24 bit) and the hidden image (24 bit). Step2: divide the cover image into equally four blocks (N*N) Step 3: for each block do the following i) Decompose the block into R (red), G (green), and B (blue) channel and choose on of them (depending on highest color ratio). ii) Decompose the selected block by using Haar wavelet transform. Step4: preprocessing the hiding image by dividing it into equally four parts M*M. Step5: apply DCT transform to each part and all three channels (R, G, and B). Step6: insert DCT coefficient of part 1with high sub-band {HH} of part1 of the cover image. Repeat step 6 for all hiding image parts to hidden in all (HH) parts of cover image. Step7: Reconstruct the image by using inverse Haar wavelet transform to each part. Step8: combine each part with other two channels then combine the four parts together Step9: Display stego image. -The Extraction algorithm step1: Input stego image. Step2: Decompose image into four equally blocks and find the selected channel for each block Step3: decompose each part by using Haar wavelet transform. Step4: Extract hidden parts from all four (HH) sub-band. Step5: convert each part into the spatial domain by using IDCT. Step6: combine and display the hiding image - Experimental Result This research implements into many images, this results for one image. In the experiment, the cover images are 512*512 color image and secret images are 128*128 color image as shown in fig. (2). The processing on the cover image are divided it into four parts and choosing one channel for each part then applying 2_D DWT on each part. The result for first part after choosing the green channel and applying 2-d dwt is shown in Fig. (3). The hiding image is also divided into four parts then applying DCT on each part Fig. (4) showed applying DCT in red color). Then embedded each hiding part in one HH sub-band. Fig.(5) showed the stego image and retrieval image. The Histogram of the origin cover image and the stego image is shown in Fig. (6). Another way to measure the invisibility of the hidden message in terms of the Peak Signal- to-Noise Ratio (PSNR)[6]: MSE PSNR 2 10 255 log10 …… (3) where the Mean Square Error (MSE) is defined as: IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.24 (3) 2011        1 0 1 0 2 ),(ˆ),( 1 M m N n nmxnmx MN MSE …… (4) Where N, M the size of the cover image(x), and stego image (x̂ ) respectively. In our experiment the PSNR=64.8233 and MSE=0.02141 Conclusions There is a number of conclusions which were derived from this research:- 1. In this research we increase the security by hidding the coefficient of DCT of hiding image in transform domain methods (DWT). 2. To achieve high security the hidden process is in one channel in each quarter of the cover image and in HH sub-band only. 3. We can increase the amount of payload hidden message by using another sub-band like HL and LH. References 1.Manjunatha, H S.and Raja K B. (2010), High Capacity and Security Steganography using Discrete Wavelet Transform, International Journal of Computer Science and Security (IJCSS), 3: Issue (6). 2.Cox, I.J. Miller M. L. and Bloom, J. A., (2002), Digital Watermarking”, Morgan Kaufmann Publishers. 3.Meerwald, P. and Uhl, A., (2001), A Survey of Waveletdomain Watermarking Algorithms, Security and Watermarking of Multimedia Contents III, Proceedings SPIE 4314: 505-516. January 20 - 26. 4.Elbasi, E. and Eskicioglu, A. M., (2006), A DWT-Based Robust Semi-Blind image Watermarking Algorithm Using Two bands” Proc. SPIE, 6072. 5.Tong, L.and Zheng-ding, Q. (2002), DWT-based color Images Steganography Scheme, IEEE International Conference on Signal Processing, 2:1568-1571. 6.Dharwadkar, N. V.and Amberker, B. B., (2010), An Efficient Non-blind Watermarking Scheme for Color Images using Discrete Wavelet Transformation”, International Journal of Computer Applications (0975 – 8887) 2(3). 7.Strang, G. (1999), The Discrete Cosine Transform” SIAM Review, 41( 1): 135-147. Fig. (1): Two dimensional wavelet transformation of an image Image H L LL LH HL HH LL2 LH2 HL2 HH2 LH HL HH IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.24 (3) 2011 Fig. (2): The origin images Fig. (3) :Applying 2-D DWT on first part of cover image (a) Origin cover image (b) origin hiding image IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.24 (3) 2011 Fig.(4) Applying DCT on each part of hiding image Fig. (5) The stego image and retrieval image Fig.(6) The histogram of the origin cover image and the stego image (a) Stego image (b) extracted image 2011) 3( 24مجلة ابن الهیثم للعلوم الصرفة والتطبیقیة المجلد وتحویل الجیب تمام ل المویجيیو باستعمال التحالصورة الملونة في االخفاء االء عبد الحمید عبد اللطیف جامعة بغداد ،كلیة لتربیة ابن الهیثم ،قسم علوم الحاسبات 2011،اذار ، 1: استلم البحث في 2011، ایار ، 10:قبل البحث في الخالصة ستعمال غطاء اب وهو علم اخفاء المعلومات . عملیة االخفاء باستعمالان البیانات االمنة تنتقل خالل شبكة االنترنیت اربعة علىقسمت هذه الصورة ، في هذا البحث استعملت صورة ملونة كغطاء . غیر مهم بحیث ال یثیر شكوك اي شخص عتماد على اعلى وتمت عملیة االختیار باال) احمر او اخضر او ازرق ( ةواحد قناة لونیةاجزاء متساویة ولكل جزء اختیر .ستعمال التحویل المویجياب) LL, LH, HL, HH( اربع اجزاء علىالجزء المختار یقسم . نسبة لونیة موجودة في ذلك الجزء ثم تخفى ) DCT(تحویل الجیب تمام اربعة اجزاء متساویة وبعدها یطبق على كل جزء علىاما الصورة التي یراد اخفائها فتقسم ئیة اكدت التجارب ان البیانات المخفیة داخل الصورة الغطاء كانت غیر مر . من الصورة الغطاء) HH(اء هذه االجزاء في اجز . MATLAB 7.8 برنامج عماللطریقة المقترحة قد نفذت باستا ان .وامنة التحویل الجیب تمام ،اخفاء البیانات، العالمة المائیة ، التحویل المویجي :مفتاحیةالكلمات ال