Image Encryption and Compression using java
Volumn 2

Image Encryption and Compression using java

Avinash Bodhe#1, Neha Welekar*2, Jay Rahate#3, Puja Sao #4
# Guru Nanak institute of Engineering and Technology .Nagpur. India.
Faculty of information technology, RTMNU


Image compression schemes proposed by previous projects had no assurance of security. Similarly image encryption scheme proposed by the other people have no consideration of compression. So on this project a simultaneous image compression and encryption will be performed .Which will give us security as well as image size will be no issue. The order of the two processes viz. compression and encryption is JCE i.e. image will be simultaneous encryption and compression will be perform. JCE (Joint Compression and Encryption) is most safe and fast technique for image encryption and compression. For image encryption, a Blowfish Algorithm is used. Similarly for compression, RLE is used. Image Compression is concerned with minimizing the number of bit required to represent an image. The compression can be lossless or lossy. Image Encryption is hiding image from unauthorized access with the help of secret key that key can be private or public and for decryption and decompression Blowfish Algorithm and RLE will be used respectively.

Keywords – image encryption, image compression, image decryption, image decompression.


A digital image is a numeric representation (normally binary) of a two-dimensional image. Depending on whether the image resolution is fixed, it may be of vector or raster type. By itself, the term “digital image” usually refers to raster images or Raster images have a finite set of digital values, called picture elements or pixels. The digital image contains a fixed number of rows and columns of pixels. Pixels are the smallest individual element in an image, holding quantized values that represent the brightness of a given color at any specific point. Typically, the pixels are stored in computer memory as a raster image or raster map, a two-dimensional array of small integers. These values are often transmitted or stored in a compressed form. Vector images resulted from mathematical geometry (vector). In mathematical terms, a vector consists of point that has both direction and length. Often, both raster and vector elements will be combined in one image; for example, in the case of a billboard with text (vector) and photographs (raster). Image compression scheme proposed by researcher papers have no consideration of security. Similarly image encryption scheme proposed by the research papers have no consideration of reduction in image size. In this work a simultaneous image compression and encryption scheme is discussed. Compression means to reduce to size of image to save memory core. The compression can be lossless or lossy. If the reconstructed image from the compressed image is identical to the original image then it is a lossless compression otherwise it is a lossy compression. Image Encryption is hiding image from unauthorized access with the help of secret key that key can be private or public. However alone compression is not sufficient as it has an open access, anybody can access it. So if it is desired that it can be accessible only by authorized person it should be encrypted as well.


The work on image compression and encryption performed by various researchers can be categorized in any of the following categories.

A. Compression followed by Encryption (CE)

In this sequence an intruder has less cleaves to access image but encryption may again increase the size.

B. Encryption followed by Compression (EC)

In this sequence size is not again increased but an intruder may have more cleaves to access the image.

C. Joint Compression and Encryption (JCE)

This approach is mostly used in recent days which may be fast as compared to previous two but procedure is complicated. The said categories are shown in fig 1.

Figure 1. Classification of Compression and Encryption Scheme

A. Research work on CE Approach

  1. Howard Cheng and Xiaobo Li [1] performed compression using quad tree compression algorithm. And only partial encryption is applied. 13–27% of the output from quad tree compression algorithms and and less than 2% for 512X 512 images compressed by the SPIHT algorithm is encrypted. Limitation is that a different scheme has to be designed and analyzed for each compression algorithm.
  2. A. Alfalou C. Brosseau et al. [2] performed compression based on the discrete cosine transform (DCT). Two levels of encryption are used. The first one is due to the grouping of the DCTs in the spectral domain and after a second transformation, i.e. to hide the target images, one of the input images is used as encryption key. The compression is better than JPEG in terms of PSNR. The proposed method achieves PSNR as 21.7186 as compared to that of JPEG as 20.6904 on applying on Lena image.
  3. N.V.Thakur and O.G.Kakde [3] proposed the compression and encryption based on the fractal coding and spiral architecture but the compression method are lossy. Additionally to reduce time complexity of fractal coding of FFT based cross correlation is used. Any specific encryption method is not specified and any stream cipher algorithm can be used. Their experiment result are better than that of quadtree method w.r.t PSNR ratio and encoding time

The researched work referred on CE approach is analyzed in Table 1.

[1]Using Quad tree compression AlgorithmSet partitioning in hierarchical trees (SPIHT) algorithm
[2]based on the discrete cosine transform (DCT)By grouping of the DCTs in the spectral domain and then hiding with an input image as encryption key.
[3]Fractal coding is used. To reduce time complexity of fractal codingAny stream cipher algorithm can be used. Regression can be used for


B. Research work on EC Approach

  1. Mingyu Li et al. [4] used a RC5 stream cipher based scalable encryption scheme for low complexity transparent transcoding. CCSDS compression method is used which consist of two part DWT and Bit plane coding. Advantage is that Encryption is scalable.
  2. V.Radha, D.Maheswari [5] proposed image encryption algorithm that consists of two parts: scrambling of plain-image and mixing operation of scrambled image using discrete states variables of chaotic maps. Discrete Cosine transform is used for compression. The proposed algorithm is strong in providing security and is also very fast. Since the key space is large therefore the attacker cannot decrypt an encrypted image without the correct key.

The research work referred on EC approach is analyzed in table II.

[4]A RC5 stream cipher based scalable encryption scheme is used.CCSDS compression method is used which consist of two part DWT and Bit plane
[5]By mixing operation of scrambled image using discrete states variables of chaotic maps.Discrete Cosine Transform is used.

C. JCE Approach

  1. Alfalou et al. [6] used DCT to jointly compress and encrypt the image with a new system able to amalgamate spectral information. That spectral fusion, nondestructive, allows the compression and the encryption of information at the same time. Authors also showed that it is possible to use the DCT to jointly realize a compression and an encryption of the data by spectral fusion thus allowing a very important gain in transmission time.

D. Other Approach

  1. Shiguo Lian et al. [7] proposed a totally different scheme. They carried out partial encryption before and after compression. JPEG is used for image compression. Using chaotic stream cipher encryption is carried out. Encryption consists of three parts: color plane Confusion, Sign encryption and DCT coefficient confusion space. They achieved the 75% compression ratio and 7.6%Encryption time ratio on Lena image of size 256×256.


In this paper simultaneous compression and encryption is applied on a colour image. The order followed is JCE i.e. joint compression and encryption Compression. For encryption and decryption the Blowfish algorithm is used. And for compression and decompressionRLE algorithm is employed. This project will focus on compression as well as encryption which lead to gain the security of image from any unauthorized access to image and also reduction in size of image. For encryption and decryption, Blowfish Algorithm will be used respectively. For compression and decompression RLE algorithm will be used. In this paper we are making an desktop application. First we will browse to select the image from Desktop. After selecting the image we will apply compression algorithm to compress the image. For compression we will used RLE algorithm. This we will reduce the size of our image. The compressed image saved from where we had access the image. After compression we will apply encryption algorithm on compressed image. We are using blowfish algorithm for encryption using key. Encrypted image we will be saved in our desktop. The encrypted image will be sent to receiver. After receiver receive the image, we will decrypt the image using same key. We can simply encrypt our image with the help of key without using compression algorithm.


In this paper, many of the current important image compression and encryption techniques have been presented and analyzed. The best way of fast and secure transmission is by using compression and encryption of multimedia data like images. The research works have been categorized in the following three categories based on the order of the two process viz. CE, EC or JCE. The compression technique observed is either lossy or lossless. Always lossless compression is preferred but to achieve secrecy some image quality degradation is accepted. Encryption applied by different researchers by means of encrypting algorithm which encrypt the entire or partial multimedia bit sequence using a fast conventional cryptosystem . Much of the past and current research targets encrypting only a carefully selected part of the image bitstream in order to reduce the computational load, and yet keep the security level high [8]. In the proposed approach the key is required to send separately. This is a different issue of securely transmitting the secret key. Future scope of the proposed work is that we can design the mechanism to securely transmit the key so that unauthorized person should have no access to it. The performance evaluation factors are PSNR ratio and coding decoding time for compression and encryption respectively. But the balancing parameter for the combined process is not yet been defined.


  1. Howard Cheng and Xiaobo Li, “Partial Encryption of Compressed Images and Videos” IEEE Transactions On Signal Processing, Vol. 48, No. 8, pp. 2439-2451, August 2000
  2. A. Alfalou C. Brosseau, N. Abdallah, and M. Jridi, “Simultaneous fusion, compression, and encryption of multiple images”, OPTICS EXPRESS 24024Vol. 19, No. 24 OSA, 2011
  3. N.V.Thakur, and O.G.Kakde, “Compression Mechanism for Multimedia System in consideration of Information Security” Proceeding of International workshop on Machine intelligence Research MIR Day GHRCE-Nagpur, India, pp. 87-97, 2009.
  4. Mingyu Li, Xiaowei Yi and Hengtai Ma, “A Scalable Encryption Scheme for CCSDS Image Data Compression Standard” 978-1-4244-6943-7/ IEEE pp. 646-649, 2010
  5. V.Radha, D.Maheswari, “Secured Compound Image Compression Using Encryption Techniques”, 978-1-4244- 5967-4/ IEEE 2010
  6. A. Alfalou, A. Loussert, A. Alkholidi, R. El Sawda, “System for image compression and encryption by spectrum fusion in order to optimize image transmission”, ISEN-BREST Laboratory L@BISEN, France, IEEE, 2007
  7. Shiguo Lian, Jinsheng Sun, Zhiquan Wang, “A Novel Image Encryption Scheme Based-on JPEG Encoding”, Proceedings of the Eighth International Conference on Information Visualisation (IV’04) 1093-9547/IEEE, 2004.
  8. Monisha Sharma and Manoj Kumar Kowar, “Image Encryption Techniques Using Chaotic Schemes: A Review” International Journal of Engineering Science and Technology Vol. 2(6), ISSN: 0975-5462, pp. 2359- 2363, 2010M. Wegmuller, J. P. von der Weid, P. Oberson, and N. Gisin, “High resolution fiber distributed measurements with coherent OFDR,” in Proc. ECOC’00, 2000, paper 11.3.4, p. 109.

Related posts



Analysis and Optimization of Level Cache


Research On Gesture Spotting Techniques: A Review


Leave a Comment