|
发布时间: 2018-03-16 |
图像处理和编码 |
|
|
收稿日期: 2017-07-07; 修回日期: 2017-09-14
基金项目: 国家自然科学基金项目(61402012);安徽理工大学博士基金项目
第一作者简介:
罗海波(1991-), 男, 安徽理工大学软件工程专业硕士研究生, 主要研究方向为密码学方面研究。E-mail:mrluobo88@163.com.
中图法分类号: TP309.7
文献标识码: A
文章编号: 1006-8961(2018)03-0346-15
|
摘要
目的
针对当前大多数数字图像加密算法多采用单一的混沌系统,且置乱方法基本只采用像素行列互换、Arnold变换、Baker变换、序列排序构造替换表等几类,提出一种新的整合神经网络置乱图像的动态自反馈混沌系统图像加密算法。方法
该算法通过1维Logistic混沌、chebyshev混沌和自定义m(
关键词
动态自反馈混沌系统; 神经网络; 随机性; 双重置乱; 图像加密
Abstract
Objective
Several commonalities can be observed among all image encryption algorithms, which are based on a chaotic system. Most secret key generating sources are for the single chaos system, but they lack high randomicity and uniformity. Scramblings only use pixel rank swap, Arnold transform, Baker transform, sequences structure substitution table, and other common methods. The entire encryption process involves one-pixel position scrambling and pixel replacement. This paper proposes a highly secure image encryption algorithm, that is, a dynamic self-feedback chaotic system image encryption algorithm that integrates a neural network scrambling image.
Method
The algorithm constructs a dynamic self-feedback chaotic system as the secret key generation source. The specific practice is to obtain output using the one-dimensional Logistic chaotic system and the Chebyshev chaotic system through a custom m(
Key words
dynamic self-feedback chaotic system; neural network; randomness; double scrambling; image encryption
0 引言
随着计算机网络的发展,网络安全越来越受到关注。在网络信息中,图像信息因其生动、形象、直观的特点而被广泛应用,成为网络安全的重点关注领域。针对图像信息在网络传输、存储过程中存在的安全隐患,各类图像加密算法不断被提出,特别是混沌系统因其具有对初值的敏感性、伪随机性、无周期性和混沌序列的遍历性成为图像加密的主要方法[1-5]。
纵观在图像加密领域的混沌密码算法,仍是基于香农对密码设计提出的混淆和扩散原则,图像加密过程中像素位置置乱与像素值替代结合是最普遍的加密方式。图像像素位置的置乱方法诸如:徐亚等人[6]采用的Arnold变换、郭建胜等人[7]采用的Baker变换、王静等人[8]采用的混沌序列排序构造替换表等;像素值的替代方法诸如:Song等人[9]采用的秘钥序列与明文进行异或运算,考虑到安全问题,随后Zhang等人[10]引入密文反馈机制。也有部分算法如Zahmoul等人[11]采用mod运算,廖琪男等人[12]将mod运算与异或运算相结合,并引入反馈机制。总结当前各类混沌加密算法存在如下安全性问题:1)加密算法中秘钥序列完全依赖于秘钥算法,对于不同的明文进行加密,秘钥序列是一样的,使得攻击者可以通过选择明文攻击破解[13-16]。2)只进行了一轮扩散替代操作,使得攻击者可以通过明文和密文推导出秘钥从而破解密文[17]。3)由于单一混沌的频谱、误差函数等特性明确,在EFA(error function attack)攻击下,即使高维混沌也不够安全。
针对以上基于混沌系统的一系列图像加密算法所存在的安全性问题,提出了一种新的整合神经网络置乱图像的动态自反馈混沌系统图像加密算法。该算法通过1维Logistic混沌、chebyshev混沌和自定义
1 动态自反馈混沌系统
定义动态自反馈混沌系统为
$ \left\{ \begin{array}{l} f\left( {{x_i}} \right) = {f_q}\left( {{x_{i - 1}}} \right)\;\;\;\;q = 0,1,2 \cdots ,k\\ g\left( {{x_i}} \right) = {g_q}\left( {{x_{i - 1}}} \right)\;\;\;\;q = 0,1,2 \cdots ,k \end{array} \right. $ | (1) |
本文算法所构造的动态自反馈混沌系统其子系统
$ h\left( x \right) = f\left( {m\left( {f\left( x \right),g\left( x \right)} \right)} \right) $ | (2) |
模仿有限域上的乘法运算操作交换群概念,将(
$ \forall a,b \in {\mathit{\boldsymbol{G}}_q},a{ \oplus _q}b = \bmod \left( {a + b,1} \right) $ | (3) |
那么动态自反馈混沌系统就可以具体表示为
$ \left\{ \begin{array}{l} h\left( x \right) = f\left( {\bmod \left( {f\left( x \right) + g\left( x \right),1} \right)} \right)\\ f\left( {{x_i}} \right) = u{x_{i - 1}}\left( {1 - {x_{i - 1}}} \right)\\ g\left( {{x_i}} \right) = {\rm{abs}}\left( {\cos \left( {k\arccos {x_{i - 1}}} \right)} \right) \end{array} \right. $ | (4) |
式中,abs为取绝对值函数,为了检验动态自反馈混沌系统的性能,将其混沌序列
$ {b_i} = \left\{ \begin{array}{l} 0\;\;\;0 \le {a_i} < 0.5\\ 1\;\;\;\;0.5 \le {a_i} \le 1 \end{array} \right. $ | (5) |
1.1 随机性分析
1.1.1 频数检验
频数检验通过检测二值序列中0和1的个数,用以判断序列的随机情况。若二值序列具有较强随机性,其序列中0和1的个数必然大致相等,设
$ \varepsilon _1^2 = \frac{{{{\left( {{n_1} - {n_0}} \right)}^2}}}{{{n^2}}} $ | (6) |
对应5 %的显著性水平,与1自由度的
表 1
频数检验结果
Table 1
Frequency test results
初始条件 | 动态自反馈混沌系统 | ||
0 | 475 | 525 | 2.5 |
0.1 | 453 | 546 | 8.836 |
0.2 | 454 | 546 | 8.464 |
0.3 | 431 | 569 | 19 |
0.4 | 435 | 565 | 16.9 |
0.5 | 475 | 525 | 2.5 |
0.6 | 447 | 553 | 11.2 |
0.7 | 450 | 550 | 10 |
0.8 | 465 | 535 | 4.9 |
0.9 | 459 | 541 | 6.724 |
1 | 474 | 526 | 2.704 |
实验结果表明,动态自反馈混沌系统生成的随机序列可以通过频数检测,并且
1.1.2 随机性分布
1.2 平衡度分析
同频数检验一样,平衡度也是通过二值序列中1和0的个数是否相近来表征二值序列随机性是否良好,平衡度的值越小,随机性越好,反之,随机性越差。设长为
$ E\left( L \right) = \frac{{\left| {{n_1} - {n_0}} \right|}}{L} $ | (7) |
采取抽取样本的方式,分别从0~1以0.1为间隔取值生成长为度1 000的随机数列,计算11组数据得到平衡度情况如图 2所示。
实验结果表明,动态自反馈混沌系统选取不同的初值得到的平衡度曲线接近于0,平衡度取值接近于0,序列的随机性良好。
1.3 相关性分析
序列的自相关性曲线直接体现了序列的随机程度,自相关性系数
$ {a^c}\left( m \right) = \frac{1}{N}\sum\limits_{i = 1}^{N - m} {{a_i}{a_{i + m}}} $ | (8) |
在同等条件下,本文得到1维Logistic混沌系统、Chebyshew混沌系统及动态自反馈混沌系统的自相关性如图 3所示。
从图 3可以看出,动态自反馈混沌系统相较于1维Logistic混沌和chebyshev混沌,自相关性系数曲线变化范围更小,绝大部分在0.02的区间内波动,而Logistic混沌系统自相关性系数曲线整体波动范围较大,chebyshev混沌系统波动范围则在0.2区间内,可以判断动态自反馈混沌系统自相关性更低,更符合加密要求。
1.4 Lyapunov指数
Lyapunov指数反映了混沌系统轨线局部发散或收缩的状况以及对初值微小变化的敏感性,它体现了轨迹的不可预测性和随机性。1维混沌系统的Lyapunov指数的计算公式为
$ LE = \mathop {\lim }\limits_{n \to \infty } \frac{1}{n}\sum\limits_{i = 0}^{n - 1} {\ln \left| {f'\left( {{x_i}} \right)} \right|} $ | (9) |
由第1节可知本文定义的动态自反馈混沌系统其实质为:将运算
$ {L_E} = \mathop {\lim }\limits_{n \to \infty } \frac{1}{n}\sum\limits_{i = 0}^{n - 1} {\ln \left| {{{\left[ {f\left( {m\left( {{x_i}} \right)} \right)} \right]}^\prime }} \right|} $ | (10) |
对上式进一步推导可得
$ \begin{array}{*{20}{c}} {{L_E} = \mathop {\lim }\limits_{n \to \infty } \frac{1}{n}\sum\limits_{i = 0}^{n - 1} {\ln \left| {m'\left( {{x_i}} \right) \cdot f'\left[ {m\left( {{x_i}} \right)} \right]} \right|} = }\\ {\mathop {\lim }\limits_{n \to \infty } \frac{1}{n}\sum\limits_{i = 0}^{n - 1} {\ln \left| {m'\left( {{x_i}} \right)} \right|} + }\\ {\mathop {\lim }\limits_{n \to \infty } \frac{1}{n}\sum\limits_{i = 0}^{n - 1} {\ln \left| {f'\left( {m\left( {{x_i}} \right)} \right)} \right|} } \end{array} $ | (11) |
由此可以看出
$ \mathop {\lim }\limits_{n \to \infty } \frac{1}{n}\sum\limits_{i = 0}^{n - 1} {\ln \left| {m'\left( {{x_i}} \right)} \right|} = {L_{E1}} $ | (12) |
而
$ {x_{2i}} = m\left( {{x_i}} \right),f'\left( {{x_{2i}}} \right) = \frac{{{\rm{d}}f}}{{{\rm{d}}{x_{2i}}}} $ | (13) |
$ \mathop {\lim }\limits_{n \to \infty } \frac{1}{n}\sum\limits_{i = 0}^{n - 1} {\ln \left| {f'\left( {m\left( {{x_i}} \right)} \right)} \right|} = {L_{E2}} $ | (14) |
$ \left\{ \begin{array}{l} L{E_1} > 0\\ L{E_2} > 0 \end{array} \right. $ | (15) |
$ {\rm{故可得}}\;\;\;\;LE = L{E_1} + L{E_2} > 0 $ | (16) |
由此可以判断,当
表 2
Lyapunov指数
Table 2
Lyapunov index
混沌系统 | ||||
LE值 | 0.693 2 | 0.710 2 | 1.403 4 | 1.484 5 |
从表 2可以看出,相较于
1.5 序列均匀化处理
1.5.1 序列分布直方图
在同等条件下,分别对Logistic混沌系统、chebyshev混沌系统、
通过1.1—1.4节验证可知动态自反馈混沌系统随机性得到了增强,但是从取样直方图可以看出
设0~1二值随机变量为
$ \phi = \frac{{\min \left( {P\left( {\beta = 0} \right),P\left( {\beta = 1} \right)} \right)}}{{\max \left( {P\left( {\beta = 0} \right),P\left( {\beta = 1} \right)} \right)}},\;\;\;\;\;\;\phi \in \left( {0,1} \right] $ | (17) |
设
$ \left\{ \begin{array}{l} P\left( {\alpha = 0} \right) = a\\ P\left( {\beta = 0} \right) = b \end{array} \right. $ | (18) |
可得
$ \left\{ \begin{array}{l} P\left( {\alpha = 1} \right) = 1 - a\\ P\left( {\beta = 1} \right) = 1 - b \end{array} \right. $ | (19) |
故
$ \begin{array}{*{20}{c}} {P\left( {\gamma = 0} \right) = P\left( {\alpha = 0,\beta = 0} \right) + P\left( {\alpha = 1,} \right.}\\ {\left. {\beta = 1} \right) = a + \left( {1 - b} \right)\left( {1 - 2a} \right)} \end{array} $ | (20) |
$ \begin{array}{*{20}{c}} {P\left( {\gamma = 1} \right) = P\left( {\alpha = 0,\beta = 1} \right) + P\left( {\alpha = 1,} \right.}\\ {\left. {\beta = 0} \right) = a + b\left( {1 - 2a} \right)} \end{array} $ | (21) |
$ \left\{ \begin{array}{l} a < a + \left( {1 - b} \right)\left( {1 - 2a} \right) < 1 - a\\ \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;a < 1/2\;或\;a > 1/2\\ a = 1 - a\;\;\;\;\;a = 1/2\\ a < a + b\left( {1 - 2a} \right) < 1 - a\\ \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;a < 1/2\;或\;a > 1/2 \end{array} \right. $ | (22) |
根据式(20)可知
$ \left\{ \begin{array}{l} \min \left( {a,1 - a} \right) \le \max \left( {a,1 - a} \right)\\ \min \left( {b,1 - b} \right) \le \max \left( {b,1 - b} \right) \end{array} \right. $ | (23) |
结合式(15)可得
$ 1 \ge {\phi _\gamma } \ge {\phi _\alpha }\;且\;1 \ge {\phi _\gamma } \ge {\phi _\beta } $ | (24) |
由此可以推断
$ y = \frac{2}{{\rm{ \mathsf{ π} }}}\arcsin \sqrt x $ | (25) |
均匀化处理后,混沌序列在[0, 1]区间均匀分布的证明如下:由Logistic混沌定义可知其实际为定义在[0, 1]区间,值域为[0, 1]的关于随便变量
$ \begin{array}{*{20}{c}} {\rho \left( x \right) = y' = \frac{2}{{\rm{ \mathsf{ π} }}} \times \frac{1}{{\sqrt {1 - x} }} \times \frac{1}{{2\sqrt x }} = }\\ {\frac{1}{{{\rm{ \mathsf{ π} }}\sqrt {x\left( {1 - x} \right)} }}} \end{array} $ | (26) |
那么
$ \rho \left( x \right) = \left\{ \begin{array}{l} \frac{1}{{{\rm{ \mathsf{ π} }}\sqrt {x\left( {1 - x} \right)} }}\;\;\;0 < x < 1\\ 0\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;其他 \end{array} \right. $ | (27) |
设动态自反馈混沌系统迭代序列均匀化处理后为[c1, c2, c3... cn],将混沌吸引域[0, 1]划分为由
$ \left\{ \begin{array}{l} {\mathit{\boldsymbol{k}}_i} = \left[ {{S_i},{S_{i + 1}}} \right);i = 0,1, \cdots ,N - 2\\ {\mathit{\boldsymbol{k}}_{N - 1}} = \left[ {{S_{N - 1}},{S_N}} \right] \end{array} \right. $ | (28) |
$ {S_i} = \sin \left( {\frac{i}{N} \cdot \frac{{\rm{ \mathsf{ π} }}}{2}} \right);i = 0,1, \cdots ,N - 1 $ | (29) |
根据式(25)(27)可得序列中元素
$ \begin{array}{*{20}{c}} {P\left( i \right) = \int_{{S_i}}^{{S_{i + 1}}} {\rho \left( x \right){\rm{d}}x} = \int_{{S_i}}^{{S_{i + 1}}} {\frac{1}{{{\rm{ \mathsf{ π} }}\sqrt {x\left( {1 - x} \right)} }}{\rm{d}}x} = }\\ {\frac{2}{{\rm{ \mathsf{ π} }}}\arcsin \sqrt x \left| {_{{S_i}}^{{S_{i + 1}}}} \right. = \frac{1}{N}} \end{array} $ | (30) |
由此可知均匀化处理后的序列在区间[0, 1]上服从均匀分布。处理之后的序列直方图如图 4(d)所示,可以看出,处理之后的序列分布特点发生了改变,整体变得均匀,不再集中在两端。
1.5.2 方差与期望值检测
由概率论知识可知,若一个序列随机且分布均匀,则满足
$ f\left( x \right) = \left\{ \begin{array}{l} \frac{1}{{b - a}}\;\;\;a < x < b\\ 0\;\;\;\;\;\;\;\;\;其他 \end{array} \right. $ | (31) |
其期望值
$ \begin{array}{*{20}{c}} {E\left( X \right) = \int\limits_{ - \infty }^{ + \infty } {xf\left( x \right){\rm{d}}x} = \int\limits_a^b {\frac{x}{{b - a}}{\rm{d}}x} = }\\ {\frac{{{b^2} - {a^2}}}{{2\left( {b - a} \right)}} = \frac{{a + b}}{2}} \end{array} $ | (32) |
$ \begin{array}{*{20}{c}} {D\left( X \right) = E\left( {{X^2}} \right) - E\left( {{X^2}} \right) = }\\ {\int\limits_{ - \infty }^{ + \infty } {{x^2}f\left( x \right){\rm{d}}x} - {{\left( {\frac{{a + b}}{2}} \right)}^2} = \frac{{{{\left( {b - a} \right)}^2}}}{{12}}} \end{array} $ | (33) |
对于混沌系统,显然其序列值属于[0, 1]。取
表 3
序列期望与方差值
Table 3
Expectation and variance of sequence
理论值 | 实际值 | |
期望 | 0.5 | 0.563 9 |
方差 | 0.083 3 | 0.074 1 |
由表 3可以看出,动态自反馈混沌系统均匀化处理后生成的混沌序列,其实际期望值和方差值与理论值相差很小,由此可以判断动态自反馈混沌系统满足均匀分布。
2 新的图像置乱方法
2.1 置乱方法
当前图像像素矩阵的置乱普遍采用简单的像素矩阵行列互换、Arnold变换、Baker变换、3D猫映射、以及混沌序列排序构造替换表、bit位的分块置乱等,本文则是采用了新的方法来实现像素全局置乱。构造一个3层的神经网络,神经网络模型如图 5所示。
神经网络的输入层为
$ \mathit{\boldsymbol{I}} = {\left[ {{X_1},{X_2},{X_3},{X_4}} \right]^{\rm{T}}} $ | (34) |
此时
$ \mathit{\boldsymbol{I'}} = p\left( x \right) = \mathit{\boldsymbol{G}} \times \mathit{\boldsymbol{I}} = {\left[ {{{I'}_1},{{I'}_2},{{I'}_3},{{I'}_4}} \right]^{\rm{T}}} $ | (35) |
式中,
$ \mathit{\boldsymbol{F}} = r\left( {t\left( {\mathit{\boldsymbol{WI'}} + \mathit{\boldsymbol{B}}} \right),\mathit{\boldsymbol{Q}}} \right) $ | (36) |
式中,
$ \begin{array}{l} r\left( {x\left( k \right),q} \right) = \\ \left\{ \begin{array}{l} x\left( k \right)/q\;\;\;\;\;\;\;\;\;\;\;0 < x\left( k \right) \le q\\ 1 - x\left( k \right)/1 - q\;\;\;q < x\left( k \right) < 1 \end{array} \right. \end{array} $ | (37) |
$ t\left( x \right) = 1/1 + {{\rm{e}}^{ - ax}} $ | (38) |
式中,
在每一次输出后更新
$ \mathit{\boldsymbol{Q}} = \left( {0.2 \times \mathit{\boldsymbol{F}}} \right) + 0.4 $ | (39) |
每运行一次神经网络,都会产生两个随机值
2.2 性能分析
由BP神经网络知识可知,神经网络由一个输入层、一个输出层和一个或多个隐含层组成。神经网络通过信号的正向传播与误差的反向传播完成学习过程。当进行正向传播时,输入样本从输入层传入,经隐含层处理后传向输出层,如果输出层输出与期望输出不一致,就跳转为误差反向传播。误差反向传播则是采用梯度下降法将输出误差以某种形式通过隐层向输入层逐层反传,逐层迭代修改各神经元之间的网络权值和各神经元阈值。本文采用神经网络置乱的实质是用来产生随机矩阵,因此在每一轮的迭代中,默认随机选取了扩散矩阵
表 4
计算效率
Table 4
Calculation efficiency
轮次 | 所需时间/s |
1 | 0.053 6 |
65 536 | 5.624 4 |
3 500 000 | 324.845 8 |
由置乱算法设计思想可知,算法需要生成一个无重复的
表 5
计算结果遍历性
Table 5
Ergodicity of calculation results
实验序号 | 迭代轮次 | 遍历结果 |
1 | 10 | 10 |
2 | 1 000 | 683 |
3 | 10 000 | 5 725 |
4 | 100 000 | 28 146 |
5 | 1 000 000 | 53 752 |
6 | 2 500 000 | 65 381 |
7 | 3 500 000 | 65 536 |
从表 5可以看出,在迭代轮次较少时,结果的重复性较低,当迭代的轮次增多时,结果的重复性增高,直至将迭代轮次设置至350万次,才得到最终遍历所有数组的结果,产生完整的置乱矩阵。由此可以判断,只要迭代轮次足够大,计算结果可以遍历所需大小数组,但是也因此降低了算法的计算效率,当图像像素矩阵越大时,所需的计算时间就越久。
3 图像加解密算法
本文算法原理:在加密过程中与明文紧密相关,不同的密文将产生不同的密钥,有效防止了攻击者对等效秘钥的破解;采用神经网络产生置乱矩阵进行全局置乱,再从bit位进行置乱;在进行像素替代时采用两组秘钥进行了两轮替代扩散,明文、中间密文、密文三者非线性关系更为复杂,有效的防止了选择明文攻击。本文加密算法设计图如图 6所示。
3.1 加密算法
读取明文图像像素矩阵,L =
$ \left\{ \begin{array}{l} k = \bmod \left( {{\rm{sum}},4} \right)\\ {x_0} = {x_0} \times q/256 \end{array} \right. $ | (40) |
式中,
选取不同的初值
1) 像素级全局置乱。像素位置置乱操作是为了实现像素位置的全局置乱,破坏原来相邻像素之间的相关性。神经网络置乱像素的具体步骤为:
(1) 扫描明文图像生成明文图像矩阵
(2) 从
(3) 运行神经网络得到
(4) 设置数组
(5) 重复步骤(1)—(4),如果
(6) 完成图像置乱,计算公式为
$ A\left( i \right) = B\left( {R\left( i \right),C\left( i \right)} \right) $ | (41) |
2) Bit位置乱。Bit置乱可以增强算法的安全性,使选择明文攻击无效,其具体步骤描述为:
(1) 读取秘钥序列
(2) 选取
(3) 对步骤(2)中生成的数组
(4) 将置乱图像矩阵
(5) 利用数组
(6) 将二进制数组
(7) 重复执行,直到所有点转为密文,密文矩阵为
3) 像素的替代扩散。像素的替代扩散分为两轮进行,所用秘钥参数为
(1) 第1轮扩散替代加密
当
$ \left\{ \begin{array}{l} M1 = \bmod \left( {C\left( 1 \right) + y\left( 2 \right),256} \right)\\ D\left( 1 \right) = M1 \oplus \bmod \left( {y\left( 1 \right) + {C_0},256} \right) \end{array} \right. $ | (42) |
当
$ \left\{ \begin{array}{l} M1 = \bmod \left( {C\left( i \right) + y\left( {i + 1} \right),256} \right)\\ D\left( i \right) = M1 \oplus \bmod \left( {y\left( i \right) + D\left( {i - 1} \right),256} \right) \end{array} \right. $ | (43) |
(2) 第2轮扩散替代加密
当
$ \left\{ \begin{array}{l} M2 = \bmod \left( {D\left( 1 \right) + z\left( 2 \right),256} \right)\\ D1\left( 1 \right) = M2 \oplus \bmod \left( {z\left( 1 \right) + D\left( L \right),256} \right) \end{array} \right. $ | (44) |
当
$ \left\{ \begin{array}{l} M2 = \bmod \left( {D\left( i \right) + z\left( {i + 1} \right),256} \right)\\ D1\left( i \right) = M2 \oplus \bmod \left( {z\left( i \right) + D1\left( {i - 1} \right),256} \right) \end{array} \right. $ | (45) |
(3) 重复步骤(1)(2),直到
3.2 解密算法
解密过程是加密过程的逆过程,分别对应替代扩散、bit位置乱和全局置乱进行反操作。
1) 首先由下式得到置乱后的密文
(1) 第1轮解密
当
$ \left\{ \begin{array}{l} M2 = D1\left( i \right) \oplus \bmod \left( {z\left( i \right) + D1\left( {i - 1} \right),256} \right)\\ D\left( i \right) = \bmod \left( {M2 + 256 - z\left( {i + 1} \right),256} \right) \end{array} \right. $ | (46) |
当
$ \left\{ \begin{array}{l} M2 = D1\left( 1 \right) \oplus \bmod \left( {z\left( 1 \right) + D\left( L \right),256} \right)\\ D\left( 1 \right) = \bmod \left( {M2 + 256 - z\left( 2 \right),256} \right) \end{array} \right. $ | (47) |
(2) 第2轮解密
当
$ \left\{ \begin{array}{l} M1 = D\left( i \right) \oplus \bmod \left( {y\left( i \right) + D\left( {i - 1} \right),256} \right)\\ J\left( i \right) = \bmod \left( {M1 + 256 - y\left( {i + 1} \right),256} \right) \end{array} \right. $ | (48) |
当
$ \left\{ \begin{array}{l} M1 = J\left( 1 \right) \oplus \bmod \left( {y\left( 1 \right) + {C_0},256} \right)\\ J\left( 1 \right) = \bmod \left( {M1 + 256 - y\left( 2 \right),256} \right) \end{array} \right. $ | (49) |
2) 把密文
3) 根据全局置乱后的矩阵
$ B\left( {R\left( i \right),C\left( i \right)} \right) = A\left( i \right) $ | (50) |
4 实验仿真与安全性分析
4.1 仿真环境
本文算法使用256级灰度图像lena进行测试,仿真环境为Windows 7操作系统,Corei5 CPU,4 GB RAM,Matlab 2010b。经过仿真得到的像素置乱图像、像素替代图像、解密图像分别如图 7所示。
从仿真结果可以看出,经过加密后的图像已经完全改变了明文图像的特征,为了评估该算法的总体性能,下面将分别从秘钥空间、抗统计攻击、抗差分攻击等方面进行分析。
4.2 秘钥空间分析
由本文算法可知,动态自反馈混沌系统的初始秘钥有4个,为
4.3 抗统计攻击分析
4.3.1 直方图分析
4.3.2 相邻像素相关性分析
相邻像素相关系数用来反映相邻像素之间的相关程度,检验加密效果,相关系数越接近0则加密效果越好。相关系数通过选取图像中
$ \left\{ \begin{array}{l} \bar x = \frac{1}{N}\sum\limits_{i = 1}^N {{X_i}} \\ D\left( x \right) = \frac{1}{N}\sum\limits_{i = 1}^N {{{\left( {{x_i} - \bar x} \right)}^2}} \\ Conv\left( {x,y} \right) = \frac{1}{N}\sum\limits_{i = 1}^N {\left( {{x_i} - \bar x} \right)\left( {{y_i} - \bar y} \right)} \\ {\gamma _{xy}} = \frac{{Conv\left( {x,y} \right)}}{{\sqrt {D\left( x \right)} \sqrt {D\left( y \right)} }} \end{array} \right. $ | (51) |
式中,
表 6
明文图像和加密图像像素的相关系数
Table 6
Correlation coefficients of plaintext and encrypted image pixels
4.3.3 信息熵分析
信息熵用来反应图像中信息分布的随机性强弱,灰度值分布的越均匀,信息熵越大,反之则越小,信息熵
$ H\left( S \right) = - \sum\limits_{i = 0}^{N - 1} {P\left( {{S_i}} \right)\log \left[ {P\left( {{S_i}} \right)} \right]} $ | (52) |
式中,
表 7
图像信息熵
Table 7
Information entropy of image
从数据可以看出,明文图像信息熵较小,经过本文算法加密后的信息熵达到了7.998 3, 非常接近于8,可以判断该算法可以极大的改变明文图像像素值特征。
4.4 秘钥敏感性及抗差分攻击分析
4.4.1 秘钥敏感性分析
由4.2节可知本文算法可以组成一个6位的秘钥组,即
为观察秘钥改变后密文的变化,本文进一步进行了实验,分别将秘钥组中的
实验结果表明:秘钥即使只改变了10-4,得到的密文图像每个像素值都发生了变化,实验也验证了密文对秘钥组其他秘钥
4.4.2 抗差分攻击分析
密文对明文的敏感性强弱体现了算法抵抗差分攻击能力的强弱,实验证实本文加密算法对明文具有充分的敏感性,能够抵抗差分攻击。实验采取计算
$ \left\{ \begin{array}{l} NPCR = \frac{1}{{M \times N}}\sum\limits_{i = 1}^M {\sum\limits_{j = 1}^N {D\left( {i,j} \right) \times 100\% } } \\ UACI = \frac{1}{{M \times N}}\sum\limits_{i = 1}^M {\sum\limits_{j = 1}^N {\frac{{\left| {{C_1}\left( {i,j} \right) - {C_2}\left( {i,j} \right)} \right|}}{{255}} \times 100\% } } \end{array} \right. $ | (53) |
式中,
$ \left\{ \begin{array}{l} NPC{R_E} = \left( {1 - {2^{ - n}}} \right) \times 100\% \\ UAC{I_E} = \frac{1}{{{2^{2n}}}}\frac{{\sum\nolimits_{i = 1}^{{2^n} - 1} {i\left( {i + 1} \right)} }}{{{2^n} - 1}} \times 100\% \end{array} \right. $ | (54) |
式中,
实验选取8位Lena图进行加密,每2个像素值为一组,每组中一个为原始图像,另一个是对原始图像像素加2,随机选取100组图像进行加密,得到的
表 8
NPCR和UACI值
Table 8
Values of NPCR and UACI
改变位置 | |||||
10 | 16 000 | 32 000 | 48 000 | 65 530 | |
NPCR | 0.996 3 | 0.995 8 | 0.996 4 | 0.996 6 | 0.996 1 |
UACI | 0.334 9 | 0.334 6 | 0.336 2 | 0.335 8 | 0.335 7 |
从实验结果可以看出,
5 结论
鉴于当前众多图像加密算法存在的普遍安全问题,本文提出了整合神经网络置乱图像的动态自反馈混沌系统图像加密算法,该算法体现了良好的加密效果和性能,且加密过程中一次一密,多重组合抵抗选择明文攻击,通过了抗差分攻击测试、抗统计攻击测试,有效提升了图像加密的安全性。优点方面:该算法创新的构造了一种动态自反馈混沌系统作为秘钥生成源;区别于当前常用的置乱方式,引入了神经网络产生置乱矩阵;并且进行了两轮的像素替代来提升密文安全性。但是在算法实现过程中也存在2个明显的缺点:对于神经网络的输入层
参考文献
-
[1] Wang Y J, Yang F, Kang S Q, et al. An image encryption scheme using mixed high dimensional chaotic system combined with Fast Fourier Transform[C]//Proceedings of the 12th IEEE International Conference on Electronic Measurement & Instruments. Qingdao, China: IEEE, 2015: 1279-1283. [DOI:10.1109/ICEMI.2015.7494519]
-
[2] Yang S J, Min L Q, Chen E. A 4-dimensional discrete chaotic system and application in image encryption with avalanche effects[C]//Proceedings of 2015 International Conference on Cyber-Enabled Distributed Computing and Knowledge Discovery. Xi'an, China: IEEE, 2015: 37-43. [DOI:10.1109/CyberC.2015.70]
-
[3] Shruthi K M, Sheela S, Sathyanarayana S V. Image encryption scheme with key sequences based on Chaotic functions[C]//Proceedings of 2014 International Conference on Contemporary Computing and Informatics. Mysore, India: IEEE, 2014: 823-827. [DOI:10.1109/IC3I.2014.7019667]
-
[4] Elabady N F, Abdalkader H M, Moussa M I, et al. Image encryption based on new one-dimensional chaotic map[C]//Proceedings of 2014 International Conference on Engineering and Technology. Cairo, Egypt: IEEE, 2014: 1-6. [DOI:10.1109/ICEngTechnol.2014.7016811]
-
[5] Min L Q, Hao L J, Han D D, et al. An avalanche block encryption scheme and chaotic block pseudorandom number generator with application in the image encryption[C]//Proceedings of the 12th International Conference on Signal Processing. Hangzhou, China: IEEE, 2014: 1843-1850. [DOI:10.1109/ICOSP.2014.7015311]
-
[6] Xu Y, Zhang S W. Encryption algorithm of image blocking and double adaptive diffusion with Arnold mapping[J]. Journal of Image and Graphics, 2015, 20(6): 740–748. [徐亚, 张绍武. 基于Arnold映射的分块双层自适应扩散图像加密算法[J]. 中国图象图形学报, 2015, 20(6): 740–748. ] [DOI:10.11834/jig.20150602]
-
[7] Guo J S, Zhang F. An equivalent key attack on an image cryptosystem[J]. Acta Electronica Sinica, 2010, 38(4): 781–785. [郭建胜, 张锋. 一种图像加密算法的等效密钥攻击方案[J]. 电子学报, 2010, 38(4): 781–785. ]
-
[8] Wang J, Jiang G P. Cryptanalysis of a hyper-chaotic image encryption algorithm and its improved version[J]. Acta Physica Sinica, 2011, 60(6): 060503. [王静, 蒋国平. 一种超混沌图像加密算法的安全性分析及其改进[J]. 物理学报, 2011, 60(6): 060503. ]
-
[9] Song Y L, Song J, Qu J F. A secure image encryption algorithm based on multiple one-dimensional chaotic systems[C]//Proceedings of the 2nd IEEE International Conference on Computer and Communications. Chengdu, China: IEEE, 2016: 584-588. [DOI:10.1109/CompComm.2016.7924768]
-
[10] Zhang G J, Liu Q. A novel image encryption method based on total shuffling scheme[J]. Optics Communications, 2011, 284(12): 2775–2780. [DOI:10.1016/j.optcom.2011.02.039]
-
[11] Zahmoul R, Zaied M. Toward new family beta maps for chaotic image encryption[C]//Proceedings of 2016 IEEE International Conference on Systems, Man, and Cybernetics. Budapest, Hungary: IEEE, 2016: 004052-004057. [DOI:10.1109/SMC.2016.7844867]
-
[12] Liao Q N, Lu S D, Sun X B. Digital image encryption algorithm by combining hyper chaotic sequences and shift cipher[J]. Journal of Chinese Computer Systems, 2015, 36(2): 332–337. [廖琪男, 卢守东, 孙宪波. 结合超混沌序列和移位密码的数字图像加密算法[J]. 小型微型计算机系统, 2015, 36(2): 332–337. ]
-
[13] Sharma P K, Ahmad M, Khan P M. Cryptanalysis of image encryption algorithm based on pixel shuffling and chaotic s-box transformation[C]//The 2nd International Symposium on Security in Computing and Communication. Delhi, India: Springer, 2014: 173-181. [DOI:10.1007/978-3-662-44966-0_16]
-
[14] Zhu C X, Liao C L, Deng X H. Breaking and improving an image encryption scheme based on total shuffling scheme[J]. Nonlinear Dynamics, 2013, 71(1-2): 25–34. [DOI:10.1007/s11071-012-0639-0]
-
[15] Teng L, Wang X Y. A bit-level image encryption algorithm based on spatiotemporal chaotic system and self-adaptive[J]. Optics Communications, 2012, 285(20): 4048–4054. [DOI:10.1016/j.optcom.2012.06.004]
-
[16] Li C Q, Liu Y S, Zhang L Y, et al. Cryptanalyzing aclassof image encryption schemes based on Chinese remainder theorem[J]. Signal Processing:Image Communication, 2014, 29(8): 914–920. [DOI:10.1016/j.image.2014.06.011]
-
[17] Nanjing. Cryptanalysis of a hyper-chaotic image encryption algorithm and its improved version[J]. Acta Physica Sinica, 2011, 60(6): 868–870.
-
[18] Deng X H, Liao C L, Zhu C X, et al. Image encryption algorithms based on chaos through dual scrambling of pixel position and bit[J]. Journal on Communications, 2014, 35(3): 216–223. [邓晓衡, 廖春龙, 朱从旭, 等. 像素位置与比特双重置乱的图像混沌加密算法[J]. 通信学报, 2014, 35(3): 216–223. ] [DOI:10.3969/j.issn.1000-436x.2014.03.025]
-
[19] Cao G H, Hu K, Tong W. Image scrambling based on Logistic uniform distribution[J]. Acta Physica Sinica, 2011, 60(11): 110508. [曹光辉, 胡凯, 佟维. 基于Logistic均匀分布图像置乱方法[J]. 物理学报, 2011, 60(11): 110508. ] [DOI:10.7498/aps.60.110508]
-
[20] Li J S, Xing Y B, Qu C Y, et al. An image encryption method based on tent and Lorenz chaotic systems[C]//Proceedings of the 6th IEEE International Conference on Software Engineering and Service Science. Beijing, China: IEEE, 2015: 582-586. [DOI:10.1109/ICSESS.2015.7339125]
-
[21] Lin Q, Wang Y J, Wang J. The image encryption scheme with optional dynamic state variables based on hyperchaotic system[J]. Scientia Sinica Technologica, 2016, 46(9): 910–918. [林青, 王延江, 王珺. 基于超混沌系统的图像加密算法[J]. 中国科学:技术科学, 2016, 46(9): 910–918. ] [DOI:10.1360/N092016-00115]
-
[22] Sheng S Y, Wu X H. A novel bit-level image encryption scheme using hyper-chaotic systems[C]//Proceedings of the 10th International Conference on Fuzzy Systems and Knowledge Discovery. Shenyang, China: IEEE, 2013: 1015-1019. [DOI:10.1109/FSKD.2013.6816344]