A Novel Image Encryption Supported by Compression Using Multilevel Wavelet Transform

In this paper we propose a novel approach for image encryption supported by lossy compression using multilevel wavelet transform. We first decompose the input image using multilevel 2-D wavelet transform, and thresholding is applied on the decomposed structure to get compressed image. Then we carry out encryption by decomposing the compressed image by multi-level 2-D Haar Wavelet Transform at the maximum allowed decomposition level. These results in the decomposition vector C and the corresponding bookkeeping matrix S. The decomposition vector C is reshaped into the size of the input image. The reshaped vector is rearranged by performing permutation to produce encrypted image. The vector C and the matrix S serve as key in the process of both encryption and decryption. In this analysis, we have noticed that the reconstructed image is a close replica of the input image.


INTRODUCTION
An image is to be compressed so as to reduce the storage space and increase the speed of transmission.Image compression [1] is of two types: lossy or lossless.In lossless compression, the recovered data is identical to the original, whereas in the case of lossy compression the recovered data is a close replica of the original with minimal loss of data.Lossless compression can be used for text, medical images and legal documents etc. whereas lossy compression is used for natural images, speech signals etc. Images are widely used on several processes, including the Internet, and hence protecting confidential image data from unauthorized access has become an important issue in information security.Cryptography plays a vital role in information security.Cryptography [2] is the art or science that transforms a message (plaintext) into an unintelligible form (ciphertext) and then retransforms that message back to its original form.
Wavelets [3] have gained widespread acceptance in signal processing and image compression applications due to their utility in multi-resolution analysis.A basic wavelet is an oscillatory function that has limited duration.Wavelets are obtained from a single prototype wavelet called mother wavelet by dilations and shifting.Mathematically a wavelet is denoted by the function.
where a is the scaling parameter and b is the shifting parameter.The transform based on wavelets is called wavelet transform.Wavelet decomposition of an image is used to analyze the image at different frequencies with different resolutions that gives specific information.This information can be used for processing the image, such as image compression.Wavelet transforms are of two types.One is Continuous Wavelet Transform and the other one is Discrete Wavelet Transform.Several researchers [4][5][6][7][8][9][10] have dealt with image compression using wavelet transform.
An alternative representation to wavelet transform is the multiwavelet transform [11][12].Multiwavelets are very similar to wavelets but have some important differences.In particular, wavelets have an associated scaling function Φ(t) and wavelet function Ψ(t), whereas multiwavelets have two or more scaling and wavelet functions.Multilevel wavelet transforms find a wide variety of applications.They can be used can be used for compression, denoising, egde detection and encryption.In a recent investigation, Debayan et al. [13] have developed an algorithm for text encryption using multilevel 1-D wavelet transform.
In the present paper, our objective is to develop a novel method for image encryption supported by compression using multilevel 2-D Wavelet Transform.Firstly, we compress the input image using multilevel 2-dimensional wavelet transform and the compressed image is then encrypted by using a multilevel 2-dimensional Haar Wavelet Transform.
In what follows we present the plan of the paper.In section 2, we explain the proposed method.Section 3 describes the process of image compression using wavelet packet transform.We present a novel approach for wavelet-based image encryption in section 4. We provide an illustration in section5.Finally in section 6, we deal with computations that are carried out in this analysis and draw conclusions.

II. PROPOSED METHOD
When network bandwidth and storage space are limited, image has to be compressed.It is necessary to protect the image data during transmission from unauthorized access.Therefore to reduce the time for encryption, the image is first compressed prior to encryption.Reverse operations are performed at the receiving end to reconstruct the original image.The Schematic diagram of the proposed method is shown in Figure 1 The proposed method is implemented by the following steps.

Decomposition: Choose a multilevel 2-D wavelet transform having the number of decomposition levels as N.
Compute the wavelet decomposition of the input image at level N.

Thresholding:
For each level from 1 to N, a threshold is selected and global thresholding is applied to the detail coefficients.

Encryption:
The compressed image is encrypted by using multilevel 2-D Wavelet Transform (Haar).

Decryption:
The reverse process of encryption is performed to get the compressed image.The algorithm for wavelet based image encryption is given below.

Algorithm for image encryption 1) Read the input (compressed) image. 2) Decompose the input image at the maximum allowed level, using multilevel 2-D Haar Wavelet Transform to get decomposition vector C and the corresponding bookkeeping matrix S.
3) Store the vector C and the matrix S.

4) Reshape the coefficients of the decomposition vector C to have the size of the input image (N -by-N). 5) Rearrange the vector coefficients by performing permutation to produce encrypted image.
By performing inverse operations for the above steps in the reverse order, we get back the input compressed image which is the decrypted image.It is to be noted here that the decomposition vector C and the corresponding bookkeeping matrix S serve as key for both encryption and decryption.

III. WAVELET APPROACH FOR IMAGE COMPRESSION
Image compression is one of the most successful applications of wavelet transform.The Wavelet Transform can be implemented using specially designed digital filters.Let us consider an image F(x,y) of size N×N.The samples of the input image are passed through a low pass filter and a high pass filter simultaneously, and the filter outputs are downsampled by two along rows.Then the filter outputs can be further decomposed using the same filters and down-sampled by two again along columns, giving the approximation coefficients matrix (LL) and the detail coefficients matrices (LH, HL and HH) each of size N/2× N/2 as shown in Figure 2. To have a clear idea, Figure 2 can be seen as shown below.The approximation coefficients matrix (LL) is called low resolution sub image.The sub images HL, LH and HH give horizontal, vertical and diagonal details respectively.multiwavelet decompositions produce two low pass subbands and two high pass subbands in each dimension.This kind of decomposition can be repeated to further increase the frequency resolution and the approximation coefficients decomposed with high and low pass filters and then downsampled.In this analysis, we have conducted experiments using multilevel wavelet transforms based on Haar, Biorthogonal, Coiflet, Discrete Mayer Wavelet, Symlet, and we have taken the number of decomposition levels 3 to 5. However we have included levels 3 and 4 only in our analysis (See table I in section 6) for brevity in representation.
In the process of multilevel wavelet decomposition, many of the wavelet coefficients we have obtained are close to or equal to zero.Most of the information is included among a small number of the transformed coefficients.So, we truncate or quantize the coefficients including little information using thresholding.Thresholding can modify the coefficients to produce more zeros.Three types of thresholding [1] techniques can be used: local thresholding, global thresholding and dynamic thresholding.Local tresholding is one in which a different threshold is applied to each sub image where as a single threshold is applied to all sub images in global thresholding.Dynamic thresholding uses different thresholds for each coefficient separately.In our analysis, leveldependent global thresholds are selected based on Birge-Massart strategy and applied on detail coefficients as www.ijacsa.thesai.orgapproximation coefficients cannot be thresholded.This will produce many consecutive zeros which can be stored in much less space and transmitted more quickly.
It is to be noted here that the low pass filter and the high pass filter are related to each other and they are known as the quadrature mirror filters which will make image reconstruction possible.

IV. WAVELET BASED IMAGE ENCRYPRTION
In this section we present a novel method for image encryption using Wavelet Transform.The compressed image which we have obtained in section III is decomposed by multilevel 2-D Haar Wavelet Transform at the maximum allowed decomposition level and get the decomposition vector C and the corresponding bookkeeping matrix S. We reshape the decomposition vector C into a matrix form of size N×N.We rearrange the vector coefficients by performing permutation to obtain the encrypted image.
By performing inverse operations in the reverse order, we get back the input (compressed) image.The advantage of wavelet based image encryption is that the encryption time gets reduced and the decryption time also becomes small.

V. ILLUSTRAION OF THE METHOD INVOLVING COMPRESSION AND ENCRYPTION
Consider the image of Gandhiji of size 256x256 which is shown in Figure 4, given in section VI.Let us focus our attention on a portion P of the image of size 8x8 which lies in between the rows 1 to 8, and the columns 1 to 8. On representing this portion of the image in terms of its pixel values, we get the matrix given below.
Here T denotes transpose of the vector.We have obtained the decrypted matrix D based on the multi-level wavelet decomposition structure [rC,S].This is given by It is to be noted here that the decrypted matrix D and the compressed matrix CP are the same.Thus, by performing multilevel 2-D wavelet reconstruction based on the decomposition vector c and its corresponding bookkeeping matrix s, we have reconstructed the matrix rP which is a close replica of the original input matrix P.This is given by It may be noted here that the reconstructed matrix rP is an exact replica of the original input matrix P as the elements of the rP are rounded off to the nearest integer.
Here the decomposition vector and the corresponding bookkeeping matrix serve as key in the process of encryption and in the process of decryption.

VI. COMPUTATIONS AND CONCLUSIONS
In this paper we have implemented a novel approach for image encryption supported by compression using multilevel wavelet transform in MATLAB [14] .
We have considered multilevel 2-D Wavelet Transforms, namely, 'haar' 'bior6.8','coif5','dmey''sym8' for image compression and multilevel 2-D Haar wavelet transform for image encryption.We have conducted experiments using the above wavelets for three test images 'Lena', 'Gandhiji' and 'Lady'.The input image of Gandhiji of size 256x256 and its corresponding compressed, encrypted, decrypted and reconstructed images are shown below for the decomposition level 4.     In this analysis, we have found that wavelet transform is very powerful and extremely useful for compressing data such as images.It is quite interesting to see that both compression and encryption are carried out by using wavelet transform.

Size File Compressed
Size File ed Uncompress CR  www.ijacsa.thesai.orgWavelet transform 'sym8' demonstrates better performance.It is observed that for a fixed decomposition level, the increase in value of threshold results in greater compression while for a fixed value of threshold, compression score/ratio decreases with increase in decomposition level.Wavelet based image encryption could be useful in a lot of commercial applications whereby large image databases can be rendered illegible to unauthorized users.We conclude that the compression ratio depends on the type of image and type of transforms because there is no filter that performs the best for all images pertaining to different applications.

5 .
Reconstruction: Perform multilevel 2-D wavelet reconstruction of the decrypted image to get a close replica of the original input image.

Figure 1 .
Figure 1.Schematic diagram of the proposed method

Figure 4 .
Figure 4. Input image of Gandhiji

Figure 7 .
Figure 7. Decrypted image We have calculated output parameters like compression score, compression ratio that determine the efficiency of the proposed system.Compression score is given by Compression score in percentage = 100*(number of zeros of the current decomposition)/ number of coefficients)

Figure 7 .
Figure 7. Reconstructed image Compression ratio (C R ) is defined as

TABLE I .
Performance comparison