﻿ 基于混沌系统和人工神经网络的图像加密算法
 计算机系统应用  2020, Vol. 29 Issue (8): 236-241 PDF

Image Encryption Algorithm Based on Chaotic System and Artificial Neural Network
CHEN Sen, XUE Wei
School of Internet of Things Engineering, Jiangnan University, Wuxi 214122, China
Foundation item: National Natural Science Foundation of China (61374047)
Abstract: In some chaos-based image encryption algorithms, the key is not related to the plaintext and the chaotic sequence has periodicity. In order to solve these problems, a new image encryption method is proposed. First, based on the plaintext image and the hash function SHA-384, the initial value of the Lorenz is generated, and the chaotic system is controlled to generate chaotic sequences. Then, the artificial neural network is introduced to train the chaotic sequence to eliminate its chaotic periodicity and output a new sequence. The scrambling and diffusion operations are performed on the plaintext image to complete the encryption. The experimental results show that the proposed algorithm is able to enhance the security of the cipher-image, increase the size of the key space and resist various attacks.
Key words: image encryption     hash function     chaotic system     artificial neural network     security analysis

1 算法基础 1.1 Lorenz混沌系统

Lorenz混沌系统是最常用的混沌系统之一, 本文采用改进后的Lorenz混沌系统, 其数学模型为[5]:

 $\left\{ \begin{array}{l} \dot x = a(y - x)\\ \dot y = bx - x{\textit{z}} + y\\ \dot {\textit{z}} = 200{x^2} + 0.01{e^{xy}} - c{\textit{z}} \end{array} \right.$ (1)

1.2 基于神经网络训练混沌序列

 图 1 人工神经网络的结构

 $\left\{ \begin{array}{l} {y_k} = g\left({w_{0s}} + \displaystyle\sum\limits_{j = 1}^n {{Z_j}{w_{s,j}}} \right),k = 1,2, \cdots ,P\\ g(\xi ) = a\xi \end{array} \right.$ (2)

 $\left\{ \begin{array}{l} {Z_j} = f({V_{0e,j}} + {x_k}{V_{e,j}}),j = 1,2, \cdots ,{n_{cc}},k = 1,2, \cdots ,P\\ f(\xi ) = \tanh (\xi ) \end{array} \right.$ (3)

 $E{R_{\rm{k}}}{\rm{ = }}{y_k} - {x_k}$ (4)

 $\left\{ \begin{array}{l} {\delta _{0,k}} = aE{R_k},k = 1,2, \cdots ,P\\ {\delta _{h,j}} = {Z_j}(1 - {Z_j})\displaystyle\sum\limits_{j = 1}^{{n_{cc}}} {{\delta _{0,k}}{w_{s,j}},k = 1,2, \cdots ,P} \end{array} \right.$ (5)

 $\left\{ \begin{array}{l} {V_e}(i) = {V_e}(i) + \Psi \times {\delta _{h,j}} \times {x_k}\\ {W_s}(i) = {W_s}(i) + \Psi \times {\delta _{0,k}} \times {Z_j} \end{array} \right.$ (6)
 $\left\{ \begin{array}{l} {V_{0,e}}(i) = {V_{0,e}}(i) + \Psi \times {\delta _{h,j}}\\ {W_{0,s}}(i) = {W_{0,s}}(i) + \Psi \times {\delta _{0,k}} \end{array} \right.$ (7)

2 图像加密过程

2.1 加密序列的产生

 $K = {k_1},{k_2},{k_3}, \cdots ,{k_{48}}$ (8)

Lorenz混沌映射的初始值计算如下:

 $\left\{\begin{split} &{x_0} = x + od \left(\dfrac{{{k_1} \oplus \cdots \oplus {k_8} + mean}}{{256}},1\right)\\ &{y_0} = y + od \left(\dfrac{{{k_9} \oplus \cdots \oplus {k_{16}} + mean}}{{256}},1\right)\\ &{{\textit{z}}_0} = {\textit{z}} + od \left(\dfrac{{{k_{17}} \oplus \cdots \oplus {k_{24}} + mean}}{{256}},1\right) \end{split}\right.$ (9)

2.2 图像置乱

 $X(i) = od [(floor(X(i) \times {10^{13}}),M] + 1$ (10)

 $Y(j) = od [(floor(Y(j) \times {10^{13}}),N] + 1$ (11)

2.3 图像扩散

 $E = od (floor(E \times {10^{13}}),256)$ (12)

 $\left\{ \begin{array}{l} Q'(V(1)) = {\rm{bitxor(}}Q'(V(1)),E'{\rm{)}}\\ Q'(V(i)) = {\rm{bitxor(}}Q'(V(i)),Q'(V(i - 1)){\rm{)}} \end{array} \right.$ (13)

 图 2 加密方案流程图

3 实验与分析

 图 3 实验结果

3.1 图像直方图

3.2 相邻像素间相关性分析

 $E(x) = \frac{1}{N}\sum\limits_{i = 1}^N {{x_i}}$ (14)
 $D(x) = \frac{1}{N}\sum\limits_{i = 1}^N {{{({x_i} - E(x))}^2}}$ (15)
 ${\rm{cov}} (x,y) = \frac{1}{N}\sum\limits_{i = 1}^N {({x_i} - E(x))} ({y_i} - E(y))$ (16)
 ${r_{xy}} = \frac{{{\rm{cov}} (x,y)}}{{\sqrt {D(x)D(y)} }}$ (17)

 图 4 明文和密文图像直方图

3.3 信息熵

 $H(m) = - \sum\limits_{i = 1}^L {P({m_i}){{\log }_2}P({m_i})}$ (18)

3.4 密钥空间及密钥敏感性分析

3.5 差分攻击

 $C(m,n) = \left\{ \begin{array}{l} 0,{\rm if}\;\; {I_1}(m,n) = {I_2}(m,n)\\ 1,{\rm if}\;\; {I_1}(m,n) \ne {I_2}(m,n) \end{array} \right.$ (19)
 $NPCR = \dfrac{{\displaystyle\sum\limits_{m = 1}^M {\displaystyle\sum\limits_{n = 1}^N {C(m,n)} } }}{{M \times N}} \times 100\%$ (20)
 $UACI = \dfrac{{\displaystyle\sum\limits_{m = 1}^M {\displaystyle\sum\limits_{n = 1}^N {\left| {{I_1}(m,n) - {I_2}(m,n)} \right|} } }}{{M \times N \times 255}} \times 100\%$ (21)

 图 5 明文和密文在各方向上的像素相关性

4 结论

 [1] Chen JX, Zhu ZL, Zhang LB, et al. Exploiting self-adaptive permutation-diffusion and DNA random encoding for secure and efficient image encryption. Signal Processing, 2018, 142: 340-353. DOI:10.1016/j.sigpro.2017.07.034 [2] 薛伟, 吕群. 基于格雷码和混沌系统的图像加密算法. 计算机系统应用, 2018, 27(7): 177-181. DOI:10.15888/j.cnki.csa.006402 [3] 马凌, 侯小毛, 张福泉, 等. 基于复合混沌系统与人工神经网络学习的图像加密算法. 电子测量与仪器学报, 2018, 32(8): 109-116. DOI:10.13382/j.jemi.2018.08.016 [4] 张勇. 混沌数字图像加密. 北京: 清华大学出版社, 2016: 105–106. [5] 汪彦, 涂立. 基于改进Lorenz混沌系统的图像加密新算法. 中南大学学报(自然科学版), 2017, 48(10): 2678-2685. DOI:10.11817/j.issn.1672-7207.2017.10.017 [6] Telem ANK, Segning CM, Kenne G, et al. A simple and robust gray image encryption scheme using chaotic logistic map and artificial neural network. Advances in Multimedia, 2014, 2014: 602921. DOI:10.1155/2014/602921 [7] 贾忠祥, 柳银萍. 基于自适应与全局置乱的图像加密新算法. 华东师范大学学报(自然科学版), 2019, 2019(6): 61-72. [8] Sokouti M, Sokouti B. A PRISMA-compliant systematic review and analysis on color image encryption using DNA properties. Computer Science Review, 2018, 29: 14-20. DOI:10.1016/j.cosrev.2018.05.002 [9] Amina S, Mohamed FK. An efficient and secure chaotic cipher algorithm for image content preservation. Communications in Nonlinear Science and Numerical Simulation, 2018, 60: 12-32. DOI:10.1016/j.cnsns.2017.12.017 [10] 胡春杰, 阮聪, 牛智星. 基于改进Logistic映射的图像加密算法. 计算机系统应用, 2019, 28(6): 125-129. DOI:10.15888/j.cnki.csa.006788