CN110086601A - Based on the associated Josephus traversing of pixel value and hyperchaotic system image encryption method - Google Patents
Based on the associated Josephus traversing of pixel value and hyperchaotic system image encryption method Download PDFInfo
- Publication number
- CN110086601A CN110086601A CN201910349652.9A CN201910349652A CN110086601A CN 110086601 A CN110086601 A CN 110086601A CN 201910349652 A CN201910349652 A CN 201910349652A CN 110086601 A CN110086601 A CN 110086601A
- Authority
- CN
- China
- Prior art keywords
- sequence
- pixel
- image
- block
- matrix
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/001—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/002—Countermeasures against attacks on cryptographic mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0631—Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Power Engineering (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本发明涉及数字图像加密的技术领域,尤其涉及一种基于像素值关联的约瑟夫遍历和超混沌系统图像加密方法。The invention relates to the technical field of digital image encryption, in particular to a Joseph traversal and hyperchaotic system image encryption method based on pixel value association.
背景技术Background technique
随着经济的发展、社会的进步、信息化水平的提高,互联网、物联网等技术飞速发展,人类正在进入大数据和人工智能的时代。图像信息因其形象、直观、生动、信息量巨大的特点在很多领域内得到广泛的应用,例如,多媒体技术、数字化办公,移动支付等。图像信息的应用正在改变人们的生活方式和生活习惯。图像信息正充斥着人类活动的每一个角落,但是,随着图像信息的广泛应用,其安全问题也逐渐显露出来。数字图像加密技术是有效保护数字图像传输的重要手段。一些传统的文本加密算法如DES、AES等并不适用图像信息的加密:一是加密效率较低,二是加密效果一般。例如,Silva等注意到,使用DES算法加密具有大块相同灰度区域的图像时,密文图像中会出现一些加密质量不高的区域。由于图像信息在军事、政治、经济领域的广泛应用,这些信息的泄露会产生巨大的影响力和破坏力。因此,设计更为可靠的图像加密算法迫在眉睫,图像加密也正成为热门的研究领域。With the development of the economy, the progress of the society, the improvement of the level of informatization, and the rapid development of technologies such as the Internet and the Internet of Things, human beings are entering the era of big data and artificial intelligence. Image information has been widely used in many fields because of its image, intuition, vividness, and huge amount of information, such as multimedia technology, digital office, mobile payment, etc. The application of image information is changing people's lifestyle and living habits. Image information is filling every corner of human activities. However, with the wide application of image information, its security problems are gradually revealed. Digital image encryption technology is an important means to effectively protect digital image transmission. Some traditional text encryption algorithms such as DES, AES, etc. are not suitable for the encryption of image information: first, the encryption efficiency is low, and second, the encryption effect is general. For example, Silva et al. noticed that when using the DES algorithm to encrypt an image with a large area of the same gray level, some areas with low encryption quality will appear in the ciphertext image. Due to the wide application of image information in the military, political, and economic fields, the leakage of these information will have huge influence and destructive power. Therefore, it is imminent to design a more reliable image encryption algorithm, and image encryption is becoming a hot research field.
图像加密包括像素置乱和像素置换。常见的像素置乱方法有:基于图形学的扫描模式置乱法、基于伪随机序列的像素重排法等。这些置乱方法通过改变像素在图像中的位置产生加密的效果。常见的像素置换方法有:基于Hill矩阵的加密方法、基于混沌系统的密码流加密方法等。这些置换方法通过改变像素的值达到加密的效果。近些年提出的加密方案中,混沌密码学备受关注。混沌系统作为一种复杂的非线性动力系统,具有初始参数敏感、轨道不可预测、状态遍历性强的特点,通常作为伪随机数发生器使用。将混沌系统应用于图像加密的置乱和置换过程中,能够提高加密系统的安全性,弥补传统加密算法的不足。但随着密码分析技术的提高,混沌加密技术也暴露出了对密钥的低敏感性等问题。为了解决这些问题,有研究人员提出,与其他方法融合是提高混沌图像加密技术安全性的有效途径。约瑟夫问题是由古罗马著名的史学家Josephus提出的问题演变而来的,它的使用对各种恶意篡改、侵权盗版等违法行为起到了遏制作用。使用约瑟夫遍历进行数据置乱,增加了数据安全性。Image encryption includes pixel scrambling and pixel replacement. Common pixel scrambling methods include: graphics-based scanning pattern scrambling method, pseudo-random sequence-based pixel rearrangement method, etc. These scrambling methods produce an encryption effect by changing the position of pixels in the image. Common pixel replacement methods include: encryption method based on Hill matrix, cipher stream encryption method based on chaotic system, etc. These displacement methods achieve the effect of encryption by changing the value of pixels. Among the encryption schemes proposed in recent years, chaotic cryptography has attracted much attention. As a complex nonlinear dynamical system, chaotic system has the characteristics of sensitive initial parameters, unpredictable trajectory, and strong state ergodicity, and is usually used as a pseudo-random number generator. Applying the chaos system to the scrambling and permutation process of image encryption can improve the security of the encryption system and make up for the shortcomings of traditional encryption algorithms. However, with the improvement of cryptanalysis technology, chaotic encryption technology has also exposed the low sensitivity to keys and other problems. In order to solve these problems, some researchers proposed that fusion with other methods is an effective way to improve the security of chaotic image encryption technology. The Joseph question evolved from the question raised by the famous ancient Roman historian Josephus. Its use has played a deterrent role in various illegal activities such as malicious tampering and copyright infringement. Use Joseph traversal for data scrambling, which increases data security.
发明内容SUMMARY OF THE INVENTION
针对现有图像加密方法对密钥的敏感性较低,数据安全性较差的技术问题,本发明提出一种基于像素值关联的约瑟夫遍历和超混沌系统图像加密方法,具有极大的密钥敏感性,良好的伪随机性,安全性分析结果表明,能有效抵御各种经典攻击。Aiming at the technical problems that the existing image encryption method is less sensitive to the key and the data security is poor, the present invention proposes a Joseph traversal and hyper-chaotic system image encryption method based on pixel value association, which has a very large key Sensitivity, good pseudo-randomness, and security analysis results show that it can effectively resist various classic attacks.
为了达到上述目的,本发明的技术方案是这样实现的:一种基于像素值关联的约瑟夫遍历和超混沌系统图像加密方法,其步骤如下:In order to achieve the above object, the technical solution of the present invention is achieved in that a kind of Joseph traversal based on pixel value association and hyperchaotic system image encryption method, its steps are as follows:
步骤一:将大小为Height×Width的原始图像输入SHA-384散列函数,得到384位二进制序列H;将384位二进制序列H等分为48份,八个一组进行运算得到分段线性映射和Chen超混沌系统的初始值;Step 1: Input the original image with a size of Height×Width into the SHA-384 hash function to obtain a 384-bit binary sequence H; divide the 384-bit binary sequence H into 48 parts, and perform operations in groups of eight to obtain a piecewise linear map and the initial value of Chen hyperchaotic system;
步骤二:将分段线性映射的初始值带入分段线性映射进行迭代得到长度为Height*Width的伪随机序列U,将Chen超混沌系统的初始值带入Chen超混沌系统进行迭代得到四个长度为Height*Width/4的伪随机序列x、y、z、w;Step 2: Bring the initial value of the piecewise linear map into the piecewise linear map for iteration to obtain a pseudo-random sequence U of length Height*Width, and bring the initial value of the Chen hyperchaotic system into the Chen hyperchaotic system for iteration to obtain four A pseudo-random sequence x, y, z, w with a length of Height*Width/4;
步骤三:用伪随机序列U的前Height个伪随机数作为索引值,使用与像素值关联的约瑟夫置乱方法对原始图像进行行置乱操作,得到密文图像C1;Step 3: Use the first Height pseudo-random numbers of the pseudo-random sequence U as index values, and use the Joseph scrambling method associated with the pixel values to perform row scrambling operations on the original image to obtain the ciphertext image C 1 ;
步骤四:将密文图像C1等分成4份得到密文块,使用伪随机序列x、y、z、w分别对4个密文块中的像素进行像素置换并重组置换后的密文块,得到密文图像C2;Step 4: Divide the ciphertext image C 1 into 4 equal parts to obtain ciphertext blocks, use the pseudo-random sequence x, y, z, w to perform pixel replacement on the pixels in the 4 ciphertext blocks and reassemble the replaced ciphertext blocks , get the ciphertext image C 2 ;
步骤五:用伪随机序列U的后Width个伪随机数作为索引值,使用与像素值关联的约瑟夫置乱方法对密文图像C2进行列置乱操作,得到密文图像C3;Step 5: Use the last Width pseudo-random numbers of the pseudo-random sequence U as index values, and use the Joseph scrambling method associated with the pixel value to perform column scrambling operations on the ciphertext image C 2 to obtain the ciphertext image C 3 ;
步骤六:使用两个密钥像素Pixel1和Pixel2对密文图像C3中的像素做像素扩散操作,得到加密后的密文图像C。Step 6: Use two key pixels Pixel 1 and Pixel 2 to perform a pixel diffusion operation on the pixels in the ciphertext image C 3 to obtain the encrypted ciphertext image C.
所述步骤一中计算分段线性映射和Chen超混沌系统的初始值的方法为:将384位二进制序列H等分成48份,得到8位二进制序列h1,h2,…,h48,使用的分段线性映射和Chen超混沌系统的初始值的计算方法为:The method for calculating the initial value of the piecewise linear map and the Chen hyperchaotic system in the step 1 is: divide the 384-bit binary sequence H into 48 parts to obtain the 8-bit binary sequence h 1 , h 2 , ..., h 48 , use The calculation method of the piecewise linear map and the initial value of the Chen hyperchaotic system is:
其中,u1和p为分段线性映射的初始值,x1、y1、z1、w1为四维Chen超混沌系统的初始值,表示两个8位二进制序列中对应位置元素进行异或运算,u′1,x′1,y′1,z′1,w′1为给定的初始值。Among them, u 1 and p are the initial values of the piecewise linear map, x 1 , y 1 , z 1 , and w 1 are the initial values of the four-dimensional Chen hyperchaotic system, Indicates that XOR operation is performed on corresponding position elements in two 8-bit binary sequences, u′ 1 , x′ 1 , y′ 1 , z′ 1 , and w′ 1 are the given initial values.
所述分段线性映射的迭代方程为:The iterative equation of the piecewise linear mapping is:
其中,p为分段线性映射的参数,取值范围为(0,0.5);u(i+1)∈[0,1)表示分段线性映射第i次迭代产生的伪随机数,i=1,2,……,Height+Width-1;u(i)∈[0,1)是第i次迭代使用的前一次迭代的伪随机数或初始值u1;Among them, p is the parameter of the piecewise linear mapping, and the value range is (0,0.5); u(i+1)∈[0,1) represents the pseudo-random number generated by the ith iteration of the piecewise linear mapping, i= 1,2,...,Height+Width-1; u(i)∈[0,1) is the pseudo-random number or initial value u 1 of the previous iteration used in the i-th iteration;
所述Chen超混沌系统的动力方程为:The dynamic equation of the Chen hyperchaotic system is:
其中,和分别表示动力学参数x',y',z',w'的倒数,a,b,c,d,k分别为Chen超混沌系统的参数,当a=36,b=3,c=28,d=16且-0.7≤k≤0.7时,Chen超混沌系统处于超混沌状态。in, and respectively represent the reciprocal of the dynamic parameters x', y', z', w', a, b, c, d, k are the parameters of Chen's hyperchaotic system respectively, when a=36, b=3, c=28, When d=16 and -0.7≤k≤0.7, the Chen hyperchaotic system is in a hyperchaotic state.
所述伪随机序列U的实现方法为:分段线性映射利用初始值u1迭代Height+Width-1次,将初始值u1和得到的Height+Width-1个伪随机数组成一个长度为Height+Width的混沌序列u;将混沌序列u重构为伪随机序列U:The implementation method of the pseudo-random sequence U is: the piecewise linear mapping utilizes the initial value u 1 to iterate Height+Width-1 times, and the initial value u 1 and the obtained Height+Width-1 pseudo-random numbers form a length of Height The chaotic sequence u of +Width; reconstruct the chaotic sequence u into a pseudorandom sequence U:
其中,u(:)为混沌序列u中的元素,mod(,)表示求余函数;Among them, u(:) is the element in the chaotic sequence u, and mod(,) represents the remainder function;
所述得到伪随机序列x、y、z、w的方法为:将初始值x1、y1、z1、w1带入四维Chen超混沌系统,对Chen超混沌系统迭代Height×Width/4+999次,舍去前999次迭代的值,得到四个长度为Height×Width/4的伪随机序列x、y、z、w。The method of obtaining the pseudo-random sequence x, y, z, w is as follows: bring the initial values x 1 , y 1 , z 1 , w 1 into the four-dimensional Chen hyperchaotic system, and iterate the Chen hyperchaotic system Height×Width/4 +999 times, the value of the first 999 iterations is discarded, and four pseudo-random sequences x, y, z, and w of length Height×Width/4 are obtained.
所述步骤三中与像素值关联的约瑟夫置乱方法的实现方法为:将伪随机序列U(j)的元素作为初始步长InitialValue、原始图像的第j行元素作为序列S的元素带入扩充的约瑟夫函数,得到的序列S′是置乱后密文图像C1的第j行元素;其中,j=1,2,……,Height;The implementation method of the Joseph scrambling method associated with the pixel value in the step 3 is as follows: the element of the pseudo-random sequence U(j) is used as the initial step size InitialValue, and the element of the jth row of the original image is brought into the expansion as the element of the sequence S Joseph function, the obtained sequence S' is the jth row element of the scrambled ciphertext image C 1 ; where, j=1,2,...,Height;
所述步骤五中与像素值关联的约瑟夫置乱方法的实现方法为:将伪随机序列U(Height+q)的元素作为初始步长InitialValue、密文图像C2的第q列元素作为序列S的元素带入扩充的约瑟夫函数,得到的序列S′是置乱后密文图像C1的第j行元素;其中,q=1,2,……,Width。The implementation method of the Joseph scrambling method associated with the pixel value in the step 5 is: the element of the pseudo-random sequence U(Height+q) is used as the initial step size InitialValue , and the qth column element of the ciphertext image C2 is used as the sequence S The elements of are brought into the extended Joseph function, and the obtained sequence S' is the jth row element of the scrambled ciphertext image C 1 ; where, q=1,2,...,Width.
所述扩充的约瑟夫函数为:S′=F(S,InitialValue);The extended Joseph function is: S'=F(S, InitialValue);
其中,F(,)是约瑟夫函数,S是待置乱的序列,S′是置乱后的序列,InitialValue为初始步长;Among them, F(,) is the Joseph function, S is the sequence to be scrambled, S′ is the sequence after scrambling, and InitialValue is the initial step size;
所述扩充的约瑟夫函数的实现方法为:初始遍历时的步长为InitialValue,第n次循环时的步长为S′n-1+1;其中,2≤n≤N,N为序列S中元素的个数;具体实现方法为:The implementation method of the extended Joseph function is as follows: the step size during the initial traversal is InitialValue, and the step size during the nth cycle is S' n-1 +1; where 2≤n≤N, N is the sequence S The number of elements; the specific implementation method is:
步骤1:以步长为InitialValue遍历序列S组成的约瑟夫环,求得S′1;Step 1: traverse the Joseph ring composed of sequence S with the step size as InitialValue, and obtain S′ 1 ;
步骤2:以步长为S′1+1遍历约瑟夫环,求得S′2;Step 2: traverse the Joseph ring with a step size of S′ 1 +1 to obtain S′ 2 ;
步骤3:循环步骤2:以步长为S′n-1+1遍历约瑟夫环,求得S′n;Step 3: Cycle Step 2: Traversing the Joseph ring with a step size of S′ n-1 +1 to obtain S′ n ;
步骤4:以步长为S′N-1+1遍历约瑟夫环,求得S′N;Step 4: traverse the Joseph ring with a step size of S′ N-1 +1 to obtain S′ N ;
步骤5:S′1、S′2、……、S′n、……、S′N组成的序列为之乱后的序列S′。Step 5: The sequence composed of S' 1 , S' 2 , ..., S' n , ..., S' N is the scrambled sequence S'.
所述步骤四中进行像素置换的方法是:The method for performing pixel replacement in step 4 is:
步骤S1:对四个伪随机序列x、y、z、w进行重构得到四个取值区间为[0,255]的伪随机矩阵X、Y、Z、W;Step S1: Reconstruct the four pseudo-random sequences x, y, z, and w to obtain four pseudo-random matrices X, Y, Z, and W with a value range of [0,255];
步骤S2:将大小为Height×Width的密文图像C1等分为大小为Height×Width/4的密文块Block1、Block2、Block3、Block4,使用伪随机矩阵X、Y、Z、W分别与密文块Block1、Block2、Block3、Block4做按位异或运算,得到四个矩阵Block′1,Block′2,Block′3,Block′4;Step S2: Divide the ciphertext image C 1 whose size is Height×Width into ciphertext blocks Block 1 , Block 2 , Block 3 , and Block 4 whose size is Height×Width/4, and use pseudorandom matrices X, Y, Z , W and ciphertext blocks Block 1 , Block 2 , Block 3 , and Block 4 perform bitwise XOR operations respectively to obtain four matrices Block′ 1 , Block′ 2 , Block′ 3 , and Block′ 4 ;
步骤S3:利用伪随机矩阵X、Y、Z、W分别计算控制字矩阵ControlMatrix1和控制字矩阵ControlMatrix2;Step S3: Utilize the pseudo-random matrix X, Y, Z, W to calculate the control word matrix ControlMatrix 1 and the control word matrix ControlMatrix 2 respectively;
步骤S4:使用控制字矩阵ControlMatrix1,将矩阵Block′1和矩阵Block′4进行交叉操作得到交叉后的矩阵Block″1和矩阵Block″4;使用ControlMatrix2作为控制字矩阵,将矩阵Block′2和矩阵Block′3进行交叉操作得到交叉后的矩阵Block″2和矩阵Block″3;Step S4: using the control word matrix ControlMatrix 1 , matrix Block' 1 and matrix Block' 4 are interleaved to obtain crossed matrix Block" 1 and matrix Block"4; using ControlMatrix 2 as the control word matrix, matrix Block' 2 Carry out cross operation with matrix Block ' 3 and obtain matrix Block " 2 and matrix Block " 3 after crossing;
步骤S5:将交叉后的矩阵Block″1、Block″2、Block″3和Block″4重新组成密文图像C2。Step S5: Recompose the crossed matrices Block″ 1 , Block″ 2 , Block″ 3 and Block″ 4 into a ciphertext image C 2 .
所述伪随机矩阵的重构方法为:The reconstruction method of the pseudo-random matrix is:
其中,x(:)、y(:)、z(:)、w(:)分别为序列x、y、z、w中的元素,为向下取整符号,mod(·,·)为求余函数,重组函数reshape(a1,b1,c1)表示将数组a1按列优先的顺序重新排列成大小为b1×c1的数组;Among them, x(:), y(:), z(:), w(:) are elements in the sequence x, y, z, w respectively, is the rounding down symbol, mod( , ) is the remainder function, and the reshape function reshape(a1,b1,c1) means to rearrange the array a1 into an array of size b1×c1 in the order of column priority;
所述矩阵Block′1=bitxor(Block1,X),Block′2=bitxor(Block2,Y),Block′3=bitxor(Block3,Z),Block′4=bitxor(Block4,W),其中,bitxor(·,·)为二进制位异或运算;所述控制字矩阵ControlMatrix1=bitxor(X,Y),控制字矩阵ControlMatrix2=bitxor(Z,W)。所述利用控制字矩阵进行交叉操作的方法为:将待交叉的两个矩阵中的对应位置的元素分别转化为八位的二进制数A和二进制数B,将控制字矩阵中对应位置的元素别转化为八位的二进制数得到控制字C,如果控制字C中的某控制位的值为1时,二进制数A和二进制数B中与控制位对应位置的二进制字符交换;当控制字C中的某控制位的值为0时,二进制数A和二进制数B中与控制位对应位置的二进制字符不进行任何操作。The matrix Block' 1 =bitxor(Block 1 ,X), Block' 2 =bitxor(Block 2 ,Y), Block' 3 =bitxor(Block 3 ,Z), Block' 4 =bitxor(Block 4 ,W) , wherein, bitxor(·,·) is a binary bit XOR operation; the control word matrix ControlMatrix 1 =bitxor(X,Y), and the control word matrix ControlMatrix 2 =bitxor(Z,W). The method of using the control word matrix to carry out the interleaving operation is as follows: the elements at the corresponding positions in the two matrices to be intersected are respectively converted into eight-bit binary numbers A and binary numbers B, and the elements at the corresponding positions in the control word matrix are identified Convert it into an eight-bit binary number to obtain the control word C. If the value of a certain control bit in the control word C is 1, the binary characters in the binary number A and the binary number B corresponding to the control bit are exchanged; when the control word C When the value of a certain control bit of is 0, the binary characters corresponding to the control bit in binary number A and binary number B do not perform any operation.
所述步骤六进行像素扩散的方法为:The method for performing pixel diffusion in step 6 is:
将密文图像C3转化为长度为Height*Width的一维像素序列PixelSequence,利用密钥像素Pixel1对一维像素序列PixelSequence向后扩散得到一维像素序列PixelSequence':Convert the ciphertext image C 3 into a one-dimensional pixel sequence PixelSequence whose length is Height*Width, and use the key pixel Pixel 1 to diffuse the one-dimensional pixel sequence PixelSequence backward to obtain the one-dimensional pixel sequence PixelSequence':
利用密钥像素Pixel2对向后扩散得到一维像素序列PixelSequence'向前扩散得到一维像素序列PixelSequence”:Use the key pixel Pixel 2 to diffuse backward to obtain a one-dimensional pixel sequence PixelSequence'forward diffusion to obtain a one-dimensional pixel sequence PixelSequence":
将长度为Height*Width的一维像素序列PixelSequence”重构成大小为Height×Width的二维矩阵得到加密后的密文图像C;其中bitxor(·,·)为二进制位异或运算。The encrypted ciphertext image C is obtained by reconstructing the one-dimensional pixel sequence "PixelSequence" whose length is Height*Width into a two-dimensional matrix whose size is Height*Width; where bitxor(·,·) is a binary bit XOR operation.
本发明的有益效果:与像素值关联的约瑟夫置乱方法将约瑟夫问题、混沌系统和像素值关联起来,借助混沌映射对初始条件的敏感性与伪随机性,结合约瑟夫遍历置乱的优势,增加了对明文的敏感性,并且减少了置乱过程中混沌系统的迭代次数;将图像进行分块,结合高维度的混沌系统,使分块间进行异或和交叉操作对像素做置换操作,增加了密文图像的随机性同时也提高了密文图像的安全性;通过使用像素的扩散操作使密文图像中的所有像素均受到其它像素的影响,提高了像素之间的联系。仿真结果和安全性分析表明,本发明对密钥的敏感性强,能有效抵御统计性分析和穷举分析等攻击操作,可以用作图像加密。Beneficial effects of the present invention: the Joseph scrambling method associated with pixel values associates the Joseph problem, the chaotic system, and the pixel values, with the help of the sensitivity and pseudo-randomness of the chaotic map to initial conditions, combined with the advantages of Joseph ergodic scrambling, increasing The sensitivity to the plaintext is reduced, and the number of iterations of the chaotic system in the scrambling process is reduced; the image is divided into blocks, combined with a high-dimensional chaotic system, the XOR and cross operations between the blocks are performed to replace the pixels, increasing The randomness of the ciphertext image is improved and the security of the ciphertext image is also improved; all pixels in the ciphertext image are affected by other pixels by using pixel diffusion operation, and the connection between pixels is improved. Simulation results and security analysis show that the invention has strong sensitivity to keys, can effectively resist attack operations such as statistical analysis and exhaustive analysis, and can be used for image encryption.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying 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 also be obtained according to these drawings without creative efforts.
图1为本发明的流程图。Fig. 1 is a flowchart of the present invention.
图2为本发明Chen混沌系统的相轨图,其中,(a)为x-y,(b)为x-z,(c)为x-w,(d)为y-z,(e)为y-w,(f)为z-w。Fig. 2 is the phase orbit diagram of the Chen chaotic system of the present invention, wherein, (a) is x-y, (b) is x-z, (c) is x-w, (d) is y-z, (e) is y-w, (f) is z-w .
图3为本发明原始图像和使用与像素值关联的约瑟夫问题置乱的图像,其中,(a)为Lena原始图像,(b)为置乱后的Lena图像,(c)为Cameraman原始图像,(d)为置乱后的Cameraman图像。Fig. 3 is the original image of the present invention and the image scrambling using the Joseph problem associated with the pixel value, wherein, (a) is the original image of Lena, (b) is the Lena image after scrambling, (c) is the original image of Cameraman, (d) is the Cameraman image after scrambling.
图4为本发明像素置换的操作示意图,其中,(a)为交叉操作的示意图,(b)为图像分割、按位异或运算和交叉运算的流程图。Fig. 4 is a schematic diagram of the operation of pixel replacement in the present invention, wherein (a) is a schematic diagram of interleaving operation, and (b) is a flow chart of image segmentation, bitwise XOR operation and interleaving operation.
图5为本发明的原始图像和密文图像,其中,(a)为128×128的Cameraman原始图像,(b)为256×256的Lena原始图像,(c)为256×256的Cameraman原始图像,(d)为512×512的Brain原始图像,(e)为128×128的Cameraman密文图像,(f)为256×256的Lena密文图像,(g)为256×256的Cameraman密文图像,(h)为512×512的Brain密文图像。Fig. 5 is original image and ciphertext image of the present invention, wherein, (a) is the Cameraman original image of 128 * 128, (b) is the Lena original image of 256 * 256, (c) is the Cameraman original image of 256 * 256 , (d) is the original Brain image of 512×512, (e) is the Cameraman ciphertext image of 128×128, (f) is the Lena ciphertext image of 256×256, (g) is the Cameraman ciphertext image of 256×256 Image, (h) is a 512×512 Brain ciphertext image.
图6为本发明的256×256的Lena原始图像、密文图像以及当密钥发生微小改变时的解密图像,其中,(a)Lena原始图像,(b)为正确的解密图像,(c)为u1改变10-15后的解密图像,(d)为p改变10-15后的解密图像,(e)为x1改变10-15后的解密图像,(f)为y1改变10-15后的解密图像,(g)为z1改变10-14后的解密图像,(h)为w1改变10-15后的解密图像。Fig. 6 is the 256×256 Lena original image of the present invention, the ciphertext image and the decrypted image when the key changes slightly, wherein, (a) Lena original image, (b) is the correct decrypted image, (c) is the decrypted image after changing u1 by 10 -15 , (d) is the decrypted image after changing p by 10 -15 , (e) is the decrypted image after changing x 1 by 10 -15 , (f) is changing y 1 by 10 -15 (g) is the decrypted image after z 1 is changed by 10 -14 , (h) is the decrypted image after w 1 is changed by 10 -15 .
图7为本发明原始图像、原始图像的直方图和密文图像的直方图,其中,(a)为Lena原始图像,(b)为Cameraman原始图像,(c)为Baboon原始图像,(d)为Lena原始图像的直方图,(e)为Cameraman原始图像的直方图,(f)为Baboon原始图像的直方图,(g)为Lena密文图像的直方图,(h)为Cameraman密文图像的直方图,(i)为Baboon密文图像的直方图。Fig. 7 is the original image of the present invention, the histogram of original image and the histogram of ciphertext image, wherein, (a) is Lena original image, (b) is Cameraman original image, (c) is Baboon original image, (d) is the histogram of Lena original image, (e) is the histogram of Cameraman original image, (f) is the histogram of Baboon original image, (g) is the histogram of Lena ciphertext image, (h) is Cameraman ciphertext image The histogram of , (i) is the histogram of the Baboon ciphertext image.
图8为Lena原始图像和密文图像中各方向上相邻像素的值,其中,(a)为Lena原始图像中水平方向上,(b)为Lena原始图像中垂直方向上,(c)为Lena原始图像中对角线方向上,(d)为Lena密文图像中水平方向上,(e)为Lena密文图像中垂直方向上,(f)为Lena密文图像中对角线方向上。Figure 8 is the value of adjacent pixels in each direction in the Lena original image and the ciphertext image, where (a) is in the horizontal direction in the Lena original image, (b) is in the vertical direction in the Lena original image, and (c) is In the diagonal direction in the original Lena image, (d) is in the horizontal direction in the Lena ciphertext image, (e) is in the vertical direction in the Lena ciphertext image, (f) is in the diagonal direction in the Lena ciphertext 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 a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
如图1所示,一种基于像素值关联的约瑟夫遍历和超混沌系统图像加密方法,其特征在于,其步骤如下:As shown in Figure 1, a Joseph traversal and hyperchaotic system image encryption method based on pixel value association is characterized in that its steps are as follows:
步骤一:将大小为Height×Width的原始图像输入SHA-384散列函数,得到384位二进制序列H;将384位二进制序列H等分为48份,八个一组进行运算得到分段线性映射和Chen超混沌系统的初始值。Step 1: Input the original image with a size of Height×Width into the SHA-384 hash function to obtain a 384-bit binary sequence H; divide the 384-bit binary sequence H into 48 parts, and perform operations in groups of eight to obtain a piecewise linear map and Chen initial values for hyperchaotic systems.
本发明使用SHA-384函数产生加密所需的密钥。SHA-384函数是Hash安全散列函数的一种,可以将任意长度的原始图像即明文图像转换为长度为384位的二进制序列。SHA-384函数是不可逆的,因此无法通过密钥推断出任何的明文信息。本发明所使用的混沌系统共有两个,分别为一维分段线性映射和四维Chen超混沌映射。这些混沌系统的初始值共有六个,,分别为u1,p,x1,y1,z1,w1。所述步骤一中计算分段线性映射和Chen超混沌系统的初始值的方法为:将384位二进制序列H等分成48份,得到8位二进制序列h1,h2,…,h48,使用的分段线性映射和Chen超混沌系统的初始值的计算方法为:The present invention uses the SHA-384 function to generate the key required for encryption. The SHA-384 function is a kind of Hash security hash function, which can convert the original image of any length, that is, the plaintext image, into a binary sequence with a length of 384 bits. The SHA-384 function is irreversible, so it is impossible to deduce any plaintext information through the key. There are two chaotic systems used in the present invention, which are one-dimensional piecewise linear mapping and four-dimensional Chen hyperchaotic mapping. There are six initial values of these chaotic systems, respectively u 1 , p, x 1 , y 1 , z 1 , w 1 . The method for calculating the initial value of the piecewise linear map and the Chen hyperchaotic system in the step 1 is: divide the 384-bit binary sequence H into 48 parts to obtain the 8-bit binary sequence h 1 , h 2 , ..., h 48 , use The calculation method of the piecewise linear map and the initial value of the Chen hyperchaotic system is:
其中,u1和p为分段线性映射的初始值,x1、y1、z1、w1为四维Chen超混沌系统的初始值,表示两个8位二进制序列中对应位置元素进行异或运算,u′1,x′1,y′1,z′1,w′1为给定的初始值。Among them, u 1 and p are the initial values of the piecewise linear map, x 1 , y 1 , z 1 , and w 1 are the initial values of the four-dimensional Chen hyperchaotic system, Indicates that XOR operation is performed on corresponding position elements in two 8-bit binary sequences, u′ 1 , x′ 1 , y′ 1 , z′ 1 , and w′ 1 are the given initial values.
步骤二:将分段线性映射的初始值带入分段线性映射进行迭代得到长度为Height*Width的伪随机序列U,将Chen超混沌系统的初始值带入Chen超混沌系统进行迭代得到四个长度为Height*Width/4的伪随机序列x、y、z、w。Step 2: Bring the initial value of the piecewise linear map into the piecewise linear map for iteration to obtain a pseudo-random sequence U of length Height*Width, and bring the initial value of the Chen hyperchaotic system into the Chen hyperchaotic system for iteration to obtain four A pseudorandom sequence x, y, z, w of length Height*Width/4.
混沌系统在密码学中极具应用价值,它因为系统初始值敏感,轨道遍历性强的特点通常被作为伪随机数发生器使用。本发明中置乱过程所使用的伪随机索引值序列由分段线性映射产生。所述分段线性映射的迭代方程为:The chaotic system is of great application value in cryptography. It is usually used as a pseudo-random number generator because of its sensitive initial value and strong track ergodicity. The pseudo-random index value sequence used in the scrambling process in the present invention is generated by piecewise linear mapping. The iterative equation of the piecewise linear mapping is:
其中,p为分段线性映射的参数,取值范围为(0,0.5);u(i+1)∈[0,1)表示分段线性映射第i次迭代产生的伪随机数,i=1,2,……,Height+Width-1;u(i)∈[0,1)是第i次迭代使用的前一次迭代的伪随机数或初始值u1。分段线性映射利用初始值u1迭代Height+Width-1次,将初始值u1和得到的Height+Width-1个伪随机数组成一个长度为Height+Width的混沌序列u,混沌序列u中元素的取值范围为[0,1)。Among them, p is the parameter of the piecewise linear mapping, and the value range is (0,0.5); u(i+1)∈[0,1) represents the pseudo-random number generated by the ith iteration of the piecewise linear mapping, i= 1,2,...,Height+Width-1; u(i)∈[0,1) is the pseudo-random number or initial value u 1 of the previous iteration used in the i-th iteration. The piecewise linear mapping uses the initial value u 1 to iterate Height+Width-1 times, and the initial value u 1 and the obtained Height+Width-1 pseudo-random numbers form a chaotic sequence u with a length of Height+Width. In the chaotic sequence u The value range of the element is [0,1).
与像素值关联的约瑟夫置乱方法中,索引值必须为大于0的整数,所以对分段线性映射产生的伪随机的混沌序列u进行重构,将混沌序列u重构为伪随机序列U:In the Joseph scrambling method associated with pixel values, the index value must be an integer greater than 0, so the pseudo-random chaotic sequence u generated by the piecewise linear mapping is reconstructed, and the chaotic sequence u is reconstructed into a pseudo-random sequence U:
其中,u(:)为混沌序列u中的元素,伪随机序列U中元素的位置和u(:)中元素的位置一一对应,mod(,)表示求余函数。Among them, u(:) is the element in the chaotic sequence u, the position of the element in the pseudo-random sequence U corresponds to the position of the element in u(:), and mod(,) represents the remainder function.
将序列U的前Height个值用作与像素值关联的约瑟夫置乱方法中行置乱的初始值,后Width个值用作与像素值关联的约瑟夫置乱方法列置乱的初始值。例如,当分段线性映射的u(1)=0.23046875,p=0.37890625时,采用改进后的约瑟夫遍历方法对Lena和Cameraman的原始图像进行置乱,结果如图3所示。由图3可知,置乱后的Lena图像和Cameraman图像明显与原始的Lena图像和Cameraman图像不同。The first Height values of the sequence U are used as the initial values of the row scrambling in the Joseph scrambling method associated with the pixel values, and the last Width values are used as the initial values of the Joseph scrambling method column scrambling associated with the pixel values. For example, when u(1)=0.23046875 and p=0.37890625 of the piecewise linear map, the improved Joseph traversal method is used to scramble the original images of Lena and Cameraman, and the result is shown in Figure 3. It can be seen from Figure 3 that the scrambled Lena image and Cameraman image are obviously different from the original Lena image and Cameraman image.
本发明中像素的置换过程使用的混沌系统为Chen超混沌系统,高维的混沌系统相比于低维混沌系统初始值和系统参数更多,轨道更为复杂,系统更为安全。所述Chen超混沌系统的动力方程为:The chaotic system used in the pixel replacement process in the present invention is a Chen hyperchaotic system. Compared with the low-dimensional chaotic system, the high-dimensional chaotic system has more initial values and system parameters, more complex orbits, and a safer system. The dynamic equation of the Chen hyperchaotic system is:
其中,和分别表示动力学参数x',y',z',w'的倒数,a,b,c,d,k分别为Chen超混沌系统的参数,当a=36,b=3,c=28,d=16且-0.7≤k≤0.7时,Chen超混沌系统处于超混沌状态。当x(1)=0.312,y(1)=0.3828125,z(1)=0.4765625,w(1)=0.45703125,k=0.2时,使用Runge-Kutta方法对Chen超混沌系统进行迭代,Chen超混沌系统的相轨图如图2所示。由图2可知,Chen混沌系统轨道复杂,遍历性强,可以用于信息加密。in, and respectively represent the reciprocal of the dynamic parameters x', y', z', w', a, b, c, d, k are the parameters of Chen's hyperchaotic system respectively, when a=36, b=3, c=28, When d=16 and -0.7≤k≤0.7, the Chen hyperchaotic system is in a hyperchaotic state. When x(1)=0.312, y(1)=0.3828125, z(1)=0.4765625, w(1)=0.45703125, k=0.2, use the Runge-Kutta method to iterate the Chen hyperchaotic system, Chen hyperchaos The phase orbit diagram of the system is shown in Figure 2. It can be seen from Figure 2 that Chen's chaotic system has complex orbits and strong ergodicity, and can be used for information encryption.
所述得到伪随机序列x、y、z、w的方法为:将初始值x1、y1、z1、w1带入四维Chen超混沌系统,对Chen超混沌系统迭代Height×Width/4+999次,舍去前999次迭代的值以消除暂态效应,得到四个长度为Height×Width/4的伪随机序列x、y、z、w。The method of obtaining the pseudo-random sequence x, y, z, w is as follows: bring the initial values x 1 , y 1 , z 1 , w 1 into the four-dimensional Chen hyperchaotic system, and iterate the Chen hyperchaotic system Height×Width/4 +999 times, the value of the first 999 iterations is discarded to eliminate the transient effect, and four pseudo-random sequences x, y, z, w of length Height×Width/4 are obtained.
步骤三:用伪随机序列U的前Height个伪随机数作为索引值,使用与像素值关联的约瑟夫置乱方法对原始图像进行行置乱操作,得到密文图像C1。Step 3: Use the first Height pseudo-random numbers of the pseudo-random sequence U as index values, and use the Joseph scrambling method associated with the pixel values to perform row scrambling operations on the original image to obtain the ciphertext image C 1 .
据说著名犹太历史学家Josephus有过以下的故事:在罗马人占领乔塔帕特后,39个犹太人与Josephus及他的朋友躲到一个洞中,39个犹太人决定宁愿死也不要被敌人抓到,于是决定了一个自杀方式,41个人排成一个圆圈,由第1个人开始报数,每报数到第3人该人就必须自杀,然后再由下一个重新报数,直到所有人都自杀身亡为止。然而Josephus和他的朋友并不想遵从。问题是,给定了总数和步长,一开始要站在什么地方才能避免被处决?Josephus要他的朋友先假装遵从,他将朋友与自己安排在第16个与第31个位置,逃过了这场死亡游戏。对于约瑟夫问题可以量化成一个约瑟夫函数S′=F(S,k),该函数中,S序列代表元素的排列集合{s1,s2,s3,…,sN},k表示步长。以序列S={1,2,3,4,5,6,7},k=3为例,该约瑟夫函数的解为{3,6,2,7,5,1,4},此解代表序列中元素3,6,2,7,5,1,4被依次选出。约瑟夫问题是一个经典的计算问题,又称为约瑟夫环。后人对约瑟夫问题进行了扩充,增加了起始位点和循环的方向,大大丰富了约瑟夫问题的内涵。It is said that the famous Jewish historian Josephus had the following story: After the Romans occupied Chotapat, 39 Jews hid in a cave with Josephus and his friends, and the 39 Jews decided that they would rather die than be caught by the enemy , so a suicide method was decided, 41 people lined up in a circle, the first person started to count, every time the third person was counted, the person had to commit suicide, and then the next person counted again, until everyone committed suicide until death. However Josephus and his friends did not want to comply. The question is, given the total number and step size, where to stand in the first place to avoid being executed? Josephus asked his friend to pretend to obey first, and he placed his friend and himself in the 16th and 31st positions, escaping the death game. For the Joseph problem, it can be quantified into a Joseph function S′=F(S,k). In this function, the S sequence represents the permutation set of elements {s 1 ,s 2 ,s 3 ,…,s N }, and k represents the step size . Taking the sequence S={1, 2, 3, 4, 5, 6, 7}, k=3 as an example, the solution of the Joseph function is {3, 6, 2, 7, 5, 1, 4}, the solution The elements 3, 6, 2, 7, 5, 1, and 4 in the representative sequence are selected in turn. The Joseph problem is a classic computational problem, also known as the Joseph ring. Later generations expanded the Joseph problem, adding the starting point and the direction of the cycle, which greatly enriched the connotation of the Joseph problem.
为了使约瑟夫遍历与明文关联,本发明对约瑟夫问题进行改造,给出了一种与像素值关联的约瑟夫遍历方法,将约瑟夫函数扩充并将其应用在像素的置乱过程中得到与像素值关联的约瑟夫置乱方法。扩充的约瑟夫函数为:S′=F(S,InitialValue);其中,F(·,·)是约瑟夫函数,S是待置乱的序列且S={s1,s2,s3,…,sN},S′是置乱后的序列,InitialValue为初始步长。In order to make the Joseph traversal associated with the plaintext, the present invention reforms the Joseph problem, and provides a Joseph traversal method associated with the pixel value, which expands the Joseph function and applies it to the pixel scrambling process to obtain an association with the pixel value. The Joseph scrambling method. The extended Joseph function is: S′=F(S,InitialValue); where, F(·,·) is the Joseph function, S is the sequence to be scrambled and S={s 1 ,s 2 ,s 3 ,…, s N }, S′ is the scrambled sequence, and InitialValue is the initial step size.
所述扩充的约瑟夫函数的实现方法为:初始遍历时的步长为InitialValue,第n次循环时的步长为S′n-1+1;其中,2≤n≤N,N为序列S中元素的个数;具体实现方法为:The implementation method of the extended Joseph function is as follows: the step size during the initial traversal is InitialValue, and the step size during the nth cycle is S' n-1 +1; where 2≤n≤N, N is the sequence S The number of elements; the specific implementation method is:
步骤1:以步长为InitialValue遍历序列S组成的约瑟夫环,求得S′1;Step 1: traverse the Joseph ring composed of sequence S with the step size as InitialValue, and obtain S′ 1 ;
步骤2:以步长为S′1+1遍历约瑟夫环,求得S′2;Step 2: traverse the Joseph ring with a step size of S′ 1 +1 to obtain S′ 2 ;
步骤3:循环步骤2:以步长为S′n-1+1遍历约瑟夫环,求得S′n;Step 3: Cycle Step 2: Traversing the Joseph ring with a step size of S′ n-1 +1 to obtain S′ n ;
步骤4:以步长为S′N-1+1遍历约瑟夫环,求得S′N;Step 4: traverse the Joseph ring with a step size of S′ N-1 +1 to obtain S′ N ;
步骤5:S′1、S′2、……、S′n、……、S′N组成的序列为之乱后的序列S′。Step 5: The sequence composed of S' 1 , S' 2 , ..., S' n , ..., S' N is the scrambled sequence S'.
假设给定序列S={1,0,255,128,100,80,60},InitialValue=3,扩充的约瑟夫函数F(S,InitialValue)的遍历步骤为:Assuming a given sequence S={1, 0, 255, 128, 100, 80, 60}, InitialValue=3, the traversal steps of the extended Joseph function F(S, InitialValue) are:
步骤1:以步长为3遍历约瑟夫环,求得S′1=255;Step 1: traverse the Joseph ring with a step size of 3, and obtain S′ 1 =255;
步骤2:以步长为S′1+1=256遍历约瑟夫环,求得S′2=60;Step 2: traverse the Joseph ring with a step size of S′ 1 +1=256, and obtain S′ 2 =60;
步骤3:以步长为S′2+1=61遍历约瑟夫环,求得S′3=1;Step 3: traverse the Joseph ring with a step size of S′ 2 +1=61, and obtain S′ 3 =1;
步骤4:以步长为S′3+1=2遍历约瑟夫环,求得S′4=128;Step 4: traverse the Joseph ring with a step size of S′ 3 +1=2, and obtain S′ 4 =128;
步骤5:以步长为S′4+1=129遍历约瑟夫环,求得S′5=0;Step 5: traverse the Joseph ring with a step size of S′ 4 +1=129, and obtain S′ 5 =0;
步骤6:以步长为S′5+1=1遍历约瑟夫环,求得S′6=100;Step 6: traverse the Joseph ring with a step size of S′ 5 +1=1, and obtain S′ 6 =100;
步骤7:以步长为S′6+1=101遍历约瑟夫环,求得S′7=80。Step 7: Traversing the Joseph ring with a step size of S′ 6 +1=101 to obtain S′ 7 =80.
所以,当S={1,0,255,128,100,80,60},InitialValue=3时,函数F(S,InitialValue)的解为序列S′={255,60,1,128,0,100,80}。改造后的约瑟夫函数被用于像素的置乱过程中,其中,InitialValue是置乱过程的密钥。该置乱过程是可逆的,即知道加密后的像素序列S′和初始步长InitialValue,即可还原出原序列S。该置乱方法的还原过程可被描述为S=F-1(S′,InitialValue)。Therefore, when S={1, 0, 255, 128, 100, 80, 60}, InitialValue=3, the solution of the function F(S, InitialValue) is the sequence S'={255, 60, 1, 128, 0 , 100, 80}. The modified Joseph function is used in the pixel scrambling process, where InitialValue is the key of the scrambling process. The scrambling process is reversible, that is, the original sequence S can be restored by knowing the encrypted pixel sequence S' and the initial step size InitialValue. The restoration process of the scrambling method can be described as S=F −1 (S′, InitialValue).
所述步骤三中与像素值关联的约瑟夫置乱方法的实现方法为:将伪随机序列U(j)的元素作为初始步长InitialValue、原始图像的第j行元素作为序列S的元素带入扩充的约瑟夫函数,得到的序列S′是置乱后密文图像C1的第j行元素;其中,j=1,2,……,Height。具体方法为:The implementation method of the Joseph scrambling method associated with the pixel value in the step 3 is as follows: the element of the pseudo-random sequence U(j) is used as the initial step size InitialValue, and the element of the jth row of the original image is brought into the expansion as the element of the sequence S The obtained sequence S′ is the jth row element of the scrambled ciphertext image C 1 ; where j=1,2,...,Height. The specific method is:
S1:将伪随机序列U(j)的元素作为初始步长、原始图像的第j行元素作为序列S带入扩充的约瑟夫函数,遍历约瑟夫环得到S′j1,其中,j=1,2,……,Height;S1: Take the elements of the pseudo-random sequence U(j) as the initial step size, and the elements of the jth row of the original image as the sequence S into the extended Joseph function, and traverse the Joseph ring to obtain S′ j1 , where j=1,2, ......, Height;
S2:将S′j1+1作为步长遍历约瑟夫环,得到S′j2;S2: Use S′ j1 +1 as the step size to traverse the Joseph ring to get S′ j2 ;
S3:循环步骤S2:将S′j(q)+1作为步长遍历约瑟夫环,得到S′j(q+1);其中,q=1,2,……,Width-1;S3: Loop step S2: use S' j(q) +1 as the step size to traverse the Joseph ring to obtain S'j(q+1); where, q=1,2,...,Width-1;
S4:将S′j(Width-1)+1作为步长遍历约瑟夫环,得到S′j(width);S4: Use S′ j(Width-1) +1 as the step size to traverse the Joseph ring to obtain S′ j(width) ;
S5:S′j1、S′j2……、S′j(q+1)、S′j(width)组成的序列序列S′j是原始图像的第j行置乱后的序列,即S′j1、S′j2……、S′j(q)、S′j(width)是密文图像C1的第j行的元素。S5: S' j1 , S' j2 ..., S' j(q+1) , S' j(width) The sequence sequence S' j is the sequence after the jth line of the original image is scrambled, that is, S' j1 , S′ j2 . . . , S′ j(q) , S′ j(width) are the elements of the jth row of the ciphertext image C 1 .
使用与像素值关联的约瑟夫置乱方法包括行置乱操作和列置乱操作。因为置乱所使用的伪随机索引值序列的长度较小,所以置乱所使用的伪随机索引值序列将由分段线性映射产生。Methods using Joseph scrambling associated with pixel values include row scrambling operations and column scrambling operations. Because the length of the pseudo-random index value sequence used for scrambling is small, the pseudo-random index value sequence used for scrambling will be generated by the piecewise linear map.
步骤四:将密文图像C1等分成4份得到密文块,使用伪随机序列x、y、z、w分别对4个密文块中的像素进行像素置换并重组置换后的密文块,得到密文图像C2。Step 4: Divide the ciphertext image C 1 into 4 equal parts to obtain ciphertext blocks, use the pseudo-random sequence x, y, z, w to perform pixel replacement on the pixels in the 4 ciphertext blocks and reassemble the replaced ciphertext blocks , to get the ciphertext image C 2 .
像素置乱将图像的位置进行打乱,破坏了相邻像素之间的相关性,但是像素并没有经过任何计算,无法有效地抵抗密码学攻击,进一步通过像素置换能够彻底混淆明文图像和密文图像之间的关系。本发明使用异或和交叉操作对像素进行置换操作。交叉操作是遗传算法中常用的算子,交叉操作的示意图如图4(a)所示。即假设有两个待加密的像素A和B,为使交叉操作具有可逆性,这里添加一个控制字C,并将A、B和C均转为八位二进制数:当控制字C中的某位值为1时,像素A、B中与控制位对应位置的二进制字符交换;当控制字C中的某位值为0时,像素A、B中与控制位对应位置的二进制字符不进行任何操作。Pixel scrambling scrambles the position of the image and destroys the correlation between adjacent pixels, but the pixels have not undergone any calculations and cannot effectively resist cryptographic attacks. Further pixel replacement can completely confuse the plaintext image and ciphertext relationship between images. The present invention uses XOR and cross operations to perform replacement operations on pixels. Crossover operation is a commonly used operator in genetic algorithm, and the schematic diagram of crossover operation is shown in Figure 4(a). That is, assuming that there are two pixels A and B to be encrypted, in order to make the interleaving operation reversible, a control word C is added here, and A, B, and C are all converted into eight-bit binary numbers: when a certain value in the control word C When the bit value is 1, the binary characters at the positions corresponding to the control bits in pixels A and B are exchanged; when a certain bit value in the control word C is 0, the binary characters at the positions corresponding to the control bits in pixels A and B are not changed. operate.
如图4(b)所示,所述步骤四中进行像素置换的方法是:As shown in Figure 4(b), the method for pixel replacement in step 4 is:
步骤S1:对四个伪随机序列x、y、z、w进行重构得到四个取值区间为[0,255]的伪随机矩阵X、Y、Z、W。Step S1: Reconstruct the four pseudo-random sequences x, y, z, and w to obtain four pseudo-random matrices X, Y, Z, and W whose values range from [0,255].
所述伪随机矩阵的重构方法为:The reconstruction method of the pseudo-random matrix is:
其中,x(:)、y(:)、z(:)、w(:)分别为序列x、y、z、w中的元素,为向下取整符号,mod(·,·)为求余函数,重组函数reshape(a1,b1,c1)表示将数组a1按列优先的顺序重新排列成大小为b1×c1的数组。Among them, x(:), y(:), z(:), w(:) are elements in the sequence x, y, z, w respectively, is the rounding down symbol, mod(·,·) is the remainder function, and the reshape function reshape(a1,b1,c1) means to rearrange the array a1 into an array of size b1×c1 in the order of column priority.
步骤S2:将大小为Height×Width的密文图像C1等分为大小为Height×Width/4的密文块Block1、Block2、Block3、Block4,使用伪随机矩阵X、Y、Z、W分别与密文块Block1、Block2、Block3、Block4做按位异或运算,得到四个矩阵Block′1,Block′2,Block′3,Block′4。Step S2: Divide the ciphertext image C 1 whose size is Height×Width into ciphertext blocks Block 1 , Block 2 , Block 3 , and Block 4 whose size is Height×Width/4, and use pseudorandom matrices X, Y, Z , W and the ciphertext blocks Block 1 , Block 2 , Block 3 , and Block 4 are respectively bitwise XORed to obtain four matrices Block′ 1 , Block′ 2 , Block′ 3 , and Block′ 4 .
所述矩阵Block′1=bitxor(Block1,X),Block′2=bitxor(Block2,Y),Block′3=bitxor(Block3,Z),Block′1=bitxor(Block4,W),其中,bitxor(·,·)为二进制位异或运算,即将密文块和伪随机矩阵对应位置的元素转换为8位二进制数,然后对应位置的二进制数进行二进制位异或计算,然后将8位二进制数转化为十进制数即为矩阵Block′1,Block′2,Block′3,Block′4的对应位置的元素。The matrix Block' 1 = bitxor (Block 1 , X), Block' 2 = bitxor (Block 2 , Y), Block' 3 = bitxor (Block 3 , Z), Block' 1 = bitxor (Block 4 , W) , where, bitxor(·,·) is a binary bit XOR operation, that is, convert the elements at the corresponding positions of the ciphertext block and the pseudo-random matrix into 8-bit binary numbers, and then perform binary bit XOR calculations on the binary numbers at the corresponding positions, and then The conversion of 8-bit binary numbers into decimal numbers is the elements of the corresponding positions of the matrix Block′ 1 , Block′ 2 , Block′ 3 , and Block′ 4 .
步骤S3:利用伪随机矩阵X、Y、Z、W分别计算控制字矩阵ControlMatrix1和控制字矩阵ControlMatrix2。Step S3: Calculate the control matrix ControlMatrix 1 and the control matrix ControlMatrix 2 respectively by using the pseudo-random matrices X, Y, Z, and W.
所述控制字矩阵ControlMatrix1=bitxor(X,Y),控制字矩阵ControlMatrix2=bitxor(Z,W)。即利用两个伪随机矩阵进行二进制位异或运算得到控制字矩阵。The control word matrix ControlMatrix 1 =bitxor(X,Y), and the control word matrix ControlMatrix 2 =bitxor(Z,W). That is, two pseudo-random matrices are used to perform binary bit XOR operation to obtain a control word matrix.
步骤S4:使用控制字矩阵ControlMatrix1,将矩阵Block′1和矩阵Block′4进行交叉操作得到交叉后的矩阵Block″1和矩阵Block″4;使用ControlMatrix2作为控制字矩阵,将矩阵Block′2和矩阵Block′3进行交叉操作得到交叉后的矩阵Block″2和矩阵Block″3。Step S4: using the control word matrix ControlMatrix 1 , matrix Block' 1 and matrix Block' 4 are interleaved to obtain crossed matrix Block" 1 and matrix Block"4; using ControlMatrix 2 as the control word matrix, matrix Block' 2 Perform crossover operation with matrix Block′ 3 to obtain crossover matrix Block″ 2 and matrix Block″ 3 .
所述利用控制字矩阵进行交叉操作的方法为:将待交叉的两个矩阵中的对应位置的元素分别转化为八位的二进制数A和二进制数B,将控制字矩阵中对应位置的元素别转化为八位的二进制数得到控制字C,如果控制字C中的某控制位的值为1时,二进制数A和二进制数B中与控制位对应位置的二进制字符交换;当控制字C中的某控制位的值为0时,二进制数A和二进制数B中与控制位对应位置的二进制字符不进行任何操作。The method of using the control word matrix to carry out the interleaving operation is as follows: the elements at the corresponding positions in the two matrices to be intersected are respectively converted into eight-bit binary numbers A and binary numbers B, and the elements at the corresponding positions in the control word matrix are identified Convert it into an eight-bit binary number to obtain the control word C. If the value of a certain control bit in the control word C is 1, the binary characters in the binary number A and the binary number B corresponding to the control bit are exchanged; when the control word C When the value of a certain control bit of is 0, the binary characters corresponding to the control bit in binary number A and binary number B do not perform any operation.
步骤S5:将交叉后的矩阵Block″1、Block″2、Block″3和Block″4重新组成密文图像C2。Step S5: Recompose the crossed matrices Block″ 1 , Block″ 2 , Block″ 3 and Block″ 4 into a ciphertext image C 2 .
步骤五:用伪随机序列U的后Width个伪随机数作为索引值,使用与像素值关联的约瑟夫置乱方法对密文图像C2进行列置乱操作,得到密文图像C3。Step 5: Use the last Width pseudo-random numbers of the pseudo-random sequence U as index values, and use the Joseph scrambling method associated with pixel values to perform a column scrambling operation on the ciphertext image C 2 to obtain the ciphertext image C 3 .
所述步骤五中与像素值关联的约瑟夫置乱方法的实现方法为:将伪随机序列U(Height+q)的元素作为初始步长InitialValue、密文图像C2的第q列元素作为序列S的元素带入扩充的约瑟夫函数,得到的序列S′是置乱后密文图像C1的第j行元素;其中,q=1,2,……,Width。具体实现方法与步骤三相同。The implementation method of the Joseph scrambling method associated with the pixel value in the step 5 is: the element of the pseudo-random sequence U(Height+q) is used as the initial step size InitialValue , and the qth column element of the ciphertext image C2 is used as the sequence S The elements of are brought into the extended Joseph function, and the obtained sequence S' is the jth row element of the scrambled ciphertext image C 1 ; where, q=1,2,...,Width. The specific implementation method is the same as step three.
步骤六:使用两个密钥像素Pixel1和Pixel2对密文图像C3中的像素做像素扩散操作,得到加密后的密文图像C。Step 6: Use two key pixels Pixel 1 and Pixel 2 to perform a pixel diffusion operation on the pixels in the ciphertext image C 3 to obtain the encrypted ciphertext image C.
为了使密文中的像素互相影响,进一步对像素进行扩散。首先将密文图像C3的图像矩阵转换成一维序列,然后入两个算子先后对像素进行向后扩散和向前扩散,以确保图像中的每一个像素都受到其它像素的影响。所述步骤六进行像素扩散的方法为:In order to make the pixels in the ciphertext interact with each other, the pixels are further diffused. First, the image matrix of the ciphertext image C 3 is converted into a one-dimensional sequence, and then two operators are used to diffuse the pixels backward and forward to ensure that each pixel in the image is affected by other pixels. The method for performing pixel diffusion in step 6 is:
将密文图像C3转化为长度为Height*Width的一维像素序列PixelSequence,利用密钥像素Pixel1对一维像素序列PixelSequence向后扩散得到一维像素序列PixelSequence':Convert the ciphertext image C 3 into a one-dimensional pixel sequence PixelSequence whose length is Height*Width, and use the key pixel Pixel 1 to diffuse the one-dimensional pixel sequence PixelSequence backward to obtain the one-dimensional pixel sequence PixelSequence':
利用密钥像素Pixel2对向后扩散得到一维像素序列PixelSequence'向前扩散得到一维像素序列PixelSequence”:Use the key pixel Pixel 2 to diffuse backward to obtain a one-dimensional pixel sequence PixelSequence'forward diffusion to obtain a one-dimensional pixel sequence PixelSequence":
将长度为Height*Width的一维像素序列PixelSequence”重构成大小为Height×Width的二维矩阵得到加密后的密文图像C。像素扩散操作的解密过程是加密过程的逆过程,这里不再赘述。Reconstruct the one-dimensional pixel sequence "PixelSequence" whose length is Height*Width into a two-dimensional matrix whose size is Height×Width to obtain the encrypted ciphertext image C. The decryption process of the pixel diffusion operation is the inverse process of the encryption process, and will not be repeated here .
本发明的解密方法是加密方法的逆过程,因此本发明不再赘述。The decryption method of the present invention is the reverse process of the encryption method, so the present invention will not repeat it.
当加密的初始密钥分别为u′1=0,x′1=0,y′1=0,z′1=0,w′1=0,Pixel1=127,Pixel1=255时,使用本发明加密的原始图像和密文图像如图5所示,该仿真实验在MATLABR2018a平台上完成。通过观察,本发明加密的密文图像已经完全失去原始图像所表达的特征。因为本发明的加密算法是无损的,所以使用本发明所得到的密文图像的解密图像和原始图像完全相同,这里不再一一列举。下面将对使用本发明加密的密文图像的安全性进行量化分析,以此证明该加密算法的安全性。When the encrypted initial keys are u′ 1 =0, x′ 1 =0, y′ 1 =0, z′ 1 =0, w′ 1 =0, Pixel 1 =127, Pixel 1 =255, use The original image and ciphertext image encrypted by the present invention are shown in Figure 5, and the simulation experiment was completed on the MATLABR2018a platform. Through observation, the encrypted ciphertext image of the present invention has completely lost the characteristics expressed by the original image. Because the encryption algorithm of the present invention is lossless, the decrypted image of the ciphertext image obtained by using the present invention is exactly the same as the original image, and will not be listed here. In the following, the security of the encrypted ciphertext image using the present invention will be quantitatively analyzed to prove the security of the encryption algorithm.
本发明使用SHA-384算法产生的二进制序列和两个像素作为初始密钥,其密钥空间足以抵抗穷举攻击。本发明所使用的两个混沌系统对系统的初始值十分敏感,当混沌系统的初始值发生微小的改变时,解密图像会发生很大的变化。图6中列举了大小为256×256的Lena原始图像、密文图像以及当密钥发生微小改变时的解密图像,通过对比可以看出,当密钥发生微小的改变,密文图像便无法被正确的解密。本发明有着极强的密钥灵敏性。均方差(MSE)和峰值信噪比(PSNR)可以用来衡量当密钥发生微小改变时原始图像与解密图像的差别,MSE的计算方法如公式(11)所示,PSNR的计算方法如公式(12)所示:The invention uses the binary sequence generated by the SHA-384 algorithm and two pixels as the initial key, and its key space is sufficient to resist exhaustion attack. The two chaotic systems used in the present invention are very sensitive to the initial value of the system. When the initial value of the chaotic system changes slightly, the decrypted image will change greatly. Figure 6 lists the original image of Lena with a size of 256×256, the ciphertext image, and the decrypted image when the key changes slightly. Through comparison, it can be seen that when the key changes slightly, the ciphertext image cannot be detected. correct decryption. The present invention has extremely strong key sensitivity. Mean square error (MSE) and peak signal-to-noise ratio (PSNR) can be used to measure the difference between the original image and the decrypted image when the key changes slightly. The calculation method of MSE is shown in formula (11), and the calculation method of PSNR is shown in formula As shown in (12):
公式(11)和(12)中,P1(i,j)表示原始图像第i行、第j列的像素,P2(i,j)表示当密钥发生微小改变时的解密图像第i行、第j列的像素,Height和Width分别为图像的高和宽。一般来说,当MSE≥30时,说明两幅图像之间的差异是显著的。PSNR的值越小,两幅图像之间的差异越大。以Lena图像为例,当密钥发生微小改变时,原始图像和解密图像之间的MSE和PSNR的值如表1所示。通过对比可知,本发明的密钥灵敏性很强。In formulas (11) and (12), P 1 (i, j) represents the pixel in the i-th row and j-th column of the original image, and P 2 (i, j) represents the i-th pixel of the decrypted image when the key changes slightly. The pixels in row and column j, Height and Width are the height and width of the image respectively. In general, when MSE ≥ 30, it means that the difference between the two images is significant. The smaller the value of PSNR, the greater the difference between the two images. Taking the Lena image as an example, when the key changes slightly, the values of MSE and PSNR between the original image and the decrypted image are shown in Table 1. It can be seen from the comparison that the key sensitivity of the present invention is very strong.
表1当密钥发生微小改变时原始图像和解密图像之间的MSE和PSNR的值Table 1 The values of MSE and PSNR between the original image and the decrypted image when the key changes slightly
直方图可以反映出一个图像中所有像素的值的统计情况。图7中(a)-(c)为原始图像、(d)-(f)为原始图像的直方图、(g)-(i)为密文图像的直方图。原始图像的直方图中,像素值分布较为集中,具有一定的统计特性,对穷举攻击没有抵抗能力。而密文图像中像素的分布则均匀而且分散,像素的分布规律被打破,不再具有统计特性,攻击者不能利用统计特性穷举图像的原有信息,因此本发明可以很好地抵抗统计分析攻击。A histogram can reflect the statistics of the values of all pixels in an image. In Figure 7, (a)-(c) is the original image, (d)-(f) is the histogram of the original image, and (g)-(i) is the histogram of the ciphertext image. In the histogram of the original image, the distribution of pixel values is relatively concentrated and has certain statistical characteristics, so it has no resistance to exhaustive attacks. However, the distribution of pixels in the ciphertext image is uniform and scattered, the distribution of pixels is broken, and no longer has statistical characteristics. Attackers cannot use statistical characteristics to exhaustively enumerate the original information of the image. Therefore, the present invention can well resist statistical analysis. attack.
像素直方图的分布规律可以使用直方图方差来衡量,用histi(i=0,1,…,255)表示图像的直方图,则直方图方差的计算公式如公式(13)所描述:The distribution law of the pixel histogram can be measured by the histogram variance. Use hist i (i=0,1,...,255) to represent the histogram of the image, and the calculation formula of the histogram variance is as described in formula (13):
直方图方差表示图像直方图中像素值分布的均匀程度,直方图的方差越小,像素值分布越均匀。图7中所列举图像的方差如表2所示。通过对比可知,本发明极大的改变了图像的方差,具有良好的打破原始图像直方图分布的能力。The histogram variance indicates the uniformity of pixel value distribution in the image histogram, the smaller the variance of the histogram, the more uniform the pixel value distribution. The variance of the images listed in Figure 7 is shown in Table 2. It can be seen from the comparison that the present invention greatly changes the variance of the image and has a good ability to break the histogram distribution of the original image.
表2直方图的方差统计Table 2 Variance statistics of the histogram
信息熵是香农提出的用以量化信息量的概念,香农用信息熵来量化信息的不确定度。信息熵的计算方法如公式(14):Information entropy is a concept proposed by Shannon to quantify the amount of information. Shannon uses information entropy to quantify the uncertainty of information. The calculation method of information entropy is as formula (14):
式中,s表示信源中可能出现的事件的总数,p(i)表示信源中每种事件i可能出现的概率。信息熵H(s)可以用来度量图像的随机程度。当使用公式(14)计算图像的信息熵时, histi(i=0,1,…,255)表示图像的直方图。一幅理想的随机图像,其像素出现每种数值的概率均为1/256,所以理想情况下随机图像的信息熵为8。当图像的信息熵接近于8时,说明图像的随机程度很强。表3中列举了使用本发明加密方法的原始图像和密文图像的信息熵,通过对比可知,使用本发明加密的密文图像的信息熵接近于8,所以密文图像的随机性很强。In the formula, s represents the total number of possible events in the source, and p(i) represents the probability of each event i in the source. Information entropy H(s) can be used to measure the randomness of an image. When using formula (14) to calculate the information entropy of an image, hist i (i=0,1,...,255) represents the histogram of the image. An ideal random image has a probability of 1/256 for each value in a pixel, so ideally the information entropy of a random image is 8. When the information entropy of the image is close to 8, it means that the randomness of the image is very strong. Table 3 lists the information entropy of the original image and the ciphertext image using the encryption method of the present invention. By comparison, it can be seen that the information entropy of the ciphertext image encrypted using the present invention is close to 8, so the randomness of the ciphertext image is very strong.
表3原始图像和密文图像的信息熵Table 3 Information entropy of original image and ciphertext image
图8中(a)-(c)为Lena原始图像水平方向、垂直方向和对角线方向的相邻像素的值的统计,(d)-(f)为Lena密文图像水平方向、垂直方向和对角线方向的相邻像素的值的统计。原始图像中大部分区域相邻像素间的值都十分接近,图像相邻位置像素的值的相关性很强。而密文图像打破像素之间的强相关性,对抵抗统计分析攻击具有很大的意义。相邻像素间相关系数的计算方法如公式(15)所示:(a)-(c) in Figure 8 is the statistics of the values of adjacent pixels in the horizontal direction, vertical direction and diagonal direction of the Lena original image, and (d)-(f) is the horizontal direction and vertical direction of the Lena ciphertext image and the statistics of the values of adjacent pixels in the diagonal direction. The values between adjacent pixels in most areas of the original image are very close, and the correlation between the values of adjacent pixels in the image is very strong. The ciphertext image breaks the strong correlation between pixels, which is of great significance for resisting statistical analysis attacks. The calculation method of the correlation coefficient between adjacent pixels is shown in formula (15):
其中,xi表示被选定的像素的值,yi表示和xi的相邻的像素的值,N表示被选定的像素的总数,E(x)为被选定的像素的平均值,E(y)为与被选定的像素相邻的像素的平均值,D(x)表示被选定的像素的方差,D(y)与被选定的像素相邻的像素的方差,cov(x,y)表示x、y之间的协方差,rxy表示x、y之间的协方差。Among them, xi represents the value of the selected pixel, y i represents the value of the adjacent pixel to xi , N represents the total number of selected pixels, and E(x) is the average value of the selected pixels , E(y) is the average value of the pixels adjacent to the selected pixel, D(x) represents the variance of the selected pixel, D(y) is the variance of the pixels adjacent to the selected pixel, cov(x,y) represents the covariance between x and y, and r xy represents the covariance between x and y.
随机选取10000对像素点,对原始图像和密文图像的水平方向、垂直方向和对角线方向上的相关系数进行了统计。统计结果如表4所示。表4中的统计结果表明,在原始图像中随机选取得到的像素相关性很强,而在密文图像中像素之间的相关系数接近于0。本发明所提出的加密方法可以更好地打乱像素之间的相关性,因此可以更好地抵御统计分析攻击。Randomly select 10,000 pairs of pixels, and make statistics on the correlation coefficients of the original image and the ciphertext image in the horizontal direction, vertical direction and diagonal direction. The statistical results are shown in Table 4. The statistical results in Table 4 show that the randomly selected pixels in the original image have a strong correlation, while the correlation coefficient between pixels in the ciphertext image is close to 0. The encryption method proposed by the present invention can better disrupt the correlation between pixels, so it can better resist statistical analysis attacks.
表4原始图像和密文图像各方向的相关系数Table 4 Correlation coefficients of original image and ciphertext image in each direction
差分攻击是指使明文发生微小的改变,然后比较分析密文的改变。像素数改变率(NPCR)和归一化平均改变强度(UACI)两个指标可以反应出算法抵抗差分攻击能力的大小,NPCR的计算方法如公式(16)所示,UACI的计算方法如公式(17)所示:Differential attack refers to making small changes in the plaintext, and then comparing and analyzing the changes in the ciphertext. Number of Pixel Change Rate (NPCR) and Normalized Average Change Intensity (UACI) two indicators can reflect the size of the algorithm's ability to resist differential attacks. The calculation method of NPCR is shown in formula (16), and the calculation method of UACI is shown in formula ( 17) as shown:
公式(12)中,sign()为符号函数,其计算方法如公式(18)所示:In formula (12), sign() is a sign function, and its calculation method is shown in formula (18):
NPCR的理想值为100%,UACI的理想值为33.4635%,明文发生微小改变后,其NPCR、UACI的值越接近与理想值,加密算法的抗差分攻击能力越强。表5中列举了当明文图像发生1bit的变化,它们的密文图像的NPCR,UACI的值,通过对比可知,本发明具有良好的抗差分攻击能力。The ideal value of NPCR is 100%, and the ideal value of UACI is 33.4635%. After a slight change in the plaintext, the closer the values of NPCR and UACI are to the ideal value, the stronger the ability of the encryption algorithm to resist differential attacks. Table 5 lists the values of NPCR and UACI of their ciphertext images when the plaintext images change by 1 bit. Through comparison, it can be seen that the present invention has good anti-differential attack capability.
表5明文图像发生1bit的变化后NPCR、UACI的值Table 5 Values of NPCR and UACI after a 1-bit change in the plaintext image
本发明对约瑟夫问题做出了改进,提出了一种与像素值关联的约瑟夫置乱方法,这种置乱方法将约瑟夫问题、混沌系统和像素值关联起来,增加了对明文的敏感性,并且减少了置乱过程中混沌系统的迭代次数。本发明使用高维度的混沌系统对像素做置换操作,增加了加密系统的随机性的,同时也提高了系统的安全性。本发明通过使用像素的扩散操作使密文图像中的所有像素均受到其它像素的影响,提高了像素之间的联系。仿真结果和安全性分析表明,本发明是安全的,可以用作图像加密。The present invention improves the Joseph problem, and proposes a Joseph scrambling method associated with pixel values. This scrambling method associates the Joseph problem, the chaotic system and the pixel value, increases the sensitivity to plaintext, and The number of iterations of the chaotic system in the scrambling process is reduced. The present invention uses a high-dimensional chaotic system to perform replacement operations on pixels, which increases the randomness of the encryption system and improves the security of the system at the same time. In the present invention, all pixels in the ciphertext image are affected by other pixels by using pixel diffusion operation, thereby improving the connection between pixels. Simulation results and safety analysis show that the invention is safe and can be used for image encryption.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the present invention. within the scope of protection.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910349652.9A CN110086601B (en) | 2019-04-28 | 2019-04-28 | Joseph traversal and hyperchaotic system image encryption method based on pixel value association |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910349652.9A CN110086601B (en) | 2019-04-28 | 2019-04-28 | Joseph traversal and hyperchaotic system image encryption method based on pixel value association |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110086601A true CN110086601A (en) | 2019-08-02 |
CN110086601B CN110086601B (en) | 2020-03-10 |
Family
ID=67417308
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910349652.9A Active CN110086601B (en) | 2019-04-28 | 2019-04-28 | Joseph traversal and hyperchaotic system image encryption method based on pixel value association |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110086601B (en) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110838908A (en) * | 2019-11-11 | 2020-02-25 | 陕西师范大学 | An Image Encryption and Decryption Method Based on GF Matrix Transformation and Random Hierarchical Fusion |
CN111353166A (en) * | 2020-02-25 | 2020-06-30 | 南通大学 | An encryption method for converting pictures to Chinese characters |
CN111432244A (en) * | 2020-03-17 | 2020-07-17 | 中国人民解放军国防科技大学 | Lightweight image encryption and decryption method, device and system based on attributes |
CN111444522A (en) * | 2020-03-19 | 2020-07-24 | 南昌大学 | Random blocking chaotic image encryption method |
CN111464291A (en) * | 2020-02-26 | 2020-07-28 | 北京邮电大学 | A quantum key randomness detection device |
CN112202545A (en) * | 2020-10-26 | 2021-01-08 | 郑州轻工业大学 | Image encryption method based on Y-type filling curve and variable-step Joseph traversal |
CN112543093A (en) * | 2020-11-27 | 2021-03-23 | 长沙理工大学 | Image encryption method, device and storage medium based on double-entropy source hyperchaotic system |
CN112636895A (en) * | 2020-09-07 | 2021-04-09 | 长沙理工大学 | Image encryption and decryption method and image encryption and decryption system |
CN112769545A (en) * | 2020-12-22 | 2021-05-07 | 郑州轻工业大学 | Image encryption method based on adjacent pixel Joseph transformation and Mealy state machine |
CN113067696A (en) * | 2021-03-30 | 2021-07-02 | 中国科学院大学 | Multi-round symmetrical digital image encryption method and system based on bit grouping |
CN113536377A (en) * | 2021-07-20 | 2021-10-22 | 南京邮电大学 | Encrypted domain cross-modal information retrieval method based on hyperchaos pseudorandom sequence |
CN114239037A (en) * | 2021-12-27 | 2022-03-25 | 中国矿业大学 | Multi-image encryption method based on sand road rule |
CN114389788A (en) * | 2021-12-17 | 2022-04-22 | 中国人民解放军海军工程大学 | Image Encryption Algorithm Based on Mixed Chaos and Block Scrambling |
CN114928436A (en) * | 2022-07-20 | 2022-08-19 | 华东交通大学 | Wisdom campus network safety protection system |
CN115314600A (en) * | 2022-10-12 | 2022-11-08 | 山东沃尔美肥业有限公司 | Chemical fertilizer production monitoring data management method |
CN115529122A (en) * | 2022-09-28 | 2022-12-27 | 华东交通大学 | Medical image encryption method based on two-dimensional Logistic-Gaussian hyperchaotic mapping |
CN115719300A (en) * | 2023-01-09 | 2023-02-28 | 浙江出海云技术有限公司 | Personnel information management method for big data |
CN115733933A (en) * | 2022-11-29 | 2023-03-03 | 广州韬露科技有限公司 | Network security encryption method based on artificial intelligence |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040202326A1 (en) * | 2003-04-10 | 2004-10-14 | Guanrong Chen | System and methods for real-time encryption of digital images based on 2D and 3D multi-parametric chaotic maps |
CN103489151A (en) * | 2013-09-11 | 2014-01-01 | 河南大学 | Color image encryption method based on chaos sequence and hyper-chaos system |
CN103929563A (en) * | 2014-04-11 | 2014-07-16 | 陕西师范大学 | Image Encryption and Decryption Method Based on Improved Joseph Traversal and Generalized Henon Mapping |
CN108718232A (en) * | 2018-08-17 | 2018-10-30 | 中国矿业大学 | Image encryption method based on AES and chaos |
-
2019
- 2019-04-28 CN CN201910349652.9A patent/CN110086601B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040202326A1 (en) * | 2003-04-10 | 2004-10-14 | Guanrong Chen | System and methods for real-time encryption of digital images based on 2D and 3D multi-parametric chaotic maps |
CN103489151A (en) * | 2013-09-11 | 2014-01-01 | 河南大学 | Color image encryption method based on chaos sequence and hyper-chaos system |
CN103929563A (en) * | 2014-04-11 | 2014-07-16 | 陕西师范大学 | Image Encryption and Decryption Method Based on Improved Joseph Traversal and Generalized Henon Mapping |
CN108718232A (en) * | 2018-08-17 | 2018-10-30 | 中国矿业大学 | Image encryption method based on AES and chaos |
Non-Patent Citations (4)
Title |
---|
HUIQING HUANG等: "Image encryption scheme combining a modified Gerchberg–Saxton", 《SPRINGER-VERLAG GMBH GERMANY, PART OF SPRINGER NATURE 2018》 * |
YULING LUO等: "A parallel image encryption algorithm based on the", 《SPRINGER SCIENCE+BUSINESS MEDIA B.V., PART OF SPRINGER NATURE 2018》 * |
向德生等: "基于约瑟夫遍历的数字图像置乱算法", 《计算机工程与应用》 * |
赵玉青: "基于改进 Chen 混沌系统的图像加密算法", 《小型微型计算机系统》 * |
Cited By (33)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110838908A (en) * | 2019-11-11 | 2020-02-25 | 陕西师范大学 | An Image Encryption and Decryption Method Based on GF Matrix Transformation and Random Hierarchical Fusion |
CN110838908B (en) * | 2019-11-11 | 2023-07-07 | 陕西师范大学 | An Image Encryption and Decryption Method Based on GF Matrix Transformation and Random Hierarchical Fusion |
CN111353166A (en) * | 2020-02-25 | 2020-06-30 | 南通大学 | An encryption method for converting pictures to Chinese characters |
CN111353166B (en) * | 2020-02-25 | 2021-10-26 | 南通大学 | Encryption method for converting picture into Chinese character |
CN111464291A (en) * | 2020-02-26 | 2020-07-28 | 北京邮电大学 | A quantum key randomness detection device |
CN111432244A (en) * | 2020-03-17 | 2020-07-17 | 中国人民解放军国防科技大学 | Lightweight image encryption and decryption method, device and system based on attributes |
CN111444522B (en) * | 2020-03-19 | 2024-02-27 | 南昌大学 | Random blocking chaotic image encryption method |
CN111444522A (en) * | 2020-03-19 | 2020-07-24 | 南昌大学 | Random blocking chaotic image encryption method |
CN112636895A (en) * | 2020-09-07 | 2021-04-09 | 长沙理工大学 | Image encryption and decryption method and image encryption and decryption system |
CN112202545B (en) * | 2020-10-26 | 2021-07-23 | 郑州轻工业大学 | Image encryption method based on Y-shaped filling curve and variable step size Joseph traversal |
CN112202545A (en) * | 2020-10-26 | 2021-01-08 | 郑州轻工业大学 | Image encryption method based on Y-type filling curve and variable-step Joseph traversal |
CN112543093A (en) * | 2020-11-27 | 2021-03-23 | 长沙理工大学 | Image encryption method, device and storage medium based on double-entropy source hyperchaotic system |
CN112543093B (en) * | 2020-11-27 | 2022-06-10 | 长沙理工大学 | Image encryption method, device and storage medium based on dual entropy source hyperchaotic system |
CN112769545A (en) * | 2020-12-22 | 2021-05-07 | 郑州轻工业大学 | Image encryption method based on adjacent pixel Joseph transformation and Mealy state machine |
CN112769545B (en) * | 2020-12-22 | 2022-01-28 | 郑州轻工业大学 | Image Encryption Method Based on Adjacent Pixel Joseph Transform and Mealy State Machine |
CN113067696B (en) * | 2021-03-30 | 2022-07-29 | 中国科学院大学 | A multi-round symmetric digital image encryption method and system based on bit grouping |
CN113067696A (en) * | 2021-03-30 | 2021-07-02 | 中国科学院大学 | Multi-round symmetrical digital image encryption method and system based on bit grouping |
CN113536377A (en) * | 2021-07-20 | 2021-10-22 | 南京邮电大学 | Encrypted domain cross-modal information retrieval method based on hyperchaos pseudorandom sequence |
CN113536377B (en) * | 2021-07-20 | 2023-09-05 | 南京邮电大学 | Encryption domain cross-modal information retrieval method based on hyperchaotic pseudorandom sequence |
CN114389788A (en) * | 2021-12-17 | 2022-04-22 | 中国人民解放军海军工程大学 | Image Encryption Algorithm Based on Mixed Chaos and Block Scrambling |
CN114389788B (en) * | 2021-12-17 | 2024-04-16 | 中国人民解放军海军工程大学 | Image encryption algorithm with mixed chaos and block scrambling |
CN114239037A (en) * | 2021-12-27 | 2022-03-25 | 中国矿业大学 | Multi-image encryption method based on sand road rule |
CN114239037B (en) * | 2021-12-27 | 2024-06-04 | 中国矿业大学 | Multi-image encryption method based on sand road rule |
CN114928436A (en) * | 2022-07-20 | 2022-08-19 | 华东交通大学 | Wisdom campus network safety protection system |
CN114928436B (en) * | 2022-07-20 | 2022-09-27 | 华东交通大学 | A smart campus network security protection system |
CN115529122A (en) * | 2022-09-28 | 2022-12-27 | 华东交通大学 | Medical image encryption method based on two-dimensional Logistic-Gaussian hyperchaotic mapping |
CN115529122B (en) * | 2022-09-28 | 2025-02-07 | 华东交通大学 | Medical image encryption method based on two-dimensional Logistic-Gaussian hyperchaotic mapping |
CN115314600B (en) * | 2022-10-12 | 2023-01-24 | 山东沃尔美肥业有限公司 | Chemical fertilizer production monitoring data management method |
CN115314600A (en) * | 2022-10-12 | 2022-11-08 | 山东沃尔美肥业有限公司 | Chemical fertilizer production monitoring data management method |
CN115733933A (en) * | 2022-11-29 | 2023-03-03 | 广州韬露科技有限公司 | Network security encryption method based on artificial intelligence |
CN115733933B (en) * | 2022-11-29 | 2023-10-31 | 南京先维信息技术有限公司 | Network security encryption method based on artificial intelligence |
CN115719300B (en) * | 2023-01-09 | 2023-05-12 | 浙江出海云技术有限公司 | Personnel information management method for big data |
CN115719300A (en) * | 2023-01-09 | 2023-02-28 | 浙江出海云技术有限公司 | Personnel information management method for big data |
Also Published As
Publication number | Publication date |
---|---|
CN110086601B (en) | 2020-03-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110086601B (en) | Joseph traversal and hyperchaotic system image encryption method based on pixel value association | |
Xian et al. | Image encryption based on chaotic sub-block scrambling and chaotic digit selection diffusion | |
Zhu et al. | A chaos-based symmetric image encryption scheme using a bit-level permutation | |
CN109660696B (en) | New image encryption method | |
CN102982499B (en) | Based on color image encryption and the decryption method of multi-fractional order chaos system | |
CN110086600B (en) | An Image Encryption Method Based on Hyperchaotic System and Variable Step Joseph Problem | |
CN107392970B (en) | A digital image encryption method based on bit plane and high-dimensional chaotic system | |
CN113660079B (en) | Image encryption method based on self-diffusion and DNA encoding | |
CN107330338B (en) | Color image encryption and decryption method and system based on double chaotic cross-diffusion | |
CN112769545B (en) | Image Encryption Method Based on Adjacent Pixel Joseph Transform and Mealy State Machine | |
CN115580687B (en) | Multi-image encryption method based on variable parameter hyperchaotic system and S-shaped diffusion | |
CN115766962B (en) | A multi-key image encryption method based on five-dimensional conservative hyperchaotic system | |
Liu et al. | Cryptanalysis and enhancement of an image encryption scheme based on bit-plane extraction and multiple chaotic maps | |
CN118474267A (en) | Image processing method based on chaotic system applying inverse cosine function | |
CN111683191A (en) | A fast chaotic image encryption method with simultaneous row and column scrambling and diffusion | |
CN114579993A (en) | Image encryption method based on quantum key distribution and pixel scrambling | |
CN117440101A (en) | Image encryption algorithm and electronic equipment based on multi-chaotic system and circular DNA operation | |
CN111682932A (en) | A Single-round Image Encryption Method Based on Hybrid Chaos Map | |
CN115776368A (en) | Image encryption method, electronic equipment and storage medium based on Logistic mapping scrambling offset | |
CN116707754A (en) | A digital image encryption method based on five-dimensional non-equilibrium point hyperchaos | |
Xuelong et al. | A symmetric cryptography based on extended cellular automata | |
Nasir et al. | High security nested PWLCM chaotic map bit-level permutation based image encryption | |
CN111047495B (en) | Color image encryption method and system based on hyperchaos and double random phase encoding | |
Fadhil Al-Husainy | A novel image encryption algorithm based on the extracted map of overlapping paths from the secret key | |
CN114915695B (en) | Bit-level image encryption method based on 2D-Chebyshev chaotic mapping |
Legal Events
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 450002 No. 5 Dongfeng Road, Jinshui District, Henan, Zhengzhou Patentee after: Zhengzhou University of light industry Country or region after: China Address before: 450002 No. 5 Dongfeng Road, Jinshui District, Henan, Zhengzhou Patentee before: ZHENGZHOU University OF LIGHT INDUSTRY Country or region before: China |