Performance Analysis of DCT Based Lossy Compression Method with Symmetrical Encryption Algorithms

In the modern era, the issues pertaining with secured, fast and efficient image transmission with limited bandwidth are challenging task. This provides a platform to the researcher to work on image compression-encryption (CE) methodologies. To influence the degree of compression, this paper presents a DCT based compression algorithm using luminous quantization followed by advanced encryption standard (AES) and data encryption standard (DES) encryption methods. In this paper, the effect of encryption over compressed image in terms of PSNR and SSIM is analysed. Efficiency of the AES and DES encryption algorithms are compared based on key space, histogram and differential analysis. The experiment is performed on five different test images. From the results, it is observed that DCT-AES combination of compression-encryption algorithms gives higher resistance to redundant data and provides better security to information during transmission.


Introduction
In recent years, the advancement in information science and technology broadly affects the human daily life. The size of digital data is growing rapidly in order to achieve images of high quality. As a consequence, it requires large space to store and larger bandwidth for transmission over communication channel. Although there is rapid advancement in computer technology for storage techniques, but much of the time, it requires reducing digital data storage so that data can be transmitted faster with limited bandwidth over communication line. The image compression facilitates to transmit large size images with minimal bytes and to restore the image with good quality on reception. Redundant and irrelevant information is removed during image compression using lossy or lossless compression [1]. In lossy image compression redundant information is completely discarded so image quality degrades after reconstruction [2]. Lossless image compression method ensures the transmission of image data with full information and better quality [3]. In modern era of digital data technology, the data transmission through electronic media provides the exchange of information with state of security and secrecy. The cryptographic mechanism provides secure transmission of information or image. In cryptography mechanism the original data is scrambled with a security key to accomplish privacy and integrity of data [4]. In encryption, at the transmitter side, the information or image is encoded with a key, and the original information can be revealed at receiver side through decryption using same key which is used for encryption [5].

EAI Endorsed Transactions on
Energy Web 05 2020 -07 2020 | Volume 7 | Issue 28 | e13 On a fundamental level, compression and encryption are two limiting frameworks. Encryption guarantees that transmitted information is trustworthy and essential by changing over it from comprehensible into muddled data with the use of an encoding system [6]. Compression methodology attempts to diminish the size of moved or set away data by finding and emptying duplicate segments of confirmation or instances of data [7]. Nevertheless, compression and encryption are two important steps during processing of image data and both the processes are significantly related. For secure transmission of image with minimum bandwidth, image compression and encryption processes must be used simultaneously [8]. The focuses are to create a more diminutive data size; better quality of data during reconstruction and fasten transmission of data over limited bandwidth with security. In this paper, we have used the compression technique before encryption because the utilization of compression algorithm before applying encryption algorithm will decrease facsimile part of information which is inclined for cryptanalytic misuse [9]. Likewise, compression of data can accelerate the encryption procedure, and corresponding decoding procedure will construct the plaintext. Since the data compression eliminates repetition of data and also since cryptanalysis utilizes frequency analysis concept that depends on redundant data findings so to use first compression before encryption reduces the viability of cryptanalytic assaults [10]. This paper is having further 5 sections. Section 2 comprises the literature review in which various researches on image compression and encryption methodologies is discussed. Section 3 describes fundamental knowledge about discrete cosine transform (DCT), AES, DES algorithms and performance evaluation parameters. Section 4 illustrates the proposed algorithms. Results and discussions are presented in section 5. Finally, Section 6 includes conclusion and future works.

Literature review
Loussert et al. [11] have proposed a hybrid compression and encryption model. In this paper, the compression is based on DCT transformation while the encryption is based on bit XOR operation where finger prints are used as a key. These methods are applied on various samples of data and results shows that if transmission time increases then the processed data is more secure and robust against different cryptanalytic attacks. Krikor et al. [1] have proposed a encryption algorithm which reduces the process of computation for big size images. In this algorithm the encryption is performed on small stream of bits instead of encrypting full image. In proposed method the image is decomposed in 8x8 blocks. DCT transformation method is applied to transform the 8x8 block of image in frequency domain from spatial domain. The stream cipher i.e. nonlinear back shift register method is used to encrypt the high frequency image blocks. The proposed encryption uses a 48 bits key. For encryption of image using nonlinear shift register method by generating pseudorandom sequence first 32 bits are utilized and to randomize the image remaining 16 bits are used to develop rows and columns. The result shows that the proposed algorithm of encrypting small stream of bits is having high security than if full image data is encrypted. Gupta and Silakari [12] presented compression and encryption algorithms using chaos theory. In this paper the compression algorithm is used before the encryption process for faster transmission of data. Curvelet transformation is used for compression which removes redundancy in image data. The experimental results shows that the average PSNR is more than 30dB, average entropy is nearly 8, NPCR is more than 99% and UACI is above 33%. These results show that the proposed method gives better transmission performance in terms of security and speed. Li and Lo [13] recommended a method for hybrid compression and encryption for JPEG image. The motive of this paper is to increase the encryption power with maintaining the compression efficiency. In this paper AC coefficient encryption, DC coefficient encryption and orthogonal transform transformation operation of encryption algorithm are utilized. In this paper sign-flip into butterflies operation on 8x8 DCT transform blocks is applied. The testing result shows that the proposed algorithm shows better security of image from statistical and replacement attacks. Alfalou et al. [14] have proposed a methodology to perform compression, encryption with fusion of multiple images simultaneously. In this proposed algorithm DCT method is adopted and spectral fusion is utilized simultaneously as per the properties of DCT, spectral filtering, and quantization of encoded frequency. The study shows that the encryption efficiency can be improved if the rotation angle of every block varies randomly just before the fusion. Biometric locks are used to increase encryption efficiency. The results show that the presented algorithm gives the compression ratio of 50% which is higher than the conventional method. Zhiqianga et al. [15] have proposed a combined image compression and encryption for JPEG images. The encryption algorithm uses a chaotic based operation. The results shows that the proposed algorithm giving better compression ratio with better security during transmission. Goel, N et al. [16] has combined the lossy and lossless compression methods. DCT is used for lossy compression and Huffman coding is used for lossless compression methodology. Logistic map method is used to perform symmetric encryption process. This paper presents a pictorial view of logistic map dimension which have been used as pseudorandom numbers. This paper shows that many shortcomings of dictionary-scrambling-based encryption technique can be overcome by using proposed methodology. The researcher has used low contrast images as test data and it gives high PSNR values. Ou et al. [17] have developed an hybrid compression encryption algorithm to process the image data. In this paper DWT is combined with the Haar wavelet transform without quantizer to perform the compression process. The AES algorithm is used for encryption purpose. The motive of this paper is to develop an algorithm by which high compression ratio can be generated for compressed images without disturbing the security concern. By this method the image data can be transmitted on lower bandwidth with security. The proposed method is applied on six gray scale images having different sizes and it also shows that the reconstructed images are efficient and having high quality.

EAI Endorsed Transactions on
Energy Web 05 2020 -07 2020 | Volume 7 | Issue 28 | e13 Shen H., L. Zhang et al. [18] have proposed an burgeoning compressive sensing based baysian dictionary learning algorithm. Authors have used this algorithm to overcome the problem of dead pixel strips in MODIS. These dead pixel strips are spread over large area of satellite images in band 6 and corrupt the products of MODIS. Authors have demonstrated the efficiency of proposed algorithm on Terra and Aqua images. Zhou N., Zhang A. et al. [19] have proposed a method for hybrid compression and encryption to provide easy distribution and storage of the encryption key. In this algorithm, the input image is divided in four blocks and pixels of two adjacent blocks are randomly exchanged by random matrices. These random matrices are bounded by measurement matrices. Authors have shown that proposed algorithm provide better security and moderate compression efficiency.

Image Transformation
The image transformation represents transforming of image data from one domain to another domain. During image transformation the data sequence of image is transformed from spatial domain to frequency domain or vice versa. This transformation enables the extraction of various features of image that may not be detected in spatial domain. In every transformation technique data should be divided into sub bands which are having least dependence on each other. In this paper, DCT based compression algorithm is proposed for compressing the image data. The proposed DCT based compression algorithm designed to operate M×N block sizes. During DCT transformation, block is divided in to two bands, one is low frequency band which has important visual information of the image and another band is high frequency band which has texture and details of the image. The DCT operates a block B of M×N samples and creates Z, which represent M×N block of coefficients. The high frequency coefficients are least important than lower frequency coefficients because high frequency coefficients values are usually closed to zero. In this research, for designing the DCT based compression algorithm, the high frequency band is removed. The DCT of an M×N sample block is represented as: (1) The values , are called the DCT coefficients of image. The result of the DCT transformation for a block in the spatial domain is a set of frequencies that are arranged in a zigzag ascending order as shown in Figure 2. The frequency located at f (0, 0) is the lowest frequency and is called the DC value. This value represents the general style of the block and considered to be the most important frequency amongst all the other frequencies in the block. The rest of the frequencies range from low to high in a zigzag pattern and are called the AC values. The AC values contain the details of the block which range from general to fine details, as we progress forward in the zigzag order.

Original Image
Reconstructed Image

DCT based compression algorithm
DCT has block artifacts that can be minimized by selecting small size of block. By using 8x8 block size and applying quantization minimize each pixel value 0 to 32 so 5 bits needed to represent pixel value.
1. Gray scale image is taken as input to compress. If original Input image is coloured then converted into gray scale image. 2. Each pixel value is subtracted by 128 to put 0 in the middle of the range. 3. Then resultant matrix is divided into blocks of size 8x8. 4. DCT is applied to each block to convert pixels in the spatial domain into coefficients in the frequency domain. DCT element (0,0) is the average value of the block the other element tells about spectral power present at each spatial frequency. 5. Less important DCT coefficient are wiped out by using quantization. 6. Linearize the 64 element of each block using zigzag scanning and apply run length encoding. 7. Encodes the numbers using Huffman encoding. 8. Compressed image is encrypted using AES.

AES algorithm for encryption
AES has flexibility in key length. Same plaintext block size can use 128 bit, 192 bit key or 256 bit key for different no. of rounds respectively 10, 12 or 14. This feature of AES makes it more secure against cryptanalysis attacks. Al l operations are performed on entire byte rather than on each bit of plaintext and key. AES algorithm steps involve onetime initialization process followed by processes in 10 rounds.  Using S-box generated plain text byes are replaced.

A. One time initialization process
 Bytes in each row of the substituted plaintext are rotated by row no.  Using Galois field multiplication mix column operation is performed on generated bytes. Resulting matrix is XORed with the key for this round. In reverse order the same process is executed for decryption.

DES Algorithm for encryption
The Data Encryption Standard (DES) is a block cipher symmetric key cryptographic algorithm, which is published in January 1977 by the US National Bureau of Standards [2], [3]. Input binary data is divided into blocks of size 64 bits that is encrypted by using key of length 56 bits. Confusion (substitution) and diffusion (transposition) are the Basic fundamentals of cryptography that is used in DES. In Data encryption standard algorithm, initially 64 bits in a block is permuted where jugglery of bit positions EAI Endorsed Transactions on Energy Web 05 2020 -07 2020 | Volume 7 | Issue 28 | e13 Performance Analysis of DCT Based Lossy Compression Method with Symmetrical Encryption Algorithms 5 take place. 64 bits permuted data is divided into two halves each of 32 bits that is known as left plaintext and right plaintext. 16 identical rounds are performed on these two blocks using the key. These 16 identical rounds consist of key transformation, permutation and substitution and finally XOR operation. After completing 16 rounds final permutation is performed. During each round following operations are performed:  In key transformation process different 48 bit key is generated using compression permutation.  Generate different 48 bit key during each round makes DES highly secure.  Right plaintext data of 32 bits is expanded to 48 bits using expansion permutation.  This 48 bit expanded data is XORed with 48 bit key.  Using S-box substitution 48 bit input is substituted in 32 bits Right plain text.  32 bit right plain text data is permuted and then XORed with 32 bit left plaintext.  Reverse process is applied for decryption.  During decryption process subkeys are used in reverse order

Performance evaluation metrics
Image compression reduces the size of transmitted or storage data but the challenge is to have no destruction in reconstructed image at receiver end. Peak signal to Noise ratio (PSNR) and Structural similarity index (SSIM) are the two important features of image compression technique. For a good image compression technique the compressed image must have high values of PSNR and SSIM. Image encryption algorithms change the pixel value of an image. These changes in pixel values must be maximum and be in an irregular manner. The encrypted image must contain totally random patterns so that no feature of original image can be extracted by these random patterns. The encrypted image must have low correlation with original image.

The image compression performance parameters
The quality of compressed image can be measured by calculating PSNR in dB and SSIM in percent. PSNR is defined as the ratio of square of input image size and the Mean Square Error (MSE). The image quality and PSNR are directly proportional to each other i.e. as PSNR increases the compressed image quality also increases.
The Mean Square Error can be expressed as, Where , and , denotes the original and reconstructed pixel respectively, and the images are of size × . Structural Similarity Index (SSIM) evaluates the similarity between processed image and original image. The SSIM depends on luminance, contrast and structural term. The overall index is a multiplicative combination of the three terms.

The image encryption performance parameter
The motive behind the encryption of data is to protect the information from brute force attacks. In encryption algorithms, the original image is substituted by encrypted images and both the images i.e. original image and encrypted image are uncorrelated with each other. The performance of an image encryption algorithm is evaluated EAI Endorsed Transactions on Energy Web 05 2020 -07 2020 | Volume 7 | Issue 28 | e13 based on key space analysis, histogram analysis and differential analysis.

Key space analysis
The key-space analysis of an encryption algorithm is the wide range of possible keys that can be utilized for data encoding using that algorithm. To make the brute force attack infeasible, the range of the keys must be suitably large so that key space can be large.

Histogram analysis
For a better security of the transmitted information the encryption algorithm should not provide any statistical alignment between encrypted image and original image. The pixel value distribution of an image can be viewed with the help of histogram analysis. The histogram of original image has sharp rises and sharp falls while the histogram of encrypted image has uniform distribution. Both the histograms of encrypted image and original image have no statistical similarities.

Differential analysis
The encrypted image should be sensible to small changes in input image. The linkage between original image and encrypted image can be analyzed by modifying only single pixel in original image and observe the variation in cipher image. If the variations in cipher image are significant with respect to small changes in original image, then the encrypted image is secure from differential attacks. When one-pixel value is change in original image then Number of Pixels Change Rate (NPCR) gives difference in pixel values of two generated cipher text in terms of percentage. To show resistance of algorithm against differential attack percentage value should greater than 99%. Consider the two cipher-images, C 1 and C 2 , whose corresponding plain images have only one pixel difference the NPCR of these two images is defined as Where M×N defines the size of image and ( , ) is defined as Unified Averaged Changed Intensity (UACI) gives averaged changed intensity difference between original and modified cipher text images. The mathematical formula of UACI is given by

System environment
The computer system used in this simulation is Windows10, and the simulation software used is MATLAB 2018B.

Results and discussions
In this paper the digital images which are two-dimensional digital data are selected for experimental purpose. The test data set contains 5 digital images on which experiments have been performed. The standard images like Baboon, Boat, Lina, Pepper and Barbara are used in this article. All images are gray scale having size of 512 × 512 and .BMP format. In this article, compression algorithms are applied first and then compressed images are encrypted. It can be seen from literature review that the cost of security is minimum if compression is performed before encryption [20]. analyzed based on their histograms and it is found that both the images and corresponding histograms are similar.      Table 1 compares the PSNR value for 5 test images under three case studies. It is observed that PSNR value increases while the encryption process is applied after compression. The value of PSNR during DCT-AES and DCT-DES compression-encryption process is greater than 30dB which shows that human visual system can not identify the difference between original image and processed image [25].

DCT-DES Compression-encryption algorithm results
The increase in PSNR value in DCT-AES compressionencryption algorithm is higher than the DCT-DES. Fig. 8 is showing the graphical representation of PSNR values for all five test images.    the table 3 and table 4, it is observed that in both the encryption algorithms the values of NPCR and UACI is higher than the threshold limit for all 5 test images.
The values of NPCR and UACI during DCT-AES compression-encryption algorithms are higher than the DCT-DES compression-encryption algorithms. The graphical representation of NPCR and UACI for both the compression-encryption algorithms for different test images is shown in Fig. 10 and Fig. 11 respectively.

Conclusion and future research
In this paper, we present a DCT based compression algorithm for compressing the image. The compressed image is encrypted by two different encryption algorithms AES and DES. The efficiency of proposed compressionencryption methods is analyzed through PSNR, SSIM, NPCR and UACI. From the results it is observed that combination of DCT-AES compression-encryption algorithm provides higher values of PSNR and SSIM. From both the combinations of compression-encryption methodology, the value of NPCR and UACI is larger than 99% and 33% respectively but DCT-AES combination provides higher NPCR and UACI in comparison with DCT-DES combination. It has been authenticated that the DCT-AES combination of compression-encryption algorithm capable of removing redundancy in image data effectively and also provides better security during transmission. The proposed research can be further implement and analyse on colour images as well as on high quality satellite images. The presented research can also be further extended on encryption followed by compression methodology.