Digital image encryption based on Joseph circle and Chaotic system has become a hot spot in the research of image encryption. An encryption algorithm based on improved Josephus loop and logistic mapping is proposed to scrambling blocks in this paper. At first, the original image is scrambled by using logistic mapping to obtain the encrypted image, and then the encrypted image is divided into many blocks. Finally, the position of the blocked image is scrambled by using the improved Josephus ring to get the encrypted image. According to the experiments, the information entropy of the encrypted image reaches 7.99 and the adjacent correlations in three directions are within ±0.1. The experimental results show that the proposed algorithm has advantages of large key space, high key sensitivity and can effectively resist the attacks of statistical analysis and gray value analysis. It has good encryption effect on digital image encryption.
With the rapid development of the application of multimedia technology on the Internet, more and more images are transmitted in the network, such as malicious serial image information, interception and so on, which brings convenience to users and causes a series of potential safety problems. Therefore, it is very important to ensure the security of image information in the process of network transmission. Among the technologies of guarantee image security [
In 1998, Fridrich proposed an image encryption algorithm based on permutation and confusion structure in [
The above works used some pixel value replacement methods in the process of encryption, such as compute of encryption pixels and adjacent elements [
Joseph’s problem describes n individuals in a circle, counting from the first person, and continuously eliminating the mth person until the last one remains [
According to the Joseph problem, we can uniquely identify an arrangement of n elements in the order of elimination. Given n and m, we can uniquely obtain a permutation constructed by ( 1 , 2 , ⋯ , n ). Write f y s f ( n , m ) . For example, f y s f ( 4 , 3 ) , which corresponds to the element sequence of 3, 2, 4, 1, so the elements of the order can be 1, 2, 3, 4 by mapping f y s f ( 4 , 3 ) to replace it with 3, 2, 4, 1.
In order to increase the permutation variables generated by Joseph’s traversal mappings, the application of Josephus rings is now augmented by an interval q constraint, which results in the randomness of the resulting permutations and increases their key space during the image’s encryption. After increasing the interval q, the corresponding Joseph-ergodic mapping becomes f y s f 1 ( n , q , m ) .
In 1976, American ecological mathematician May proposed a logistic mapping model used to simulate the growth behavior of biological populations. It is very simple in mathematical form, but its dynamic behavior is complicated by its nonlinear chaotic system. In the process of image encryption has a wide range of applications. The equation is:
x n + 1 = u x n ( 1 − x n ) , (1)
where n and u are system parameters. When n = 1 , 2 , ⋯ and 3 .75 ≤ u ≤ 4 , the system is chaotic. In order to expand the encryption key of digital image, many researchers have improved the logistic mapping equation. For example, the improved logistic mapping equation is [
x n + 1 = ( u x n ( 1 − x n ) × 2 k ) − f l o o r ( u x n ( 1 − x n ) × 2 k ) , k ∈ Z + , k ≥ 8. (2)
Its chaotic map is shown in
x n + 1 = ( u 1 log ( x n ) × x n ( 1 − x n ) × 6 k ) − f l o o r ( u 1 log ( x n ) × x n ( 1 − x n ) × 6 k ) , 5 ≤ k ≤ 15. (3)
When 5 ≤ k ≤ 15 and u 1 ∈ [ 0 , 4 ] , the system is chaotic. Its chaotic map is shown in
After the above improvement, 2.1 effectively increases the substitution variable generated by Joseph’s ergodic mapping, and 2.2 effectively enhances the chaos state, transformativeness and the range of k of the logistic mapping sequence.
At first, the original image is scrambled by using logistic mapping to obtain the encrypted image, then the encrypted image is divided into many blocks. Finally,
the position of the blocked image is scrambled by using the improved Josephus ring to get the encrypted image.
Given a M × N grayscale image, the encryption steps are described as following:
Step 1: Enter the encrypted grayscale image Q, the size of the image is M × N, let L = M × N.
Step 2: Enter the keys u 1 , x 0 , k , l , where u 1 is the control parameter of the logistic chaotic map, x 0 is the initial value of the logistic chaotic map, and x 0 ∈ ( 0 , 1 ) , k is the control index of the equation, l is the range of the chaotic sequence converted to an integer and 100 < l < L . This article take l = 256 .
Step 3: Generate a L-long chaotic sequence T = [ x 1 , x 2 ⋯ , x L ] by using the formula (3), and then modifies each component x i of T to obtain the key vector of the sequence T 1 = [ x 1 1 , x 2 1 , ⋯ , x L 1 ] and the vector T 1 as the image encryption.
Step 4: convert the image Q from M × N matrix to one-dimensional row vector B = [ x 1 2 , x 2 2 , ⋯ , x L 2 ] .
Step 5: Exclusive-OR the T 1 and B to obtain another one-dimensional vector C = [ x 1 3 , x 2 3 , ⋯ , x L 3 ] , and then convert C to an M × N matrix to obtain the image E 1 encrypted with the improved logistic map.
Step 6: Input m 1 , n 1 , where m 1 is the pixel of each line after the block, n 1 is the column pixel of each block after the block; and the values of A and B are respectively the factors of M and N. The values of A and B may be the same or different.
Step 7: Partition the encrypted image E 1 to obtain m 1 × n 1 matrix of ( M / m 1 ) × ( N / n 1 ) blocks.
Step 8: Enter m, q, where m is the number of the first few to come up with this one, q is the number of intervals.
Step 9: Write n = ( M / m 1 ) × ( N / n 1 ) , C = ( 1 , 2 , ⋯ , n ) , where 1 , 2 , ⋯ , ( N / n 1 ) are the numbering from left to right of m 1 × n 1 array in the first row, ( N / n 1 + 1 ) , ⋯ , 2 × ( N / n 1 ) are the numbering of the m 1 × n 1 array in the second row from left to right and go on in order .Then all the elements in C are scrambled by the improved Josephian traversal mapping f y s f 1 ( n , p , m ) to get a sequence C 1 .
Step 10: The elements in C 1 (that is, the numbering in step 9) are arranged in a matrix of ( M / m 1 ) × ( N / n 1 ) from left to right in the order of positions in C 1 (Write X = ( M / m 1 ) × ( N / n 1 ) , where X is ( M / m 1 ) × ( N / n 1 ) matrix), and then these m 1 × n 1 matrix of corresponding number are got into the X to get a disorganized block image.
Step 11: The block image in the tenth step is restored to M ×N image, which is the final encrypted image E.
Step 1: Input the final encrypted image E in step 11 above.
Step 2: Enter the correct m 1 , n 1 to block the encrypted image E.
Step 3: Enter the correct m, q for scrambling the restoration of the block to be restored encrypted image.
Step 4: restoring the restored encrypted block image to an M × N encrypted image again.
Step 5: Enter the correct key u 1 , x 0 , k , l , and perform the exclusive-OR operation on the M × N encrypted image to obtain the decrypted image.
PC configuration: Intel (R) Celeron (R) CPU N3450 @ 1.10 GHz 1.10 GHz, memory 4 GB, win 10 64 bit operating system. Through the Matlab R2014a programming to achieve the above encryption algorithm.
The experiments selected four grayscale images of lena, baboon, boat and couple, in which the pixel value of the first image was 1024 × 1024 and the pixel values of the remaining images were both 512 × 512. The algorithm of this paper is used to test the selected four images.
Image encryption algorithm should have enough key space and the sensitivity of key changes, so as to effectively defend against attacks. The key of this algorithm consists of 8 parameters of u 1 , x 0 , k , l , m 1 , n 1 , m , p , where u 1 ∈ ( 0 , 4 ) , x 0 ∈ ( 0 , 1 ) and k ∈ ( 5 , 15 ) are all decimal digits, plus the range of l , m 1 , n 1 , m and p, the key space of this algorithm is more than 1037 (calculated with a computer precision of 10−15) and has a good ability to resist attacks. The comparison results with other algorithms are shown in
The sensitivity of the key can be divided into the sensitivity of the encryption and the sensitivity of the decryption. In the encryption process, the sensitivity
Methods | Ours | Ref. [ | Ref. [ |
---|---|---|---|
Key space | 1037 | 2106 | 1.2 × 1024 |
can be reflected by the slight transformation of the key. We use to calculate the rate of change of ciphertext image to reflect the key encryption sensitivity, which is calculated as:
C R C = ∑ i = 1 L D i f ( E i , E ′ i ) L × 100 % (4)
where E i is a ciphertext image encrypted by the initial key, E ′ i is a ciphertext image encrypted with a small change of the key, and D i f ( E i , E ′ i ) is the number of elements with different pixel values in E i and E ′ i . The following were lena, baboon, boat image as an example.
Sensitivity analysis of several parameters in the logistic map above, the following parameters m 1 , n 1 , m , p are used to get on decryption analysis, the experiment chose the classic lena image and only analyzes m 1 and p (the other two parameters n 1 and m were similar to those of m 1 and p).
The experimental results from Figures 4-6 show that the ciphertext changes rate is above 99% even though the key changes slightly in the encryption process. In the process of decryption, even if the key changes slightly, it can not get the correct decryption image. The experimental results from
Histograms can well reflect the distribution of image pixel values. The smoother the histogram is, the more uniform the pixel values are.
According to the literature [
B D ( G , C ) = ∑ i = 1 M ∑ j = 1 N f ( i , j ) M N × 100 % (5)
where f ( i , j ) = { 1 , g i j = c i j 0 , g i j ≠ c i j .
From the formula (5) to calculate the fixed point of the encryption algorithm as shown in
After the image is encrypted, the gray value of many pixels will change. The fixed point ratio only reflects the change of the gray level in quantity, but it can not reflect the changed degree of the gray level. Therefore, in order to better evaluate the changed degree of gray-scale of encrypted image, the following gives the average changed value of gray [
Image | All pixels | Fixed point | Fixed point ratio |
---|---|---|---|
lena | 1,048,576 | 4014 | 0.39% |
baboon | 262,144 | 1075 | 0.41% |
boat | 262,144 | 1021 | 0.39% |
couple | 262,144 | 974 | 0.37% |
G A V E ( C , G ) = ∑ i = 1 M ∑ j = 1 N | c i j − g i j | M N (6)
where G is a plain text image and C is an encrypted image. According to formula (6) calculate the average gray value of the encryption algorithm changes as shown in
image | lena | baboon | boat | couple |
---|---|---|---|---|
Average changed value of gray | 84.92 | 71.26 | 75.05 | 70.53 |
Information entropy reflects the distribution of image gray values. The more uniform the gray value of images is, the larger the information entropy of images is. On the contrary, the entropy of information is smaller [
H ( G ) = − ∑ i = 1 L p ( x i ) log 2 ( x i ) (7)
The information entropy of the original image and the ciphertext image calculated according to formula (7) are shown in
The correlation of adjacent pixels is used to evaluate the effect of image encryption algorithms in eliminating the correlation of adjacent pixels in a plaintext image. In this paper, 3000 adjacent pixels are randomly selected in the original images and ciphertext images of 4 images. The correlation coefficients of adjacent pixels of the original image and the ciphertext image in the horizontal direction, the correlation coefficients of the adjacent pixels of the original image and the ciphertext image in the vertical direction and the correlation coefficients of adjacent pixels of the original image and the ciphertext image in the diagonal direction are calculated according to the formulas (8) - (11).
E ( x ) = 1 K ∑ i = 1 K x i (8)
D ( x ) = 1 K ∑ i = 1 K ( x i − E ( x ) ) 2 (9)
C o v ( x , y ) = 1 K ∑ i = 1 K ( x i − E ( x ) ) ( y i − E ( y ) ) (10)
r x y = C o v ( x , y ) D ( x ) × D ( y ) (11)
With the rapid development of network technology, how to ensure the security of digital images in storage and transmission has become an important issue in the current information security. The encryption algorithm in this paper is
image | lena | baboon | boat | couple |
---|---|---|---|---|
The original image | 7.9790 | 7.3713 | 7.1267 | 7.2369 |
Ciphertext image | 7.9999 | 7.9992 | 7.9991 | 7.9990 |
Image | lena | baboon | boat | couple | |
---|---|---|---|---|---|
Horizontal correlation coefficient | Original image | 0.9991 | 0.7060 | 0.9602 | 0.8284 |
Encrypted Image | 0.0012 | −0.0122 | −0.0032 | −0.0412 | |
Vertical correlation coefficient | Original image | 0.9977 | 0.8350 | 0.7954 | 0.9124 |
Encrypted Image | 0.0783 | −0.0642 | −0.0149 | 0.0261 | |
Diagonal correlation coefficient | Original image | 0.9972 | 0.6983 | 0.7922 | 0.7493 |
Encrypted Image | 0.0372 | −0.0064 | −0.0016 | -0.0339 |
encryption algorithm based on improved Josephus loop and improved logistic mapping to scrambling block. At first, we use logistic mapping to scramble the original image to obtain the encrypted image and then the encrypted image is divided into blocks. Finally, an improved Josephus ring is used to perform the position of the blocked image to get the encrypted image in this paper. By Matlab simulation experiments and the safety of experimental results are analyzed, the results show that the algorithm has the advantages of large key space, high key sensitivity, and can effectively resist the statistical analysis and gray value analysis attacks. So, it has good encryption effect on digital image encryption.
Zhuang, Z.B., Wang, J., Liu, J.Y., Yang, D.D. and Chen, S.Q. (2018) A New Digital Image Encryption Algorithm Based on Improved Logistic Mapping and Josephus Circle. Journal of Computer and Communications, 6, 31-44. https://doi.org/10.4236/jcc.2018.66003