Advances in Multimedia

Volume 2012, Article ID 767364, 8 pages

http://dx.doi.org/10.1155/2012/767364

## Image Encryption Using a Lightweight Stream Encryption Algorithm

Cryptography and Secure Systems Laboratory, Faculty of Electrical Engineering, Iran University of Science and Technology (IUST), Tehran, Iran

Received 2 November 2011; Revised 21 April 2012; Accepted 23 April 2012

Academic Editor: Mohamed Hamdi

Copyright © 2012 Saeed Bahrami and Majid Naderi. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Security of the multimedia data including image and video is one of the basic requirements for the telecommunications and computer networks. In this paper, we consider a simple and lightweight stream encryption algorithm for image encryption, and a series of tests are performed to confirm suitability of the described encryption algorithm. These tests include visual test, histogram analysis, information entropy, encryption quality, correlation analysis, differential analysis, and performance analysis. Based on this analysis, it can be concluded that the present algorithm in comparison to A5/1 and W7 stream ciphers has the same security level, is better in terms of the speed of performance, and is used for real-time applications.

#### 1. Introduction

Nowadays, multimedia data such as image and video is expanding in communications and computer networks [1]. Due to widespread use of multimedia data and despite widespread threats and attacks in communication systems, security of this data is necessary [2, 3]. Multimedia encryption challenges originate from two realities. Firstly, multimedia data have great volumes. Secondly, they need real-time uses [4]. So using encryption for security results in additional computations for information processing. As a result, a balance between security and synchronization requirement is necessary [5]. To reach this aim, we use lightweight and high-speed encryption algorithms. One of the methods to ensure security is considering all data as binary strings and encrypt them using block encryption algorithms such as DES. These algorithms are very complex and involve large amounts of computations, and their software implement is not fast enough for high-volume multimedia data [6].

Commonly stream encryption algorithms are used for image encryption [5, 7–9]. Stream ciphers are built using a pseudorandom key sequence, and then this sequence is combined with the original text through exclusive-or operator. Generally, stream encryption systems have suitable performance when speed and error probability of data transmission are high. In this paper, the simple and lightweight stream encryption algorithm is used for multimedia applications such as image, and also various statistical tests are performed in order to assure the security of the algorithm and compared to A5/1 and W7 stream cipher. The notable point in this algorithm is producing the key sequence by AES block cipher in order to enhance the security.

A5/1 and W7 stream cipher algorithms are used for the key production from the linear feedback shift registers. A5/1 algorithm has 64-bit private key, and W7 algorithm has 128-bit private key. Also, both algorithms have adequate security and proper performance speed for image encrypting as compared to block cipher algorithms such as DES, AES, and RC5. Reference [7] provides more details about these two algorithms and their applications in multimedia security.

This paper is classified as follows. In Section 2, one of the stream encryption algorithms is introduced step by step for multimedia use. Section 3 represents a series of security discussion and statistical tests that include visual test, histogram analysis, information entropy, encryption quality, correlation analysis, differential analysis, and performance analysis introduced and compared to A5/1 and W7 stream cipher. Section 4 concludes the work results.

#### 2. The Stream Encryption Algorithm

As mentioned in the previous section, stream encryption algorithms are used in attention for real-time applications. In this algorithm, stream ciphers are used in order to accelerate implementation of the algorithm. In order to enhance the security, the key product is the same as the key product of AES block cipher.

In this algorithm, the main text is divided in different sections and each section is encrypted by the stream encryption algorithm. In any section, the encryption algorithm uses a separation secret key. The secret key of our encryption schemes is protected by the block cipher (such as AES). denotes a block cipher encryption algorithm on message using key , and denotes a stream cipher encryption algorithm on message using key . At the beginning of this algorithm, the key of different sections is generated as *, *then if the plain text is as *,* the encrypted text would be as *,* and any section of the encrypted text is as .

Let be a function defined as
where is the 128-bit key and for 32-bits , is a 32-bit string, is the bit-wise exclusive-or, + and are mod 2^{32} addition and multiplication. To encrypt every 32 bits of the original text, this algorithm has the following steps.

*Step 1. *A 128-bit key sequence is generated by the block algorithm AES and is considered to be for 32-bit .

It should be noted that this 128-bit key is updated by the AES algorithm to encrypt every 32-bit of the original text.

*Step 2. *By the function proposed in (1), value is obtained as follows:
where value in (1) is replaced by . and are equal to 32 bits of the previous plain text and cipher text, respectively. In addition, as it was stated above, is the bitwise exclusive-or.

*Step 3. *Again, by the function expressed in (1), value is obtained as
In this step, value in (1) is replaced by *. * is equal to 32 bits of the original text in the two previous cases, and also was obtained in Step 2 by (2).

*Step 4. *For the third time, (1) is given as
In this equation, value in (1) is equal to . is equal to 32 bits of the encrypted text in the two previous cases, and was obtained in Step 3 by (3).

*Step 5. *In this stage, according to the following equation, 32 bits of the cipher text are obtained:
where value is equal to 32 bits of the plain text and so value was obtained in Step 4.

All the Steps 2–5 can be summarized by the following equation: In all the Steps 2–4, , , , and can be considered equal to , , , and .

The decryption procedure is similar to the encryption one, just with the difference, the locations of and in (5) are exchanged as follows: It should be mentioned that value in the decryption procedure is obtained in accordance with the encryption procedure as well as using the previous original and encrypted texts.

#### 3. Security and Performance Analysis

The main parameter on design of any encryption algorithm is amount of algorithm robustness against cryptographic attacks including brute force, statistical attack, known plain text attack, and chosen plain text attack. Thus, a cipher of high key and plain text sensitivity is desirable. Besides, computational speed and quality of encrypted images are other important issues. In this section, we performed security discussion of the scheme and a series of tests to compare the efficiency of the described algorithm. Images used to implement the tests are some pictures of USC-SIPI image database (freely available at http://sipi.usc.edu/database/).

##### 3.1. Security Discussion of the Scheme

*Security of the Key*

The key of the encryption/decryption is that is produced by the BE block cipher. Therefore, achieving the key is difficult.

*Meet in the Middle Attack (the Attack to the Section Key)*

This type of attack is a brute force attack. By meeting one or more bits in the middle, it searches exhaustively the key bits through the middle bits [5]. Since this algorithm has three rounds of , the meet in the middle attack does not work. Since at least one way to the middle goes through two rounds of , therefore, the number of key bits that affects a single bit is large.

*Chosen Cipher Text Attack (the Attack to the Section Key)*

All the stream ciphers that have cipher text feedback are weak to the chosen cipher text. For example, if stream cipher was defined as
the cipher would be weak to chose cipher text attack. By choosing , , being different at only one bit, the attacker can ask for the decryption of , and apply the differential attack [5]. But the stream cipher is defined as
where it has both cipher text and plain text feedback. Consequently, achieving the plain text without adequate information from the original text and the encrypted text is impossible.

##### 3.2. Statistical Tests

###### 3.2.1. Visual Test

Observation is an important factor in cipher image test. A good encryption algorithm should mix image so that features are not visually detectable. Also, no information should be observed in the encrypted image by comparing the encrypted and original images [10, 11].

Result of the described algorithm encryption is shown in Figure 1. Figure 1 shows that the encrypted image is quite distinct from the original image.

###### 3.2.2. Histogram Analysis

To prevent the information leakage and aggressive attacks, it must be ensured that the original and encrypted images do not have any statistical similarity. Histogram analysis expresses the way of the distribution of pixels in the image using the drawing number of observations for each amount of pixels brightness [12–16]. Figure 2 shows the histogram analysis on the test image using the described algorithm. The histogram of original image has a sharp rise with a sharp decline as shown in Figure 2(a), and histogram of the encrypted image as shown in Figure 2(b) has a uniform distribution that is completely different from histogram of the original image and has no statistical similarity. Therefore, the attacker with the histogram analysis of the encrypted image cannot acquire information from the original image.

###### 3.2.3. Information Entropy

Shannon introduced information entropy as the measure of source information in 1949. The entropy of a message source is defined as
In this equation, represents the probability of symbol and the entropy is expressed in bits [17]. If we suppose that the source emits 2^{8} symbols with equal probability and , random source entropy is equal to 8. If an encryption algorithm creates symbols with entropy less than 8, there is likelihood to predict original image from encrypted image, which is a threat to the system security. As it is observed in Table 1, entropy of studied algorithms is very close to the ideal value of 8. This means that information leakage in the encryption process is negligible and studied algorithms are secure upon the entropy attack. Also, we conclude that the entropies of A5/1 and the proposed algorithms are closer to the ideal value compared with entropy of W7.

###### 3.2.4. Encryption Quality

The image encryption creates large changes in the amount of pixels. These pixels are completely different from the original image. These changes are irregular. More changes in values of the pixels show more effectiveness of encryption algorithm and thus better quality. Let and be the gray level of the pixels at the xth row and yth column of a encrypted and original images, respectively. Encryption quality shows the average of changes in each amount of gray , and, according to [18], it can be expressed as where and are the number of repetition from each gray value in the original image and the encrypted image, respectively. Encryption quality for A5/1, W7, and the described algorithm is available for different images in Table 2. From the obtained values, we conclude which the qualities of A5/1 and the proposed algorithm are better than W7.

###### 3.2.5. Correlation Analysis

Any pixel correlates highly with adjacent pixels in the original image. Equations (5), (6), and (7) are used to study the correlation between adjacent pixels in horizontal, vertical, and diagonal orientations [4, 7, 15, 16]: In these equations, is correlation coefficient, and are intensity values of two adjacent pixels in the image, and is the number of pair pixels of the selected adjacency in the image to calculate the correlation. 1000 pairs of two adjacent pixels are selected randomly from the image. Ideally, correlation coefficient of the original image is equal to one, and the correlation coefficient of the encrypted image is equal to zero. Also, the correlation diagram is used. Initially, the neighborhood of horizontal, vertical, and diagonal of pixels is identified in this diagram. Then, diagram is plotted based on the value of each pixel and its neighbors.

As it is specified in Figure 3, correlation between pixels of the original image is too much, while there is a little correlation between neighboring pixels in the encrypted image. In Table 3, correlation coefficients of different encrypted images by studied encryption algorithms have been given for neighborhoods of horizontal, vertical, and diagonal. The table shows that the values of correlation coefficients of the three algorithms are very close to zero for each neighborhood. Therefore, these algorithms are secure against correlation attacks.

###### 3.2.6. Differential Analysis

An encryption algorithm should be designed so that it is sensitive to the small changes in the original image. Attacker tries to view the changes result in the encrypted image making minor changes in the original image. Thus, it reveals a significant relationship between the original image and the encrypted image. Also, this action facilitates finding the algorithm key. If a small change in the original image can cause a large change in the encrypted image, then the differential attack is not possible.

Three common measures were used for differential analysis: MAE, NPCR, and UACI [7, 17]. MAE is mean absolute error. NPCR is the number of pixels change rate of encrypted image, while one pixel of original image is changed.

UACI is the unified average changing intensity, which measures the average intensity of the differences between the original image and the encrypted image.

If and are the gray level of the pixels at the th row and yth column of a encrypted and original image, respectively, then MAE is defined as The MAE test results for the three encryption algorithms have been recorded in Table 4. Information recorded in the table shows that the calculated MAE values of encryption algorithms have little difference.

Consider two encrypted images and that, corresponding to original images, are only different in a pixel. The NPCR is defined as and UACI is defined as It is clear that large amounts of NPCR and UACI indicate a high sensitivity of the encryption algorithm to the original image. The NPCR and UACI test results have been recorded in Table 5. The results indicate that the NPCR and UACI are less than 0.01% for the studied algorithms. Unfortunately, this means that these algorithms have low sensitivity to changes in the original image.

###### 3.2.7. Performance Analysis

In addition to security issues, the speed of encryption algorithm is important for real-time processing. Efficiency of the proposed encryption algorithm is dependent on the comparison between the speed of encryption algorithms. Efficiency of algorithms has been achieved with a unoptimized MATLAB code on a machine with Intel core 2 Duo 2.10 processor and 2 Gbytes of RAM memory for Windows 7 operating system. The results in Table 6 show that the described algorithm in terms of execution speed is better than algorithms A5/1 and W7 and so is better for real-time applications.

#### 4. Conclusion

In this investigation, one stream encryption algorithm was proposed for multimedia systems, and many statistical tests were performed to prove suitability of the algorithm, and so this algorithm was compared to A5/1 and W7 stream ciphers. Based on the visual test, there is not any kind of information from the original image in the encrypted image. The histogram shows that distribution of brightness in pixels of the encrypted image is completely uniform, and there is not any statistical similarity with the histogram of the original image. The results of information entropy test show that this value is very close to the ideal value in the encrypted images for all three algorithms. Consequently, these algorithms are secure against entropy attacks. Also, comparison between the entropy of the three algorithms shows that entropies of A5/1 and the proposed algorithms are closer to the ideal value compared with entropy of W7. Based on the results of the encryption quality, the described and A5/1 algorithms have a better quality in the diffusion and confusion of pixels than W7 algorithm. Diagram and coefficients of correlation show that correlation between pixels of the encrypted image has declined severely, and these algorithms are secure against correlation attacks. In order to measure the sensitivity of the algorithm to minor changes in the original image, two measures were considered: NPCR and UACI. The results showed that the proposed algorithm and A5/1 and W7 algorithms have a little sensitivity to minor changes in the original image, ultimately. Performance speed of the described algorithm and two algorithms of A5/1 and W7 were compared. The results showed that performance speed of the described algorithm is faster than two algorithms of A5/1 and W7. According to last discussions, it seems that the described algorithm in software applications has more advantages compared to both algorithms of A5/1 and W7.

#### References

- A. Uhl and A. Pommer, “Application scenarios for the encryption of still visual data,” in
*Image and video encryption from Digital Rights Management to secured personal communication, Advances in Information Security*, vol. 15, pp. 31–43, Springer, 2005. View at Google Scholar - S. Lian and X. Chen, “On the design of partial encryption scheme for multimedia content,”
*Mathematical and Computer Modelling*. In press. - N. Taneja, B. Raman, and I. Gupta, “Combinational domain encryption for still visual data,”
*Multimedia Tools and Applications*, vol. 59, no. 3, pp. 775–793, 2012. View at Publisher · View at Google Scholar - S. S. Agaian, R. G. R. Rudraraju, and R. C. Cherukuri, “Logical transform based encryption for multimedia systems,” in
*Proceedings of the IEEE International Conference on Systems, Man and Cybernetics (SMC '10)*, pp. 1953–1957, October 2010. View at Publisher · View at Google Scholar · View at Scopus - F. Bao and R. H. Deng, “Light-weight encryption schemes for multimedia data and high-speed networks,” in
*Proceedings of the 50th Annual IEEE Global Telecommunications Conference (GLOBECOM '07)*, pp. 188–192, November 2007. View at Publisher · View at Google Scholar · View at Scopus - C. Li, S. Li, M. Asim, J. Nunez, G. Alvarez, and G. Chen, “On the security defects of an image encryption scheme,”
*Image and Vision Computing*, vol. 27, no. 9, pp. 1371–1381, 2009. View at Publisher · View at Google Scholar · View at Scopus - A. Jolfaei and A. Mirghadri, “Survey: image Encryption Using A5/1 and W7,” vol. 2, no. 8. View at Google Scholar
- N. Thomas, D. Redmill, and D. Bull, “Secure transcoders for single layer video data,”
*Signal Processing*, vol. 25, no. 3, pp. 196–207, 2010. View at Publisher · View at Google Scholar · View at Scopus - F. Liu and H. Koenig, “A survey of video encryption algorithms,”
*Computers and Security*, vol. 29, no. 1, pp. 3–15, 2010. View at Publisher · View at Google Scholar · View at Scopus - G. Alvarez and S. Li, “Some basic cryptographic requirements for chaos-based cryptosystems,”
*International Journal of Bifurcation and Chaos*, vol. 16, no. 8, pp. 2129–2151, 2006. View at Publisher · View at Google Scholar · View at Scopus - A. Pande and J. Zambreno, “The secure wavelet transform,”
*Journal of Real-Time Image Processing*, vol. 18, no. 3, pp. 844–856, 2010. View at Publisher · View at Google Scholar · View at Scopus - C. N. Raju, G. Umadevi, K. Srinathan, and C. V. Jawahar, “Fast and secure real-time video encryption,” in
*Proceedings of the 6th Indian Conference on Computer Vision, Graphics and Image Processing (ICVGIP '08)*, pp. 257–264, December 2008. View at Publisher · View at Google Scholar · View at Scopus - J. Zhou, Z. Liang, Y. Chen, and O. C. Au, “Security analysis of multimedia encryption schemes based on multiple Huffman table,”
*IEEE Signal Processing Letters*, vol. 14, no. 3, pp. 201–204, 2007. View at Publisher · View at Google Scholar · View at Scopus - W. Li and N. Yu, “A robust chaos-based image encryption scheme,” in
*Proceedings of the IEEE International Conference on Multimedia and Expo (ICME '09)*, pp. 1034–1037, July 2009. View at Publisher · View at Google Scholar · View at Scopus - R. C. Luo, L. Y. Chung, and C. H. Lien, “A novel symmetric cryptography based on the hybrid haar wavelets encoder and chaotic masking scheme,”
*IEEE Transactions on Industrial Electronics*, vol. 49, no. 4, pp. 933–944, 2002. View at Publisher · View at Google Scholar · View at Scopus - G. Chen, Y. Mao, and C. K. Chui, “A symmetric image encryption scheme based on 3D chaotic cat maps,”
*Chaos, Solitons and Fractals*, vol. 21, no. 3, pp. 749–761, 2004. View at Publisher · View at Google Scholar · View at Scopus - C. E. Shannon, “Communication theory of secrecy systems,”
*Bell Systems Technical Journal*, vol. 28, pp. 656–715, 1949. View at Google Scholar - H. E. D. H. Ahmed, H. M. Kalash, and O. S. Farag Allah, “Encryption quality analysis of the RC5 block cipher algorithm for digital images,”
*Optical Engineering*, vol. 45, no. 10, Article ID 107003, 2006. View at Publisher · View at Google Scholar · View at Scopus