Abstract
In this research paper, a new approach to image encryption has been proposed. The technique involves using a seed to generate a random list of prime numbers, which is then used to generate subsequent lists recursively. In this manner, a random number generation is created by recursive seeding, rather than one direct seed. This final set of lists is used to encrypt each pixel of the image. Moreover, each pixel is encrypted with its counterpart pixel in the original image, to reduce the possibility of deducing the original image without knowledge of the key. Statistical analysis tests are used to justify the strength of the algorithm.
Keywords
1 Introduction
When sensitive data is transmitted from one digital entity to another, mechanisms are required to secure the transmission. This data may be digitized as text, files, images, videos, or others. Image encryption has a diverse field of applications, such as private Internet communications, medical imaging systems, military or government communications, and so on. Cryptography is one of several techniques that may be employed to prevent such unauthorized access of sensitive information, and aims at achieving high standards of data confidentiality, data integrity, and authentication [1, 2]. Cryptographic transmissions can generally be classified into two broad categories: symmetric/private-key algorithms, and asymmetric, or public key algorithms Symmetric key algorithms are computationally less expensive (in general) to implement, when compared to asymmetric algorithms. These algorithms can be implemented in many ways, such as round-key substitution, chaotic maps, Feistel cipher mechanisms, and combinations of the above mentioned techniques and more. In the proposed algorithm, a symmetric schematic is implemented, tested with various indexes, and compared against other strong algorithms. A symmetric key algorithm has been chosen as this class of encryption algorithms is generally more suitable for bulk message transmissions [6], as opposed to the asymmetric class. Here, the images under consideration would qualify as bulk transmission of pixel data.
2 Literature Review
Unlike the encryption procedures of text or bytes in files, images have some unique properties that distinguish them from other kinds of media, such as the correlation between adjacent pixels, redundancy, noise, and others. This implies that the kinds of attacks and security measures to protect such images will differ from regular modes of encryption [3]. There are different approaches to encrypting an image. Stream encryption algorithms involve building a pseudo-random key sequence, and then influencing the original stream of pixels with the key sequence with the help of an exclusive-or operation [4, 5, 7, 8]. The A5/1 stream cipher algorithm [9] uses a 64-bit key for key production from a set of linear feedback shift registers. Similarly, the W7 stream cipher algorithm uses a 128-bit key. Block cipher cryptosystems can also be used, which involves encrypting text by applying an encryption key and a corresponding encryption algorithm to a block of data (continuous pixels) instead of transforming the pixels on at a time (as performed in stream-cipher algorithms). Encryption can also be broadly classified into three other categories of substitution, permutation, and combinations of substitution and permutation [10]. Substitution schemes change the actual pixel values by means of an externally applied algorithm and/or key, while permutation schemes merely shuffle the given set of pixel values as specified by the algorithm. In some cases, both of the methods are employed to improve security standards. A combination of Arnolds cat map and Chens chaotic system has been proposed in [11]. In [12], three permutation techniques have been implemented by shuffling the pixels at the bit level, pixel level, and block level at a pre-specified order. In [13], the AES algorithm has been significantly improved by adding the usage of a key stream generator. The implementation in [14] uses a bit-level permutation based on a chaotic crypto-system. This idea is especially effective, as permutation at the bit level has the dual advantage of changing both the order and value of the pixels in the image. In [15], another crypto-system based on a total shuffling scheme has been demonstrated. In [16, 17], multiple logistic maps and chaotic systems have been utilized to improve the encryption security. Another implementation [18] uses a key whose size is equal to the product of the dimensions of the original gray-scale image. The technique in [21] is based on Nearest Neighbouring Coupled Map Lattices (NCML). In this manner, several methodologies have been used and/or combined to increase encryption standards. Here, a new algorithm based on substitution is proposed. Instead of direct permutation, a dependency of every original pixel is introduced into generation of all encrypted pixels. Similar work is done in recent works [22, 23]. But in [22], the image is xor-transposed before the introduction of a variable factor, i.e. the key. If this variable factor were to be brought in during the transposition itself, it would introduce a higher rate of NPCR as the key has a direct role to play in the xor-transposition stage. In [23], the key is being mutated sufficiently by generating the key with sufficient xor operations, but the original image itself can be processed in a more secure and efficient manner. Our algorithm patches these setbacks and presents a very high standard of encryption, as depicted by analysis results.
3 Methodology
Assume the dimensions of the image to be \((m, n, o)\). Each pixel value has range [0, 255], and uses 1 byte of memory.
3.1 Encryption Procedure
PRNG Generation Let \(\varOmega (n)\) be a function to return the last 8 bits of n, \(\varTheta (n)\) be a function to return the largest prime factor, and \(\oplus \) be the XOR operation.
-
A random number, \(\mathrm {\alpha }\) is passed as a seed.
-
\(\mathrm {\mu }\) is generated by manipulating the current system time.
-
Let the array (to hold the PRNG) be rarr[1:256].
-
For i = 1:256: \(\mathrm {\mu }\) = \(\mathrm {\mu }\) + \(\mathrm {\alpha }\), rarr[i] = \(\mathrm {\varOmega ( \theta (\mu ) * \mu )}\)
The array with the new PRNG, rarr[1...256], is returned, with each element of the random array rarr[ ] using 1 byte of memory.
Self-XOR Transform
-
Take the middle element of PRNG, \(x\), and obtain \(r = x \% (m*n*o)\).
-
Arrange the pixels of the image in a cyclic, one-dimensional order. Start from the rth position in the linear array, and XOR it with the previous element in the logical circular array. Continue for all pixels in the image.
Transforming the Image with the PRNG Arrange all the pixel values of the image in a linear, one-dimensional order. Let this array be called encr[m*n*o].
-
Initialize index i = 0 for the iterations, and c = 0 for the PRNG index.
Calculate encr[i] = encr[i] \(\oplus \) rarr[c] Modify rarr[c] = ((rarr[c]2 rarr[c+1]) % 255) \(\oplus \) encr[i], c = (c+1) % 255
Perform this transformation for all pixel values by incrementing i.
-
Initialize index i = m*n*o, and c = 0.
Calculate encr[i] = encr[i] \(\oplus \) rarr[c] Modify rarr[c] = ((rarr[c]2 * rarr[c+1])%255) \(\mathrm {\oplus }\) ((encr[i]+(i/(n*3))) * (encr[i] + (i%(n*3))/3) * (encr[i]+(i%(n*3))%3))
Then increment c in a cyclic order, i.e. c = (c+1) % 255
Perform this transformation for all pixel values by decrementing i.
-
Store the transformed image as the final encrypted image.
3.2 Decryption Procedure
PRNG Generation The PRNG is generated in the same manner as in the encryption procedure. The same random number \(\alpha \) is passed as a seed, along with the previously generated \(\mu \). The generated PRNG array, rarr[1...256], is returned, with each element using 1 byte of memory.
Transforming the encrypted image with the PRNG
-
Arrange all the pixel values of the image in a linear, one-dimensional order.
-
Initialize the index i = m*n*o, and c = 0. For every ith pixel value in the linear image, XOR it with the cth element in the generated PRNG, rarr[ ].
Before continuing the iteration, modify rarr[c] = ((rarr[c]2 rarr[c+1])%255) \(\oplus \) ((encr[i]+(i/(n*3))) * (encr[i]+(i%(n*3))/3) * (encr[i]+(i%(n*3))%3)) Then increment c in a cyclic order, i.e. c = (c+1) % 255
Perform this transformation for all pixel values by decrementing i.
-
Initialize i = 0 for the iterations, and c = 0 for the PRNG index. XOR the ith pixel value in the linear image with the cth element in rarr[ ]. Store the resultant value in another array encr[ ].
Modify rarr[c] = ((rarr[c]2 rarr[c+1])%255) \(\oplus \) encr[i], c = (c+1) % 255
Perform this transformation for all pixel values by incrementing i.
Self-XOR Transform
-
Take the middle element of PRNG, \(x\), and obtain \(r = x \% (m*n*o)\).
-
Arrange the pixels of the image in a cyclic, one-dimensional order. Start from the rth position in the linear array, and XOR it with the previous element in the logical circular array. Continue for all pixels in the image.
-
Store the generated image as the final decrypted image.
4 Results and Analysis
In this section, the different tests that were performed to analyze the strength and security of the proposed image encryption algorithm are presented. Test images from the USC-SIPI Image Database [19], were used. An RGB image of size 512\(\,\times \,\)512 (Lena, 4.2.02.tiff) was used to perform the tests on MATLAB r2015a.
4.1 Visual Test
It must be ensured that there is no visual pattern, relationship, or similarity between the original and encrypted forms of the test image. Figure 1 verifies this.
4.2 Histogram Analysis
Statistical attacks can be used to derive conclusions from the encrypted forms of images. These attacks are especially effective when a known plaintext attack is executed. To prevent the leakage of information by such attacks, it must be ensured that the original and encrypted forms of the image do not exhibit any statistical similarity. A histogram analysis provides information about the distribution of the number of pixels in an image for each value of a pixels intensity. In this test, three histograms have been plotted for each color plane of the three-dimensional color image. If in the encrypted histogram, there is an equal probability of generating pixels of all intensities, there is a higher degree of encrypted symmetry, as there is no possibility of eliminating attack options. Moreover, if the histograms of the original and encrypted images show no statistical resemblance, an attack based on the histogram analysis of the encrypted image will not deterministically provide information about the original image. This idea has been exploited here [20], where Shannon suggests that several cryptographic ciphers can be broken by an appropriate statistical analysis. Here, the resistance to statistical attacks has been demonstrated by means of histogram and correlation tests. Figure 2a shows that the original image has a non-uniform histogram, implying that data can be visually extracted. However, in Fig. 2b, the histograms resemble a straight line. This shows that every pixel intensity in the encrypted image has a nearly equal probability of generation. It can also be observed that there is no similarity between the histograms of the original and encrypted images, thus showing resistance to a known-plaintext attack.
4.3 Correlation Coefficient Analysis
In an ordinary image, adjacent pixels will generally be related to each other, in all directions; horizontally, vertically, and diagonally. However, the pixels of an encrypted image should show minimal correlation to its neighbors. The correlation test performed here considers all pairs of adjacent pixels in the horizontal, vertical, and diagonal axes.
Here, \(x_{i}\) and \(y_{i}\) are the values of two adjacent pixels in a particular color plane. \(N\) denotes the number of pixel pairs \((x_{i},y_{i})\) in the test image. \(()\) and \(()\) are the expectation/mean values of all the \(x_{i}\) and \(y_{i}\) values. \(V(x)\) and \(V(y)\) are the individual variances of all of the \(x_{i}\) and \(y_{i}\) values. \(cov(x,y)\) is the covariance of the distributions of all \(x_{i}\) and \(y_{i}\) values. \(\gamma _{xy}\) represents the correlation between the \(x_{i}\) and \(y_{i}\) distributions.
The correlation coefficient can range from \([-1,+1]\). When it is 0, the two variables are independent of each other. This implies that the covariance between \(x\) and \(y\), \(cov(x,y)\) is equal to zero. Here, the two variables considered are the intensities of any two adjacent pixels in a particular axis. In this test, all three axes were considered for the three color planes of the RGB image.
As in Table 1, all correlation coefficients for the image encrypted by the proposed algorithm tend to approach the ideal value of 0 faster than other algorithms, implying that there is minimal correlation between the pixels of the encrypted images. As in Fig. 3a, there is a very high degree of correlation in all axes, shown by the 45-degree pattern in the correlation plots. As in Fig. 3b, the correlation plots of the encrypted image in all axes and color planes show completely scattered patterns, indicating low correlation among adjacent encrypted pixels.
4.4 Entropy Analysis
Entropy indicates the randomness of the occurrence of a particular pixel value. Shannon [20] introduced the concept of information entropy as a quantifiable measure of data in a source. It is defined as:
Here, \(3N\) is the total number of symbols (color planes per pixel), and \(P(s_{i})\) is the probability of the occurrence of the symbol \(s_{i}\). In this case, a color plane of a pixel is 8 bits in size. Thus, \(s_{i}\) can result in 28 different outcomes. If we assume these to be generated by the encrypting algorithm with equal probability, then the entropy of the set of symbols is 8. Entropy can range from 1 to 8. If the entropy value is less than 8, then the probability of predicting the original symbols increases, which compromises encryption strength.The near-ideal value of entropy by the proposed algorithm in Table 2 shows that the predictability of encrypted pixels by the proposed algorithm is negligible, and is thus capable of resisting against entropy-based attacks. This is significant, as the high entropy value indicates the pixel values in all three color channels cannot be determined in computationally feasible time.
4.5 Differential Analysis
The encrypted image should be sensitive to small changes introduced in the original image. If not, then many concurrences can be observed in the encrypted forms of two original images with small differences, and a series of known-plaintext attacks can relate the original and encrypted forms of an image. Moreover, this type of attack facilitates the determination of the keys used during the encryption process (\(\mathrm {\mu }\) and \(\mathrm {\alpha }\)). Two measures were considered: NPCR (Number of Pixels Change Rate), and UACI (Unified Average Changing Intensity). NPCR gives an indication of how many encrypted pixel values exhibit a change when exactly one pixel of original image is changed. UACI measures the average intensity of the differences between the original image and the encrypted image. If two plain images \(P_{K}\) and \(\overline{P_{K}}\) differ in exactly one color plane of exactly one pixel, let their encrypted forms be \(C_{K}\) and \(\overline{C_{K}}\). For an RGB image of height M, width N, and number of planes O, UACI and NPCR are:
For this test, six separate encryptions were generated, where one encryption was made on the image in its intact form, and five others were made upon changing exactly one plane of exactly one pixel in random locations. High NPCR (ideally 100%) and UACI (ideally 33%) values indicate that the encryption algorithm will reflect large differences on minor changes in the original image.
Table 3 shows that the proposed algorithm is highly sensitive to changes in the original image.
4.6 Peak Signal-to-Noise Ratio Analysis
PSNR indicates the change between the original pixels and the distorted pixels, calculated in decibels. It can be used for either encryption or decryption tests. The ideal PSNR value between the original and encrypted image is 0 (implying complete introduction of noise into the image), and the ideal value between the original and the decrypted image is infinity (implying complete recovery of data). Here, the PSNR value was infinity for decrypted images, implying no loss in data, and the value for the encrypted image was significantly low (8.643746373387632).
5 Conclusion
Figure 4a shows that the proposed algorithm gives lower correlation among adjacent encrypted pixels. It shows little similarity between the original and encrypted images, and the histogram analysis verifies this assessment. Figure 4b shows a nearly ideal value of 8.00 for entropy by the proposed algorithm. Figure 4c shows nearly equal values of NPCR for all considered algorithms. Figure 4d shows negligible deviation from the ideal 33.33% for UACI. The proposed algorithm is stronger than several other candidate algorithms, and in conclusion, it can be expected to find many real-world applications.
References
Nigam Sangwan, Text Encryption with Huffman Compression, International Journal of Computer Applications (0975 8887) Volume 54 No.6, September 2012.
Ayushi, A Symmetric Key Cryptographic Algorithm International Journal of Computer Applications (09758887) Volume 1 No. 15.
S. Lian and X. Chen, On the design of partial encryption scheme for multimedia content, Mathematical and Computer Modelling.
F. Bao and R. H. Deng, Light-weight encryption schemes for multimedia data and high-speed networks, GLOBECOM 07, pp. 188192, November 2007.
A. Jolfaei and A. Mirghadri, Image Encryption Using A5/1 and W7, vol. 2, no. 8.
Cryptography & Network Security, 6th Edition - William Stallings.
N. Thomas, D. Redmill, and D. Bull, Secure transcoders for single layer video data, Signal Processing, vol. 25, no. 3, pp. 196207, 2010.
F. Liu and H. Koenig, A survey of video encryption algorithms, Computers and Security, vol. 29, no. 1, pp. 3–15, 2010.
S. Bahrami, M. Naderi, Image Encryption Using a Lightweight Stream Encryption Algorithm, Advances in Multimedia, Article ID 767364, 2012.
Secure Image Encryption Algorithms: A Review, International Journal of Scientific & Technology Research Volume 2, Issue 4, April 2013, ISSN 2277-8616.
Zhi-Hong Guan, Fangjun Huang, Wenjie Guan, Chaosbased image encryption algorithm, Physics Letters A 346, Elsevier, 2005.
Mitra, Y. V. Subba Rao and S. R. M. Prasanna, A New Image Encryption Approach using Combinational Permutation Techniques, IJECE, 2006.
M. Zeghid, M. Machhout, L. khriji, A modified AES based algorithm for image Encryption, World Academy of Science, Engineering and Technology 3, 2007.
Z. Zhu, W. Zhang, K. Wong, A chaos-based symmetric image encryption scheme using bit-level permutation, Information Sciences, 1171–1186 Elsevier, 2010.
G. Zhang and Q. Liu, A novel image encryption method based on total shuffling scheme, Optics Communications, vol. 284, no. 12, pp. 2775 2780, 2011.
Ismail, Amin, A Digital Image Encryption Algorithm On Composition Of Two Chaotic Logistic Maps, Proc. 27th IEEE Intl Conf. Signal Processing, 733–739, 2011.
H. Alsafasfeh, A. A. Arfoa, Image encryption based on the general approach for multiple chaotic system, Journal of Signal & Information Processing 2, 238–244, 2011.
Khaled Loukhaoukha, J. Chouinard, A. Berdai, A Secure Image Encryption Algorithm Based on Rubiks Cube Principle, Laval University, Canada G1K 7P4, 2011.
USC-SIPI Image Database, Signal & Image Processing Institute.
C. E. Shannon, Communication theory of secrecy systems, Bell System Technical Journal, vol. 28, no. 4, pp. 656715, 1949.
Yong Wanga, Kwok-Wo Wong, Xiaofeng Liaoc, Guanrong Chen, A new chaos-based fast image encryption algorithm, Applied Soft Computing, Elsevier, 2011.
P. Sree, M. Padmaja, An Improved Image Encryption Using Pixel XOR Transpose Technique Over Images, IJETTCS, Vol. 4, Issue 3, May–June 2015 ISSN 22786856
A. Dixit, P. Dhruve, Image encryption using permutation and rotational XOR technique (Eds): SIPM, FCST, ITCA, WSE, ACSIT pp. 01–09, 2012.
Belazi Akram, B. Oussama, H. Safya, Selective Image Encryption Using DCT with AES Cipher, (CS & IT), No. https://doi.org/10.5121/csit.2014.41306, pg. 69–77, 2014.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Annadurai, S., Manoj, R., Jathanna, R.D. (2018). A Novel Self-transforming Image Encryption Algorithm Using Intrinsically Mutating PRNG. In: Somani, A., Srivastava, S., Mundra, A., Rawat, S. (eds) Proceedings of First International Conference on Smart System, Innovations and Computing. Smart Innovation, Systems and Technologies, vol 79. Springer, Singapore. https://doi.org/10.1007/978-981-10-5828-8_20
Download citation
DOI: https://doi.org/10.1007/978-981-10-5828-8_20
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-10-5827-1
Online ISBN: 978-981-10-5828-8
eBook Packages: EngineeringEngineering (R0)