<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JCC</journal-id><journal-title-group><journal-title>Journal of Computer and Communications</journal-title></journal-title-group><issn pub-type="epub">2327-5219</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jcc.2018.66003</article-id><article-id pub-id-type="publisher-id">JCC-85408</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  A New Digital Image Encryption Algorithm Based on Improved Logistic Mapping and Josephus Circle
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Zhiben</surname><given-names>Zhuang</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Jing</surname><given-names>Wang</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Jingyi</surname><given-names>Liu</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Dingding</surname><given-names>Yang</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Shiqiang</surname><given-names>Chen</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>School of Science, Hubei University for Nationalities, Enshi, China</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>zbxzzb185898@163.com(ZZ)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>05</day><month>06</month><year>2018</year></pub-date><volume>06</volume><issue>06</issue><fpage>31</fpage><lpage>44</lpage><history><date date-type="received"><day>12,</day>	<month>March</month>	<year>2018</year></date><date date-type="rev-recd"><day>18,</day>	<month>June</month>	<year>2018</year>	</date><date date-type="accepted"><day>21,</day>	<month>June</month>	<year>2018</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  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 &#177;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.
 
</p></abstract><kwd-group><kwd>Digital Image Encryption</kwd><kwd> Image Block Scrambling</kwd><kwd> Josephus Loop</kwd><kwd> Logistic Mapping</kwd><kwd> Pixel Scrambling</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>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 [<xref ref-type="bibr" rid="scirp.85408-ref1">1</xref>] , image encryption [<xref ref-type="bibr" rid="scirp.85408-ref1">1</xref>] is a more intuitive method and the essence of image encryption is pixel scrambling [<xref ref-type="bibr" rid="scirp.85408-ref2">2</xref>] .</p><p>In 1998, Fridrich proposed an image encryption algorithm based on permutation and confusion structure in [<xref ref-type="bibr" rid="scirp.85408-ref1">1</xref>] . [<xref ref-type="bibr" rid="scirp.85408-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref3">3</xref>] discussed the use of Arnold mapping for pixel replacement, in which [<xref ref-type="bibr" rid="scirp.85408-ref3">3</xref>] also incorporates discrete Chen mapping of pixel values for permutation confusion; [<xref ref-type="bibr" rid="scirp.85408-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref7">7</xref>] used the randomness of one-dimensional chaotic sequence to scramble the pixel position of the image to realize encryption; [<xref ref-type="bibr" rid="scirp.85408-ref8">8</xref>] proposed an image bit encryption algorithm based on Joseph’s ergodic and generalized Henon mapping. The security image to be encrypted Hash Algorithm 1 (SHA-1) summary and user-selected encryption parameters are combined as the key to drive Generalized Henon Mapping to randomly disturb the starting position, the reported number of intervals and the reported direction of the improved Josephus traversal map, so that different encrypted images and encryption parameters correspond substantially to different site replacement processes and added a site obfuscation process to improve the security of site replacement. [<xref ref-type="bibr" rid="scirp.85408-ref9">9</xref>] proposed an image pixels scrambling by Tent chaotic mapping and then using S-box permutation of color image encryption algorithm at the bit; [<xref ref-type="bibr" rid="scirp.85408-ref8">8</xref>] - [<xref ref-type="bibr" rid="scirp.85408-ref14">14</xref>] introduced a bit-based encryption algorithm; [<xref ref-type="bibr" rid="scirp.85408-ref15">15</xref>] proposed improved the Logistic map by using scale transformation, constructing robust system and composite mapping respectively. [<xref ref-type="bibr" rid="scirp.85408-ref16">16</xref>] proposed an image encryption with chaotically coupled chaotic maps. [<xref ref-type="bibr" rid="scirp.85408-ref17">17</xref>] proposed an image encryption algorithm based on Brownian motion and image, and introduced a new one-dimensional chaotic system. [<xref ref-type="bibr" rid="scirp.85408-ref18">18</xref>] analyzed the security of image encryption algorithm based on the incorrect fractional-order chaotic system. In [<xref ref-type="bibr" rid="scirp.85408-ref19">19</xref>] , a data invariant encryption algorithm based on improved Logistic mapping is proposed. The image encryption performance is analyzed and studied and some indexes of encryption performance evaluation are also given in the [<xref ref-type="bibr" rid="scirp.85408-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref20">20</xref>] .</p><p>The above works used some pixel value replacement methods in the process of encryption, such as compute of encryption pixels and adjacent elements [<xref ref-type="bibr" rid="scirp.85408-ref4">4</xref>] , operations of encryption pixel gray value and key [<xref ref-type="bibr" rid="scirp.85408-ref9">9</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref10">10</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref11">11</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref13">13</xref>] and so on. None of these algorithms involve encrypting the original image first, followed by blocking the entire encrypted image and then scrambling the block. Therefore, this paper presents a digital image encryption algorithm based on improved Josephus loop and improved logistic mapping to scramble block. The images selected by this algorithm are all gray-scale image. The simulation experiments are carried out by Matlab, and the experimental results are evaluated by the evaluation indexes of information entropy, histogram, fixed point ratio and adjacent pixel correlation. 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.</p></sec><sec id="s2"><title>2. The Preparatory Work</title><sec id="s2_1"><title>2.1. Improved Joseph’s Traversal Mappings</title><p>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 [<xref ref-type="bibr" rid="scirp.85408-ref8">8</xref>] .</p><p>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.</p><p>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 ) .</p></sec><sec id="s2_2"><title>2.2. Improved Logistic Mapping</title><p>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:</p><p>x n + 1 = u x n ( 1 − x n ) , (1)</p><p>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 [<xref ref-type="bibr" rid="scirp.85408-ref14">14</xref>] :</p><p>x n + 1 = ( u x n ( 1 − x n ) &#215; 2 k ) − f l o o r ( u x n ( 1 − x n ) &#215; 2 k ) , k ∈ Z + , k ≥ 8. (2)</p><p>Its chaotic map is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>. In order to make the encrypted image more secure, the Equation (2) is made the following improvements. The equation is:</p><p>x n + 1 = ( u 1 log ( x n ) &#215; x n ( 1 − x n ) &#215; 6 k ) − f l o o r ( u 1 log ( x n ) &#215; x n ( 1 − x n ) &#215; 6 k ) , 5 ≤ k ≤ 15. (3)</p><p>When 5 ≤ k ≤ 15 and u 1 ∈ [ 0 , 4 ] , the system is chaotic. Its chaotic map is shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>. Compared with the sequence generated by the chaotic mapping in (2), the sequence in (3) is more chaotic and transformable. At the same time, the value range of k is increased so that the key space of the encryption algorithm also increases.</p><p>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.</p></sec></sec><sec id="s3"><title>3. Algorithm Description</title><sec id="s3_1"><title>3.1. Encryption Algorithm Description</title><p>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,</p><p>the position of the blocked image is scrambled by using the improved Josephus ring to get the encrypted image.</p><p>Given a M &#215; N grayscale image, the encryption steps are described as following:</p><p>Step 1: Enter the encrypted grayscale image Q, the size of the image is M &#215; N, let L = M &#215; N.</p><p>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 &lt; l &lt; L . This article take l = 256 .</p><p>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.</p><p>Step 4: convert the image Q from M &#215; N matrix to one-dimensional row vector B = [ x 1 2 , x 2 2 , ⋯ , x L 2 ] .</p><p>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 &#215; N matrix to obtain the image E 1 encrypted with the improved logistic map.</p><p>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.</p><p>Step 7: Partition the encrypted image E 1 to obtain m 1 &#215; n 1 matrix of ( M / m 1 ) &#215; ( N / n 1 ) blocks.</p><p>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.</p><p>Step 9: Write n = ( M / m 1 ) &#215; ( N / n 1 ) , C = ( 1 , 2 , ⋯ , n ) , where 1 , 2 , ⋯ , ( N / n 1 ) are the numbering from left to right of m 1 &#215; n 1 array in the first row, ( N / n 1 + 1 ) , ⋯ , 2 &#215; ( N / n 1 ) are the numbering of the m 1 &#215; 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 .</p><p>Step 10: The elements in C 1 (that is, the numbering in step 9) are arranged in a matrix of ( M / m 1 ) &#215; ( N / n 1 ) from left to right in the order of positions in C 1 (Write X = ( M / m 1 ) &#215; ( N / n 1 ) , where X is ( M / m 1 ) &#215; ( N / n 1 ) matrix), and then these m 1 &#215; n 1 matrix of corresponding number are got into the X to get a disorganized block image.</p><p>Step 11: The block image in the tenth step is restored to M &#215;N image, which is the final encrypted image E.</p></sec><sec id="s3_2"><title>3.2. Decryption Algorithm Description</title><p>Step 1: Input the final encrypted image E in step 11 above.</p><p>Step 2: Enter the correct m 1 , n 1 to block the encrypted image E.</p><p>Step 3: Enter the correct m, q for scrambling the restoration of the block to be restored encrypted image.</p><p>Step 4: restoring the restored encrypted block image to an M &#215; N encrypted image again.</p><p>Step 5: Enter the correct key u 1 , x 0 , k , l , and perform the exclusive-OR operation on the M &#215; N encrypted image to obtain the decrypted image.</p></sec></sec><sec id="s4"><title>4. Experimental Results and Analysis</title><sec id="s4_1"><title>4.1. Experimental Platform</title><p>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.</p></sec><sec id="s4_2"><title>4.2. Experimental Results</title><p>The experiments selected four grayscale images of lena, baboon, boat and couple, in which the pixel value of the first image was 1024 &#215; 1024 and the pixel values of the remaining images were both 512 &#215; 512. The algorithm of this paper is used to test the selected four images. <xref ref-type="fig" rid="fig3">Figure 3</xref> shows the comparison of plaintext, ciphertext and decrypted images. It can be seen from <xref ref-type="fig" rid="fig3">Figure 3</xref> that the encrypted image has become cluttered and visually distinct from the plaintext image, showing that the algorithm has a good encrypted visual effect and the decrypted image is completely correct, indicating that the algorithm in this paper can correctly implement the role of image encryption and decryption.</p></sec><sec id="s4_3"><title>4.3. Key Space and Key Sensitivity Analysis</title><p>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 10<sup>37</sup> (calculated with a computer precision of 10<sup>−15</sup>) and has a good ability to resist attacks. The comparison results with other algorithms are shown in <xref ref-type="table" rid="table1"><xref ref-type="table" rid="table">Table </xref>1</xref>.</p><p>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 <sub> </sub></p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1"><xref ref-type="table" rid="table">Table </xref>1</xref></label><caption><title> Key space comparison results with other methods</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Methods</th><th align="center" valign="middle" >Ours</th><th align="center" valign="middle" >Ref. [<xref ref-type="bibr" rid="scirp.85408-ref9">9</xref>]</th><th align="center" valign="middle" >Ref. [<xref ref-type="bibr" rid="scirp.85408-ref16">16</xref>]</th></tr></thead><tr><td align="center" valign="middle" >Key space</td><td align="center" valign="middle" >10<sup>37</sup></td><td align="center" valign="middle" >2<sup>106</sup></td><td align="center" valign="middle" >1.2 &#215; 10<sup>24</sup></td></tr></tbody></table></table-wrap><p>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:</p><p>C R C = ∑ i = 1 L D i f ( E i , E ′ i ) L &#215; 100 % (4)</p><p>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.</p><p><xref ref-type="fig" rid="fig4">Figure 4</xref> test the sensitivity of key u 1 , <xref ref-type="fig" rid="fig4">Figure 4</xref>(a) is the original image of lena, <xref ref-type="fig" rid="fig4">Figure 4</xref>(b) is the ciphertext image E encrypted by the keys u 1 = 3.7 , x 0 = 0.5 , k = 9.8 , l = 256 , m 1 = 64 , n 1 = 128 , m = 3 and p = 2 , <xref ref-type="fig" rid="fig4">Figure 4</xref>(c) is the encrypted image E ′ whose key u 1 is changed to 3.70000000000001. By formula (4) calculated the rate of change between the two images was 99.61%. <xref ref-type="fig" rid="fig4">Figure 4</xref>(d) is the decrypted image obtained by decrypting E ′ with the key u 1 = 3.7 , and <xref ref-type="fig" rid="fig4">Figure 4</xref>(e) is the decrypted image obtained by decrypting E ′ with the key u 1 = 3.70000000000001 .</p><p><xref ref-type="fig" rid="fig5">Figure 5</xref> test the sensitivity of key x 0 . <xref ref-type="fig" rid="fig5">Figure 5</xref>(a) is the original picture of baboon, <xref ref-type="fig" rid="fig5">Figure 5</xref>(b) is the ciphertext image E encrypted with the key u 1 = 3.7 , x 0 = 0.5 , k = 9.8 , l = 256 , m 1 = 32 , n 1 = 64 , m = 3 and p = 2 . <xref ref-type="fig" rid="fig5">Figure 5</xref>(c) is the encrypted image E ′ whose key x 0 is changed to 0.50000000000001. Through the formula (4) calculated the rate of change between the two images was 99.59%. <xref ref-type="fig" rid="fig5">Figure 5</xref>(d) is the decrypted image obtained by decrypting E with the key x 0 = 0.50000000000001 , and <xref ref-type="fig" rid="fig5">Figure 5</xref>(e) is the decrypted image obtained by decrypting E with the key x 0 = 0.5 .</p><p><xref ref-type="fig" rid="fig6">Figure 6</xref> test the sensitivity of key k. <xref ref-type="fig" rid="fig6">Figure 6</xref>(a) is the original picture of the boat, <xref ref-type="fig" rid="fig6">Figure 6</xref>(b) is the ciphertext image E encrypted with the key u 1 = 3.7 , x 0 = 0.5 , k = 9.8 , l = 256 , m 1 = 32 , n 1 = 64 , m = 3 and p = 2 . <xref ref-type="fig" rid="fig6">Figure 6</xref>(c) is the encrypted image E ′ whose key k is changed to 9.80000000000001. By formula (4) calculated the rate of change between the two images was 99.61%. <xref ref-type="fig" rid="fig6">Figure 6</xref>(d) is the decrypted image obtained by decrypting E with the key k = 9.80000000000001 , and <xref ref-type="fig" rid="fig6">Figure 6</xref>(e) is the decrypted image obtained by decrypting E with the key k = 9.8 .</p><p>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).</p><p><xref ref-type="fig" rid="fig7">Figure 7</xref> test the influences of key m 1 on the decryption process. <xref ref-type="fig" rid="fig7">Figure 7</xref>(a) is the original picture of the lena, <xref ref-type="fig" rid="fig7">Figure 7</xref>(b) is the ciphertext image encrypted with the key u 1 = 3.7 , x 0 = 0.5 , k = 9.8 , l = 256 , m 1 = 64 , n 1 = 64 , m = 3 and p = 2 , <xref ref-type="fig" rid="fig7">Figure 7</xref>(c) is the decrypted image with m 1 changed to 128.</p><p><xref ref-type="fig" rid="fig8">Figure 8</xref> test the influences of key p on the decryption process. <xref ref-type="fig" rid="fig8">Figure 8</xref>(a) is the original image of the lena, <xref ref-type="fig" rid="fig8">Figure 8</xref>(b) is the ciphertext image encrypted by the key u 1 = 3.7 , x 0 = 0.5 , k = 9.8 , l = 256 , m 1 = 64 , n 1 = 64 , m = 3 and p = 2 , and <xref ref-type="fig" rid="fig8">Figure 8</xref>(c) is the decrypted image with p changed to 3.</p><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 <xref ref-type="fig" rid="fig7">Figure 7</xref>, <xref ref-type="fig" rid="fig8">Figure 8</xref> show that when m 1 , n 1 , m , p are different from the values entered during encryption, only a small portion of small images can be decrypted, however, most other small blocks are not easy to decrypt, which shows that this algorithm has good key sensitivity and encryption effect.</p></sec><sec id="s4_4"><title>4.4. Histogram Analysis</title><p>Histograms can well reflect the distribution of image pixel values. The smoother the histogram is, the more uniform the pixel values are. <xref ref-type="fig" rid="fig9">Figure 9</xref> shows the histograms of the original image and the encrypted image of the lena and baboon images, respectively.</p></sec><sec id="s4_5"><title>4.5. Image Encryption Fixed Point Ratio Analysis</title><p>According to the literature [<xref ref-type="bibr" rid="scirp.85408-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref20">20</xref>] , the fixed point refers to the pixel whose gray value does not change before and after the image is encrypted. The fixed point ratio is the percentage of the fixed point of the image and all pixels, which is calculated as follows:</p><p>B D ( G , C ) = ∑ i = 1 M ∑ j = 1 N f ( i , j ) M N &#215; 100 % (5)</p><p>where f ( i , j ) = { 1 , g i j = c i j 0 , g i j ≠ c i j .</p><p>From the formula (5) to calculate the fixed point of the encryption algorithm as shown in <xref ref-type="table" rid="table2"><xref ref-type="table" rid="table">Table </xref>2</xref>.</p></sec><sec id="s4_6"><title>4.6 Average Gray Value Change Analysis</title><p>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 [<xref ref-type="bibr" rid="scirp.85408-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.85408-ref20">20</xref>] . The formula is as follows:</p><table-wrap id="table2" ><label><xref ref-type="table" rid="table2"><xref ref-type="table" rid="table">Table </xref>2</xref></label><caption><title> Encrypted image fixed point ratio analysis table</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Image</th><th align="center" valign="middle" >All pixels</th><th align="center" valign="middle" >Fixed point</th><th align="center" valign="middle" >Fixed point ratio</th></tr></thead><tr><td align="center" valign="middle" >lena</td><td align="center" valign="middle" >1,048,576</td><td align="center" valign="middle" >4014</td><td align="center" valign="middle" >0.39%</td></tr><tr><td align="center" valign="middle" >baboon</td><td align="center" valign="middle" >262,144</td><td align="center" valign="middle" >1075</td><td align="center" valign="middle" >0.41%</td></tr><tr><td align="center" valign="middle" >boat</td><td align="center" valign="middle" >262,144</td><td align="center" valign="middle" >1021</td><td align="center" valign="middle" >0.39%</td></tr><tr><td align="center" valign="middle" >couple</td><td align="center" valign="middle" >262,144</td><td align="center" valign="middle" >974</td><td align="center" valign="middle" >0.37%</td></tr></tbody></table></table-wrap><p>G A V E ( C , G ) = ∑ i = 1 M ∑ j = 1 N | c i j − g i j | M N (6)</p><p>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 <xref ref-type="table" rid="table3"><xref ref-type="table" rid="table">Table </xref>3</xref>.</p><table-wrap id="table3" ><label><xref ref-type="table" rid="table3"><xref ref-type="table" rid="table">Table </xref>3</xref></label><caption><title> Average gray value change analysis table</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >image</th><th align="center" valign="middle" >lena</th><th align="center" valign="middle" >baboon</th><th align="center" valign="middle" >boat</th><th align="center" valign="middle" >couple</th></tr></thead><tr><td align="center" valign="middle" >Average changed value of gray</td><td align="center" valign="middle" >84.92</td><td align="center" valign="middle" >71.26</td><td align="center" valign="middle" >75.05</td><td align="center" valign="middle" >70.53</td></tr></tbody></table></table-wrap></sec><sec id="s4_7"><title>4.7. Information Entropy Analysis</title><p>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 [<xref ref-type="bibr" rid="scirp.85408-ref20">20</xref>] . Information entropy is calculated as follows:</p><p>H ( G ) = − ∑ i = 1 L p ( x i ) log 2 ( x i ) (7)</p><p>The information entropy of the original image and the ciphertext image calculated according to formula (7) are shown in <xref ref-type="table" rid="table4"><xref ref-type="table" rid="table">Table </xref>4</xref>.</p></sec><sec id="s4_8"><title>4.8. Neighborhood Pixel Correlation Analysis</title><p>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). <xref ref-type="table" rid="table5"><xref ref-type="table" rid="table">Table </xref>5</xref> is a comparison table of correlation coefficients between the original image and the encrypted image. In <xref ref-type="fig" rid="fig1">Figure 1</xref>0, the correlation between the original baboon image and the encrypted image in the horizontal, vertical and diagonal directions is compared.</p><p>E ( x ) = 1 K ∑ i = 1 K x i (8)</p><p>D ( x ) = 1 K ∑ i = 1 K ( x i − E ( x ) ) 2 (9)</p><p>C o v ( x , y ) = 1 K ∑ i = 1 K ( x i − E ( x ) ) ( y i − E ( y ) ) (10)</p><p>r x y = C o v ( x , y ) D ( x ) &#215; D ( y ) (11)</p></sec></sec><sec id="s5"><title>5. Conclusion</title><p>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</p><table-wrap id="table4" ><label><xref ref-type="table" rid="table4"><xref ref-type="table" rid="table">Table </xref>4</xref></label><caption><title> <xref ref-type="table" rid="table">Table </xref>of information entropy analysis of original and encrypted images</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >image</th><th align="center" valign="middle" >lena</th><th align="center" valign="middle" >baboon</th><th align="center" valign="middle" >boat</th><th align="center" valign="middle" >couple</th></tr></thead><tr><td align="center" valign="middle" >The original image</td><td align="center" valign="middle" >7.9790</td><td align="center" valign="middle" >7.3713</td><td align="center" valign="middle" >7.1267</td><td align="center" valign="middle" >7.2369</td></tr><tr><td align="center" valign="middle" >Ciphertext image</td><td align="center" valign="middle" >7.9999</td><td align="center" valign="middle" >7.9992</td><td align="center" valign="middle" >7.9991</td><td align="center" valign="middle" >7.9990</td></tr></tbody></table></table-wrap><table-wrap id="table5" ><label><xref ref-type="table" rid="table5"><xref ref-type="table" rid="table">Table </xref>5</xref></label><caption><title> Comparison table of correlation coefficient between original image and encrypted image</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Image</th><th align="center" valign="middle" ></th><th align="center" valign="middle" >lena</th><th align="center" valign="middle" >baboon</th><th align="center" valign="middle" >boat</th><th align="center" valign="middle" >couple</th></tr></thead><tr><td align="center" valign="middle"  rowspan="2"  >Horizontal correlation coefficient</td><td align="center" valign="middle" >Original image</td><td align="center" valign="middle" >0.9991</td><td align="center" valign="middle" >0.7060</td><td align="center" valign="middle" >0.9602</td><td align="center" valign="middle" >0.8284</td></tr><tr><td align="center" valign="middle" >Encrypted Image</td><td align="center" valign="middle" >0.0012</td><td align="center" valign="middle" >−0.0122</td><td align="center" valign="middle" >−0.0032</td><td align="center" valign="middle" >−0.0412</td></tr><tr><td align="center" valign="middle"  rowspan="2"  >Vertical correlation coefficient</td><td align="center" valign="middle" >Original image</td><td align="center" valign="middle" >0.9977</td><td align="center" valign="middle" >0.8350</td><td align="center" valign="middle" >0.7954</td><td align="center" valign="middle" >0.9124</td></tr><tr><td align="center" valign="middle" >Encrypted Image</td><td align="center" valign="middle" >0.0783</td><td align="center" valign="middle" >−0.0642</td><td align="center" valign="middle" >−0.0149</td><td align="center" valign="middle" >0.0261</td></tr><tr><td align="center" valign="middle"  rowspan="2"  >Diagonal correlation coefficient</td><td align="center" valign="middle" >Original image</td><td align="center" valign="middle" >0.9972</td><td align="center" valign="middle" >0.6983</td><td align="center" valign="middle" >0.7922</td><td align="center" valign="middle" >0.7493</td></tr><tr><td align="center" valign="middle" >Encrypted Image</td><td align="center" valign="middle" >0.0372</td><td align="center" valign="middle" >−0.0064</td><td align="center" valign="middle" >−0.0016</td><td align="center" valign="middle" >-0.0339</td></tr></tbody></table></table-wrap><p>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.</p></sec><sec id="s6"><title>Cite this paper</title><p>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</p></sec></body><back><ref-list><title>References</title><ref id="scirp.85408-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Fridrich, J. (1998) Symmetric Ciphers Based on Two-Dimensional Chaotic Maps. Intemational Journal of Bifurcation and Chaos, 8, 1259-1284.  
https://doi.org/10.1142/S021812749800098X</mixed-citation></ref><ref id="scirp.85408-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Xu, J.F. and Yang, Y. (2006) Analysis of Scrambling Performance of Encrypted Image. Neural Computation, 33, 110-113.</mixed-citation></ref><ref id="scirp.85408-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Guan, Z.H., Huang, F.J. and Guan, W.J. (2005) Chaos-Based Image Encryption Algorithm. Physics Letters A, 346, 153-157.</mixed-citation></ref><ref id="scirp.85408-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Xu, B. and Yuan, L. (2014) Research on Image Encryption Algorithm Logistic Chaotic Based on an Improved Digital Mapping. Computer Measurement &amp; Control, 22, 2157-2159.</mixed-citation></ref><ref id="scirp.85408-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Li, C.H., Luo, G.C., Qin, K. and Li, C.B. (2016) An Image Encryption Scheme Based on Chaotic Tent Map. Nonlinear Dynamics, 1-7.</mixed-citation></ref><ref id="scirp.85408-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Li, X., Zhang, G.J. and Zhang, X.Y. (2015) Image Encryption Algorithm with Compound Chaotic Maps. Journal of Ambient Intelligence &amp; Humanized Computing, 6, 563-570. https://doi.org/10.1007/s12652-013-0217-4</mixed-citation></ref><ref id="scirp.85408-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Yi, K.X., Sun, X. and Shi, J.Y. (2000) An Image Encryption Algorithm Based on Chaotic Sequences. Journal of Computer-Aided Design &amp; Computer Graphics, 12, 672-676.</mixed-citation></ref><ref id="scirp.85408-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Gou, Y., Shao, L.P. and Yang, L. (2015) Bit-Level Image Encryption Algorithm Based on Josephus and Henon Chaotic Map. Application Research of Computers, 32, 1-7.</mixed-citation></ref><ref id="scirp.85408-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Hussain, I. and Gondal, M.A. (2014) An Extended Image Encryption Using Chaotic Coupled Map and S-Box Transformation. Nonlinear Dynamics, 76, 1355-1363.  
https://doi.org/10.1007/s11071-013-1214-z</mixed-citation></ref><ref id="scirp.85408-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">El-Latif, A.A.A., Li, L., Zhang, T.J., Wang, N., Song, X.H. and Niu, X.M. (2012) Digital Image Encryption Scheme Based on Multiple Chaotic Systems. Sensing and Imaging, 13, 67-88. https://doi.org/10.1007/s11220-012-0071-z</mixed-citation></ref><ref id="scirp.85408-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Khanzadi, H., Eshghi, M. and Borujeni, S.E. (2014) Image Encryption Using Random Bit Sequence Based on Chaotic Maps. Arabian Journal Forence &amp; Engineering, 39, 1039-1047. https://doi.org/10.1007/s13369-013-0713-z</mixed-citation></ref><ref id="scirp.85408-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Seyedzadeh, S.M., Norouzi, B., Mosavi, M.R. and Mirzakuchaki, S. (2015) A Novel Color Image Encryption Algorithm Based on Spatial Permutation and Quantum Chaotic Map. Nonlinear Dynamics, 81, 1-19.  
https://doi.org/10.1007/s11071-015-2008-2</mixed-citation></ref><ref id="scirp.85408-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Zhu, H.G., Lu, X.J., Zhang, X.D. and Tang, Q.S. (2014) A Novel Image Encryption Scheme with 2D-Logistic Map and Quadratic Residue. Journal of Northeastern University (Natural Science), 35, 20-23.</mixed-citation></ref><ref id="scirp.85408-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Liu, R. (2015) New Algorithm for Color Image Encryption Using Improved 1D Logistic. Open Cybernetics &amp; Systemics Journal, 9, 210-215.  
https://doi.org/10.2174/1874110X01509010210</mixed-citation></ref><ref id="scirp.85408-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Elgendy, F., Sarhan, A.M., Eltobely, T.E., El-Zoghdy, S.F., El-Sayed, H.S. and Faragallah, O.S. (2015) Chaos-Based Model for Encryption and Decryption of Digital Images. Multimedia Tools &amp; Applications, 1-25.</mixed-citation></ref><ref id="scirp.85408-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Pisarchik, A. and Zanin, M. (2008) Image Encryption with Chaotically Coupled Chaotic Maps. Journal of Physics D, 237, 2638-2648.  
https://doi.org/10.1016/j.physd.2008.03.049</mixed-citation></ref><ref id="scirp.85408-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Chai, X. (2017) An Image Encryption Algorithm Based on Bit Level Brownian Motion and New Chaotic Systems. Multimedia Tools and Applications, 76, 1159-1175.  
https://doi.org/10.1007/s11042-015-3088-1</mixed-citation></ref><ref id="scirp.85408-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Norouzi, B. and Mirzakuchaki, S. (2017) Breaking a Novel Image Encryption Scheme Based on an Improper Fractional Order Chaotic System. Multimedia Tools and Applications, 76, 1817-1826. https://doi.org/10.1007/s11042-015-3085-4</mixed-citation></ref><ref id="scirp.85408-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Yang, D., Wang, J. and Chen, S. (2017) An Encryption Algorithm Keeping Data Length Unchanged Based on Modified Logistic Map. Computer Applications and Software, 34, 293-298.</mixed-citation></ref><ref id="scirp.85408-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Wang, Y., Zhu, W. and Zhan, X. (2006) Study on Scrambling Capability Based on Image Encryption. Computer Engineering and Design, 27, 4729-4731.</mixed-citation></ref></ref-list></back></article>