技术领域Technical field
本发明涉及数字图像加密的技术领域,尤其涉及一种基于4D混沌系统的图像加密方法。The invention relates to the technical field of digital image encryption, and in particular to an image encryption method based on a 4D chaotic system.
背景技术Background technique
随着互联网、大数据、人工智能和5G通信的快速发展,大量的信息被数字化并通过网络传输。特别是数字图像方面,其使用和传输已经成为我们日常生活中不可或缺的一部分。然而,尽管数字图像的广泛应用带来了巨大的便利,但是也面临着未经授权的访问、篡改和盗用的风险。为了保护个人隐私、确保图像的完整性以及保护知识产权,数字图像加密技术应运而生。数字图像加密旨在将图像信息转化为一系列无法理解的数据,使得只有授权用户才能正确解读和还原图像。随着技术的不断进步和创新,对数字图像加密的要求逐渐增加,为了确保图像加密的安全性,迫切需要更完善的图像加密算法来满足用户的需求。With the rapid development of the Internet, big data, artificial intelligence and 5G communications, a large amount of information is digitized and transmitted through the network. Especially in terms of digital images, their use and transmission have become an integral part of our daily lives. However, although the widespread application of digital images has brought great convenience, it also faces risks of unauthorized access, tampering and theft. In order to protect personal privacy, ensure the integrity of images and protect intellectual property rights, digital image encryption technology emerged as the times require. Digital image encryption aims to convert image information into a series of unintelligible data so that only authorized users can correctly interpret and restore the image. With the continuous advancement and innovation of technology, the requirements for digital image encryption are gradually increasing. In order to ensure the security of image encryption, a more complete image encryption algorithm is urgently needed to meet the needs of users.
近年来,非线性数字混沌系统在数据加密领域越来越受到关注。数字混沌系统具备许多与加密学相关的理想特性,因此在图像加密系统中得到广泛应用。混沌系统在图像加密中具有以下特点:高度不可预测性、极大的密钥空间、快速的加解密过程、强大的抗攻击性以及可逆性。然而,混沌系统并不是绝对安全的,仍然可能受到特定攻击算法的威胁。因此,在设计和应用混沌系统进行图像加密时,仍需融合其他加密技术以增强安全性。比如,一维混沌系统具有结构简单、计算量小等优点,因而受到密码学家的青睐。然而,由于一维混沌映射的简单运动特性,它的密钥空间相对较小、容错性有限、且缺乏统一理论和分析支持,相比之下,高维混沌系统具有复杂的混沌行为和不可预测的轨迹,为提升图像加密的安全性提供了更多的潜在资源。在1963年,Lorenz引入了混沌理论的概念,并且其提出的经典混沌系统---Lorenz系统被广泛的应用于图像加密。Wang基于改进的一维复合正弦映射提出了一种新的图像加密算法,提高了加密图像的安全性,但其混沌周期窗口较短,混沌行为的范围有限,容易受到攻击。为了解决低维混沌系统在图像加密中的缺点,Lai将逻辑映射和高斯映射结合起来,提出了一种新的二维混沌系统,具有极好的混沌性能,同时基于该混沌系统提出了一种新的加密方案,具有很好的安全性能。1999年陈提出了一个新的混沌系统---Chen系统,该混沌系统的吸引子在相空间比Lorenz系统更加复杂,其广泛的应用于图像加密,提高了加密算法的复杂度和鲁棒性。In recent years, nonlinear digital chaotic systems have received increasing attention in the field of data encryption. Digital chaos systems possess many ideal properties related to cryptography and are therefore widely used in image encryption systems. Chaotic systems have the following characteristics in image encryption: high unpredictability, huge key space, fast encryption and decryption process, strong attack resistance and reversibility. However, chaotic systems are not absolutely secure and may still be threatened by specific attack algorithms. Therefore, when designing and applying chaos systems for image encryption, other encryption technologies still need to be integrated to enhance security. For example, one-dimensional chaotic systems have the advantages of simple structure and low computational complexity, so they are favored by cryptographers. However, due to the simple motion characteristics of one-dimensional chaotic mapping, its key space is relatively small, its fault tolerance is limited, and it lacks unified theory and analytical support. In contrast, high-dimensional chaotic systems have complex chaotic behavior and unpredictability. The trajectory provides more potential resources for improving the security of image encryption. In 1963, Lorenz introduced the concept of chaos theory, and the classic chaotic system he proposed---the Lorenz system is widely used in image encryption. Wang proposed a new image encryption algorithm based on improved one-dimensional compound sine mapping, which improves the security of encrypted images. However, its chaotic period window is short, the range of chaotic behavior is limited, and it is vulnerable to attacks. In order to solve the shortcomings of low-dimensional chaotic systems in image encryption, Lai combined logical mapping and Gaussian mapping and proposed a new two-dimensional chaotic system with excellent chaotic performance. At the same time, a new two-dimensional chaotic system was proposed based on this chaotic system. New encryption scheme with good security performance. In 1999, Chen proposed a new chaotic system, the Chen system. The attractor of this chaotic system is more complex than the Lorenz system in phase space. It is widely used in image encryption and improves the complexity and robustness of the encryption algorithm. .
在图像加密方案中,最重要的环节就是置乱和扩散。置乱是改变像素点的位置,从而降低相邻像素之间的相关性。扩散是对像素点的灰度值进行改变,使得任一像素值的改变都会影响尽可能多的其他像素的灰度值。研究者已经提出了许多图像加密方案,其中大多数加密方案都是按照先置乱,再扩散的顺序处理,尽管这些加密方案具有良好的安全性,但也存在一些问题。例如在文献[Xu X,Feng J(2010)Research and implementation ofimage encryption algorithm based on zigzag transformation and inner productpolarization vector.IEEE Int Conf Granular Comp:556-561]中,Xu仅仅采用了之字形扫描的方式进行置乱,相邻像素之间的相关性并没有被完全打破,极容易受到暴力攻击。此外,单次的置乱和扩散操作过于简单,可能导致加密方案安全性较低,而多次重复的置乱、扩散操作会显著降低加密效率。为了解决这些问题,研究者们将置乱、扩散组合起来,提出了置乱和扩散同步进行的位级置乱方法。位级置乱方法就是把像素值转换为八位二进制,然后对二进制进行打乱,达到同步置乱、扩散像素的目的。Wen提出了一种在比特级采用不同扫描方式置乱的方法,以改变像素位置和值。Zhou提出一种新型位级图像加密方案,将八位二进制每一位单独分为一个平面,并对每一个平面进行不同的索引置乱,通过分析,这种方法有很好的置乱和扩散效果。Shahna采用比特级循环位移的方法进行置乱,安全和性能分析表明:该算法具有很高的安全性和鲁棒性。In image encryption schemes, the most important steps are scrambling and diffusion. Scrambling changes the position of pixels to reduce the correlation between adjacent pixels. Diffusion is to change the gray value of a pixel so that a change in any pixel value affects the gray value of as many other pixels as possible. Researchers have proposed many image encryption schemes, most of which are processed in the order of scrambling first and then diffusion. Although these encryption schemes have good security, they also have some problems. For example, in the literature [Xu Chaos, the correlation between adjacent pixels is not completely broken, and it is extremely vulnerable to brute force attacks. In addition, a single scrambling and diffusion operation is too simple, which may cause the encryption scheme to be less secure, while repeated scrambling and diffusion operations will significantly reduce encryption efficiency. In order to solve these problems, researchers combined scrambling and diffusion and proposed a bit-level scrambling method in which scrambling and diffusion are performed simultaneously. The bit-level scrambling method is to convert the pixel value into an eight-bit binary, and then scramble the binary to achieve the purpose of synchronously scrambling and diffusing pixels. Wen proposed a method of scrambling at the bit level using different scanning methods to change pixel positions and values. Zhou proposed a new bit-level image encryption scheme, dividing each eight-bit binary bit into a separate plane, and scrambling each plane with different indexes. Through analysis, this method has good scrambling and diffusion Effect. Shahna uses the bit-level cyclic displacement method for scrambling. Security and performance analysis show that this algorithm is highly secure and robust.
置乱算法打破了像素之间的强相关性,为了更好的隐藏图像的关键信息,还需要对图像做进一步的扩散处理。现已提出的扩散算法常用的有异或、加取模、加法、减法、乘法等,Sun提出了双向乘法加法结合运算,通过正向和逆向两次扩散,实现全局扩散的效果。Wang提出了基于三种模型的图像扩散,其主要是根据混沌序列选择不同的模型进行扩散,虽然达到了对像素扩散的目的,但由于其选择模型比较复杂,加密时间较长。The scrambling algorithm breaks the strong correlation between pixels. In order to better hide the key information of the image, further diffusion processing of the image is required. Commonly used diffusion algorithms that have been proposed include XOR, modulo addition, addition, subtraction, multiplication, etc. Sun proposed a two-way multiplication and addition combined operation to achieve the global diffusion effect through two forward and reverse diffusions. Wang proposed image diffusion based on three models, which mainly selects different models for diffusion based on chaotic sequences. Although the purpose of pixel diffusion is achieved, the encryption time is long due to the complexity of the selected model.
发明内容Contents of the invention
针对现有的图像加密方法的安全性低,加密效率低的技术问题,本发明提出一种基于4D混沌系统的图像加密方法,利用混沌矩阵中元素的奇偶性以及明文图像行列的奇偶性来进行置乱,可以充分的打破相邻像素的相关性;十六进制位平面置乱不仅能够彻底改变像素的位置,也能充分修改像素的值,可以达到同步置乱的效果,根据混沌序列随机选择组合运算扩散的方式来修改像素值,可以进一步增强图像加密的安全性。In view of the technical problems of low security and low encryption efficiency of existing image encryption methods, the present invention proposes an image encryption method based on a 4D chaotic system, which utilizes the parity of elements in the chaos matrix and the parity of the plaintext image rows. Scrambling can fully break the correlation between adjacent pixels; hexadecimal bit plane scrambling can not only completely change the position of the pixel, but also fully modify the value of the pixel, which can achieve the effect of synchronous scrambling and randomize according to the chaotic sequence. Selecting the combined operation diffusion method to modify pixel values can further enhance the security of image encryption.
为了达到上述目的,本发明的技术方案是这样实现的:一种基于4D混沌系统的图像加密方法,其步骤如下:In order to achieve the above objectives, the technical solution of the present invention is implemented as follows: an image encryption method based on a 4D chaotic system, the steps of which are as follows:
步骤一:采用SHA-512算法计算大小为M×N的明文图像P的哈希值H,通过外部密钥和哈希值H计算得到4D混沌系统的初始值x0、y0、z0、w0;Step 1: Use the SHA-512 algorithm to calculate the hash value H of the plaintext image P of size M×N, and calculate the initial values x0 , y0 , z0 , of the 4D chaotic system through the external key and hash value H. w0 ;
步骤二:把初始值x0、y0、z0、w0代入4D混沌系统迭代M×N次,得到四个混沌序列X′、Y′、Z′、W′,四个混沌序列X′、Y′、Z′、W′进行数据处理获得三个混沌序列U、V、T;Step 2: Substitute the initial values x0 , y0 , z0 , and w0 into the 4D chaotic system and iterate M×N times to obtain four chaotic sequences X′, Y′, Z′, and W′, and four chaotic sequences X′ , Y′, Z′, W′ perform data processing to obtain three chaotic sequences U, V, T;
步骤三:对混沌序列U进行处理得到两个索引序列T1和T2,根据两个索引序列T1和T2对明文图像P进行奇偶置乱得到图像矩阵P1;Step 3: Process the chaotic sequence U to obtain two index sequences T1 and T2 , perform parity scrambling on the plaintext image P according to the two index sequences T1 and T2 to obtain the image matrix P1 ;
步骤四:十六进制位平面置乱:将图像矩阵P1转换为十六进制得到字符矩阵P2,将字符矩阵P2中只有一个字符的高位补零,然后按高位、低位划分为两个平面P3和P4;对混沌序列U进行一系列处理得到位置索引坐标矩阵S1和位置索引坐标矩阵S2,将平面P3和平面P4分别根据位置索引坐标矩阵S1和位置索引坐标矩阵S2进行索引置乱,分别得到矩阵P5和矩阵P6;将矩阵P5和矩阵P6中的字符分别作为十六进制的高位和低位恢复为一个十六进制的字符矩阵P7,将字符矩阵P7转换为十进制得到图像矩阵P8;Step 4: Hexadecimal bit plane scrambling: Convert the image matrix P1 to hexadecimal to obtain the character matrix P2 , pad the high bits of only one character in the character matrix P2 with zeros, and then divide it into high bits and low bits. Two planes P3 and P4 ; perform a series of processing on the chaotic sequence U to obtain the position index coordinate matrix S1 and the position index coordinate matrix S2 . The planes P3 and P4 are respectively divided into two planes according to the position index coordinate matrix S1 and position index. The index coordinate matrix S2 is indexed and scrambled to obtain the matrix P5 and the matrix P6 respectively; the characters in the matrix P5 and the matrix P6 are restored to a hexadecimal character as the high and low bits of hexadecimal respectively. Matrix P7 , convert the character matrix P7 into decimal to obtain the image matrix P8 ;
步骤五:将图像矩阵P8转换为一维数组,按照混沌序列T的元素值选取不同的组合运算公式利用混沌序列V进行扩散运算后转化为矩阵,得到密文图像C。Step 5: Convert the image matrix P8 into a one-dimensional array, select different combination operation formulas according to the element values of the chaotic sequence T, use the chaotic sequence V to perform a diffusion operation and then convert it into a matrix to obtain the ciphertext image C.
优选地,所述4D混沌系统的表达式为:Preferably, the expression of the 4D chaotic system is:
其中,a、b、c、d为系统参数,x、y、z、w均为状态变量,分别为状态变量x、y、z、w的导数。Among them, a, b, c, d are system parameters, x, y, z, w are state variables. are the derivatives of state variables x, y, z, w respectively.
优选地,所述通过外部密钥和哈希值H计算得到4D混沌系统的初始化参数x0、y0、z0、w0的方法为:将明文图像P输入SHA-512算法中输出512位二进制的哈希值H;将哈希值H等分为64组、每组8位的二进制序列k1,k2,k3,…,k64;将64组二进制序列k1,k2,k3,…,k64进行异或运算得到中间变量:Preferably, the method of calculating the initialization parameters x0 , y0 , z0 , and w0 of the 4D chaotic system through the external key and the hash value H is: input the plaintext image P into the SHA-512 algorithm and output 512 bits Binary hash value H; divide the hash value H into 64 groups, each group of 8-bit binary sequences k1 , k2 , k3 ,..., k64 ; divide the 64 groups of binary sequences k1 , k2 , k3 ,..., k64 perform XOR operation to obtain the intermediate variable:
中间变量与4个外部密钥e(1)、e(2)、e(3)、e(4)运算计算出混沌系统的初始值x0、y0、z0、w0为:The intermediate variables are operated with four external keys e(1), e(2), e(3), and e(4) to calculate the initial values x0 , y0 , z0 , and w0 of the chaotic system as:
其中,为异或运算,Q1-Q8为计算的中间变量,mod为求模函数。in, is the XOR operation, Q1 -Q8 are the intermediate variables for calculation, and mod is the modular function.
优选地,把初始值x0、y0、z0、w0代入4D混沌系统迭代1000次,继续迭代M×N次,得到四个混沌序列:X′=[x′1,x′2,x′3,…x′M×N]、Y′=[y′1,y′2,y′3,…y′M×N]、Z′=[z′1,z′2,z′3,…z′M×N]、W′=[w′1,w′2,w′3,…w′M×N];Preferably, substitute the initial values x0 , y0 , z0 , and w0 into the 4D chaotic system and iterate 1000 times, and continue to iterate M×N times to obtain four chaotic sequences: X′=[x′1 , x′2 , x′3 ,...x′M×N ], Y′=[y′1 , y′2 , y′3 ,...y′M×N ], Z′=[z′1 , z′2 , z′3 ,...z′M×N ], W′=[w′1 , w′2 , w′3 ,...w′M×N ];
所述混沌序列X′、Y′、Z′、W′进行数据处理的方法为:将混沌序列X′、Y′、Z′、W′分别进行运算得到四个新的整数混沌序列X、Y、Z、W的方法为:The method for data processing of the chaotic sequences X′, Y′, Z′, and W′ is as follows: performing operations on the chaotic sequences X′, Y′, Z′, and W′ respectively to obtain four new integer chaotic sequences X, Y , Z, W methods are:
对四个整数混沌序列X、Y、Z、W进行运算,得到加密所用的三个混沌序列U、V、T为:Perform operations on the four integer chaotic sequences X, Y, Z, and W to obtain the three chaotic sequences U, V, and T used for encryption:
其中,floor为向下取整函数,mod为求模函数,为异或运算;x′i、y′i、z′i、w′i、Xi、Yi、Zi、Wi分别为混沌序列X′、Y′、Z′、W′、整数混沌序列X、Y、Z、W的第i个元素,i的取值为[1,M*N]。Among them, floor is the downward rounding function, mod is the modular function, is the exclusive OR operation; x′i , y′i , z′i , w′i , Xi , Yi , Zi ,and Wi are respectively chaotic sequences The i-th element of the sequence X, Y, Z, W, the value of i is [1, M*N].
优选地,对混沌序列U进行处理得到两个索引序列T1和T2的方法为:将混沌序列U重塑成与明文图像P大小一致的矩阵U1,对矩阵U1的每一行进行分析:记录奇数行中的奇数数量,记录偶数行中的偶数数量,得到长度为M的索引序列T1;对矩阵U1的每一列进行分析:则记录奇数列中的奇数数量,记录偶数列中的偶数数量,得到长度为N的索引序列T2。Preferably, the method for processing the chaotic sequence U to obtain two index sequences T1 and T2 is: reshape the chaotic sequence U into a matrix U1 that is consistent in size with the plaintext image P, and analyze each row of the matrix U1 : record the number of odd numbers in the odd rows, record the number of even numbers in the even rows, and obtain the index sequence T1 of length M; analyze each column of the matrix U1 : then record the number of odd numbers in the odd columns, record the number of odd numbers in the even columns is an even number, and an index sequence T2 of length N is obtained.
优选地,根据两个索引序列T1和T2对明文图像P进行奇偶置乱的方法为:Preferably, the method of parity scrambling the plaintext image P according to the two index sequences T1 and T2 is:
根据索引序列T1进行奇偶行循环移位置乱:明文图像P的奇数行向左循环移位,明文图像P的偶数行则向右循环移位,移动的位数为索引序列T1中所对应的数;The odd and even rows are circularly shifted according to the index sequence T1 : the odd rows of the plaintext image P are circularly shifted to the left, and the even rows of the plaintext image P are circularly shifted to the right, and the number of shifted bits is the corresponding number in the index sequenceT1 number;
根据索引序列T2进行奇偶列循环移位置乱:奇偶行循环移位置乱后的图像的奇数列则向上循环移位,奇偶行循环移位置乱后的图像的偶数列则向下循环移位,移动的位数为索引序列T2中所对应的数。The odd and even columns are cyclically shifted and scrambled according to the index sequence T2 : the odd columns of the image after the odd and even rows are cyclically shifted and scrambled are cyclically shifted upwards, and the even columns of the image after the odd and even rows are cyclically shifted are cyclically shifted downwards. The number of bits moved is the corresponding number in the index sequence T2 .
优选地,所述对混沌序列U进行一系列处理得到位置索引坐标矩阵S1和位置索引坐标矩阵S2的方法为:将混沌矩阵U1的每一列进行排列得到索引矩阵I1,将矩阵U1的每一行进行排列得到索引矩阵I2;将索引矩阵I1的每一列元素加上所在列的列号得到位置坐标矩阵F1;将索引矩阵I2的每一行的元素加上所在行的行号得到位置坐标矩阵F2;将位置坐标矩阵F1的每一行按照索引矩阵I2的每一行进行交换得到位置索引坐标矩阵S1,将位置坐标矩阵F2的每一列按照索引矩阵I1的每一列进行交换得到位置索引坐标矩阵S2。Preferably, the method of performing a series of processing on the chaotic sequence U to obtain the position index coordinate matrix S1 and the position index coordinate matrix S2 is: arranging each column of the chaos matrix U1 to obtain the index matrix I1 , and converting the matrix U into Arrange each row of1 to obtain the index matrix I2 ; add the column number of each column of the index matrix I1 to the column number of the column to obtain the position coordinate matrix F1 ; add the elements of each row of the index matrix I2 to the column number of the row The row number is used to obtain the position coordinate matrix F2 ; exchange each row of the position coordinate matrix F1 according to each row of the index matrix I2 to obtain the position index coordinate matrix S1 , and exchange each column of the position coordinate matrix F2 according to the index matrix I1 Each column of is exchanged to obtain the position index coordinate matrix S2 .
优选地,所述排列为升序排列;将矩阵P5中的每个字符作为十六进制的高位字符,将矩阵P6中的每个字符作为十六进制的低位字符,恢复成一个十六进制的字符矩阵P7。Preferably, the arrangement is in ascending order; each character in matrix P5 is regarded as a high-order character of hexadecimal, and each character in matrix P6 is regarded as a low-order character of hexadecimal, and restored to a ten Hexadecimal character matrix P7 .
优选地,所述扩散的运算方法包括逻辑运算的异或运算以及初等运算中的加法、减法。Preferably, the diffusion operation method includes exclusive OR operation of logical operation and addition and subtraction in elementary operation.
优选地,所述扩散运算的实现方法为:将图像矩阵P8转换为一维数组P9,利用生成的混沌序列T的元素值选取不同的公式进行扩散:Preferably, the diffusion operation is implemented by: converting the image matrix P8 into a one-dimensional array P9 , and using the element values of the generated chaotic sequence T to select different formulas for diffusion:
其中,给定C1(0)=0,P9(i)为一维数组P9中的第i个元素,V(i)为混沌序列V的第i个元素,C1(i)为扩散后的序列的第i个元素;最后将序列C1转化为矩阵为密文图像C。Among them, given C1(0)=0, P9 (i) is the i-th element in the one-dimensional array P9 , V(i) is the i-th element of the chaotic sequence V, and C1(i) is the after-diffusion The i-th element of the sequence; finally, the sequence C1 is converted into a matrix into a ciphertext image C.
与现有技术相比,本发明的有益效果:使用哈希函数SHA-512和明文图像的信息生成混沌初始密钥,并利用改进的4D混沌系统产生的混沌序列对明文图像进行奇偶置乱,利用混沌矩阵中元素的奇偶性以及明文图像行列的奇偶性来进行置乱,可以充分的打破相邻像素的相关性;然后将置乱后的图像转换为十六进制字符矩阵,按其高低位字符分别划为两个平面,根据混沌序列生成两个位置索引矩阵,分别对这两个平面进行索引置乱,将置乱后的两个平面恢复为十六进制字符矩阵,进一步恢复成图像矩阵形式;位平面置乱分别在十六进制的高位字符和低位字符进行,不仅能够彻底改变像素的位置,也能充分修改像素的值,可以达到同步置乱的效果;最后,结合混沌序列选择不同的组合运算扩散公式,对置乱后的图像进行扩散,得到加密图像,可以进一步增强图像加密的安全性。仿真实验和安全性评价表明,本发明能够有效地对灰色图像进行加密,并具有良好的抗各种攻击的安全性。Compared with the existing technology, the beneficial effects of the present invention are: using the hash function SHA-512 and the information of the plaintext image to generate a chaotic initial key, and using the chaotic sequence generated by the improved 4D chaotic system to perform odd-even scrambling of the plaintext image, Using the parity of the elements in the chaos matrix and the parity of the plain text image rows to perform scrambling can fully break the correlation of adjacent pixels; then convert the scrambled image into a hexadecimal character matrix, according to its height The bit characters are divided into two planes respectively, and two position index matrices are generated according to the chaotic sequence. The two planes are index scrambled respectively. The scrambled two planes are restored to hexadecimal character matrices, and further restored to Image matrix form; bit plane scrambling is performed on high-order characters and low-order characters of hexadecimal, which can not only completely change the position of the pixel, but also fully modify the value of the pixel, achieving the effect of synchronous scrambling; finally, combined with chaos The sequence selects different combination operation diffusion formulas to diffuse the scrambled image to obtain an encrypted image, which can further enhance the security of image encryption. Simulation experiments and security evaluation show that the present invention can effectively encrypt gray images and has good security against various attacks.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1为本发明的流程图。Figure 1 is a flow chart of the present invention.
图2为本发明的4D混沌系统的相图,其中,(a)为x-y相,(b)为x-z相,(c)为x-w相,(d)为y-w相,(e)为x-y-z相,(f)为y-z-w相。Figure 2 is a phase diagram of the 4D chaotic system of the present invention, in which (a) is the x-y phase, (b) is the x-z phase, (c) is the x-w phase, (d) is the y-w phase, and (e) is the x-y-z phase. (f) is the y-z-w phase.
图3为本发明的4D混沌系统的确定参数LE图。Figure 3 is a determined parameter LE diagram of the 4D chaotic system of the present invention.
图4为混沌系统的分岔图对比,其中,(a)为4D混沌系统参数a、c、d固定b可变,(b)为4D混沌系统参数a、b、c固定d可变,(c)为Chen混沌系统参数a、b固定c可变,(d)为Chen混沌系统参数a、c固定b可变。Figure 4 is a comparison of bifurcation diagrams of chaotic systems, where (a) is the 4D chaotic system parameters a, c, d fixed and b variable, (b) is the 4D chaotic system parameters a, b, c fixed d variable, ( c) is the Chen chaotic system parameters a, b fixed and c variable, (d) is the Chen chaotic system parameters a, c fixed b variable.
图5为混沌系统的李雅普诺夫指数图对比,其中,(a)为4D混沌系统参数a、c、d固定b可变,(b)为4D混沌系统参数a、b、c固定d可变,(c)为Chen混沌系统参数a、b固定c可变,(d)为Chen混沌系统参数a、c固定b可变。Figure 5 is a comparison of Lyapunov exponent diagrams of chaotic systems, in which (a) is the 4D chaotic system parameters a, c, d fixed and b variable, (b) is the 4D chaotic system parameters a, b, c fixed d variable , (c) is the Chen chaotic system parameters a and b are fixed and c is variable, (d) is the Chen chaotic system parameters a and c are fixed and b is variable.
图6为本发明的双参数的最大李雅普诺夫指数图,其中,(a)为二维,(b)为三维。Figure 6 is a diagram of the maximum Lyapunov exponent of the two parameters of the present invention, in which (a) is two-dimensional and (b) is three-dimensional.
图7为本发明的4D混沌系统初值灵敏性分析图,其中,(a)为x0+10-14,(b)为y0+10-14,(c)为z0+10-14,(d)为w0+10-14。Figure 7 is an initial value sensitivity analysis diagram of the 4D chaotic system of the present invention, in which (a) is x0 +10-14 , (b) is y0 +10-14 , and (c) is z0 +10-14 , (d) is w0 +10-14 .
图8为本发明奇偶置乱的示意图。Figure 8 is a schematic diagram of parity scrambling according to the present invention.
图9为本发明位置索引坐标矩阵生成的示意图。Figure 9 is a schematic diagram of position index coordinate matrix generation according to the present invention.
图10为本发明十六进制位平面置乱的示意图。Figure 10 is a schematic diagram of hexadecimal bit plane scrambling according to the present invention.
图11为本发明的仿真结果图,其中,(a)为Cameraman明文图像,(b)为Cameraman密文图像,(c)为Cameraman解密图像,(d)为Lena明文图像,(e)为Lena密文图像,(f)为Lena解密图像,(g)为House明文图像,(h)为House密文图像,(i)为House解密图像,(j)为Peppers明文图像,(k)为Peppers密文图像,(l)为Peppers解密图像,(m)为Barbara明文图像,(n)为Barbara密文图像,(o)为Barbara解密图像。Figure 11 is a simulation result diagram of the present invention, in which (a) is the Cameraman plaintext image, (b) is the Cameraman ciphertext image, (c) is the Cameraman decrypted image, (d) is the Lena plaintext image, and (e) is the Lena Ciphertext image, (f) is Lena decrypted image, (g) is House plaintext image, (h) is House ciphertext image, (i) is House decrypted image, (j) is Peppers plaintext image, (k) is Peppers Ciphertext image, (l) is Peppers decrypted image, (m) is Barbara plaintext image, (n) is Barbara ciphertext image, (o) is Barbara decrypted image.
图12为本发明的密钥灵敏性测试结果,其中,(a)为Cameraman明文图像,(b)为正确密钥加密,(c)为e(1)+10-14解密,(d)为e(2)+10-14解密,(e)为e(3)+10-14解密,(f)为e(4)+10-14解密。Figure 12 shows the key sensitivity test results of the present invention, where (a) is the Cameraman plaintext image, (b) is the correct key encryption, (c) is e(1)+10-14 decryption, and (d) is e(2)+10-14 decrypts, (e) decrypts e(3)+10-14 , (f) decrypts e(4)+10-14 .
图13为本发明明文图像直方图和密文图像直方图,其中,(a)为Cameraman明文图像,(b)为Cameraman密文图像,(c)为Lena明文图像,(d)为Lena密文图像,(e)为House明文图像,(f)为House密文图像,(g)为Peppers明文图像,(h)为Peppers密文图像,(i)为Barbara明文图像,(j)为Barbara密文图像。Figure 13 is a plaintext image histogram and a ciphertext image histogram of the present invention, where (a) is a Cameraman plaintext image, (b) is a Cameraman ciphertext image, (c) is a Lena plaintext image, and (d) is a Lena ciphertext image. Image, (e) is the House plaintext image, (f) is the House ciphertext image, (g) is the Peppers plaintext image, (h) is the Peppers ciphertext image, (i) is the Barbara plaintext image, (j) is the Barbara ciphertext image text image.
图14为本发明Cameraman图像在各个方向上的相邻像素统计图,其中,(a)为明文水平方向,(b)为密文水平方向,(c)为明文垂直方向,(d)为密文垂直方向,(e)为明文对角线方向,(f)为密文对角线方向。Figure 14 is a statistical diagram of adjacent pixels in various directions of the Cameraman image of the present invention, in which (a) is the horizontal direction of plain text, (b) is the horizontal direction of cipher text, (c) is the vertical direction of plain text, and (d) is the cipher text direction. The vertical direction of the text, (e) is the diagonal direction of the plain text, (f) is the diagonal direction of the cipher text.
图15为本发明经过不同程度噪声攻击的密文图像和解密图像,其中,(a)为0.01强度密文图像,(b)为0.05强度密文图像,(c)为0.1强度密文图像,(d)为0.01强度解密图像,(e)为0.05强度解密图像,(f)为0.1强度解密图像。Figure 15 shows the ciphertext image and decrypted image after different levels of noise attacks according to the present invention, where (a) is a 0.01 strength ciphertext image, (b) is a 0.05 strength ciphertext image, (c) is a 0.1 strength ciphertext image, (d) is the decrypted image with 0.01 intensity, (e) is the decrypted image with 0.05 intensity, and (f) is the decrypted image with 0.1 intensity.
图16为本发明不同裁剪攻击的密文图像和解密图像,其中,(a)为1/16裁剪密文图像,(b)为1/4裁剪密文图像,(c)为1/2裁剪密文图像,(d)为1/16裁剪解密图像,(e)为1/4裁剪解密图像,(f)为1/2裁剪解密图像。Figure 16 shows the ciphertext image and decrypted image of different cropping attacks of the present invention, where (a) is a 1/16 cropped ciphertext image, (b) is a 1/4 cropped ciphertext image, and (c) is a 1/2 cropped image. Ciphertext image, (d) is a 1/16 cropped decrypted image, (e) is a 1/4 cropped decrypted image, (f) is a 1/2 cropped decrypted image.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有付出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without exerting creative efforts fall within the scope of protection of the present invention.
如图1所示,一种基于4D混沌系统的图像加密方法,针对低维混沌系统存在的不足,本发明基于三维Chen混沌系统构造了一个4D混沌系统,相比于Chen混沌系统,该4D混沌系统具有更好的混沌特性。基于改进的混沌系统,本发明提出了一种新的加密算法,包含奇偶置乱、十六进制位平面置乱以及选择组合运算扩散。在奇偶置乱阶段,利用混沌矩阵中元素的奇偶性以及明文图像行列的奇偶性来进行置乱,可以充分的打破相邻像素的相关性。与传统的位平面置乱不同,十六进制位平面置乱是分别在十六进制的高位字符和低位字符进行,不仅能够彻底改变像素的位置,也能充分修改像素的值,可以达到同步置乱的效果。本发明又用选择组合运算扩散的方式来修改像素值,因为其扩散公式是根据混沌序列随机选取的,所以可以进一步增强图像加密的安全性。通过密钥空间分析、密钥敏感性分析、直方图分析、方差测试等实验测试和分析证明了本发明技术方案的有效性和安全性。As shown in Figure 1, an image encryption method based on a 4D chaotic system. In view of the shortcomings of the low-dimensional chaotic system, the present invention constructs a 4D chaotic system based on the three-dimensional Chen chaotic system. Compared with the Chen chaotic system, the 4D chaotic system has The system has better chaotic properties. Based on the improved chaotic system, the present invention proposes a new encryption algorithm, including parity and even scrambling, hexadecimal bit plane scrambling and selective combination operation diffusion. In the parity scrambling stage, the parity of the elements in the chaos matrix and the parity of the plaintext image rows are used for scrambling, which can fully break the correlation of adjacent pixels. Different from traditional bit plane scrambling, hexadecimal bit plane scrambling is performed on the high-order characters and low-order characters of the hexadecimal system. It can not only completely change the position of the pixel, but also fully modify the value of the pixel, which can achieve The effect of synchronized scrambling. The present invention also uses selective combination operation diffusion to modify pixel values. Because its diffusion formula is randomly selected based on the chaotic sequence, it can further enhance the security of image encryption. The effectiveness and security of the technical solution of the present invention are proved through experimental tests and analyzes such as key space analysis, key sensitivity analysis, histogram analysis, and variance testing.
本发明首先在Chen混沌系统的基础上引入新的状态变量,构造了一个改进的4D混沌系统,并通过相位图、分岔图、李亚普诺夫指数谱、NIST测试等方法验证其混沌行为。The present invention first introduces new state variables based on Chen's chaotic system, constructs an improved 4D chaotic system, and verifies its chaotic behavior through phase diagrams, bifurcation diagrams, Lyapunov index spectra, NIST tests and other methods.
混沌系统是一类非线性动力系统,其行为复杂而难以预测。Chen混沌系统是一个经典的混沌系统,其表达式如公式(1)所示:Chaotic systems are a type of nonlinear dynamic systems whose behavior is complex and difficult to predict. Chen chaotic system is a classic chaotic system, and its expression is as shown in formula (1):
其中,a、b和c是参数,当a=35、b=3、c=28时,Chen混沌系统出现混沌状态。为了增强其混沌的特性,本发明在经典的Chen混沌系统的基础上引入新的状态变量,并将其耦合到Chen混沌系统的第一维、第二维和第三维上,构造了一个新的4D混沌系统,表达式如公式(2)所示:Among them, a, b and c are parameters. When a=35, b=3, c=28, the Chen chaotic system appears in a chaotic state. In order to enhance its chaotic characteristics, the present invention introduces new state variables based on the classic Chen chaotic system and couples them to the first, second and third dimensions of the Chen chaotic system to construct a new 4D chaotic system, the expression is as shown in formula (2):
其中,a、b、c、d为系统参数,x、y、z、w均为状态变量,分别为状态变量x、y、z、w的导数。混沌性能好的混沌系统通常具有复杂的吸引子,在相图中占据较大的面积。设置参数a=36、b=-16、c=28、d=-3,初值x0=1、y0=0.1、z0=0.1、w0=1,得到的相图如图2所示,得到的李雅普诺夫指数(LE)图如图3所示,由图3可知LE1=1.993、LE2=0.000484、LE3=-0.2849、LE4=-12.71,并且它们相加之和小于0,所以本发明改进的4D混沌系统是超混沌的。Among them, a, b, c, d are system parameters, x, y, z, w are all state variables. are the derivatives of state variables x, y, z, and w respectively. Chaotic systems with good chaotic performance usually have complex attractors that occupy a larger area in the phase diagram. Set parameters a=36, b=-16, c=28, d=-3, initial values x0 =1, y0 =0.1, z0 =0.1, w0 =1, and the obtained phase diagram is shown in Figure 2 shown, the obtained Lyapunov exponent (LE) graph is shown in Figure 3. From Figure 3, it can be seen that LE1 =1.993, LE2 =0.000484, LE3 =-0.2849, LE4 =-12.71, and the sum of them is is less than 0, so the improved 4D chaotic system of the present invention is super chaotic.
混沌系统的动力学行为可以通过分岔图来评估,分岔图显示了系统的运动状态随系统参数的变化,通过分岔图可以直接观察到系统的演化过程。本发明先对改进的4D混沌系统的分岔图进行了分析,如图4的(a)和4的(b)所示。图4的(a)是使用初始条件为x0=1、y0=0.1、z0=0.1、w0=1,参数为a=36、c=28、d=-3、b∈(-20,0)的分岔图,从图4的(a)可以看出,当b∈(-20,-9.36)时,4D混沌系统表现出超混沌行为,当b∈(-9.36,-3.51)时,4D混沌系统处于混沌状态,当b∈(-3.51,0)时4D混沌系统再次进入超混沌状态。图4的(b)的初始条件不变,参数为a=36,b=-16,c=28,d∈(-10,0)的分岔图,从图4的(b)可以看出,当系统参数d在[-10,-4.92]范围内时,4D混沌系统产生混沌吸引子,当系统参数d在[-4.92,0]范围内时,4D混沌系统进入超混沌状态。然后又对三维Chen混沌系统的分岔图进行了分析,如图4的(c)和4的(d)所示。图4的(c)是使用初始条件为x0=1、y0=0.1、z0=0.1,参数为a=35、b=3、c∈(20,30)的分岔图。图4的(d)的初始条件不变,参数为a=35、c=28、b∈(0,4)的分岔图,可以看出本发明所构建的4D混沌系统相对于三维Chen混沌系统表现出更好的混沌效果。The dynamic behavior of a chaotic system can be evaluated through bifurcation diagrams, which show the changes in the motion state of the system with system parameters. The evolution process of the system can be directly observed through bifurcation diagrams. The present invention first analyzes the bifurcation diagram of the improved 4D chaotic system, as shown in Figure 4 (a) and 4 (b). (a) of Figure 4 uses the initial conditions of x0 =1, y0 =0.1, z0 =0.1, w0 =1, and the parameters are a = 36, c = 28, d = -3, b∈(- 20, 0) bifurcation diagram, as can be seen from Figure 4 (a), when b∈(-20,-9.36), the 4D chaotic system exhibits super-chaotic behavior, when b∈(-9.36,-3.51 ), the 4D chaotic system is in a chaotic state, and when b∈(-3.51, 0), the 4D chaotic system enters a hyperchaotic state again. The initial conditions of Figure 4(b) remain unchanged, the parameters are a=36, b=-16, c=28, d∈(-10,0). It can be seen from Figure 4(b) that the bifurcation diagram , when the system parameter d is in the range of [-10, -4.92], the 4D chaotic system generates a chaotic attractor. When the system parameter d is in the range of [-4.92, 0], the 4D chaotic system enters a hyperchaotic state. Then the bifurcation diagram of the three-dimensional Chen chaotic system was analyzed, as shown in Figure 4 (c) and 4 (d). (c) of Figure 4 is a bifurcation diagram using the initial conditions of x0 =1, y0 =0.1, z0 =0.1, and the parameters of a = 35, b = 3, c∈(20,30). The initial conditions of (d) in Figure 4 remain unchanged, and the parameters are a=35, c=28, and b∈(0, 4). It can be seen that the 4D chaotic system constructed by the present invention is better than the three-dimensional Chen chaos. The system exhibits better chaos effects.
李亚普诺夫指数是用来识别动态系统混沌特性的关键特征之一。对于高阶动态系统,由于初始分离矢量的方向不同,会存在多个李雅普诺夫指数。本发明构建的系统是一个4D混沌系统,因此具有四个李亚普诺夫指数。当4D混沌系统的李亚普诺夫指数是四个负数,表明4D混沌系统处于一个不动点状态。当4D混沌系统处于周期轨道上时,会有一个负的李雅普诺夫指数和一个零的指数。而当4D混沌系统处于混沌轨道上时,4D混沌系统的李亚普诺夫指数分别是一个正的和三个负的。当4D混沌系统处于超混沌状态时,4D混沌系统的李亚普诺夫指数至少有两个正数或者更多。与一般的混沌系统相比,超混沌系统通常具有更复杂和丰富的动态行为,这增强了系统的随机性和不可预测性。Lyapunov exponent is one of the key features used to identify the chaotic characteristics of dynamic systems. For high-order dynamic systems, there will be multiple Lyapunov exponents due to different directions of the initial separation vectors. The system constructed by this invention is a 4D chaotic system, so it has four Lyapunov exponents. When the Lyapunov exponent of the 4D chaotic system is four negative numbers, it indicates that the 4D chaotic system is in a fixed point state. When a 4D chaotic system is in a periodic orbit, there will be a negative Lyapunov exponent and an exponent of zero. When the 4D chaotic system is on a chaotic orbit, the Lyapunov exponents of the 4D chaotic system are one positive and three negative respectively. When the 4D chaotic system is in a hyperchaotic state, the Lyapunov exponent of the 4D chaotic system has at least two positive numbers or more. Compared with general chaotic systems, hyperchaotic systems usually have more complex and rich dynamic behaviors, which enhances the randomness and unpredictability of the system.
在本发明构建的4D混沌系统中,当初始条件为x0=1、y0=0.1、z0=0.1、w0=1,系统参数为a=36、c=28、d=-3、b∈(-20,0)时,李雅普诺夫指数谱如图5的(a)所示,可以看出当系统参数b∈(-20,-9.36)∪(-3.51,0)时,具有两个正的李雅普诺夫指数,4D混沌系统处于超混沌状态,当系统参数b∈(-9.36,-3.51)时,具有一个正的李雅普诺夫指数,4D混沌系统处于混沌状态。图5的(b)显示了初值不变,系统参数a=36、b=-16、c=28、d∈(-10,0)时的李亚普诺夫指数谱,可以看出,当系统参数d在[-10,-4.92]范围内时,有一个正的李雅普诺夫指数,4D混沌系统处于混沌轨道上。当系统参数d∈(-4.92,0)时,4D混沌系统具有两个正的李雅普诺夫指数,4D混沌系统进入超混沌状态。在三维Chen混沌系统中,当初始条件为x0=1、y0=0.1、z0=0.1,参数为a=35、b=3、c∈(20,30)时的李雅普诺夫指数谱如图5的(c)所示。图4的(d)显示了初始条件不变,参数为a=35、c=28、b∈(0,4)时的李亚普诺夫指数谱,可以看出本发明改进的4D混沌系统的混沌范围比三维Chen混沌系统的混沌范围要大,并且其最大李雅普诺夫指数比三维Chen混沌系统的要大。综上所述,本发明改进的4D混沌系统相对于三维Chen混沌系统表现出更好的混沌效果。In the 4D chaotic system constructed by the present invention, when the initial conditions are x0 =1, y0 =0.1, z0 =0.1, w0 =1, the system parameters are a = 36, c = 28, d = -3, When b∈(-20,0), the Lyapunov exponent spectrum is shown in (a) of Figure 5. It can be seen that when the system parameter b∈(-20,-9.36)∪(-3.51,0), it has With two positive Lyapunov exponents, the 4D chaotic system is in a hyperchaotic state. When the system parameter b∈(-9.36, -3.51), there is a positive Lyapunov exponent, and the 4D chaotic system is in a chaotic state. (b) of Figure 5 shows the Lyapunov index spectrum when the initial value remains unchanged and the system parameters a=36, b=-16, c=28, d∈(-10,0). It can be seen that when the system When the parameter d is in the range of [-10, -4.92], there is a positive Lyapunov exponent, and the 4D chaotic system is on a chaotic orbit. When the system parameter d∈(-4.92,0), the 4D chaotic system has two positive Lyapunov exponents, and the 4D chaotic system enters a hyperchaotic state. In the three-dimensional Chen chaotic system, when the initial conditions are x0 =1, y0 =0.1, z0 =0.1, the parameters are a=35, b=3, c∈(20,30), the Lyapunov index spectrum As shown in (c) of Figure 5. (d) of Figure 4 shows the Lyapunov index spectrum when the initial conditions are unchanged and the parameters are a=35, c=28, b∈(0, 4). It can be seen that the chaos of the improved 4D chaotic system of the present invention is The range is larger than that of the three-dimensional Chen chaotic system, and its maximum Lyapunov exponent is larger than that of the three-dimensional Chen chaotic system. To sum up, the improved 4D chaotic system of the present invention exhibits better chaotic effects than the three-dimensional Chen chaotic system.
混沌系统由于其复杂的特性,对系统参数具有很好的响应特性,参数的任何微小变化都可能直接改变混沌系统的混沌状态。系统的动力学可以用最大李雅普诺夫指数图很明显地看出。当初始条件为x0=1、y0=0.1、z0=0.1、w0=1,系统参数为a=36,c=28,b∈(-20,0),d∈(-5,0)时,其二维的双参数李雅普诺夫指数图如图6的(a)所示,双参数的三维可视化图如图6的(b)所示,其中色调代表了其李雅普诺夫指数的大小,其暖色调越深数值越大,暗色调越深数值越小。由图6可知本发明改进的4D混沌系统有较大的混沌范围。Due to its complex characteristics, chaotic systems have good response characteristics to system parameters. Any small changes in parameters may directly change the chaotic state of the chaotic system. The dynamics of the system can be clearly seen using the maximum Lyapunov exponent plot. When the initial conditions are x0 =1, y0 =0.1, z0 =0.1, w0 =1, the system parameters are a=36, c=28, b∈(-20,0), d∈(-5, 0), its two-dimensional two-parameter Lyapunov exponent is shown in Figure 6(a), and its two-parameter three-dimensional visualization is shown in Figure 6(b), where the hue represents its Lyapunov exponent. The size of the value, the darker the warm tones, the larger the value, and the darker the dark tones, the smaller the value. It can be seen from Figure 6 that the improved 4D chaotic system of the present invention has a larger chaotic range.
一个性能良好的混沌系统对其初始值非常敏感,初始值的微小差异可以产生一个完全不同的混沌轨迹。本发明为了分析改进的4D混沌系统的初始灵敏度,分别让每个初始值变化10-14,实验结果如图7所示。据观察,本发明所改进的4D混沌系统对初始值具有很大的敏感性。A well-performing chaotic system is very sensitive to its initial values, and small differences in initial values can produce a completely different chaotic trajectory. In order to analyze the initial sensitivity of the improved 4D chaotic system, the present invention changes each initial value by 10-14 respectively. The experimental results are shown in Figure 7. It is observed that the 4D chaotic system improved by the present invention has great sensitivity to the initial value.
NIST测试包括15个测试,可以用来估计一个二进制序列的随机性。每个检验给出一个显著性水平α(α=0.01),然后得到概率值(P值)。如果是P值≥α,则该二进制序列是随机的。如果P值<α,则该二进制序列是非随机的。对于理想的加密算法,P值应大于α。表1列出了使用混沌系统生成的混沌序列的NIST测试结果。The NIST test consists of 15 tests that can be used to estimate the randomness of a binary sequence. Each test is given a significance level α (α = 0.01), and then a probability value (P value) is obtained. If the P value ≥α, then the binary sequence is random. If the P value <α, then the binary sequence is non-random. For an ideal encryption algorithm, the P value should be greater than α. Table 1 lists the NIST test results of chaotic sequences generated using chaotic systems.
表1 NIST测试结果Table 1 NIST test results
从表1可以看出所有测试项目均通过NIST测试,说明本发明改进的4D混沌系统生成的混沌序列随机性很强。It can be seen from Table 1 that all test items passed the NIST test, indicating that the chaotic sequence generated by the improved 4D chaotic system of the present invention is highly random.
在混沌系统中,平衡点通常被定义为系统状态保持不变的点或轨迹。形式上,对于一个动力学系统,平衡点可以表示为状态向量x的某个值x*,其满足以下条件:f(x*)=0,其中f(x)表示混沌系统的演化函数或迭代方程。也就是说,当系统处于平衡点x*时,系统的状态将保持不变,不再发生任何变化。In chaotic systems, the equilibrium point is usually defined as the point or trajectory where the state of the system remains unchanged. Formally, for a dynamic system, the equilibrium point can be expressed as a certain value x* of the state vector x, which satisfies the following conditions: f(x* )=0, where f(x) represents the evolution function or iteration of the chaotic system equation. That is to say, when the system is at the equilibrium point x* , the state of the system will remain unchanged and no more changes will occur.
通过求解可以得到4D混沌系统的3个平衡点,分别为:Through solving, we can get three equilibrium points of the 4D chaotic system, which are:
E1(0,0,0,0)、E2(-23.1930,-65.8602,-2.8397,-1536)、E3(-0.2070,-0.3498,-1.6903,-5.1434)。4D混沌系统的雅可比矩阵J如公式(3)所示:E1 (0, 0, 0, 0), E2 (-23.1930, -65.8602, -2.8397, -1536), E3 (-0.2070, -0.3498, -1.6903, -5.1434). The Jacobian matrix J of the 4D chaotic system is shown in formula (3):
其中,系统参数a=36,b=-16,c=28,d=-3,将3个平衡点分别代入雅可比矩阵,求其特征根如公式(4)所示:Among them, the system parameters a=36, b=-16, c=28, d=-3, substitute the three equilibrium points into the Jacobian matrix respectively, and find their characteristic roots as shown in formula (4):
由公式(4)可以看出,3个平衡点对应的特征根实数部分并不都是负的,因此3个平衡点都是不稳定平衡点,这意味着本发明的改进的4D混沌系统对初始条件的微小改变非常敏感,有很好的敏感性和响应性,并且该系统的行为有高度的不确定性,所以能够产生高度复杂和难以预测的序列。改进的4D混沌系统的散度为:It can be seen from formula (4) that the real parts of the characteristic roots corresponding to the three equilibrium points are not all negative, so the three equilibrium points are all unstable equilibrium points, which means that the improved 4D chaotic system of the present invention has It is very sensitive to small changes in initial conditions, has good sensitivity and responsiveness, and the behavior of the system is highly uncertain, so it can produce highly complex and unpredictable sequences. The divergence of the improved 4D chaotic system is:
这里a=36,c=28,d=-3,所以因此本发明所改进的4D混沌系统是耗散的。Here a=36, c=28, d=-3, so Therefore, the 4D chaotic system improved by the present invention is dissipative.
本发明基于改进的4D混沌系统提出了一种高度安全的图像加密方法,如图1所示,加密过程主要分为密钥的产生、奇偶置乱、十六进制位平面置乱和选择组合运算扩散四部分。给定一个大小为M×N的明文图像P,加密的详细步骤如下:输入包括明文图像P,初始参数a、b、c、d。输出为密文图像C。The present invention proposes a highly secure image encryption method based on an improved 4D chaotic system. As shown in Figure 1, the encryption process is mainly divided into key generation, parity scrambling, hexadecimal bit plane scrambling and selection combination. Four parts of operational diffusion. Given a plaintext image P of size M×N, the detailed steps of encryption are as follows: The input includes the plaintext image P and initial parameters a, b, c, d. The output is a ciphertext image C.
步骤一:初始值的生成:采用SHA-512算法计算大小为M×N的明文图像P的哈希值H,通过外部密钥和哈希值H计算得到混沌系统的初始化参数x0、y0、z0、w0。Step 1: Generation of initial value: Use the SHA-512 algorithm to calculate the hash value H of the plaintext image P of size M×N, and calculate the initialization parameters x0 and y0 of the chaotic system through the external key and hash value H. , z0 , w0 .
首先将明文图像P输入SHA-512算法中,输出512位二进制哈希值H。将哈希值H等分为64组二进制序列,每组8位,即Hk=k1,k2,k3,…,k64。为了增加密钥空间,本发明又加入了4个外部密钥,分别为e(1)、e(2)、e(3)、e(4),将这64组二进制序列k1,k2,k3,…,k64和4个外部密钥代入公式(6)和(7)计算出混沌系统的初始值x0、y0、z0、w0。First, the plaintext image P is input into the SHA-512 algorithm, and a 512-bit binary hash value H is output. The hash value H is equally divided into 64 groups of binary sequences, each group is 8 bits, that is, Hk = k1 , k2 , k3 ,..., k64 . In order to increase the key space, the present invention adds 4 external keys, namely e(1), e(2), e(3), and e(4). These 64 sets of binary sequences k1 , k2 , k3 ,..., k64 and 4 external keys are substituted into formulas (6) and (7) to calculate the initial values x0 , y0 , z0 , w0 of the chaotic system.
其中,为异或运算,Q1-Q8为计算的中间变量,mod为求模函数。in, is the XOR operation, Q1 -Q8 are the intermediate variables for calculation, and mod is the modular function.
步骤二:把初始值x0、y0、z0、w0代入4D混沌系统迭代M×N次,得到四个混沌序列X′、Y′、Z′、W′,按照公式(8)和(9)进行数据处理获得三个混沌序列U、V、T。Step 2: Substitute the initial values x0 , y0 , z0 , and w0 into the 4D chaotic system and iterate M×N times to obtain four chaotic sequences X′, Y′, Z′, and W′. According to formula (8) and (9) Perform data processing to obtain three chaotic sequences U, V, and T.
把初始值x0、y0、z0、w0代入4D混沌系统迭代1000次,以消除暂态效应。继续迭代M×N次,得到四个混沌序列:X′=[x′1,x′2,x′3,…x′M×N]、Y′=[y′1,y′2,y′3,…y′M×N]、Z′=[z′1,z′2,z′3,…z′M×N]、W′=[w′1,w′2,w′3,…w′M×N],然后对这四个混沌序列X′、Y′、Z′、W′按公式(8)进行处理,使其取值范围在0~256之间,得到四个新的整数混沌序列X、Y、Z、W;为增加其随机性,再对这四个混沌序列X、Y、Z、W按公式(9)进行异或运算,得到加密所用的三个混沌序列U、V、T,其中混沌序列U用于置乱部分,混沌序列V、T用于扩散部分。Substitute the initial values x0 , y0 , z0 , and w0 into the 4D chaotic system and iterate 1000 times to eliminate transient effects. Continue to iterate M×N times and obtain four chaotic sequences: X′=[x′1, x′2 , x′3 ,... ′3 ,…y′M×N ], Z′=[z′1 , z′2 , z′3 ,…z′M×N ], W′=[w′1 , w′2 , w′3 ,...w′M×N ], and then process these four chaotic sequences X′, Y′, Z′, W′ according to formula (8) so that their values range from 0 to 256, and four New integer chaotic sequences X, Y, Z, and W; in order to increase their randomness, XOR operations are performed on these four chaotic sequences Sequences U, V, T, where the chaotic sequence U is used for the scrambling part, and the chaotic sequences V and T are used for the diffusion part.
步骤三:对混沌序列U进行一系列处理得到两个索引序列T1和T2,根据这两个索引序列对明文图像P进行奇偶置乱得到图像矩阵P1。Step 3: Perform a series of processing on the chaotic sequence U to obtain two index sequences T1 and T2 . Based on these two index sequences, perform odd-even scrambling on the plaintext image P to obtain the image matrix P1 .
为了打破明文图像P中相邻像素之间强相关性,本发明提出了一种奇偶置乱的方法。首先,将生成的混沌序列U重塑成和明文图像P大小一致的矩阵U1,对矩阵U1的每一行进行分析,如果是奇数行,则将记录该行中的奇数数量,如果是偶数行,则记录该行中的偶数数量,得到一个长度为M的序列T1,如图7所示;接着对矩阵U1的每一列进行分析,如果是奇数列,则记录该列中的奇数数量,如果是偶数列,则记录该列中的偶数数量,得到一个长度为N的序列T2。其次,根据序列T1进行奇偶行循环移位置乱,对于明文图像P的奇数行则向左循环移位,对于明文图像P的偶数行则向右循环移位,移动的位数为序列T1中所对应的数。最后,根据序列T2进行奇偶列循环移位置乱,对于奇偶行循环移位置乱后的图像的奇数列则向上循环移位、偶数列则向下循环移位,移动的位数为序列T2中所对应的数,有效地打破了明文图像中相邻像素之间强相关性。In order to break the strong correlation between adjacent pixels in the plaintext image P, the present invention proposes a parity scrambling method. First, reshape the generated chaotic sequence U into a matrix U1 with the same size as the plaintext image P. Analyze each row of the matrix U1. If it is an odd number of rows, the odd number in the row will be recorded. If it is an even number, row, record the number of even numbers in the row, and obtain a sequence T1 of length M, as shown in Figure 7; then analyze each column of the matrix U1 , and if it is an odd number column, record the odd number in the column Quantity, if it is an even column, record the even number in the column to obtain a sequence T2 of length N. Secondly, the odd and even rows are cyclically shifted according to the sequence T1. For the odd rows of the plaintext image P, they are cyclically shifted to the left. For the even rows of the plaintext image P, they are cyclically shifted to the right. The number of bits moved is the sequence T1 the corresponding number in . Finally, the odd and even columns are cyclically shifted and scrambled according to the sequence T2. For the odd and even rows of the cyclically shifted and scrambled image, the odd columns are cyclically shifted upwards and the even columns are cyclically shifted downwards. The number of shifted bits is the sequence T2 The number corresponding to effectively breaks the strong correlation between adjacent pixels in the plaintext image.
步骤四:将奇偶置乱得到的图像矩阵P1转换为十六进制得到矩阵P2,将其中只有一个字符的高位补零,然后按其高位、低位划分为两个平面P3和P4;对混沌序列U进行一系列处理得到位置索引坐标矩阵S1和位置索引坐标矩阵S2,将平面P3和平面P4分别根据位置索引坐标矩阵S1和位置索引坐标矩阵S2进行索引置乱,分别得到矩阵P5和矩阵P6。将矩阵P5和矩阵P6中的字符分别作为十六进制的高位和低位,恢复为一个十六进制字符矩阵P7,并且转换为十进制得到图像矩阵P8。Step 4: Convert the image matrix P1 obtained by odd-even scrambling into hexadecimal to obtain the matrix P2 , fill in the high bits with only one character with zeros, and then divide the high and low bits into two planes P3 and P4 ; Perform a series of processing on the chaotic sequence U to obtain the position index coordinate matrix S1 and the position index coordinate matrix S2 , and index the plane P3 and the plane P4 according to the position index coordinate matrix S1 and the position index coordinate matrix S2 respectively. chaos, and obtain the matrix P5 and the matrix P6 respectively. The characters in matrix P5 and matrix P6 are used as the high and low bits of hexadecimal respectively, restored to a hexadecimal character matrix P7 , and converted to decimal to obtain the image matrix P8 .
为增强加密图像的安全性,本发明提出了一种十六进制位平面置乱的方法,不仅能够改变像素的位置,而且也能改变像素值的大小,实现了比特级置乱。如图8和图9所示,具体步骤如下所述:In order to enhance the security of encrypted images, the present invention proposes a method of hexadecimal bit plane scrambling, which can not only change the position of pixels, but also change the size of pixel values, realizing bit-level scrambling. As shown in Figure 8 and Figure 9, the specific steps are as follows:
步骤1:先将奇偶置乱后的图像矩阵P1转换为16进制字符矩阵P2,因为图像像素都在0到255之间,所以转换为16进制字符都有1到2个字符,将只有一个字符的高位补零,这样每个像素位都有两个字符。Step 1: First convert the odd-even scrambled image matrix P1 into a hexadecimal character matrix P2 . Because the image pixels are between 0 and 255, the converted hexadecimal characters have 1 to 2 characters. Zero-pad the high-order bits of only one character so that each pixel has two characters.
步骤2:将每个16进制字符的两个字符高、低位分开,分别得到两个字符矩阵P3和P4。Step 2: Separate the high and low characters of each hexadecimal character to obtain two character matrices P3 and P4 respectively.
步骤3:将矩阵U1的每一列都进行升序排列得到索引矩阵I1,将矩阵U1的每一行都进行升序排列得到索引矩阵I2。Step 3: Arrange each column of matrix U1 in ascending order to obtain index matrix I1 , and arrange each row of matrix U1 in ascending order to obtain index matrix I2 .
步骤4:将索引矩阵I1的每一列元素加上其所在列的列号,得到一个位置坐标矩阵F1;将索引矩阵I2的每一行的元素加上其所在行的行号,得到一个位置坐标矩阵F2。Step 4: Add each column element of the index matrix I1 to the column number of the column where it is located to obtain a position coordinate matrix F1 ; add the element of each row of the index matrix I2 to the row number of the row where it is located to obtain a Position coordinate matrix F2 .
步骤5:为使置乱效果更好,将位置坐标矩阵F1的每一行按照索引矩阵I2的每一行进行交换得到一个位置索引坐标矩阵S1,将位置坐标矩阵F2的每一列按照索引矩阵I1的每一列进行交换得到一个位置索引坐标矩阵S2。Step 5: In order to make the scrambling effect better, exchange each row of the position coordinate matrix F1 according to each row of the index matrix I2 to obtain a position index coordinate matrix S1 , and exchange each column of the position coordinate matrix F2 according to the index Each column of matrix I1 is exchanged to obtain a position index coordinate matrix S2 .
步骤6:将字符矩阵P3和P4分别按照位置索引坐标矩阵S1和S2进行索引置乱得到矩阵P5和矩阵P6。Step 6: Index the character matrices P3 and P4 according to the position index coordinate matrices S1 and S2 respectively to obtain the matrix P5 and the matrix P6 .
步骤7:将矩阵P5中的每个字符作为十六进制的高位字符,将矩阵P6中的每个字符作为十六进制的低位字符,恢复成一个十六进制字符矩阵P7,将字符矩阵P7中的十六进制转换为十进制,得到置乱后的图像矩阵P8。Step 7: Treat each character in matrix P5 as a high-order character of hexadecimal, and treat each character in matrix P6 as a low-order character of hexadecimal to restore a hexadecimal character matrix P7 , convert the hexadecimal in the character matrix P7 to decimal, and obtain the scrambled image matrix P8 .
步骤五:将图像矩阵P8转换为一维数组,利用公式(10)按照混沌序列T的元素值选取的不同的组合运算公式利用混沌序列V进行扩散运算后转化为矩阵,得到密文图像C。Step 5: Convert the image matrix P8 into a one-dimensional array, use formula (10) to select different combination operation formulas according to the element values of the chaotic sequence T, use the chaotic sequence V to perform a diffusion operation and then convert it into a matrix to obtain the ciphertext image C .
为了进一步提升加密图像的安全性,提出了一种选择组合运算扩散的方法,利用混沌序列选取不同的组合运算公式,对图像矩阵的像素进行扩散,运算方法包括逻辑运算的异或运算以及初等运算中的加法、减法、乘法。将这些运算方法组合成不同的公式进行扩散,不仅能改变像素值,还能增加加密的随机性,从而提升扩散效果。In order to further improve the security of encrypted images, a method of selecting combination operation diffusion is proposed. Chaos sequences are used to select different combination operation formulas to diffuse the pixels of the image matrix. The operation methods include logical operations, XOR operations and elementary operations. Addition, subtraction, and multiplication in . Combining these operation methods into different formulas for diffusion can not only change the pixel value, but also increase the randomness of encryption, thus improving the diffusion effect.
首先将置乱后的图像矩阵P8转换为一维数组,利用上面生成的混沌序列T(i),按照公式(10),选取不同的公式进行扩散。这里给定C1(0)=0。First, the scrambled image matrix P8 is converted into a one-dimensional array. Using the chaotic sequence T(i) generated above, according to formula (10), different formulas are selected for diffusion. It is given here that C1(0)=0.
其中,P9(i)为一维数组中的第i个元素,V(i)为混沌序列V的第i个元素,C1(i)为扩散后的序列的第i个元素,最后将序列C1转化为矩阵即为密文图像C。Among them, P9 (i) is the i-th element in the one-dimensional array, V(i) is the i-th element of the chaotic sequence V, C1(i) is the i-th element of the diffuse sequence, and finally the sequence C1 is converted into a matrix and is the ciphertext image C.
加密算法的解密过程是上述加密方法的逆过程。The decryption process of the encryption algorithm is the reverse process of the above encryption method.
为了验证本发明的可行性和有效性,在Matlab 2018b实验平台进行仿真。图11展示了Cameraman、Lena、House、Peppers和Barbara五幅的明文图像、密文图像和解密图像。从这些图像可以看出,明文图像经过加密之后得到的密文图像和明文图像完全不同,失去了明文图像的特征信息,而解密后的图像与明文图像完全一致,没有丢失任何信息,这一结果说明本发明具有很好的加密效果。In order to verify the feasibility and effectiveness of this invention, simulations were performed on the Matlab 2018b experimental platform. Figure 11 shows five plaintext images, ciphertext images and decrypted images of Cameraman, Lena, House, Peppers and Barbara. It can be seen from these images that the ciphertext image obtained after the plaintext image is encrypted is completely different from the plaintext image, and the characteristic information of the plaintext image is lost, while the decrypted image is completely consistent with the plaintext image without losing any information. This result It shows that the present invention has good encryption effect.
对加密算法性能的评估需要从多个方面进行分析,本发明从密钥空间、敏感性、直方图、方差、相关性、差分攻击、信息熵、局部信息熵、PSNR、噪声攻击和裁剪攻击等方面对该本发明的加密方法进行了实验测试和分析,以评估加密方法的安全性和可靠性。The evaluation of encryption algorithm performance needs to be analyzed from many aspects. This invention includes key space, sensitivity, histogram, variance, correlation, differential attack, information entropy, local information entropy, PSNR, noise attack and clipping attack, etc. In this aspect, the encryption method of the present invention was experimentally tested and analyzed to evaluate the security and reliability of the encryption method.
密钥空间是指一个密码算法可用的所有可能密钥的集合,它的大小对密码算法的安全性至关重要,密钥空间越大,密码算法越难以通过穷举法等暴力攻击方法破解。为了保证图像加密的安全性,密钥空间应当大于2100。在本发明的加密方法中,密钥由一个512位散列、四个初始值以及四个外部密钥组成。SHA-512算法的密钥空间为2512,初始值x0、y0、z0、w0和四个外部密钥的计算精度为10-15,它们的密钥空间为10120,总的密钥空间为2512+10120,密钥空间远大于2100,所以本发明的加密方法足以抵抗暴力攻击。The key space refers to the set of all possible keys available for a cryptographic algorithm. Its size is crucial to the security of the cryptographic algorithm. The larger the key space, the more difficult the cryptographic algorithm is to crack through brute force attacks such as exhaustive methods. In order to ensure the security of image encryption, the key space should be larger than 2100 . In the encryption method of the present invention, the key consists of a 512-bit hash, four initial values and four external keys. The key space of the SHA-512 algorithm is 2512. The calculation accuracy of the initial values x0 , y0 , z0 , w0 and the four external keys is 10-15 . Their key space is 10120. The total The key space is 2512 +10120 , and the key space is much larger than 2100 , so the encryption method of the present invention is sufficient to resist brute force attacks.
一个安全的图像加密算法,不仅要有较大的密钥空间,还应该具有高度的密钥敏感性。在对密钥进行敏感性测试时,只需对原始密钥进行微小的改动,再用其对加密图像进行解密。明文图像和解密图像之间的差异越大,密钥的敏感性就越强。A secure image encryption algorithm must not only have a large key space, but also have a high degree of key sensitivity. When testing the sensitivity of a key, only minor changes are made to the original key, which is then used to decrypt the encrypted image. The greater the difference between the plaintext image and the decrypted image, the more sensitive the key is.
在敏感性测试中,本发明以Cameraman图像为例,使用初始密钥加密之后,分别对外部密钥e(1)、e(2)、e(3)、e(4)作出微小的改动,用改动过的密钥依次进行解密,实验结果如图12所示。通过12可以看出,很明显,即使只对密钥做出微小的改变,攻击者也无法从解密图像获得有用的信息,说明本发明所提出的加密方法具有很强的密钥敏感性。In the sensitivity test, the present invention takes the Cameraman image as an example. After encrypting it with the initial key, minor changes are made to the external keys e(1), e(2), e(3), and e(4) respectively. Decryption is performed sequentially using the modified key, and the experimental results are shown in Figure 12. As can be seen from 12, it is obvious that even if only a small change is made to the key, the attacker cannot obtain useful information from the decrypted image, indicating that the encryption method proposed in the present invention has strong key sensitivity.
直方图分析是一种常见的图像分析方法,可以用来研究图像的像素值分布情况。一般未加密图像的像素值分布很不均匀,经过加密算法加密后,像素值的分布越均匀,算法的加密性能越好,抗攻击性越强,所加密的图像就越安全。图13显示了不同明文图像和密文图像的直方图,明显的可以看出,密文图像像素值的分布比明文图像像素的分布更均匀,证明本发明提出的加密方法有很好的安全性。Histogram analysis is a common image analysis method that can be used to study the distribution of pixel values in an image. Generally, the distribution of pixel values of unencrypted images is very uneven. After being encrypted by an encryption algorithm, the more uniform the distribution of pixel values, the better the encryption performance of the algorithm, the stronger the resistance to attacks, and the safer the encrypted image is. Figure 13 shows the histograms of different plaintext images and ciphertext images. It can be clearly seen that the distribution of pixel values in the ciphertext image is more uniform than the distribution of pixels in the plaintext image, proving that the encryption method proposed by the present invention has good security. .
方差直接体现密文图像直方图与理论直方图的偏差程度,其定义如公式(11)所示:The variance directly reflects the degree of deviation between the ciphertext image histogram and the theoretical histogram, and its definition is as shown in formula (11):
式中,vi是密文图像直方图中该灰度级像素值出现的频率,t=(M×N)/256,M和N是图像的行数和列数。选取显著性水平为0.05时,方差当测试密文图像的方差小于此方差时,即/>直方图近似均匀分布。表2显示了明文图像和密文图像的方差值,通过比较,密文图像的方差值远小于明文图像的方差值,这意味着密文图像的像素值的分布是均匀的。In the formula,vi is the frequency of occurrence of this gray level pixel value in the histogram of the ciphertext image, t=(M×N)/256, M and N are the number of rows and columns of the image. When the significance level is selected as 0.05, the variance When the variance of the test ciphertext image is less than this variance, that is/> The histogram is approximately uniformly distributed. Table 2 shows the variance values of the plaintext image and the ciphertext image. By comparison, the variance value of the ciphertext image is much smaller than the variance value of the plaintext image, which means that the distribution of pixel values of the ciphertext image is uniform.
表2明文图像和密文图像的方差结果Table 2 Variance results of plaintext images and ciphertext images
通常情况下明文图像的相邻像素在水平、垂直和对角线方向之间有很强的相关性,其可能泄露攻击者所需要的统计信息。因此,图像加密算法应该尽可能的减少密文图像的相关性。相邻像素之间的相关性系数用公式(12)计算。Typically there is a strong correlation between adjacent pixels of a plaintext image in the horizontal, vertical and diagonal directions, which may reveal statistical information needed by an attacker. Therefore, image encryption algorithms should reduce the correlation of ciphertext images as much as possible. The correlation coefficient between adjacent pixels is calculated using formula (12).
公式(12)中各个参数的计算公式如(13):The calculation formula of each parameter in formula (12) is as follows (13):
其中,rx,r是相关性系数,E(x)表示x的期望,D(x)表示x的方差,cov(x,y)表示协方差,x和y是一对像素值,N为图像中像素的总个数。图14以Cameraman的明文图像和密文图像为例,选取10000对像素值,分别检验了水平、垂直、对角线三个方向的相关性,结果表明了密文图像的相邻像素之间的相关性被破坏。表3分别计算了Cameraman图像和其它4幅图像在各个方向上的相关性系数,从中可以看出,密文图像的相关性系数趋于0,这表明所提出的加密方法可以有效降低像素之间的相关性。表4显示的是与其他加密算法的相关性比较。结果表明,与其他加密算法相比,本发明所提出的加密算法对明文图像相关性的破坏性更强。其中,对比算法1来自于文献[Li-Hua Gong,Hui-Xin Luo,Rou-Qing Wu,Nan-Run Zhou,New4D chaotic system with hidden attractors and self-excited attractors andits application in image encryption based on RNG,Physica A:StatisticalMechanics and its Applications,Volume 591,2022,126793,ISSN 0378-4371],对比算法2来自于文献[R.Vidhya,M.Brindha,A novel conditional Butterfly NetworkTopology based chaotic image encryption,Journal of Information Security andApplications,Volume 52,102484,ISSN 2214-2126],对比算法3来自于文献[[34]ZhangT,Zhu B,Ma Y,Zhou X.A Novel Image Encryption Algorithm Based on MultipleRandom DNA Coding and Annealing.Electronics.2023;12(3):501],对比算法4来自于文献[L.Liu,Y.Lei and D.Wang,"A Fast Chaotic Image Encryption Scheme WithSimultaneous Permutation-Diffusion Operation,"in IEEE Access,vol.8,pp.27361-27374,2020,doi:10.1109/ACCESS.2020.2971759]。Among them,r The total number of pixels in the image. Figure 14 takes Cameraman's plaintext image and ciphertext image as an example. 10,000 pairs of pixel values are selected to test the correlation in three directions: horizontal, vertical, and diagonal. The results show that the correlation between adjacent pixels of the ciphertext image is Relevance is broken. Table 3 calculates the correlation coefficients of the Cameraman image and the other four images in each direction. It can be seen that the correlation coefficient of the ciphertext image tends to 0, which shows that the proposed encryption method can effectively reduce the number of pixels between pixels. correlation. Table 4 shows a correlation comparison with other encryption algorithms. The results show that compared with other encryption algorithms, the encryption algorithm proposed in the present invention is more destructive to the correlation of plaintext images. Among them, comparison algorithm 1 comes from the literature [Li-Hua Gong, Hui-Xin Luo, Rou-Qing Wu, Nan-Run Zhou, New4D chaotic system with hidden attractors and self-excited attractors and its application in image encryption based on RNG, Physica A: StatisticalMechanics and its Applications, Volume 591, 2022, 126793, ISSN 0378-4371], comparison algorithm 2 comes from the literature [R.Vidhya, M.Brindha, A novel conditional Butterfly NetworkTopology based chaotic image encryption, Journal of Information Security andApplications , Volume 52, 102484, ISSN 2214-2126], comparison algorithm 3 comes from the literature [[34] ZhangT, Zhu B, Ma Y, Zhou XA Novel Image Encryption Algorithm Based on MultipleRandom DNA Coding and Annealing.Electronics.2023; 12( 3):501], comparison algorithm 4 comes from the literature [L.Liu, Y.Lei and D.Wang, "A Fast Chaotic Image Encryption Scheme WithSimultaneous Permutation-Diffusion Operation," in IEEE Access, vol.8, pp.27361 -27374,2020,doi:10.1109/ACCESS.2020.2971759].
表3明文图像和密文图像各方向上的相关系数Table 3 Correlation coefficients of plaintext images and ciphertext images in all directions
表4密文图像相关性与其他方案对比Table 4 Comparison of ciphertext image correlation and other schemes
信息熵反映了图像中的平均信息量,可用于验证像素值分布的随机性。灰度图像理想状态下的信息熵为8,图像的信息熵越大,随机性就越强。信息熵的计算公式为:Information entropy reflects the average amount of information in an image and can be used to verify the randomness of pixel value distribution. The ideal information entropy of a grayscale image is 8. The greater the information entropy of the image, the stronger the randomness. The calculation formula of information entropy is:
其中,L代表图像灰度级,mi是图像第i个像素值,P(mi)是对应的每一个灰度值出现的概率。用本发明提出的加密方案分别对五幅不同的图像进行加密,进而得到它们的信息熵,并且和其他算法的信息熵对比,其结果如表5所示。可以看出,用本发明提出的加密方法加密的图像的信息熵均接近8,并且其熵值也大于参考文献中的那些算法的熵值,证明了本发明提出的加密方法可以抵抗熵攻击。Among them, L represents the gray level of the image, mi is the i-th pixel value of the image, and P(mi) is the probability of occurrence of each corresponding gray level value. Use the encryption scheme proposed by the present invention to encrypt five different images respectively, and then obtain their information entropy, and compare it with the information entropy of other algorithms. The results are shown in Table 5. It can be seen that the information entropy of the images encrypted by the encryption method proposed by the present invention is close to 8, and its entropy value is also greater than the entropy value of those algorithms in the reference literature, proving that the encryption method proposed by the present invention can resist entropy attacks.
局部信息熵的计算公式为:The calculation formula of local information entropy is:
其中,Si是密文信息熵,k是选取的组数,TB是每组的像素数。选择k为3,TB为1936,显著性水平α为0.05时,如果得到的局部信息熵在[7.901515698,7.903422936]范围内,说明加密图像通过测试。用本发明提出的加密方法分别对五幅不同的图像进行加密,进而得到它们的局部信息熵,其结果如表6所示。可以看出,所有密文图像均通过局部信息熵测试,因此密文图像具有高度的随机性。Among them,Si is the ciphertext information entropy, k is the number of selected groups, and TB is the number of pixels in each group. When k is selected as 3, TB is 1936, and the significance level α is 0.05, if the obtained local information entropy is within the range of [7.901515698, 7.903422936], it means that the encrypted image passes the test. The encryption method proposed by the present invention is used to encrypt five different images, and then their local information entropy is obtained. The results are shown in Table 6. It can be seen that all ciphertext images pass the local information entropy test, so the ciphertext images have a high degree of randomness.
表5明文图像、密文图像的全局信息熵和其他算法对比Table 5 Comparison of global information entropy of plaintext images, ciphertext images and other algorithms
表6密文图像局部信息熵结果Table 6 Local information entropy results of ciphertext images
PSNR代表峰值信噪比,MES代表均方误差,它们可以用于图像质量的评估,PSNR值越小(MSE值越大),加密效果越好。定义公式为:PSNR represents the peak signal-to-noise ratio and MES represents the mean square error. They can be used to evaluate image quality. The smaller the PSNR value (the larger the MSE value), the better the encryption effect. The definition formula is:
式中,M为图像的宽度,N为图像的长度,P为明文图像,C为加密图像,b为像素二进制字符串的长度。表7将不同明文图像加密后的MSE、PSNR值和其他算法的进行了对比,可以看出,用本发明加密后的图像的PSNR值非常小,并且其PSNR值也小于其他算法,说明本发明的加密算法具有很高的安全性。其中,对比算法5来自于文献[Xingyuan Wang,Nana Guan,Anovel chaotic image encryption algorithm based on extended Zigzag confusionand RNA operation,Optics&Laser Technology,Volume 131,2020,106366,ISSN 0030-3992],对比算法6来自于文献[Xingyuan Wang,Jingjing Yang,A novel imageencryption scheme of dynamic S-boxes and random blocks based onspatiotemporal chaotic system,Optik,Volume 217,2020,164884,ISSN 0030-4026],对比算法7来自于文献[X.Y.Wang,W.H.Xue,and J.B.An,“Image encryption algorithmbased on LDCML and DNA coding sequence,”Multimed Tools Appl.,vol.80,pp.591-614,2021],对比算法8来自于文献[S.F.Yousif,A.J.Abboud,and R.S.Alhumaima,“Anewimage encryption based on bit replacing,chaos and DNA coding techniques,”Multimed Tools Appl.,vol.81,pp.27453-27493,2022]。In the formula, M is the width of the image, N is the length of the image, P is the plaintext image, C is the encrypted image, and b is the length of the pixel binary string. Table 7 compares the MSE and PSNR values of different plaintext images encrypted with other algorithms. It can be seen that the PSNR value of the image encrypted with the present invention is very small, and its PSNR value is also smaller than other algorithms, indicating that the present invention The encryption algorithm has high security. Among them, comparison algorithm 5 comes from the literature [Xingyuan Wang, Nana Guan, Anovel chaotic image encryption algorithm based on extended Zigzag confusion and RNA operation, Optics & Laser Technology, Volume 131, 2020, 106366, ISSN 0030-3992], and comparison algorithm 6 comes from the literature [Xingyuan Wang,Jingjing Yang,A novel image encryption scheme of dynamic S-boxes and random blocks based on onspatiotemporal chaotic system,Optik,Volume 217,2020,164884,ISSN 0030-4026], comparison algorithm 7 comes from the literature [X.Y.Wang,W.H. Xue, and J.B.An, "Image encryption algorithm based on LDCML and DNA coding sequence," Multimed Tools Appl., vol.80, pp.591-614, 2021], comparison algorithm 8 comes from the literature [S.F. Yousif, A.J. Abboud, and R.S. Alhumaima, “Anewimage encryption based on bit replacing, chaos and DNA coding techniques,” Multimed Tools Appl., vol.81, pp.27453-27493, 2022].
表7密文图像的PSNR和MES及与其他算法的对比Table 7 PSNR and MES of ciphertext images and comparison with other algorithms
差分攻击是一种针对图像加密算法的攻击方法,它主要是对明文图像的某个像素值进行微小的改变,然后使用加密算法对两个明文图像进行加密,通过对两个密文图像进行对比分析,从中找出明文图像和密文图像之间的联系,来获取密钥或者推断出部分密钥信息,进而破解图像。Differential attack is an attack method against the image encryption algorithm. It mainly changes a certain pixel value of the plaintext image slightly, and then uses the encryption algorithm to encrypt the two plaintext images, and compares the two ciphertext images. Analysis to find the connection between the plaintext image and the ciphertext image to obtain the key or infer part of the key information, and then crack the image.
利用像素值的变化率NPCR和统一平均变化强度UACI可以评估加密算法抵抗差分攻击的能力,它们的计算公式为:The ability of the encryption algorithm to resist differential attacks can be evaluated using the change rate NPCR of the pixel value and the unified average change intensity UACI. Their calculation formula is:
其中,M×N是密文图像的尺度大小,C1、C2是密文,D(i,j)是用来判别密文C1、C2的。NPCR和UACI的理想值分别为99.6049%和33.4635%。在密钥不变的情况下,用本发明的加密方法对两个明文图像进行加密,表8、表9显示了计算出来的NPCR和UACI值以及和其他算法的比较结果。从对比结果可以看出,本发明计算得到的NPCR和UACI值,比对比算法2-5的更接近理论值。Among them, M×N is the scale size of the ciphertext image, C1 and C2 are the ciphertext, and D(i,j) is used to identify the ciphertext C1 and C2 . The ideal values of NPCR and UACI are 99.6049% and 33.4635% respectively. When the key remains unchanged, the encryption method of the present invention is used to encrypt two plaintext images. Table 8 and Table 9 show the calculated NPCR and UACI values and the comparison results with other algorithms. It can be seen from the comparison results that the NPCR and UACI values calculated by the present invention are closer to the theoretical values than those of the comparison algorithms 2-5.
表8密文图像的NPCR和UACI值Table 8 NPCR and UACI values of ciphertext images
表9密文图像的NPCR和UACI值及和其他算法的对比Table 9 NPCR and UACI values of ciphertext images and comparison with other algorithms
在数据传输过程中容易遭受噪声攻击,噪声攻击会导致密文图像受损,清晰度降低。在保持密钥不变的情况下,本发明对Cameraman图像分别加入强度为0.01、0.05、0.1的椒盐噪声,并使用本发明所提出的加密方法进行解密。图15显示了解密图像,可以明显看出,解密后的图像,仍然可以被识别,说明本发明的加密方法具有抵抗噪声攻击的能力。It is vulnerable to noise attacks during data transmission. Noise attacks will cause the ciphertext image to be damaged and the clarity to be reduced. While keeping the key unchanged, the present invention adds salt and pepper noise with strengths of 0.01, 0.05, and 0.1 to the Cameraman image, and uses the encryption method proposed by the present invention for decryption. Figure 15 shows the decrypted image. It can be clearly seen that the decrypted image can still be identified, indicating that the encryption method of the present invention has the ability to resist noise attacks.
图像在传输的过程中可能遭受裁剪攻击或者数据丢失,一个高度安全的图像加密算法应该能够抵抗裁剪攻击。本发明测验加密方法抗剪裁攻击能力的方法是将密文图像中的一部分像素值删除,再用解密算法进行解密,如果能很大程度的还原明文图像,说明该加密方案具有很强的抗剪裁攻击能力。在测试中分别对Cameraman密文图像进行1/16、1/4、1/2的剪裁攻击后进行解密。如图16所示,Cameraman密文图像在加入不同程度的裁剪攻击,仍然可以被解密和识别,说明本加密方案能有效抵抗裁剪攻击。Images may suffer from cropping attacks or data loss during transmission. A highly secure image encryption algorithm should be able to resist cropping attacks. The method of the present invention to test the ability of the encryption method to resist clipping attacks is to delete part of the pixel values in the ciphertext image, and then use the decryption algorithm to decrypt. If the plaintext image can be restored to a great extent, it means that the encryption scheme has strong resistance to clipping. Attack ability. In the test, the Cameraman ciphertext image was decrypted after performing 1/16, 1/4, and 1/2 cropping attacks. As shown in Figure 16, the Cameraman ciphertext image can still be decrypted and recognized after adding varying degrees of cropping attacks, indicating that this encryption scheme can effectively resist cropping attacks.
本发明设计了一种改进的4D混沌系统,并通过分析其相位图、分岔图、李亚普诺夫指数谱、初值灵敏性、NIST测试、平衡点及其耗散性,证明4D混沌系统具有良好的混沌特性,适用于图像加密。为验证改进的4D混沌系统在密码学中的应用潜力,本发明基于4D混沌系统提出了一种新的图像加密方法,主要包括奇偶置乱,十六进制位平面置乱以及选择组合运算扩散。通过仿真实验和理论分析,验证了本发明的加密方法对选择明文攻击、暴力攻击、统计分析攻击、差分攻击、噪声攻击和裁剪攻击的有效性。因此,本发明提出的加密算法具有很好的安全性能,适用于实时图像加密应用。The present invention designs an improved 4D chaotic system and proves that the 4D chaotic system has the characteristics of Good chaotic properties, suitable for image encryption. In order to verify the application potential of the improved 4D chaotic system in cryptography, the present invention proposes a new image encryption method based on the 4D chaotic system, which mainly includes parity and even scrambling, hexadecimal bit plane scrambling and selective combination operation diffusion. . Through simulation experiments and theoretical analysis, the effectiveness of the encryption method of the present invention against selected plaintext attacks, brute force attacks, statistical analysis attacks, differential attacks, noise attacks and clipping attacks is verified. Therefore, the encryption algorithm proposed by the present invention has good security performance and is suitable for real-time image encryption applications.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311365820.6ACN117499005A (en) | 2023-10-20 | 2023-10-20 | Image encryption method based on 4D chaotic system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311365820.6ACN117499005A (en) | 2023-10-20 | 2023-10-20 | Image encryption method based on 4D chaotic system |
| Publication Number | Publication Date |
|---|---|
| CN117499005Atrue CN117499005A (en) | 2024-02-02 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311365820.6APendingCN117499005A (en) | 2023-10-20 | 2023-10-20 | Image encryption method based on 4D chaotic system |
| Country | Link |
|---|---|
| CN (1) | CN117499005A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118509537A (en)* | 2024-07-16 | 2024-08-16 | 中南大学 | Image encryption method and device |
| CN118524217A (en)* | 2024-07-22 | 2024-08-20 | 宁波康达凯能医疗科技有限公司 | Inter-frame image code rate control method based on Lyapunov stability |
| CN119363320A (en)* | 2024-12-30 | 2025-01-24 | 山东青橙数字科技有限公司 | Image privacy security protection method based on RNA (ribonucleic acid) coding |
| CN119603410A (en)* | 2025-02-08 | 2025-03-11 | 贵州大学 | Image encryption method and device based on neural network chaotic system |
| CN120602598A (en)* | 2025-08-06 | 2025-09-05 | 电子科技大学中山学院 | Image encryption method based on RNA extended coding and quantum chaos |
| CN120675696A (en)* | 2025-08-20 | 2025-09-19 | 中国地质调查局南京地质调查中心(华东地质科技创新中心) | Method, device, equipment and storage medium for selectively encrypting live three-dimensional model data |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118509537A (en)* | 2024-07-16 | 2024-08-16 | 中南大学 | Image encryption method and device |
| CN118524217A (en)* | 2024-07-22 | 2024-08-20 | 宁波康达凯能医疗科技有限公司 | Inter-frame image code rate control method based on Lyapunov stability |
| CN118524217B (en)* | 2024-07-22 | 2024-12-03 | 宁波康达凯能医疗科技有限公司 | Inter-frame image code rate control method based on Lyapunov stability |
| CN119363320A (en)* | 2024-12-30 | 2025-01-24 | 山东青橙数字科技有限公司 | Image privacy security protection method based on RNA (ribonucleic acid) coding |
| CN119603410A (en)* | 2025-02-08 | 2025-03-11 | 贵州大学 | Image encryption method and device based on neural network chaotic system |
| CN120602598A (en)* | 2025-08-06 | 2025-09-05 | 电子科技大学中山学院 | Image encryption method based on RNA extended coding and quantum chaos |
| CN120675696A (en)* | 2025-08-20 | 2025-09-19 | 中国地质调查局南京地质调查中心(华东地质科技创新中心) | Method, device, equipment and storage medium for selectively encrypting live three-dimensional model data |
| Publication | Publication Date | Title |
|---|---|---|
| CN112084517B (en) | Image encryption method based on chaotic mapping and bit-level permutation | |
| CN108898025B (en) | A chaotic image encryption method based on double chaotic and DNA coding | |
| Kumar et al. | IEHC: An efficient image encryption technique using hybrid chaotic map | |
| Ahmad et al. | A secure image encryption scheme based on chaotic maps and affine transformation | |
| CN117499005A (en) | Image encryption method based on 4D chaotic system | |
| Zhang et al. | Chaotic image encryption based on circular substitution box and key stream buffer | |
| CN107220923B (en) | Digital picture feedback encryption method based on image network | |
| CN108122188B (en) | an image encryption method | |
| Liu et al. | A novel hyperchaotic encryption algorithm for color image utilizing DNA dynamic encoding and self-adapting permutation | |
| CN116192362B (en) | A chaotic system with adjustable Lyapunov exponent and image encryption and decryption method | |
| Khan et al. | A new chaos-based secure image encryption scheme using multiple substitution boxes | |
| CN113077373A (en) | Image encryption method based on chaos mapping and bidirectional operation Feistel structure | |
| Murugan et al. | A hybrid image encryption algorithm using chaos and Conway's game‐of‐life cellular automata | |
| CN117834785A (en) | Multi-image encryption method based on two-dimensional compressed sensing and visual security | |
| Thiyagarajan et al. | A chaotic image encryption scheme with complex diffusion matrix for plain image sensitivity | |
| Zhao et al. | A novel image encryption algorithm by delay induced hyper-chaotic Chen system | |
| Aziz et al. | A novel symmetric image cryptosystem resistant to noise perturbation based on S8 elliptic curve S-boxes and chaotic maps | |
| CN117318910A (en) | Color image encryption method based on multi-dimensional chaotic system and DNA encoding | |
| Iqbal et al. | An efficient hybrid encryption model based on deep convolutional neural networks, deoxyribonucleic acid computing and chaotic system | |
| Naim et al. | A new chaotic image encryption algorithm based on a modified version of the AES algorithm | |
| Ding et al. | A new multi-wing hyperchaotic system and its application in image encryption | |
| Hassan et al. | Henon chaotic map-based image encryption scheme using bit-level circular shift | |
| Abd El-Latif et al. | Image encryption scheme of pixel bit based on combination of chaotic systems | |
| Liu et al. | A color image encryption algorithm based on DNA computation and Chen system | |
| Debbarma et al. | 2D Chaos based color image encryption using pseudorandom key generation |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |