索引
传送门
- 文献原文可前往其收录处《混沌映射与比特重组的图像加密》.
- 文献的算法流程 (包括算法勘误, 算法整理) 可以参见博文《《混沌映射与比特重组的图像加密》(平萍等)一文的算法流程》.
- 对原文算法的改进可以参见博文《《混沌映射与比特重组的图像加密》(平萍等)一文的算法改进和展望》.
- 对算法及其改进形式的仿真实验可以参见博文《《混沌映射与比特重组的图像加密》(平萍等)一文的仿真实验 (基于Matlab)》.
- 对算法的性能分析可以参见博文《《混沌映射与比特重组的图像加密》(平萍等)一文的性能分析(一)-- 敏感性分析 (基于Matlab)》 以及 《《混沌映射与比特重组的图像加密》(平萍等)一文的性能分析(二)-- 相关性, 安全性强度, 计算用时分析 (基于Matlab)》.
- 原文算法的实现可以参见博文《《混沌映射与比特重组的图像加密》(平萍等)一文的算法实现(基于Matlab)》.
算法中的若干处粗浅分析
(1) 完全离散的Henon映射
{ x ( n + 1 ) = 1 − a x 2 ( n ) + y ( n ) m o d N , y ( n + 1 ) = b x ( n ) + c m o d N , \left\{ \begin{aligned} & x\left( n+1 \right)=1-a{
{x}^{2}}\left( n \right)+y\left( n \right)\text{ }\bmod N, \\ & y\left( n+1 \right)=bx\left( n \right)+c\text{ }\bmod N, \\ \end{aligned} \right. {
x(n+1)=1−ax2(n)+y(n) modN,y(n+1)=bx(n)+c modN,
当 b = 1 b=1 b=1时是集合 A = { ( n 1 , n 2 ) ∈ Z > 0 2 : 1 ≤ n 1 , 2 ≤ N } A=\left\{ \left( {
{n}_{1}},{
{n}_{2}} \right)\in \mathbb{Z}_{>0}^{2}:\text{ }1\le {
{n}_{1,2}}\le N \right\} A={
(n1,n2)∈Z>02: 1≤n1,2≤N}上的双射.
证明 当 b = 1 b=1 b=1时, 表达式更新为
{ x ( n + 1 ) = 1 − a x 2 ( n ) + y ( n ) m o d N , y ( n + 1 ) = x ( n ) + c m o d N . (1.1) \left\{ \begin{aligned} & x\left( n+1 \right)=1-a{
{x}^{2}}\left( n \right)+y\left( n \right)\text{ }\bmod N, \\ & y\left( n+1 \right)=x\left( n \right)+c\text{ }\bmod N. \\ \end{aligned} \right. \tag{1.1} {
x(n+1)=1−ax2(n)+y(n) modN,y(n+1)=x(n)+c modN.(1.1)
首先证明映射(1.1)是一个单射, 即证明成立推理
( x 1 ( n + 1 ) , y 1 ( n + 1 ) ) = ( x 2 ( n + 1 ) , y 2 ( n + 1 ) ) ⇒ ( x 1 ( n ) , y 1 ( n ) ) = ( x 2 ( n ) , y 2 ( n ) ) . (1.2) \left( {
{x}_{1}}\left( n+1 \right),{
{y}_{1}}\left( n+1 \right) \right)=\left( {
{x}_{2}}\left( n+1 \right),{
{y}_{2}}\left( n+1 \right) \right)\text{ }\Rightarrow \text{ }\left( {
{x}_{1}}\left( n \right),{
{y}_{1}}\left( n \right) \right)=\left( {
{x}_{2}}\left( n \right),{
{y}_{2}}\left( n \right) \right). \tag{1.2} (x1(n+1),y1(n+1))=(x2(n+1),y2(n+1)) ⇒ (x1(n),y1(n))=(x2(n),y2(n)).(1.2)
( x 1 ( n + 1 ) , y 1 ( n + 1 ) ) = ( x 2 ( n + 1 ) , y 2 ( n + 1 ) ) ⇒ y 1 ( n + 1 ) = y 2 ( n + 1 ) ⇒ x 1 ( n ) + c ≡ x 2 ( n ) + c m o d N ⇒ x 1 ( n ) ≡ x 2 ( n ) m o d N \begin{aligned} & \left( {
{x}_{1}}\left( n+1 \right),{
{y}_{1}}\left( n+1 \right) \right)=\left( {
{x}_{2}}\left( n+1 \right),{
{y}_{2}}\left( n+1 \right) \right) \\ & \Rightarrow {
{y}_{1}}\left( n+1 \right)={
{y}_{2}}\left( n+1 \right) \\ & \Rightarrow {
{x}_{1}}\left( n \right)+c\equiv {
{x}_{2}}\left( n \right)+c\text{ }\bmod N \\ & \Rightarrow {
{x}_{1}}\left( n \right)\equiv {
{x}_{2}}\left( n \right)\text{ }\bmod N \\ \end{aligned} (x1(n+1),y1(n+1))=(x2(n+1),y2(n+1))⇒y1(n+1)=y2(n+1)⇒x1(n)+c≡x2(n)+c modN⇒x1(n)≡x2(n) modN
由于 1 ≤ x 1 , 2 ( n ) ≤ N 1\le {
{x}_{1,2}}\left( n \right)\le N 1≤x1,2(n)≤N, 因此成立
x 1 ( n ) = x 2 ( n ) . (1.3) {
{x}_{1}}\left( n \right)={
{x}_{2}}\left( n \right). \tag{1.3} x1(n)=x2(n).(1.3)
基于式(1.3), 有以下推理
( x 1 ( n + 1 ) , y 1 ( n + 1 ) ) = ( x 2 ( n + 1 ) , y 2 ( n + 1 ) ) ⇒ x 1 ( n + 1 ) = x 2 ( n + 1 ) ⇒ 1 − a x 1 2 ( n ) + y 1 ( n ) ≡ 1 − a x 2 2 ( n ) + y 2 ( n ) m o d N ⇒ y 1 ( n ) ≡ y 2 ( n ) m o d N \begin{aligned} & \left( {
{x}_{1}}\left( n+1 \right),{
{y}_{1}}\left( n+1 \right) \right)=\left( {
{x}_{2}}\left( n+1 \right),{
{y}_{2}}\left( n+1 \right) \right) \\ & \Rightarrow {
{x}_{1}}\left( n+1 \right)={
{x}_{2}}\left( n+1 \right) \\ & \Rightarrow 1-a{
{x}_{1}}^{2}\left( n \right)+{
{y}_{1}}\left( n \right)\equiv 1-a{
{x}_{2}}^{2}\left( n \right)+{
{y}_{2}}\left( n \right)\text{ }\bmod N \\ & \Rightarrow {
{y}_{1}}\left( n \right)\equiv {
{y}_{2}}\left( n \right)\text{ }\bmod N \\ \end{aligned} (x1(n+1),y1(n+1))=(x2(n+1),y2(n+1))⇒x1(n+1)=x2(n+1)⇒1−ax12(n)+y1(n)≡1−ax22(n)+y2(n) modN⇒y1(n)≡y2(n) modN
由于 1 ≤ y 1 , 2 ( n ) ≤ N 1\le {
{y}_{1,2}}\left( n \right)\le N 1≤y1,2(n)≤N, 因此成立
y 1 ( n ) = y 2 ( n ) . (1.4) {
{y}_{1}}\left( n \right)={
{y}_{2}}\left( n \right). \tag{1.4} y1(n)=y2(n).(1.4)
由式(1.3), 式(1.4), 推理(1.2)成立, 即映射(1.1)是一个单射.
再证明映射(1.1)是一个满射. 根据同余式的性质, 成立
x ( n + 1 ) ≡ 1 − a x 2 ( n ) + y ( n ) m o d N ⇔ y ( n ) ≡ x ( n + 1 ) − 1 + a x 2 ( n ) m o d N y ( n + 1 ) ≡ x ( n ) + c m o d N ⇔ x ( n ) ≡ y ( n + 1 ) − c m o d N \begin{matrix} \begin{aligned} & \text{ }x\left( n+1 \right)\equiv 1-a{
{x}^{2}}\left( n \right)+y\left( n \right)\text{ }\bmod N \\ & \Leftrightarrow y\left( n \right)\equiv x\left( n+1 \right)-1+a{
{x}^{2}}\left( n \right)\text{ }\bmod N \\ \end{aligned} & \begin{aligned} & \text{ }y\left( n+1 \right)\equiv x\left( n \right)+c\text{ }\bmod N \\ & \Leftrightarrow x\left( n \right)\equiv y\left( n+1 \right)-c\text{ }\bmod N \\ \end{aligned} \\ \end{matrix} x(n+1)≡1−ax2(n)+y(n) modN⇔y(n)≡x(n+1)−1+ax2(n) modN y(n+1)≡x(n)+c modN⇔x(n)≡y(n+1)−c modN
得到逆推式
{ x ( n ) = y ( n + 1 ) − c m o d N , y ( n ) = x ( n + 1 ) − 1 + a x 2 ( n ) m o d N . (1.5) \left\{ \begin{aligned} & x\left( n \right)=y\left( n+1 \right)-c\text{ }\bmod N, \\ & y\left( n \right)=x\left( n+1 \right)-1+a{
{x}^{2}}\left( n \right)\text{ }\bmod N. \\ \end{aligned} \right. \tag{1.5} {
x(n)=y(n+1)−c modN,y(n)=x(n+1)−1+ax2(n) modN.(1.5)
式(1.5)说明了 ∀ ( x ( n + 1 ) , y ( n + 1 ) ) ∈ A \forall \left( x\left( n+1 \right),y\left( n+1 \right) \right)\in A ∀(x(n+1),y(n+1))∈A, 总可以由式(1.5)找到对应的 ( x ( n ) , y ( n ) ) ∈ A \left( x\left( n \right),y\left( n \right) \right)\in A (x(n),y(n))∈A, 使得二者成立(1.1)的映射关系, 因此映射(1.1)是一个满射.
综上, 映射(1.1)是一个双射, 可逆, 且(1.5)就是映射(1.1)对应的逆向映射. 又因为双射的复合还是一个双射, 这为算法中在 N × N N \times N N×N方阵上实行若干次完全离散Henon映射的可行性提供了理论依据.
(2) Tent系统的系统方程为
{ x ( n + 1 ) = μ x ( n ) , 0 < x ( n ) ≤ 0.5 , x ( n + 1 ) = μ ( 1 − x ( n ) ) , 0.5 < x ( n ) < 1. (2.1) \left\{ \begin{aligned} & x\left( n+1 \right)=\mu x\left( n \right),\text{ }0<x\left( n \right)\le 0.5, \\ & x\left( n+1 \right)=\mu \left( 1-x\left( n \right) \right),\text{ }0.5<x\left( n \right)<1. \\ \end{aligned} \right. \tag{2.1} {
x(n+1)=μx(n), 0<x(n)≤0.5,x(n+1)=μ(1−x(n)), 0.5<x(n)<1.(2.1)
即
x ( n + 1 ) = μ ⋅ min { x ( n ) , 1 − x ( n ) } . (2.2) x\left( n+1 \right)=\mu \centerdot \min \left\{ x\left( n \right),1-x\left( n \right) \right\}. \tag{2.2} x(n+1)=μ⋅min{
x(n),1−x(n)}.(2.2)
式中要求 x ( n ) ∈ ( 0 , 1 ) x\left( n \right)\in \left( 0,1 \right) x(n)∈(0,1), 为了让 x ( n + 1 ) x\left( n+1 \right) x(n+1)也满足 x ( n + 1 ) ∈ ( 0 , 1 ) x\left( n+1 \right)\in \left( 0,1 \right) x(n+1)∈(0,1), 由式(2.2)得到 μ ∈ ( 0 , 2 ) \mu \in \left( 0,2 \right) μ∈(0,2).
0 < μ < 1 0<\mu <1 0<μ<1时, 序列 { x ( n ) } = { x ( 1 ) , x ( 2 ) , μ x ( 2 ) , μ 2 x ( 2 ) , ⋯ } \left\{ x\left( n \right) \right\}=\left\{ x\left( 1 \right),x\left( 2 \right),\mu x\left( 2 \right),{
{\mu }^{2}}x\left( 2 \right),\cdots \right\} {
x(n)}={
x(1),x(2),μx(2),μ2x(2),⋯}, 其中
x ( 2 ) = min { x ( 1 ) , 1 − x ( 1 ) } < 0.5. x\left( 2 \right)=\min \left\{ x\left( 1 \right),1-x\left( 1 \right) \right\}<0.5. x(2)=min{
x(1),1−x(1)}<0.5.
该序列除去第1个数之后显然是一个单调递减的收敛序列, 收敛点为0.
μ = 1 \mu =1 μ=1时, 序列 { x ( n ) } = { x ( 1 ) , x ( 2 ) , x ( 2 ) , x ( 2 ) , ⋯ } \left\{ x\left( n \right) \right\}=\left\{ x\left( 1 \right),x\left( 2 \right),x\left( 2 \right),x\left( 2 \right),\cdots \right\} {
x(n)}={
x(1),x(2),x(2),x(2),⋯}, 其中
x ( 2 ) = min { x ( 1 ) , 1 − x ( 1 ) } < 0.5. x\left( 2 \right)=\min \left\{ x\left( 1 \right),1-x\left( 1 \right) \right\}<0.5. x(2)=min{
x(1),1−x(1)}<0.5.
1 < μ < 2 1<\mu <2 1<μ<2时, 系统处于混沌状态.
需要特别注意的是, 原文献基于上面的讨论只点明算法应用Tent系统时应该控制参数 μ > 1 \mu >1 μ>1使得该系统是混沌的, 但是我们同时需要注意初值 x 0 x_0 x0 (加密算法的密钥) 的选取. 这里就只简单地讨论一点. 考虑
{ x ( n ) > 0.5 , x ( n ) = μ ( 1 − x ( n ) ) . (2.3) \left\{ \begin{aligned} & x\left( n \right)>0.5, \\ & x\left( n \right)=\mu \left( 1-x\left( n \right) \right). \\ \end{aligned} \right. \tag{2.3} {
x(n)>0.5,x(n)=μ(1−x(n)).(2.3)
由第2式计算得
μ = x ( n ) 1 − x ( n ) (2.4) \mu =\frac{x\left( n \right)}{1-x\left( n \right)} \tag{2.4} μ=1−x(n)x(n)(2.4)
当已经确定了Tent混沌系统参数 μ \mu μ的值之后, 应该避免初值 x ( 1 ) x\left( 1 \right) x(1)即密钥 x 0 {
{x}_{0}} x0取满足式(2.4)的值, 否则由Tent系统得到的序列除去第一位后是一个常数列 { x ( 2 ) } \left\{ x\left( 2 \right) \right\} {
x(2)}.
例子 已经确定 μ = 1.5 \mu =1.5 μ=1.5, 令 x 0 = 0.6 {
{x}_{0}}=0.6 x0=0.6, 则 μ \mu μ与 x 0 {
{x}_{0}} x0满足式(2.4), 此时Tent系统产生的序列为
0.6 , 0.4 , 0.4 , 0.4 , ⋯ 0.6,\text{ }0.4,\text{ }0.4,\text{ }0.4,\text{ }\cdots 0.6, 0.4, 0.4, 0.4, ⋯
已经不具备混沌性, 该序列作为密钥流, 安全性也大打折扣.
当已经确定了初值 x ( 1 ) x\left( 1 \right) x(1)(即密钥 x 0 {
{x}_{0}} x0)而要选择参数 μ ∈ ( 1 , 2 ) \mu \in \left( 1,2 \right) μ∈(1,2)时, 也是注意类似的问题.
(3) 注意到Tent混沌序列的控制参数 μ \mu μ和初始迭代次数 k k k的计算公式
μ = 2 s / M × N × 255 , k = 10 3 + ( s m o d 10 3 ) . \begin{aligned} & \mu ={
{2}^{
{s}/{M\times N\times 255}\;}}, \\ & k={
{10}^{3}}+\left( s\text{ }\bmod {
{10}^{3}} \right). \\ \end{aligned} μ=2s/M×N×255,k=103+(s mod103).
中都使用到明文图像的像素值总和 s s s, 因此Tent混沌序列的生成与明文图像有关, 当密钥 x 0 x_0 x0相同而明文图像不同时, Tent系统生成的混沌序列也不一样, 由此增强了算法的明文敏感性.
(4) 注意到算法全过程中使用到的混沌序列不是唯一的, 有长度为 M M M的混沌序列 E E E, 长度为 8 × N 8 \times N 8×N的混沌序列 F F F, 以及长度为 M × N M \times N M×N的混沌序列 R R R.
由 E E E产生的位置向量 P E P^E PE用来对 M × ( 8 × N ) M\times \left( 8\times N \right) M×(8×N)的大比特矩阵进行整行置乱.
由 F F F产生的位置向量 P F P^F PF用来对 M × ( 8 × N ) M\times \left( 8\times N \right) M×(8×N)的大比特矩阵进行整列置乱, 且 F F F本身有8个分量分别参与到8个 M × N M \times N M×N小比特矩阵上Henon映射参数 a i , c i {
{a}_{i}},\text{ }{
{c}_{i}} ai, ci和映射迭代次数 n i n_i ni的生成.
混沌序列 R R R在最后(第3阶段扩散解密)灰度加密过程中起到了作用.
由此可见, 算法过程中综合使用了3种混沌序列来进行置乱或扩散, 算法安全性大大增强.
(5) 注意到该算法突破了置乱范围在同一比特面的限制, 具体表现在原算法中的对 M × ( 8 × N ) M\times \left( 8\times N \right) M×(8×N)的大比特矩阵的整列置乱环节, 使得一个比特面里的元素0或1有机会移动到另一个比特面同一行的某个位置, 再配合上之前的整行置乱环节, 实现了一个比特面里的元素0或1有机会移动到另一个比特面里的任何一个位置. 置乱的规则由混沌序列 E E E和 F F F所产生的位置向量 P E P^E PE和 P F P^F PF给出.
(6) 参照博文《《混沌映射与比特重组的图像加密》(平萍等)一文的算法流程》中的 整理后的加密算法步骤一节:
算法涉及到置乱的主要环节有: 步骤(7)中的整行置乱, 步骤(8)中的整列置乱, 步骤(9)中每个比特矩阵上各自进行的若干次Henon映射置乱.
值得指出的是, 上面的置乱均在比特平面上进行, 按照原文的说法, 实质上既改变了像素的位置, 又改变了像素的值, 即也带有一些扩散的效果.
算法涉及到扩散的主要环节是: 步骤(11)中的扩散加密, 该步骤的增加增强了抵御统计分析攻击的能力.
(7) 博文《《混沌映射与比特重组的图像加密》(平萍等)一文的算法流程》中的 整理后的加密算法步骤一节中的 步骤(9)中计算 a i , c i , n i {
{a}_{i}},\text{ }{
{c}_{i}},\text{ }{
{n}_{i}} ai, ci, ni的公式为
a i = [ f N ⋅ ( i − 1 ) + 1 × 10 14 ] m o d 2 8 , c i = [ f N ⋅ ( i − 1 ) + 1 2 × 10 14 ] m o d 2 8 , n i = 1 + ( [ f N ⋅ ( i − 1 ) + 1 × 10 14 ] m o d 5 ) . \begin{aligned} & {
{a}_{i}}=\left[ {
{f}_{N\centerdot \left( i-1 \right)+1}}\times {
{10}^{14}} \right]\text{ }\bmod {
{2}^{8}}, \\ & {
{c}_{i}}=\left[ {
{f}_{N\centerdot \left( i-1 \right)+1}}^{2}\times {
{10}^{14}} \right]\text{ }\bmod {
{2}^{8}}, \\ & {
{n}_{i}}=1+\left( \left[ {
{f}_{N\centerdot \left( i-1 \right)+1}}\times {
{10}^{14}} \right]\text{ }\bmod 5 \right). \\ \end{aligned} ai=[fN⋅(i−1)+1×1014] mod28,ci=[fN⋅(i−1)+12×1014] mod28,ni=1+([fN⋅(i−1)+1×1014] mod5).
对三个式子中 1 0 14 10^{14} 1014设置意义的说明:
Tent混沌系统输入的初值 x 0 {
{x}_{0}} x0是0到1之间的一个小数, 控制参数 μ \mu μ是介于 1 1 1到 2 2 2的一个小数. 两个小数相乘得到的结果的小数点后位数一般会更多. 由此可以看出, 在保证精度的前提下, 随着Tent系统不断产生新的值, 该新值的小数点后位数一般会不断变多. 以 a i a_i ai的计算公式为例, f N ⋅ ( i − 1 ) + 1 × 10 14 {
{f}_{N\centerdot \left( i-1 \right)+1}}\times {
{10}^{14}} fN⋅(i−1)+1×1014就是将混沌序列 F F F的分量 f N ⋅ ( i − 1 ) + 1 {
{f}_{N\centerdot \left( i-1 \right)+1}} fN⋅(i−1)+1的小数点后14位移动到整数位上, 配合取整函数 [ ⋅ ] \left[ \centerdot \right] [⋅], 将第15位之后的小数删去不作使用.