发布时间: 2018-06-16 摘要点击次数: 全文下载次数: DOI: 10.11834/jig.170433 2018 | Volume 23 | Number 6 图像处理和编码

 收稿日期: 2017-08-08; 修回日期: 2017-11-13 基金项目: 国家自然科学基金项目（61473232，91430111） 第一作者简介: 梁颖(1993-), 女, 西北工业大学模式识别与智能系统专业硕士研究生, 主要从事图像压缩加密方面的研究。E-mail:yinger_3213@163.com. 中图法分类号: TP309.7 文献标识码: A 文章编号: 1006-8961(2018)06-0814-13

# 关键词

Image encryption algorithm based on bit-level synchronous permutation diffusion and pixel-level annular diffusion
Liang Ying, Zhang Shaowu
Key Laboratory of Information Fusion Technology of Ministry of Education, , School of Automation, NorthwestPolytechnical University, Xi'an 710072, China
Supported by: National Natural Science Foundation of China (61473232, 91430111)

# Key words

bit-level; synchronous permutation-diffusion; annular diffusion; blocking; image encryption

# 1 位平面特性

 ${x_{11}} = \bmod \left( {{x_1} + \frac{{sum\left( \mathit{\boldsymbol{I}} \right)}}{{xor\left( \mathit{\boldsymbol{I}} \right) \times 256}},1} \right)$ (3)

2) 通过BBD将各像素块分解到位平面，按照光栅扫描顺序将各个位平面变换为1维向量，按照高位到低位顺序构成$8 \times 64$大小二进制像素块，记作$\mathit{\boldsymbol{B}}{\rm{ = }}\left\{ {{\mathit{\boldsymbol{b}}_1}, {\mathit{\boldsymbol{b}}_{\rm{2}}}, \ldots , {\mathit{\boldsymbol{b}}_i}, \cdots , {\mathit{\boldsymbol{b}}_{{S^2}/64}}} \right\}$${{\mathit{\boldsymbol{b}}_i}}表示8 \times 64二进制像素块。 3) 设加密后的二进制中间密文为\mathit{\boldsymbol{C}} = \left\{ {{\mathit{\boldsymbol{c}}_1}, {\mathit{\boldsymbol{c}}_2}, \cdots , {\mathit{\boldsymbol{c}}_i}, \cdots , {\mathit{\boldsymbol{c}}_{{S^2}/64}}} \right\}$${{\mathit{\boldsymbol{c}}_i}}$表示$8 \times 64$二进制像素块。将第$i$个像素块的高4位整体循环左移${s_1}$位。$i = 1$${s_1} = \bmod \left( {sum\left( \mathit{\boldsymbol{I}} \right), 256} \right)$$i > 1$时，${s_1} = \sum\limits_{k = 1}^{8 \times 64} {{c_{i - 1, k}}}$

4) 扩散加密第$i$个像素块的高4位，即

 $\begin{array}{*{20}{c}} {{c_{i,1}} = {b_{i,1}} \oplus {b_{i,4 \times 64 + 1}} \oplus {{z'}_{i,1}} \oplus {\tau _i}}\\ {i = 1,2, \cdots ,{S^2}/64} \end{array}$ (6)

 $\begin{array}{*{20}{c}} {{c_{i,j}} = {b_{i,j}} \oplus {b_{i,4 \times 64 + j}} \oplus {{z'}_{i,j}} \oplus {c_{i,j - 1}}}\\ {i = 1,2, \cdots ,{S^2}/64;j = 2,3, \cdots ,4 \times 64} \end{array}$ (7)

6) 重复步骤3)-5)，直至所有像素块完成加密。将二进制中间密文$\mathit{\boldsymbol{C}}$恢复成十进制形式，并转换成$S \times S$大小的中间密文图像$\mathit{\boldsymbol{C'}}$

# 3.3 像素级环形扩散

1) 设${x_2}$${l_2}为初始密钥，将中间密文图像像素和作为扰动因子，扰动初始密钥后，即  {x_{22}} = \bmod \left( {{x_2} + sum\left( {C'} \right)/256,1} \right) (8) {x_{22}}$${l_2}$作为初始值和控制参数，迭代式(2)${n_0} + 2 \times S \times S$次。舍弃前${n_0}$项以避免暂态效应，生成两组长度为$S \times S$的混沌序列${\mathit{\boldsymbol{y}}_3} = \left\{ {{y_{3, 1}}, {y_{3, 2}}, \cdots , {y_{3, S \times S}}} \right\}$${\mathit{\boldsymbol{y}}_4} = \left\{ {{y_{4, 1}}, {y_{4, 2}}, \cdots , {y_{4, S \times S}}} \right\} 根据式(4)对两组混沌序列进行标准化处理，获得密钥序列{\mathit{\boldsymbol{z}}_3} = \left\{ {{z_{3, 1}}, {z_{3, 2}}, \cdots , {z_{3, S \times S}}} \right\}$${\mathit{\boldsymbol{z}}_4} = \left\{ {{z_{4, 1}}, {z_{4, 2}}, \cdots , {z_{4, S \times S}}} \right\}$

2) 按照图 2(a)顺序将中间密文图像$\mathit{\boldsymbol{C'}}$转换成1维向量$\mathit{\boldsymbol{H = }}\left\{ {{H_1}, {H_2}, \cdots , {H_i}, \cdots , {H_{S \times S}}} \right\}$，进行横向顺序扩散，即

 ${{H'}_1} = {H_1} \oplus sum\left( H \right) \oplus {z_{3,1}}$ (9)

 $\begin{array}{*{20}{c}} {{{H'}_i} = {H_i} \oplus {{H'}_{i - 1}} \oplus {z_{3,i}}}\\ {i = 2,3, \cdots ,S \times S} \end{array}$ (10)

 $\mathit{\boldsymbol{H' = }}\left\{ {{{H'}_1},{{H'}_2}, \cdots ,{{H'}_i}, \cdots ,{{H'}_{S \times S}}} \right\}$

3) 将1维向量$\mathit{\boldsymbol{H'}}$变换成$S \times S$矩阵，按照图 2(b)顺序将该矩阵转换成1维向量$\mathit{\boldsymbol{V}} = \left\{ {{V_1}, {V_2}, \cdots , {V_i}, \cdots , {V_{S \times S}}} \right\}$，进行纵向逆序扩散，即

 ${E_1} = {V_1} \oplus sum\left( V \right) \oplus {z_{4,1}}$ (11)

 $\begin{array}{*{20}{c}} {{E_i} = {V_i} \oplus {E_{i - 1}} \oplus {z_{4,i}}}\\ {i = 2,3, \cdots ,S \times S} \end{array}$ (12)

4) 将1维向量$\mathit{\boldsymbol{E}}$转换成$S \times S$矩阵，即获得最终加密图像。

# 4.3 相邻像素相关性分析

Table 2 Correlation coefficients between two adjacent pixels in plain/cipher images with four algorithms

 测试图像 算法 水平方向 垂直方向 对角线方向 Lena 明文 0.971 1 0.934 4 0.910 9 BSPDPAD -0.000 4 -0.000 7 0.004 7 文献[15] -0.001 8 -0.022 1 0.002 8 文献[18] -0.023 0 0.001 9 -0.003 4 文献[19] 0.001 8 0.001 1 -0.001 2 Baboon 明文 0.790 6 0.865 8 0.749 5 BSPDPAD -0.000 9 0.001 3 0.007 4 文献[15] - - - 文献[18] 0.013 2 0.001 0 0.007 2 文献[19] -0.054 0 0.006 0 0.005 7 Couple 明文 0.949 5 0.940 7 0.901 4 BSPDPAD 0.001 8 -0.006 7 0.003 5 文献[15] - - - 文献[18] -0.003 3 -0.001 3 -0.014 5 文献[19] 0.003 2 -0.036 8 0.016 0 Peppers 明文 0.979 6 0.974 5 0.955 4 BSPDPAD 0.000 6 -0.005 5 0.000 5 文献[15] - - - 文献[18] 0.003 7 -0.016 1 -0.008 4 文献[19] 0.012 2 0.007 2 -0.005 8 注：“-”表示该文献原文未给出此性能值。

# 4.4 信息熵分析

Table 3 Information entropy with three algorithms

 测试图像 BSPDPAD算法 文献[18] 文献[19] Lena 7.997 7 7.997 4 7.999 4 Baboon 7.998 3 - - Couple 7.999 2 7.997 0 - Pepper 7.997 2 7.997 3 - 注：“-”表示该文献原文未给出此性能值。

# 4.6 抗差分攻击分析

Table 4 The NPCR and UACI values with four algorithms

 测试图像 NPCR/% UACI/% BSPDPAD 文献[15] 文献[18] 文献[19] BSPDPAD 文献[15] 文献[18] 文献[19] Lena 99.658 2 99.580 4 99.620 0 99.62 33.572 2 33.534 8 33.510 0 33.436 5 Baboon 99.620 7 99.591 4 - - 33.518 6 33.464 9 - - Couple 99.641 4 - 99.616 6 - 33.539 2 - 33.510 0 - Peppeer 99.617 0 - - - 33.569 0 - - - 注：“-”表示该文献原文未给出此性能值。

# 4.7 彩色图像加密

Table 5 Correlation coefficients between two adjacent pixels in RGB components of plain/cipher images with BSPDPAD algorithm on the Lena image

 明文图像 密文图像 R通道 水平方向 0.967 8 0.007 1 垂直方向 0.944 3 -0.004 4 对角线方向 0.917 7 -0.006 9 G通道 水平方向 0.971 8 0.003 3 垂直方向 0.949 0 0.000 9 对角线方向 0.921 1 -0.008 2 B通道 水平方向 0.970 7 -0.002 4 垂直方向 0.952 7 0.010 5 对角线方向 0.930 0 0.005 2

Table 6 Results of RGB components encrypted with three algorithms on Lena image

 算法 NPCR/% UACI/% Entropy R G B R G B BSPDPAD 99.665 8 99.636 2 99.652 1 33.699 9 33.649 6 33.562 1 7.999 1 文献[9] 99.612 4 99.613 4 99.619 2 33.443 8 33.523 2 33.501 0 7.997 4 文献[10] 99.630 7 99.627 7 99.655 2 33.594 2 33.412 5 33.602 4 7.997 5

# 参考文献

• [1] Wen C C, Wang Q, Liu X H, et al. An encryption algorithm for image based on affine and composed chaos[J]. Journal of Computer Research and Development, 2013, 50(2): 319–324. [文昌辞, 王沁, 刘向宏, 等. 基于仿射和复合混沌的图像加密新算法[J]. 计算机研究与发展, 2013, 50(2): 319–324. ] [DOI:10.7544/issn1000-1239.2013.20110418]
• [2] Wu C M. An improved discrete Arnold transform and its application in image scrambling and encryption[J]. Acta Physica Sinica, 2014, 63(9): #090504. [吴成茂. 离散Arnold变换改进及其在图像置乱加密中的应用[J]. 物理学报, 2014, 63(9): #090504. ] [DOI:10.7498/aps.63.090504]
• [3] Wang X Y, Yang L. A novel chaotic image encryption scheme based on magic cube permutation and dynamic look-up table[J]. International Journal of Modern Physics B, 2012, 26(29): #1250139. [DOI:10.1142/S0217979212501391]
• [4] Luo Y L, Du M H. Image encryption algorithm based on quantum logistic map in wavelet domain[J]. Journal of South China University of Technology:Natural Science Edition, 2013, 41(6): 53–62. [罗玉玲, 杜明辉. 基于量子Logistic映射的小波域图像加密算法[J]. 华南理工大学学报:自然科学版, 2013, 41(6): 53–62. ] [DOI:10.3969/j.issn.1000-565X.2013.06.010]
• [5] Jain A, Rajpal N. A robust image encryption algorithm resistant to attacks using DNA and chaotic logistic maps[J]. Multimedia Tools and Applications, 2016, 75(10): 5455–5472. [DOI:10.1007/s11042-015-2515-7]
• [6] Radwan A G, Abd-El-Hafiz S K. Image encryption using generalized tent map[C]//Proceedings of the 20th International Conference on Electronics, Circuits, and Systems. Abu Dhabi, United Arab Emirates: IEEE, 2013: 653-656. [DOI:10.1109/ICECS.2013.6815499]
• [7] Zhai Y Y, Wang G Y. Digital image encryption algorithm based on tent chaotic sequence[J]. Modern Electronics Technique, 2014, 37(12): 73–77. [翟依依, 王光义. 基于Tent混沌序列的数字图像加密方法[J]. 现代电子技术, 2014, 37(12): 73–77. ] [DOI:10.3969/j.issn.1004-373X.2014.12.021]
• [8] Zheng Y F, Jin J X. A novel image encryption scheme based on Hénon map and compound spatiotemporal chaos[J]. Multimedia Tools and Applications, 2015, 74(18): 7803–7820. [DOI:10.1007/s11042-014-2024-0]
• [9] Wang X Y, Zhang H L. A color image encryption with heterogeneous bit-permutation and correlated chaos[J]. Optics Communications, 2015, 342: 51–60. [DOI:10.1016/j.optcom.2014.12.043]
• [10] Song J L, Zhang S W. Adaptive image encryption algorithm of blocking diffusion based on the ChaCha20 hash operation[J]. Journal of Image and Graphics, 2016, 21(6): 698–710. [宋金林, 张绍武. 整合ChaCha20哈希运算的分块扩散自适应图像加密算法[J]. 中国图形图像学报, 2016, 21(6): 698–710. ] [DOI:10.11834/jig.20160603]
• [11] 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]
• [12] Li Y P, Wang C H, Chen H. A hyper-chaos-based image encryption algorithm using pixel-level permutation and bit-level permutation[J]. Optics and Lasers in Engineering, 2017, 90: 238–246. [DOI:10.1016/j.optlaseng.2016.10.020]
• [13] Zhang W, Yu H, Zhao Y L, et al. Image encryption based on three-dimensional bit matrix permutation[J]. Signal Processing, 2016, 118: 36–50. [DOI:10.1016/j.sigpro.2015.06.008]
• [14] Xiang T, Wong K W, Liao X F. Selective image encryption using a spatiotemporal chaotic system[J]. Chaos:An Interdisciplinary Journal of Nonlinear Science, 2007, 17(2): #023115. [DOI:10.1063/1.2728112]
• [15] Ye G D, Huang X L. A feedback chaotic image encryption scheme based on both bit-level and pixel-level[J]. Journal of Vibration and Control, 2016, 22(5): 1171–1180. [DOI:10.1063/1.2728112]
• [16] Zhang W, Wong K W, Yu H, et al. A symmetric color image encryption algorithm using the intrinsic features of bit distributions[J]. Communications in Nonlinear Science and Numerical Simulation, 2013, 18(3): 584–600. [DOI:10.1016/j.cnsns.2012.08.010]
• [17] Li S J, Li Q, Li W M, et al. Statistical properties of digital piecewise linear chaotic maps and their roles in cryptography and pseudo-random coding[M]//Honary B. Cryptography and Coding. Berlin, Heidelberg: Springer, 2001, 2260: 205-221. [DOI:10.1007/3-540-45325-3_19]
• [18] Xu L, Li Z, Li J, et al. A novel bit-level image encryption algorithm based on chaotic maps[J]. Optics and Lasers in Engineering, 2016, 78: 17–25. [DOI:10.1016/j.optlaseng.2015.09.007]
• [19] Zhang Y S, Xiao D. An image encryption scheme based on rotation matrix bit-level permutation and block diffusion[J]. Communications in Nonlinear Science and Numerical Simulation, 2014, 19(1): 74–82. [DOI:10.1016/j.cnsns.2013.06.031]