Professional Documents
Culture Documents
Image Encryption Using DCT and Stream Cipher: Lala Krikor
Image Encryption Using DCT and Stream Cipher: Lala Krikor
Lala Krikor
Faculty of Information Technology, Applied Science University
Amman 11931, Jordan
E-mail: l_krekor@asu.edu.jo
Sami Baba
Faculty of Information Technology, Applied Science University
Amman 11931, Jordan
E-mail: samie@aus.edu.jo
Thawar Arif
Faculty of Information Technology, Applied Science University
Amman 11931, Jordan
E-mail: t_arif@asu.edu.jo
Zyad Shaaban
Faculty of Information Technology, Applied Science University
Amman 11931, Jordan
E-mail: z_shaaban@asu.edu.jo
Abstract
In this work we present a new method for image encryption by selecting specific
higher frequencies of DCT coefficients that taken as the characteristic values, and
encrypting them, and the resulted encrypted blocks are shuffled according to a pseudo-
random bit sequence. Selective encryption is a recent approach to reduce the computational
requirements for huge volumes of images.
1. Introduction
Nowadays, information security is becoming more important in data storage and transmission. Images
are widely used in several processes. Therefore, the protection of image data from unauthorized access
is important. Image encryption plays a significant role in the field of information hiding. Image hiding
or encrypting methods and algorithms range from simple spatial domain methods to more complicated
and reliable frequency domain ones.
It is argued that the encryption algorithms, which have been originally developed for text data,
are not suitable for securing many real-time multimedia applications because of large data sizes.
Software implementations of ciphers are usually too slow to process image and video data in
commercial systems. Hardware implementations, on the other hand, add more cost to service providers
and consumer electronics device manufacturers. A major recent trend is to minimize the computational
Image Encryption Using DCT and Stream Cipher 49
requirements for secure multimedia distribution by “selective encryption” where only parts of the data
are encrypted. A classification of the proposed schemes from the open literature is given in Table 1 [1].
There are two levels of security for digital image encryption: low level and high-level security
encryption. In low-level security encryption, the encrypted image has degraded visual quality
compared to that of the original one, but the content of the image is still visible and understandable to
the viewers. In the high-level security case, the content is completely scrambled and the image just
looks like random noise. In this case, the image is not understandable to the viewers at all. Selective
encryption aims at avoiding the encryption of all bits of a digital image and yet ensuring a secure
encryption. The key point is to encrypt only a small part of the bitstream to obtain a fast method [2].
With the rapid progress of Internet, in recent years, to establish the transmission of images,
highly reliable and high-speed digital transmission is required. Besides this, Internet applications have
to deal with security issues. Internet users exasperate potential security threats such as eavesdropping
and illegal access. They want to be protected and to ensure their privacy. Network security and image
encryption has become important and high profile issues. Most traditional or modern cryptosystems
have been designed to protect textual data. An original important and confidential plaintext is
converted into cipher text that is apparently random nonsense. Once the cipertext has been produced, it
is saved in storage or transmitted over the network. Upon reception, the ciphertext can be transformed
back into the original plaintext by using a decryption algorithm. However, images are different from
text. Although we may use the traditional cryptosystems (such as RSA and DES-like cryptosystems) to
encrypt images directly, it is not a good idea for two reasons. One is that the image size is much greater
than that of text, so the traditional cryptosystems need much time to directly encrypt the image data.
The other problem is that the decrypted text must be equal to the original text. However, this
requirement is not necessary for image; a decrypted image containing small distortion is acceptable due
to human perception[3].
Several selective encryption methods have been proposed for DCT compressed images.
Droogenbroeck and Benedett [4] selected AC coefficients from compressed images for encryption. In
their method the DC coefficients are not ciphered because they carry important visible information and
they are highly predictable. The compression and encryption stages are separated in this approach and
this requires an additional operating cost. Fisch et al. [5] have proposed a partial image encryption
where the data are organized in a scalable bitstream form [6].
The variety of applications for secure multimedia requires either full encryption or selective
encryption. However, there is a huge spectrum of applications that demands security on a lower level,
50 Lala Krikor, Sami Baba, Thawar Arif and Zyad Shaaban
as for example that ensured by selective encryption (SE). Such approaches reduce the computational
requirements in networks with diverse client device capabilities. The goal of SE is to encrypt a well
defined range of parameters or coefficients. The security level of SE is always lower when compared
with the full encryption. However, SE decreases the data size to be encrypted and consequently
requires lower computational time. Confidentiality is very important for lower powered systems such
as for example wireless devices. Always, when considering image processing applications on such
devices we should use minimal resources. However, the classical ciphers are usually too slow to be
used for image and video processing in commercial low powered systems. The selective encryption
(SE) can fulfill the application requirements without the overhead of the full encryption. In the case of
SE, only the minimum necessary data are ciphered [7].
In [8] a technique was proposed, called zigzag permutation applicable to DCT-based videos and
images. On one hand this method provides a certain level of confidentiality, while on the other hand it
increases the overall bit rate. Combining SE and image/video compression using the set partitioning in
hierarchical trees was used in [9]. However, this approach requires a significant computational
complexity. A method that does not require significant processing time and which operates directly on
the bit planes of the image was proposed in [10]. An approach that turns entropy coders into encryption
ciphers using statistical models was proposed in [11]. In [12] it was suggested a technique that encrypts
a selected number of AC coefficients. The DC coefficients are not ciphered since they carry important
visual information and they are highly predictable. In spite of the constancy in the bit rate while
preserving the bitstream compliance, this method is not scalable. Moreover, the compression and the
encryption process are separated and consequently the computational complexity is increased[7].
In this work, we propose a new method of selective encryption for 256-colors and gray color
images that is based on encrypting of (Discrete Cosine Transform) DCT coefficients. In the following
sections we present the main idea, and discuss its strengths and weaknesses.
Entropy
JPEG Image Encoder Quantizer
Quantizer
Matrix
Pseudorandom
Bit Sequence
Bit
Sequence
Key
Register (stream cipher). The concept behind encrypting only some selective DCT coefficients (the
coefficients [0,0], [0,1], [1,0], [2,0], [1,1], [0,2]) based on the fact that the image details are situated in
the higher frequencies, while the human eye is most sensitive to lower frequencies than to higher
frequencies [2]. Figure 3, shows the general block diagram of the proposed method of image
encryption.
Stream Cipher
Key
The proposed algorithm is lossless; hence the images used in such applications are of highly
important information, and loosing any amount of information is not allowed. In the followings, we
illustrate the encryption, decryption and shuffling of the images.
• Perform an Inverse DCT (IDCT) and got the new block values, noting that the resulted
values could be positive or negative values, and this due to the encryption step.
• Convert the resulted values into its equivalent 9 bits where the first bit is the sign bit
(assign 0 for positive pixel value and 1 for negative pixel value) and the remaining bits
are the IDCT result values. Noting that this step will construct a 64 x 72 bits map, and this
will extend the image block to size 8 × 9 bytes for each block.
Step 4: Apply the proposed shuffling algorithm on the resulted blocks.
Step 5: Reconstruct the image by having a new width which will increase as a result of adding an
additional bit which is the sign value of the pixel
End
• - For I =0 to NoCols
• NewCol[I] = (K2 × I) mod NoCols
• EndFor
• k=0
• For I=0 to NoRows
• For J=0 to NoCols
• // where the function Move block will move all the contained of block ImageBlock to
NewImageBlock
• MoveBlock (NewImageBlock[I, J],
• ImageBlock[NewRow[k], NewCol[k]])
• K++
• EndFor J
• EndFor I
End
6. Results
To prove the performance of the proposed encryption method, a system has been built to implement
the proposed algorithms. This system was built using VC#.NET with a simple and friendly user
interface. Two experiments will be presented in this section to show the implementation and the results
of the proposed method. Figure 4 is a (366 x 248) bmp image, which is used as input to the system in
order to be encrypted. Figure 5 shows a (378 x 248) bmp encrypted image resulted from the system.
The second experiment deals with another image. Figure 6 is a (368 x 288) bmp input image, and
Figure 7 shows a (414 x 288) bmp encrypted image resulted from the system.
7. Discussion
In the proposed algorithm the images is highly encrypted since the encryption is done by encrypting
the basic frequencies of the image, and the operation is done not by encrypting all the bytes in the
image but only special frequencies in which when it return to its corresponding pixel values all the
bytes of the image will be affected. Note that the image size will increase in width, since for each byte
needs an extra bit for the sign of the pixel value. This will lead to a bigger size of the encrypted image
that the plain original image.
The main reason of not hiding the sign in LSB for palette color images is the by changing the
value of the pixel will effect the resulted decrypted image since each value have different Red, Green,
Blue component, while in Gray images the change of the color value will not have the same effect
since the pallet of the gray scale have a smooth change from one level to another.
Image Encryption Using DCT and Stream Cipher 55
Figure 4: A (366 x 248) bmp plain image
8. Conclusion
The proposed encryption method uses the Selective Encryption approach where the DC coefficients
and some selective AC coefficients are encrypted, hence the DC coefficients carry important visual
information, and it's difficult to predict the selective AC coefficients, this give a high level of security
in comparison with methods mentioned above. The algorithm will not encrypt bit by bit the whole
image but only selective DCT coefficients will be encrypted, and extra security has been added to the
resulted encrypted blocks by using Block Shuffling method depending on two prime numbers, where
these two primes will generate sequences or row and column numbers to be used in shuffling. The
algorithm considered as a fast image encryption algorithm, due to the selective encryption of certain
portion of the image (the DC and some AC coefficients).
Acknowledgement
This paper received financial support towards the cost of its publication from the Deanship of Research
and Graduate Studies at Applied Science University, Amman, Jordan.
58 Lala Krikor, Sami Baba, Thawar Arif and Zyad Shaaban
References
[1] Xiliang Liu, "Selective encryption of multimedia content in distribution networks: challenges
and new directions", Proceedings of Communications, Internet, and Information Technology
(CIIT 2003), Scottsdale, AZ, USA, Nov. 2003.
[2] Fonteneau C., Motsch J., Babel M., and D´eforges O., "a hierarchical selective encryption
technique in a scalable image codec", International Conference in Commun-ications, Bucharest,
Romania 2008.
[3] Han Shuihua* and Yang Shuangyuan**, Non-members, "An Asymmetric Image Encryption
Based on Matrix Transformation ", ecti transactions on computer and information technology
vol.1, no.2 november 2005.
[4] M. Van Droogenbroeck and R. Benedett, “Techniques for a Selective Encryption of
Uncompressed and Compressed Images,” in Proceedings of Advanced Conceptsfor Intelligent
Vision Systems (ACIVS) 2002, Ghent, Belgium, Sept. 2002.
[5] M. M. Fisch, H. Stgner, and A. Uhl, “Layered Encryption Techniques for DCT-Coded Visual
Data,” in European Signal Processing Conference (EUSIPCO) 2004, Vienna, Austria, Sep.,
2004.
[6] Rodrigues, J.M. Puech, W. Bors, A.G. "Selective Encryption of Human Skin in JPEG Images",
IEEE International Conference on Image Processing, 2006.
[7] Puech, W.; Rodrigues, J.M.; Bors, A.G.,"Analysis and Cryptanalysis of a Selective Encryption
Method for JPEG Images", Eighth International Workshop on Image Analysis for Multimedia
Interactive Services, 2007. WIAMIS07, June 2007.
[8] L. Tang. Methods for Encrypting and Decrypting MPEG Video Data Efficiently. In Proc. ACM
Multimedia, volume 3, pages 219–229, 1996.
[9] H. Cheng and X. Li. Partial Encryption of Compressed Images and Videos. IEEE Trans. on
Signal Processing, 48(8):2439–2445, Aug. 2000.
[10] R. Lukac and K. Plataniotis. Bit-Level Based Secret Sharing for Image Encryption. Pattern
Recognition, 38(5):767–772, May 2005.
[11] C. Wu and C. Kuo. Design of Integrated Multimedia Compression and Encryption Systems.
IEEE Trans. on Multimedia, 7(5):828–839, Oct. 2005.
[12] M. V. Droogenbroeck and R. Benedett. Techniques for a Selective Encryption of
Uncompressed and Compressed Images. In Proc. of Advanced Concepts for Intelligent Vision
Systems (ACIVS) 2002, Ghent, Belgium, pages 90–97, Sept. 2002.
[13] C. Coconu, V. Stoica, F. Ionescu, and D. Profeta, "Distributed implementation of discrete
cosine transform algorithm on a network of workstations", Proceedings of the International
Workshop Trends & Recent Achievements in IT, Romania, pp. 116-121, May 2002.
[14] JPEG, jpeg.org.
[15] W. Puech and J. Rodrigues, "Crypto-compression of medical images by selective encryption of
DCT", 13th European Signal Processing Conference, Turkey, September 2005.
[16] B. Schneier, Applied Cryptography, John Wiley and Sons, 1996.