﻿ 一种新的基于混沌映射的图像加密算法 A Novel Image Encryption Algorithm Based on Chaotic Map

Journal of Image and Signal Processing
Vol. 09  No. 01 ( 2020 ), Article ID: 33699 , 10 pages
10.12677/JISP.2020.91006

A Novel Image Encryption Algorithm Based on Chaotic Map

Jing Zhang, Ruisong Ye

Department of Mathematics, Shantou University, Shantou Guangdong

Received: Dec. 6th, 2019; accepted: Dec. 23rd, 2019; published: Dec. 30th, 2019

ABSTRACT

This paper presents a digital image encryption and decryption algorithm based on bit-planes and improved one-dimensional chaotic maps. Firstly, a simple and efficient new chaotic map is constructed by using two existing one-dimensional chaotic maps to generate random sequences for scrambling and diffusing the original image. Secondly, the original plain-image is decomposed into 8-bit planes, and the generated chaotic sequence is used to change the positions and values of the pixels to achieve the effect of scrambling and diffusion. Finally, the decomposed image is merged into gray image with 256 grayscales, and then the encrypted image is obtained by block shuffling operation. Experimental results show that the algorithm has good robustness and security. It can resist various attacks as well.

Keywords:Image Encryption, Chaotic Map, Bit-Plane

1. 引言

2. 新的混沌系统

2.1. Logistic映射

Logistic映射是一种简单的非线性混沌方程，因其具有良好的混沌特性，常被拿来用在混沌图像加密的算法中。它的定义如下 [12]。

${x}_{n+1}=u×{x}_{n}×\left(1-{x}_{n}\right)$ (1)

2.2. Sine映射

Sine映射和Logistic映射有着相同的混沌行为，也是常见的一种简单的混沌系统，它的定义可以用下式描述。

${x}_{n+1}=r×\mathrm{sin}\left(\pi ×{x}_{n}\right)$ (2)

r是它的控制参数，取值范围是 $r\in \left(0,1\right]$${x}_{n}$ 是输出的混沌序列。对于这两个基本的混沌系统，我们可通过查看它们的分岔图和李雅普诺夫图来观察它们的混沌行为。

(a) (b) (c)

Figure 1. Bifurcation graph. (a) Logistic mapping; (b) Sine mapping; (c) New chaotic mapping

Figure 2. Lyapunov diagram. (a) Logistic mapping; (b) Sine mapping; (c) New chaotic mapping

2.3. 构造新的混沌映射

${x}_{n+1}=r\left(u\mathrm{sin}\left(\pi {x}_{n}\right)\left(1-\mathrm{sin}\left(\pi {x}_{n}\right)\right)×{2}^{k}\mathrm{mod}1\right)$ (3)

r是一个常数，这里我们取值为20，u是一个区间不受限制的控制参数，k的取值为18。图1(c)，图2(c)分别是它的分岔图和李雅普诺夫图。从图中我们可以看出，相比于另两个混沌映射，它的混沌性能更好，点的分布更均匀。

3. 图像加密算法

3.1. 混沌系统初始值

$x={x}_{0}+\mathrm{mod}\left(\frac{{k}_{1}\oplus {k}_{2}\oplus {k}_{3}\oplus {k}_{4}\oplus {k}_{5}\oplus {k}_{6}\oplus {k}_{7}\oplus {k}_{8}}{256},1\right)$ (4)

$y={y}_{0}+\mathrm{mod}\left(\frac{{k}_{9}\oplus {k}_{10}\oplus {k}_{11}\oplus {k}_{12}\oplus {k}_{13}\oplus {k}_{14}\oplus {k}_{15}\oplus {k}_{16}}{256},1\right)$ (5)

$u=\mathrm{mod}\left({u}_{0}+\frac{{k}_{17}\oplus {k}_{18}\oplus {k}_{19}\oplus {k}_{20}\oplus {k}_{21}\oplus {k}_{22}\oplus {k}_{23}\oplus {k}_{24}}{256},1\right)$ (6)

$r=\mathrm{mod}\left({r}_{0}+\frac{{k}_{25}\oplus {k}_{26}\oplus {k}_{27}\oplus {k}_{28}\oplus {k}_{29}\oplus {k}_{30}\oplus {k}_{31}\oplus {k}_{32}}{256},1\right)$ (7)

3.2. 图像加密算法

Figure 3. Algorithm structure diagram

$A{P}_{i}=P{D}_{{d}_{i}},i=1,2,3,\cdots ,bt$ (8)

${C}_{i}=\left(\left(A{P}_{1}\oplus A{P}_{bt}\oplus A{P}_{bt-1}\right)+floor\left(X{S}_{i}×{10}^{14}\right)\right)\mathrm{mod}2$ if $i=1$ ; (9)

${C}_{i}=\left(\left(A{P}_{2}\oplus A{P}_{bt}\oplus {C}_{1}\right)+floor\left(X{S}_{i}×{10}^{14}\right)\right)\mathrm{mod}2$ if $i=2$ ; (10)

${C}_{i}=\left(\left(A{P}_{i}\oplus {C}_{i-1}\oplus {C}_{i-2}\right)+floor\left(X{S}_{i}×{10}^{14}\right)\right)\mathrm{mod}2$ if $i\in \left[3,bt\right]$ (11)

${S}_{1}=\mathrm{mod}\left(floor\left(S×{10}^{16}\right),M×N\right)+1$ (12)

$Xt={10}^{4}×XS-fix\left({10}^{4}×XS\right)$ (13)

$bs\left(k\right)={S}_{1}\left({k}^{2}+80\right)+Xt\left(256×k\right)$,$k=1,2,\cdots ,16$ (14)

$Tb=\left\{t{b}_{1},t{b}_{2},t{b}_{3},\cdots ,t{b}_{16}\right\}$ (15)

4. 实验结果和分析

(a) (b) (c)

Figure 4. Encryption and decryption diagram of the image

4.1. 密钥空间

4.2. 直方图分析

(a) 明文图像直方图 (b) 密文图像直方图

Figure 5. Histogram analysis

4.3. 相关性分析

${r}_{xy}=\frac{\mathrm{cov}\left(x,y\right)}{\sqrt{D\left(x\right)}×\sqrt{D\left(y\right)}}$ (16)

$\mathrm{cov}\left(x,y\right)=\frac{1}{N}\underset{i=0}{\overset{N}{\sum }}\left({x}_{i}-E\left(x\right)\right)\left({y}_{i}-E\left(y\right)\right)$ (17)

$E\left(x\right)=\frac{1}{N}\underset{i=0}{\overset{N}{\sum }}{x}_{i}$,$D\left(x\right)=\frac{1}{N}\underset{i=0}{\overset{N}{\sum }}{\left({x}_{i}-E\left(x\right)\right)}^{2}$ (18)

(a) (b) (c) (d) (e) (f)

Figure 6. Correlation between adjacent pixels of plaintext image and ciphertext image

Table 1. Correlation coefficient of adjacent pixels

4.4. 敏感性分析

4.4.1. 密钥敏感性分析

(a) 正确密钥 (b) 改变x0的值 (c) 改变y0的值 (d) 改变u0的值

Figure 7. Key sensitivity analysis

4.4.2. 明文敏感性分析

$\text{NPCR}=\frac{1}{M×N}\underset{i=1}{\overset{M}{\sum }}\underset{j=1}{\overset{N}{\sum }}D\left(i,j\right)×100%$ (19)

$\text{UACI}=\frac{1}{M×N}\underset{i=1}{\overset{M}{\sum }}\underset{j=1}{\overset{N}{\sum }}\frac{|{C}_{1}\left(i,j\right)-{C}_{2}\left(i,j\right)|}{255}×100%$ (20)

$D\left(i,j\right)=\left\{\begin{array}{l}0,{C}_{1}\left(i,j\right)={C}_{2}\left(i,j\right)\\ 1,{C}_{1}\left(i,j\right)\ne {C}_{2}\left(i,j\right)\end{array}$ (21)

M，N是图像的大小， ${C}_{1}$${C}_{2}$ 是加密后的两个密文图像，它们只在一个像素点处的灰度值是不同的。通过随机选取明文图像中的像素值使其像素值加1，进行测试后，得出的NPCR和UACI的值分别是99.6091%和33.4579%，从中可以看出，提出的算法具有较好的明文敏感性。

4.5. 信息熵

$H=-\underset{i=0}{\overset{L}{\sum }}p\left(i\right){\mathrm{log}}_{2}p\left(i\right)$ (22)

Table 2. Information entropy

5. 总结

A Novel Image Encryption Algorithm Based on Chaotic Map[J]. 图像与信号处理, 2020, 09(01): 47-56. https://doi.org/10.12677/JISP.2020.91006

1. 1. 张勇. 混沌数字图像加密[M]. 北京: 清华大学出版社, 2016.

2. 2. 徐超, 张雪锋. 改进的基于位平面的图像加密算法[J]. 计算机工程与设计, 2014, 35(2): 451-456.

3. 3. Zhou, Y., Bao, L. and Chen, C.L.P. (2014) A New 1D Chaotic System for Image Encryption. Signal Processing, 97, 172-182.
https://doi.org/10.1016/j.sigpro.2013.10.034

4. 4. Hua, Z., Zhou, Y., Pun, C.M., et al. (2015) 2D Sine Logistic Modulation Map for Image Encryption. Information Sciences, 297, 80-94.
https://doi.org/10.1016/j.ins.2014.11.018

5. 5. Cao, C., Sun, K. and Liu, W. (2017) A Novel Bit-Level Image Encryption Algorithm Based on 2D-LICM Hyperchaotic Map. Signal Processing, 143, 122-133.
https://doi.org/10.1016/j.sigpro.2017.08.020

6. 6. Xu, L., Li, Z., Li, J., et al. (2016) A Novel Bit-Level Image Encryption Algorithm Based on Chaotic Maps. Optics and Lasers in Engineering, 78, 17-25.
https://doi.org/10.1016/j.optlaseng.2015.09.007

7. 7. Liu, D.D., Zhang, W., Yu, H., et al. (2018) An Image Encryption Scheme Using Self-Adaptive Selective Permutation and Inter-Intra-Block Feedback Diffusion. Signal Processing, 151, 130-143.
https://doi.org/10.1016/j.sigpro.2018.05.008

8. 8. Li, Y., Wang, C. and Chen, H. (2017) A Hyper-Chaos-Based Image Encryption Algorithm Using Pixel-Level Permutation and Bit-Level Permutation. Optics & Lasers in Engineering, 90, 238-246.
https://doi.org/10.1016/j.optlaseng.2016.10.020

9. 9. Liu, J., Yang, D., Zhou, H., et al. (2018) A Digital Image Encryption Algorithm Based on Bit-Planes and an Improved Logistic Map. Multimedia Tools & Applications, 77, 10217-10233.
https://doi.org/10.1007/s11042-017-5406-2

10. 10. Fridrich, J. (1998) Symmetric Ciphers Based on Two-Dimensional Chaotic Maps. International Journal of Bifurcation and Chaos, 8, 1259-1284.
https://doi.org/10.1142/S021812749800098X

11. 11. Jolfaei, A., Wu, X.W. and Muthukkumarasamy, V. (2014) Comments on the Security of “Diffusion-Substitution Based Gray Image Encryption” Scheme. Digital Signal Processing, 32, 34-36.
https://doi.org/10.1016/j.dsp.2014.05.011

12. 12. Phatak, S.C. and Rao, S.S. (1995) Logistic Map: A Possible Random-Number Generator. Physical Review, 51, 3670-3678.
https://doi.org/10.1103/PhysRevE.51.3670

13. 13. Chen, J.X., Zhu, Z.L., Fu, C., et al. (2015) An Efficient Image Encryption Scheme Using Gray Code Based Permutation Approach. Optics and Lasers in Engineering, 67, 191-204.
https://doi.org/10.1016/j.optlaseng.2014.11.017