[go: up one dir, main page]

CN112887075B - Encryption method of similar full-connection network image based on plaintext correlation - Google Patents

Encryption method of similar full-connection network image based on plaintext correlation Download PDF

Info

Publication number
CN112887075B
CN112887075B CN202110107767.4A CN202110107767A CN112887075B CN 112887075 B CN112887075 B CN 112887075B CN 202110107767 A CN202110107767 A CN 202110107767A CN 112887075 B CN112887075 B CN 112887075B
Authority
CN
China
Prior art keywords
matrix
sequence
image
value
chaotic
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.)
Active
Application number
CN202110107767.4A
Other languages
Chinese (zh)
Other versions
CN112887075A (en
Inventor
李锦青
底晓强
祁晖
从立钢
任维武
毕琳
解男男
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changchun University of Science and Technology
Original Assignee
Changchun University of Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Changchun University of Science and Technology filed Critical Changchun University of Science and Technology
Priority to CN202110107767.4A priority Critical patent/CN112887075B/en
Publication of CN112887075A publication Critical patent/CN112887075A/en
Application granted granted Critical
Publication of CN112887075B publication Critical patent/CN112887075B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic 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/065Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
    • H04L9/0656Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher
    • H04L9/0662Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher with particular pseudorandom sequence generator
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
    • H04N1/32272Encryption or ciphering

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Complex Calculations (AREA)

Abstract

基于明文相关的类全连接网络图像的加密方法,涉及图像加密技术领域,解决现有图像加密方法存在加密效果差的问题,本发明提出的基于明文相关的类全连接网络图像加密方法。由logistic混沌系统生成卷积核,将原图进行卷积运算、池化和激活后得到明文相关的矩阵,使用该矩阵获得密钥。使用得到的密钥迭代非线性交叉耦合超混沌系统,得到伪随机数列。然后使用伪随机对原图进行置乱,置乱包括行循环移位和列循环移位。然后使用类全连接网络对置乱后的图像进行比特级的扩散。最后把扩散后的图像与伪随机数列进行异或得到最终的密码图像。

Figure 202110107767

An encryption method for a fully connected network image based on plaintext correlation, relates to the technical field of image encryption, and solves the problem of poor encryption effect in existing image encryption methods. The convolution kernel is generated by the logistic chaotic system, and the original image is convolved, pooled and activated to obtain a matrix related to the plaintext, and the key is obtained by using this matrix. Using the obtained key, the nonlinear cross-coupled hyperchaotic system is iterated to obtain a pseudo-random number sequence. Then the original image is scrambled using pseudo-random, and the scrambling includes row cyclic shift and column cyclic shift. The scrambled image is then bit-level diffused using a fully connected-like network. Finally, XOR the diffused image with the pseudo-random number sequence to obtain the final password image.

Figure 202110107767

Description

基于明文相关的类全连接网络图像的加密方法Encryption method of quasi fully connected network image based on plaintext correlation

技术领域technical field

本发明涉及图像加密技术领域,具体涉及一种基于明文相关的类全连接网络的图像加密方法。The invention relates to the technical field of image encryption, in particular to an image encryption method based on a plaintext correlation-like fully connected network.

背景技术Background technique

随着图像信息获取和处理技术的发展,图像信息安全受到广泛关注。它已成为信息安全和密码学的热门话题。在过去的几十年里,加密方法在隐藏通过无线或有线网络传输的敏感信息方面发挥着至关重要的作用。未经授权的人无法从加密数据中泄露秘密信息。加密方法已广泛应用于医疗、军事、遥感等各种工程领域。目前,图像信息安全主要分为两个分支。一种是通过光学技术实现的光学图像加密,在图像采集过程中对图像进行加密。其核心技术是光学傅里叶变换。另一种是数字计算机实现的数字图像加密,在图像存储过程中对图像进行加密。它的核心方法被称为置乱和扩散。传统的方法如RSA、AES、DES等,也用于加密过程。但是由于图像数据中存在高度冗余和相关性,它们不能产生最佳加密结果。混沌系统被用来加密图像以解决上述问题。在基于混沌的图像加密中,通常使用混沌系统生成一个类随机的混沌序列,作为加密算法中置乱和扩散的密钥流。在这种机制中,混沌系统初始值和控制参数是加密方法安全性与复杂性的决定性要素之一。With the development of image information acquisition and processing technology, image information security has received extensive attention. It has become a hot topic in information security and cryptography. Over the past few decades, encryption methods have played a vital role in hiding sensitive information transmitted over wireless or wired networks. Unauthorized people cannot reveal secret information from encrypted data. Encryption methods have been widely used in medical, military, remote sensing and other engineering fields. At present, image information security is mainly divided into two branches. One is the optical image encryption realized by optical technology, which encrypts the image during the image acquisition process. Its core technology is optical Fourier transform. The other is digital image encryption implemented by digital computers, which encrypts images during image storage. Its core method is called scrambling and diffusion. Traditional methods such as RSA, AES, DES, etc., are also used in the encryption process. But they do not produce optimal encryption results due to the high degree of redundancy and correlation in the image data. Chaotic systems are used to encrypt images to solve the above problems. In chaos-based image encryption, a chaotic system is usually used to generate a quasi-random chaotic sequence as the key stream for scrambling and diffusion in the encryption algorithm. In this mechanism, the initial value and control parameters of the chaotic system are one of the decisive factors for the security and complexity of the encryption method.

近几十年来,基于混沌系统的图像加密算法大量出现。这些加密方案可以分为许多类别,例如基于脱氧核糖核酸(DNA)的方案,基于块的方案,基于复杂混沌系统的方案,基于特殊算法的方案,基于新的加扰扩散结构的方案等。In recent decades, image encryption algorithms based on chaotic systems have appeared in large numbers. These encryption schemes can be classified into many categories, such as deoxyribonucleic acid (DNA)-based schemes, block-based schemes, schemes based on complex chaotic systems, schemes based on special algorithms, schemes based on new scrambled diffusion structures, etc.

发明内容SUMMARY OF THE INVENTION

本发明为解决现有图像加密方法存在加密效果差的问题,提供一种基于明文相关的类全连接网络图像加密方法。In order to solve the problem of poor encryption effect in existing image encryption methods, the present invention provides a quasi-full-connection network image encryption method based on plaintext correlation.

基于明文相关的类全连接网络图像加密方法,该方法由以下步骤实现:A fully connected network image encryption method based on plaintext correlation, the method is realized by the following steps:

步骤一、选择大小为M×N的灰度图像作为原始明文图像Image,计算所述原始明文图像Image的平均像素值a,并对所述平均像素值a进行精度处理,获得处理后的像素值

Figure BDA0002918144340000021
Step 1: Select a grayscale image with a size of M×N as the original plaintext image Image, calculate the average pixel value a of the original plaintext image Image, and perform precision processing on the average pixel value a to obtain the processed pixel value.
Figure BDA0002918144340000021

步骤二、将所述像素值

Figure BDA0002918144340000022
作为初值迭代混沌系统,生成长度为m的混沌序列X,X={x1x2x3......xm-1xm};Step 2, convert the pixel value
Figure BDA0002918144340000022
As an initial value iterative chaotic system, a chaotic sequence X with length m is generated, X={x 1 x 2 x 3 ...... x m-1 x m };

采用混沌序列X计算序列Y={y1,y2,y3,y4,......yn},Y中的每个元素作为卷积核,与原始明文图像Image进行卷积核运算;The chaotic sequence X is used to calculate the sequence Y= { y 1 , y 2 , y 3 , y 4 ,... nuclear operation;

对原始明文图像Image进行n次卷积和池化后最终生成大小为

Figure BDA0002918144340000025
的矩阵,MCNN;并将生成的矩阵MCNN的每个值映射到0到
Figure BDA0002918144340000027
的整数中,映射矩阵MCNN2的每个元素记为
Figure BDA0002918144340000026
After performing n convolution and pooling on the original plaintext image Image, the final generated size is
Figure BDA0002918144340000025
matrix, MCNN; and map each value of the resulting matrix MCNN to 0 to
Figure BDA0002918144340000027
In the integers of , each element of the mapping matrix MCNN2 is denoted as
Figure BDA0002918144340000026

步骤三、对步骤二获得映射矩阵MCNN2进行计算,通过计算

Figure BDA0002918144340000028
后获得中间变量h1,h2,h3,h4,通过所述中间变量h1,h2,h3,h4计算混沌系统参数μ和λ,以及混沌系统的初始值x0和y0,计算规则如下式所示:Step 3. Calculate the mapping matrix MCNN2 obtained in step 2, and calculate
Figure BDA0002918144340000028
After obtaining the intermediate variables h 1 , h 2 , h 3 , h 4 , the chaotic system parameters μ and λ are calculated through the intermediate variables h 1 , h 2 , h 3 , h 4 , and the initial values of the chaotic system x 0 and y 0 , the calculation rule is as follows:

Figure BDA0002918144340000023
Figure BDA0002918144340000023

其中μ′0,λ′0,x′0,y′0是给定的初始值;Where μ′ 0 , λ′ 0 , x′ 0 , y′ 0 are the given initial values;

步骤四、采用非线性交叉耦合超混沌系统获得混沌序列,所述非线性交叉耦合超混沌系统由下式表示:Step 4: Obtain a chaotic sequence by adopting a nonlinear cross-coupling hyper-chaotic system, and the nonlinear cross-coupling hyper-chaotic system is represented by the following formula:

Figure BDA0002918144340000024
Figure BDA0002918144340000024

式中,xj和yj表示非线性交叉耦合超混沌系统的第j个状态变量的值,xj-1和yj-1为第j-1个状态变量的值,δ为混沌系统控制参数;In the formula, x j and y j represent the value of the j-th state variable of the nonlinear cross-coupled hyperchaotic system, x j-1 and y j-1 are the values of the j-1-th state variable, and δ is the chaotic system control parameter;

步骤五、采用步骤三中的μ,λ作为非线性交叉耦合超混沌系统的控制参数,x0,y0作为非线性交叉耦合超混沌系统的初值,迭代M×N次,生成长度为M×N的混沌序列X′和Y′,如下式:Step 5. Use μ and λ in step 3 as the control parameters of the nonlinear cross-coupled hyperchaotic system, x 0 , y 0 as the initial values of the nonlinear cross-coupled hyper-chaotic system, iterate M×N times, and the generation length is M The chaotic sequences X′ and Y′ of ×N are as follows:

Figure BDA0002918144340000031
Figure BDA0002918144340000031

步骤六、从步骤五生成的混沌序列X′的第td个元素开始,截取长度为M的M′序列,从步骤五生成的混沌序列Y′的第td个元素开始,截取长度为N的N′序列,分别对M′和N′序列进行从小到大排序,分别获得M′和N′的索引序列INDM和INDN;Step 6: Starting from the td-th element of the chaotic sequence X' generated in step 5, intercept the M' sequence with a length of M, starting from the td-th element of the chaotic sequence Y' generated in step 5, intercept N with a length of N ' sequence, sort the M' and N' sequences from small to large respectively, and obtain the index sequences INDM and INDN of M' and N' respectively;

步骤七、采用索引序列INDM对原始明文图像Image进行行循环移位,如果索引序列INDM第g个元素值为奇数,则将对应第g行进行循环左移该奇数值位,如果索引序列INDM第g个元素值为偶数,则将对应第g行进行循环右移该偶数值位,行循环移位结束后,获得矩阵Image1;Step 7. Use the index sequence INDM to perform row cyclic shift on the original plaintext image Image, if the gth element of the index sequence INDM is odd, then the gth row corresponding to the gth row is shifted to the left by the odd value, if the index sequence INDM has an odd value If the value of g elements is even, then the corresponding g-th row will be cyclically shifted to the right by the even-valued bit, and after the row cyclic shift is completed, the matrix Image1 will be obtained;

采用索引序列INDN对矩阵Image1进行列循环移位,如果索引序列INDN序列第h个元素值为奇数,将对应第h列进行循环上移该奇数值位,如果索引序列INDN序列第h个元素值为偶数,将对应第h列进行循环下移该偶数值位,列循环移位结束后,获得矩阵Image2;Use the index sequence INDN to perform a column cyclic shift on the matrix Image1. If the value of the h-th element of the index sequence INDN sequence is odd, the odd-valued bit will be cyclically shifted up corresponding to the h-th column. If the value of the h-th element of the index sequence INDN sequence is an odd number If it is an even number, the even value bit is cyclically shifted down corresponding to the hth column, and after the column cyclic shift is completed, the matrix Image2 is obtained;

步骤八、采用步骤五生成的长度为M×N的混沌序列X′,将X′序列的每个元素值映射到0到7之间,生成序列XR,将所述序列XR分割成l块,每块8个元素,用下式表示为:Step 8: Using the chaotic sequence X' with a length of M×N generated in step 5, map each element value of the X' sequence to between 0 and 7, generate a sequence XR, and divide the sequence XR into 1 blocks, Each block has 8 elements, expressed as:

XR=XR1XR2XR3......XRb-1XRb XR=XR 1 XR 2 XR 3 ......XR b-1 XR b

其中,b表示块号,b=1,2,...l;Among them, b represents the block number, b=1, 2, ... l;

步骤九、对单层全连接神经网络进行改造,生成单层类全连接网络,所述单层类全连接网络八个输入和八个输出,生成一个每行元素均是1到8随机排列的矩阵W,采用矩阵W和步骤八所述的XR序列生成八位的新序列作为改造后的网络的权值;Step 9. Transform the single-layer fully-connected neural network to generate a single-layer fully-connected network. The single-layer fully-connected network has eight inputs and eight outputs to generate a random arrangement of elements in each row from 1 to 8. Matrix W, adopts matrix W and the XR sequence described in step 8 to generate a new sequence of eight bits as the weight of the transformed network;

步骤十、将步骤七获得的Image2转换为一维矩阵P,将一维矩阵P分割为l块,每块8个元素,P=P1P2P3P4......Pb-1PbStep 10. Convert the Image2 obtained in Step 7 into a one-dimensional matrix P, and divide the one-dimensional matrix P into l blocks, each with 8 elements, P=P 1 P 2 P 3 P 4 ......P b -1 P b ;

将所述Pi采用八位的二进制表示,由下式为:The eight-bit binary representation is used for the Pi , which is represented by the following formula:

Figure BDA0002918144340000041
Figure BDA0002918144340000041

依次把Pb作为类全连接网络的输入,依次使用XRb序列对步骤九的矩阵W循环移位;XRb序列第e个元素值为s,如果s为奇数就把W矩阵对应的第e行循环左移s个元素,如果s为偶数就把W矩阵对应的第e行循环右移s个元素,把此操作后得到的矩阵,作为类全连接网络的权值;Take P b as the input of the fully connected network in turn, and use the XR b sequence to cyclically shift the matrix W in step 9; the value of the e-th element of the XR b sequence is s, and if s is an odd number, set the e-th element corresponding to the W matrix The row is shifted to the left by s elements. If s is an even number, the e-th row corresponding to the W matrix is circularly shifted to the right by s elements, and the matrix obtained after this operation is used as the weight of the fully connected network;

根据每行wc序列上的值依次选取输入的Pb每一位二进制数,然后把选取的每一位二进制数放到要输出的每个元素上;According to the value on the w c sequence of each row, select each binary number of the input P b in turn, and then put each selected binary number on each element to be output;

最后把每个输出元素的八位的二进制数用十进制数表示,然后把每个十进制数通过激活函数s-box计算后获得的值作为类全连接网络的输出值;每次输入一个Pb就输出一个PCb,把矩阵P的所有元素经过类全连接网络处理后得到一维矩阵PC;Finally, the eight-bit binary number of each output element is represented by a decimal number, and then the value obtained by each decimal number calculated by the activation function s-box is used as the output value of the fully connected network; each time a P b is input, it is A PC b is output, and all elements of the matrix P are processed by a fully connected network to obtain a one-dimensional matrix PC;

步骤十一、将步骤五生成的混沌序列Y′,映射到0到

Figure BDA0002918144340000042
之间;生成长度为M×N的序列YR,将序列YR分割为长度分别为M×N/2的序列YR1和YR2;Step 11. Map the chaotic sequence Y′ generated in step 5 to 0 to
Figure BDA0002918144340000042
between; generate a sequence YR with a length of M×N, and divide the sequence YR into sequences YR 1 and YR 2 with a length of M×N/2 respectively;

将步骤十生成的一维矩阵PC={pct}与YR1={yr1t}和YR2={yr2t}序列进行异或,用下式表示为:The one-dimensional matrix PC={pc t } generated in step 10 is XORed with the sequence of YR 1 ={yr 1t } and YR 2 ={yr 2t }, which is expressed as:

Figure BDA0002918144340000051
Figure BDA0002918144340000051

式中XOR为异或函数,异或后获得矩阵PC1;In the formula, XOR is the XOR function, and the matrix PC1 is obtained after the XOR;

步骤十二、将所述矩阵PC1转换成M×N大小的矩阵,生成的矩阵PC2为最终的加密图像。Step 12: Convert the matrix PC1 into an M×N matrix, and the generated matrix PC2 is the final encrypted image.

本发明的有益效果:本发明提出的基于明文相关的类全连接网络图像加密方法。由logistic混沌系统生成卷积核,将原图进行卷积运算、池化和激活后得到明文相关的矩阵,使用该矩阵获得密钥。使用得到的密钥迭代非线性交叉耦合超混沌系统,得到伪随机数列。然后使用伪随机对原图进行置乱,置乱包括行循环移位和列循环移位。然后使用类全连接网络对置乱后的图像进行比特级的扩散。最后把扩散后的图像与伪随机数列进行异或得到最终的密码图像。Beneficial effects of the present invention: the plaintext correlation-based fully connected network image encryption method proposed by the present invention. The convolution kernel is generated by the logistic chaotic system, and the original image is convolved, pooled and activated to obtain a matrix related to the plaintext, and the key is obtained by using this matrix. Using the obtained key, the nonlinear cross-coupled hyperchaotic system is iterated to obtain a pseudo-random number sequence. Then the original image is scrambled using pseudo-random, and the scrambling includes row cyclic shift and column cyclic shift. The scrambled image is then bit-level diffused using a fully connected-like network. Finally, XOR the diffused image with the pseudo-random number sequence to obtain the final password image.

仿真实验表明,本发明具有更大的密钥空间,可以抵抗各种攻击并具有更好的安全性,可以应用于实际的图像通信中。Simulation experiments show that the invention has a larger key space, can resist various attacks and has better security, and can be applied to actual image communication.

附图说明Description of drawings

图1本发明所述的基于明文相关的类全连接网络图像加密方法中加密过程流程图;Fig. 1 is a flow chart of encryption process in the method for encrypting network image based on plaintext correlation in full connection according to the present invention;

图2本发明所述的基于明文相关的类全连接网络图像加密方法中解密过程流程图;Fig. 2 is a flow chart of decryption process in the method for encrypting a network image based on a plaintext correlation-like fully connected network according to the present invention;

图3为采用本发明所述的基于明文相关的类全连接网络图像加密方法进行加密解密的效果图:其中图3(a)为“船只”原始图像;其中图3(b)为图3(a)的加密图像;其中图3(c)为图3(a)的解密图像。Fig. 3 is an effect diagram of encryption and decryption using the plaintext correlation-like fully-connected network image encryption method of the present invention: Fig. 3(a) is the original image of the "ship"; Fig. 3(b) is Fig. 3(b) The encrypted image of a); wherein Fig. 3(c) is the decrypted image of Fig. 3(a).

图4为采用本发明所述的基于明文相关的类全连接网络图像加密解密方法直方图分析:其中图4(a)为图3(a)的直方图;其中图4(b)为图3(c)的直方图。Fig. 4 is the histogram analysis of the method for encrypting and decrypting images based on the plaintext correlation-like fully connected network according to the present invention: Fig. 4(a) is the histogram of Fig. 3(a); Fig. 4(b) is the histogram of Fig. 3 (c) Histogram.

具体实施方式Detailed ways

具体实施方式一、结合图1和图2说明本实施方式,基于明文相关的类全连接网络图像加密方法,该方法由以下步骤实现:DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS First, the present embodiment will be described in conjunction with FIG. 1 and FIG. 2 . Based on a method for encrypting a fully connected network image related to plaintext, the method is implemented by the following steps:

步骤一、选择大小为M×N的灰度图像作为原始明文图像Image。Step 1. Select a grayscale image with a size of M×N as the original plaintext image Image.

步骤二、计算步骤一所述明文图像Image的平均像素值a,方法如下公式(1)所示:Step 2: Calculate the average pixel value a of the plaintext image Image described in Step 1, as shown in the following formula (1):

Figure BDA0002918144340000061
Figure BDA0002918144340000061

式中的sum()为求和函数,Image(:)为原始图像Image的全部像素,

Figure BDA0002918144340000062
代表灰度等级,M和N分别代表原始图像的高和宽。The sum() in the formula is the summation function, Image(:) is all the pixels of the original image Image,
Figure BDA0002918144340000062
represents the gray level, and M and N represent the height and width of the original image, respectively.

步骤三、对步骤二获得的平均像素值a进行精度处理得到

Figure BDA0002918144340000063
由公式(2)所示:Step 3: Perform precision processing on the average pixel value a obtained in Step 2 to obtain
Figure BDA0002918144340000063
It is shown by formula (2):

Figure BDA0002918144340000064
Figure BDA0002918144340000064

式中floor()为向下取整函数。where floor() is a rounding down function.

步骤四、将步骤三获得的

Figure BDA0002918144340000065
作为初值迭代混沌系统,生成长度为m的混沌序列X,X={x1x2x3......xm-1xm}。Step 4. The obtained step 3
Figure BDA0002918144340000065
As the initial value iterative chaotic system, a chaotic sequence X of length m is generated, X={x 1 x 2 x 3 ...... x m-1 x m }.

步骤五、使用步骤四生成的混沌序列X计算出序列Y={y1,y2,y3,y4,......yn},Y中的每个元素作为卷积核,与原图Image进行卷积运算,卷积核的计算方法由公式(3)所示:Step 5. Use the chaotic sequence X generated in step 4 to calculate the sequence Y={y 1 , y 2 , y 3 , y 4 , ...... y n }, each element in Y is used as a convolution kernel, The convolution operation is performed with the original image, and the calculation method of the convolution kernel is shown in formula (3):

Figure BDA0002918144340000066
Figure BDA0002918144340000066

其中,

Figure BDA0002918144340000067
为卷积核的大小。reshape函数是把截取的X的序列,转换成
Figure BDA0002918144340000068
行和
Figure BDA0002918144340000069
列。in,
Figure BDA0002918144340000067
is the size of the convolution kernel. The reshape function converts the intercepted sequence of X into
Figure BDA0002918144340000068
line and
Figure BDA0002918144340000069
List.

首先使用Y中的元素y1与原图Image进行卷积运算,如公式(4)所示:First, use the element y 1 in Y to perform a convolution operation with the original image Image, as shown in formula (4):

I1,1=conv2(Image,y1) (4)I 1,1 =conv2(Image,y 1 ) (4)

式中conv2()为卷积函数。where conv2() is the convolution function.

使用平均池化函数对卷积后的矩阵进行池化:Pool the convolutional matrix using the average pooling function:

I1,2=averagePooling(I1,1) (5)I 1,2 =averagePooling(I 1,1 ) (5)

其中,averagePooling()为平均池化函数。Among them, averagePooling() is the average pooling function.

依次循环执行公式(4),(5)对卷积池化的结果再进行计算。如公式(6)所示:Execute formulas (4) and (5) in turn in a loop to calculate the result of convolution pooling. As shown in formula (6):

Figure BDA0002918144340000071
Figure BDA0002918144340000071

其中i=2,3...n,where i=2,3...n,

每次进行卷积和池化后生成矩阵大小的计算公式为分别为(7)和(8):The formulas for calculating the size of the generated matrix after each convolution and pooling are (7) and (8), respectively:

Figure BDA0002918144340000072
Figure BDA0002918144340000072

Figure BDA0002918144340000073
Figure BDA0002918144340000073

其中,

Figure BDA0002918144340000074
Figure BDA0002918144340000075
分别为第i次卷积和池化后的矩阵的高和宽;in,
Figure BDA0002918144340000074
and
Figure BDA0002918144340000075
are the height and width of the matrix after the i-th convolution and pooling, respectively;

对输入的原始明文Image进行n次卷积、池化后最终生成大小为

Figure BDA0002918144340000076
的矩阵,记为MCNN。并将生成的MCNN矩阵的每个值映射到0到
Figure BDA0002918144340000077
的整数,映射函数由公式(9)所示:After performing n convolutions and pooling on the input original plaintext Image, the final generated size is
Figure BDA0002918144340000076
The matrix of , denoted as MCNN. and map each value of the resulting MCNN matrix to 0 to
Figure BDA0002918144340000077
, the mapping function is given by equation (9):

Figure BDA0002918144340000078
Figure BDA0002918144340000078

把MCNN1转为一维矩阵,如公式(10)所示:Convert MCNN1 to a one-dimensional matrix, as shown in formula (10):

Figure BDA0002918144340000079
Figure BDA0002918144340000079

把MCNN2每个元素记为

Figure BDA00029181443400000710
Record each element of MCNN2 as
Figure BDA00029181443400000710

步骤六、对步骤五获得的MCNN2矩阵进行计算,通过计算

Figure BDA00029181443400000711
后获得中间变量h1,h2,h3,h4,计算过程由公式(11)所示:Step 6. Calculate the MCNN2 matrix obtained in step 5. By calculating
Figure BDA00029181443400000711
After obtaining intermediate variables h 1 , h 2 , h 3 , h 4 , the calculation process is shown by formula (11):

Figure BDA00029181443400000712
Figure BDA00029181443400000712

步骤七、通过步骤六的h1,h2,h3,h4计算混沌系统参数μ和λ,以及混沌系统的初始值x0和y0,计算规则如公式(12)所示:Step 7: Calculate the parameters μ and λ of the chaotic system, and the initial values x 0 and y 0 of the chaotic system through h 1 , h 2 , h 3 , and h 4 in step 6. The calculation rules are shown in formula (12):

Figure BDA0002918144340000081
Figure BDA0002918144340000081

其中μ′0,λ′0,x′0,y′0是给定的初始值。Where μ′ 0 , λ′ 0 , x′ 0 , y′ 0 are given initial values.

步骤八、使用非线性交叉耦合超混沌系统获得混沌序列,混沌系统由公式(13)表示:Step 8. Use the nonlinear cross-coupling hyper-chaotic system to obtain the chaotic sequence. The chaotic system is represented by formula (13):

Figure BDA0002918144340000082
Figure BDA0002918144340000082

其中,xj和yj表示非线性交叉耦合超混沌系统的第j个状态变量的值。xj-1和yj-1为第j-1个状态变量的值。δ为混沌系统控制参数。Among them, x j and y j represent the value of the jth state variable of the nonlinear cross-coupled hyperchaotic system. x j-1 and y j-1 are the values of the j-1 th state variable. δ is the control parameter of the chaotic system.

步骤九、使用步骤七中的μ,λ作为非线性交叉耦合超混沌系统的控制参数,x0,y0作为非线性交叉耦合超混沌系统的初值,迭代M×N次,生成长度为M×N的混沌序列X′和Y′,如公式(14)所示:Step 9. Use μ and λ in Step 7 as the control parameters of the nonlinear cross-coupled hyperchaotic system, x 0 , y 0 as the initial values of the nonlinear cross-coupled hyper-chaotic system, iterate M×N times, and the generation length is M The chaotic sequences X′ and Y′ of ×N are shown in formula (14):

Figure BDA0002918144340000083
Figure BDA0002918144340000083

步骤十、从步骤九生成的X′序列的第td个元素开始,截取长度为M的M′序列,由公式(15)表示:Step 10. Starting from the td-th element of the X' sequence generated in Step 9, intercept the M' sequence of length M, which is represented by formula (15):

M′=X′(td:td+M-1) (15)M'=X'(td:td+M-1) (15)

从步骤九生成的Y′序列的第td个元素开始,截取长度为N的N′序列,由公式(16)表示:Starting from the td-th element of the Y' sequence generated in step 9, the N' sequence of length N is intercepted, which is represented by formula (16):

N′=Y′(td:td+N-1) (16)N'=Y'(td:td+N-1) (16)

分别对M′和N′序列进行从小到大排序,得到M′和N′的索引序列INDM和INDN,排序由公式(17)表示:Sort the M' and N' sequences from small to large, respectively, to obtain the index sequences INDM and INDN of M' and N', and the sorting is represented by formula (17):

Figure BDA0002918144340000091
Figure BDA0002918144340000091

步骤十一、使用INDM序列对原图Image进行行循环移位,如果INDM序列第g个元素值为奇数则将对应第g行进行循环左移该奇数值位,如果INDM序列第g个元素值为偶数则将对应第g行进行循环右移该偶数值位,行循环移位结束后得到矩阵Image1。Step 11. Use the INDM sequence to perform a row cyclic shift on the original image. If the value of the gth element of the INDM sequence is an odd number, the odd value position will be cyclically shifted to the left corresponding to the gth row. If the value of the gth element of the INDM sequence is an odd number If it is an even number, the corresponding g-th row will be shifted to the right by the even-valued bits, and the matrix Image1 will be obtained after the row cyclic shift is completed.

步骤十二、使用INDN序列对矩阵Image1进列行循环移位,如果INDN序列第h个元素值为奇数将对应第h列进行循环上移该奇数值位,如果INDN序列第h个元素值为偶数将对应第h列进行循环下移该偶数值位,列循环移位结束后得到矩阵Image2。h=1,2,3,4,……N;Step 12. Use the INDN sequence to cyclically shift the columns and rows of the matrix Image1. If the value of the hth element of the INDN sequence is an odd number, the odd value will be shifted up corresponding to the hth column. If the value of the hth element of the INDN sequence is an odd number, The even number will be cyclically shifted down corresponding to the hth column, and the matrix Image2 will be obtained after the column cyclic shift is completed. h=1,2,3,4,...N;

步骤十三、使用步骤九生成的长度为M×N的混沌序列X′。将X′序列的每个元素值映射到0到7之间,由公式(18)所示:Step 13: Use the chaotic sequence X′ with a length of M×N generated in step 9. Map each element value of the X' sequence to a value between 0 and 7, as shown by Equation (18):

XR=mod(floor(X′×10x,8) (18)XR=mod(floor(X′×10 x , 8) (18)

把序列XR分割成l块,每块8个元素,由公式(19)表示:Divide the sequence XR into l blocks, each with 8 elements, expressed by formula (19):

XR=XR1XR2XR3......XRb-1XRb (19)XR=XR 1 XR 2 XR 3 ......XR b-1 XR b (19)

其中,b表示块号,b=1,2,...l;Among them, b represents the block number, b=1, 2, ... l;

步骤十四、对单层全连接神经网络进行改造,全连接神经网络是一种最基本的神经网络结构,神经网络中除输入层之外的每个节点都和上一层的所有节点有连接。改造后的网络有8个输入和有8个输出,生成一个每行元素都是1到8随机排列的矩阵W,W的第c行wc由公式(20)所示:Step 14. Transform the single-layer fully-connected neural network. The fully-connected neural network is the most basic neural network structure. Every node in the neural network except the input layer is connected to all nodes in the previous layer. . The transformed network has 8 inputs and 8 outputs, and generates a matrix W whose elements in each row are randomly arranged from 1 to 8. The c-th row w c of W is shown by formula (20):

wc=randperm(8) (20)w c = randperm(8) (20)

式中randperm(8)为生成一个1到8的随机排列的数列。where randperm(8) is to generate a random sequence of 1 to 8.

使用W和步骤十三描述的XR序列生成8位的新序列作为该网络的权值,使用一种改进的s-box算法作为该网络的激活函数。通过对单层全连接神经网络进行改造生成单层类全连接网络,使用该网络对图像进行比特级的扩散;Use W and the XR sequence described in step 13 to generate a new sequence of 8 bits as the weight of the network, and use an improved s-box algorithm as the activation function of the network. A single-layer fully-connected network is generated by transforming the single-layer fully-connected neural network, and the network is used to diffuse the image at the bit level;

步骤十五、将步骤十二获得的Image2转换为一维矩阵,转换公式为(21):Step 15: Convert the Image2 obtained in step 12 into a one-dimensional matrix, and the conversion formula is (21):

P=reshape(Image2,1,M*N) (21)P=reshape(Image2, 1, M*N) (21)

将P分割为l块,每块8个元素,由公式(22)表示:Divide P into l blocks, each with 8 elements, represented by formula (22):

P=P1P2P3P4......Pb-1Pb (22)P=P 1 P 2 P 3 P 4 ......P b-1 P b (22)

步骤十六、把步骤十五描述的Pi使用8位的二进制表示,由公式(23)所示:Step 16: Use the 8-bit binary representation of Pi described in Step 15, as shown by formula (23):

Figure BDA0002918144340000101
Figure BDA0002918144340000101

依次把Pb作为类全连接网络的输入。依次使用XRb序列对步骤十四的矩阵W循环移位。XRb序列第e个元素值为s,如果s为奇数就把W矩阵对应的第e行循环左移s个元素,如果s为偶数就把W矩阵对应的第j行循环右移s个元素,把此操作后得到的矩阵,作为类全连接网络的权值。Take P b as the input of the fully connected network in turn. The matrix W of step fourteen is cyclically shifted using the XR b sequence in turn. The value of the e-th element of the XR b sequence is s. If s is an odd number, the e-th row corresponding to the W matrix is shifted to the left by s elements. If s is an even number, the j-th row corresponding to the W matrix is rotated to the right by s elements. , and use the matrix obtained after this operation as the weight of the fully connected network.

根据每行wc序列上的值依次选取输入的Pb每一位二进制数,然后把选取的每一位数放到要输出的每个元素上。最后把每个输出元素的8位的二进制数用十进制数表示,然后把每个十进制数通过激活函数s-box计算后得到值作为类全连接网络的输出值。每次输入一个P就输出一个PCb,把P的所有元素经过类全连接网络处理后得到一维矩阵PC。According to the value of each row w c sequence, select each binary digit of input P b in turn, and then put each selected digit on each element to be output. Finally, the 8-bit binary number of each output element is represented by a decimal number, and then each decimal number is calculated by the activation function s-box to obtain the value as the output value of the fully connected network. Each time a P is input, a PC b is output, and all elements of P are processed by a fully connected network to obtain a one-dimensional matrix PC.

步骤十七、把步骤八生成的Y′序列,映射到0到

Figure BDA0002918144340000111
之间。由公式(24)表示:Step seventeen, map the Y' sequence generated in step eight to 0 to
Figure BDA0002918144340000111
between. It is represented by formula (24):

Figure BDA0002918144340000112
Figure BDA0002918144340000112

步骤十八、把步骤十七中长度为M×N的序列YR分割为长度为M×N/2的序列YR1和YR2,由公式(25)表示:Step 18: Divide the sequence YR of length M×N in step 17 into sequences YR 1 and YR 2 of length M×N/2, which are represented by formula (25):

Figure BDA0002918144340000113
Figure BDA0002918144340000113

步骤十九、使用步骤十六生成的一维矩阵PC={pct}与步骤十八生成的YR1={yr1t}和YR2={yr2t}序列进行异或,由公式(26)所示:Step 19, use the one-dimensional matrix PC={pc t } generated in step 16 and the sequence of YR 1 ={yr 1t } and YR 2 ={yr 2t } generated in step 18 to perform XOR, according to formula (26) shown:

Figure BDA0002918144340000114
Figure BDA0002918144340000114

式中XOR为异或函数。异或后得到的PC1矩阵。where XOR is the exclusive OR function. The PC1 matrix obtained after XORing.

步骤二十、将步骤十九生成的PC1矩阵,转换成M×N大小的矩阵,由公式(27)所示:Step 20: Convert the PC1 matrix generated in Step 19 into a matrix of size M×N, as shown by formula (27):

PC2=reshape(PC1,M,N) (27)PC2=reshape(PC1, M, N) (27)

转换后生成的矩阵PC2为最终的加密图。The converted matrix PC2 is the final encrypted image.

本实施方式中,还包括解密步骤,具体为:In this embodiment, it also includes a decryption step, specifically:

步骤二十一、解密时使用步骤七中的μ,λ,x0,y0和给定初始值的δ以步骤十、十三和十八相同的方法得到伪随机序列INDM、INDN、XR、YR1和YR2Step 21: Use μ, λ, x 0 , y 0 in step 7 and δ of the given initial value to obtain pseudo-random sequences INDM, INDN, XR, YR 1 and YR 2 .

步骤二十二、使用步骤十四生成的矩阵W。Step 22, use the matrix W generated in step 14.

步骤二十三、将步骤二十中得到的加密图像PC2转换成一维矩阵,方法如公式(28):Step 23: Convert the encrypted image PC2 obtained in step 20 into a one-dimensional matrix, the method is as formula (28):

PC1=reshape(PC2,1,M×N) (28)PC1=reshape(PC2, 1, M×N) (28)

步骤二十四、将步骤二十三得到的一维矩阵PC1={PC1jt}与步骤二十一生成的YR1={yr1t}和YR2={yr2t}序列进行异或操作,方法如公式(29)所示:Step 24: Perform XOR operation on the one-dimensional matrix PC1={PC1 jt } obtained in step 23 and the sequence of YR 1 ={yr 1t } and YR 2 ={yr 2t } generated in step 21, method As shown in formula (29):

Figure BDA0002918144340000121
Figure BDA0002918144340000121

异或后得到PC矩阵。The PC matrix is obtained after XORing.

步骤二十五、将步骤二十四得到PC矩阵分成l块,每块8个元素,由公式(30)表示:Step 25: Divide the PC matrix obtained in step 24 into l blocks, each of which has 8 elements, represented by formula (30):

PC=PC1PC2PC3PC4...,...PCt-1PCt (30)PC = PC 1 PC 2 PC 3 PC 4 ..., ... PC t-1 PC t (30)

其中,t表示块号,t=1,2,...l。Wherein, t represents the block number, t=1, 2, . . . l.

步骤二十六、依次将步骤二十五得到的PCt输入到步骤十四描述的类全连接网络,进行逆的操作。依次将PCt的每个元素输入逆的类全连接网络,先把PCt的每个值使用成8位二进制表示,使用XRi序列修改W矩阵每行wc的值,根据wc的值选取输入的PCt的对应位置的数,最后生成8个元素的Pb序列。将PC所有元素经过逆的类全连接网络处理后得到P矩阵。In step 26, the PC t obtained in step 25 is sequentially input into the fully connected network described in step 14, and the inverse operation is performed. Input each element of PC t into the inverse fully connected network in turn, first use each value of PC t as an 8-bit binary representation, and use the XR i sequence to modify the value of w c in each row of the W matrix, according to the value of w c The number of corresponding positions of the input PC t is selected, and finally a Pb sequence of 8 elements is generated. The P matrix is obtained by processing all elements of the PC through an inverse fully connected network.

步骤二十七、将步骤二十四得到的P矩阵转换成M×N大小的矩阵,由公式(31)所示:Step 27: Convert the P matrix obtained in step 24 into a matrix of M×N size, as shown by formula (31):

Image2=reshape(P,M,N) (31)Image2=reshape(P, M, N) (31)

步骤二十八、将步骤二十七得到的Image2矩阵和INDM、INDN序列进行逆的循环移位操作。首先进行逆的列循环移位得到Image1矩阵,然后经过逆的行循环移位得到Image矩阵。Image矩阵就是得到的解密图像。Step 28: Perform an inverse cyclic shift operation on the Image2 matrix and the INDM and INDN sequences obtained in step 27. First perform the inverse column cyclic shift to obtain the Image1 matrix, and then obtain the Image matrix through the inverse row cyclic shift. The Image matrix is the resulting decrypted image.

具体实施方式二、结合图1至图4说明本实施方式,本实施方式为具体实施方式一所述的基于明文相关的类全连接网络图像的加密方法的实施例:1 to 4, this embodiment is an example of the encryption method based on the plaintext correlation-like fully connected network image described in the specific embodiment 1:

步骤一、选择大小为512×512的灰度图像作为原始明文图像Image。如附图3(a)。Step 1. Select a grayscale image with a size of 512×512 as the original plaintext image Image. As shown in Figure 3(a).

步骤二、计算步骤一所述明文图像Image的平均像素值a,方法如下公式(1)所示:Step 2: Calculate the average pixel value a of the plaintext image Image described in Step 1, as shown in the following formula (1):

a=sum(Image(:))/((28-1)×512×512) (1)a=sum(Image(:))/((2 8 -1)×512×512) (1)

式中的sum()为求和函数,Image(:)为原始图像Image的全部像素,n代表灰度等级,M和N分别代表原始图像的高和宽。In the formula, sum() is the summation function, Image(:) is all the pixels of the original image Image, n represents the gray level, and M and N represent the height and width of the original image, respectively.

步骤三、对步骤二获得的平均像素值a进行精度处理得到

Figure BDA0002918144340000133
由公式(2)所示:Step 3: Perform precision processing on the average pixel value a obtained in Step 2 to obtain
Figure BDA0002918144340000133
It is shown by formula (2):

Figure BDA0002918144340000134
Figure BDA0002918144340000134

式中floor()为向下取整函数。where floor() is a rounding down function.

步骤四、将步骤三获得的

Figure BDA0002918144340000132
作为初值迭代混沌系统,生成长度为1000的混沌序列X,X={x1x2x3......x999x1000}。混沌系统由公式(3)所示:Step 4. The obtained step 3
Figure BDA0002918144340000132
As an initial value iterative chaotic system, a chaotic sequence X with a length of 1000 is generated, X={x 1 x 2 x 3 ...... x 999 x 1000 }. The chaotic system is represented by formula (3):

x(i+1)=u×x(i)×(1-x(i)) (3)x(i+1)=u×x(i)×(1-x(i)) (3)

其中u为控制参数,本实施方式中u=3.99。xi为混沌系统的第i个混沌系统的混沌状态变量值,xi+1为混沌系统的第i+1个混沌状态变量值。Among them, u is a control parameter, and in this embodiment, u=3.99. x i is the chaotic state variable value of the i-th chaotic system of the chaotic system, and x i+1 is the i+1-th chaotic state variable value of the chaotic system.

步骤五、使用步骤四生成的混沌序列X计算出序列Y={y1,y2,y3,y4,......yn},Y中的每个元素作为卷积核,与原图Image进行卷积运算,卷积核的计算方法由公式(4)所示:Step 5. Use the chaotic sequence X generated in step 4 to calculate the sequence Y={y 1 , y 2 , y 3 , y 4 , ...... y n }, each element in Y is used as a convolution kernel, The convolution operation is performed with the original image, and the calculation method of the convolution kernel is shown in formula (4):

Figure BDA0002918144340000131
Figure BDA0002918144340000131

其中,本实施方式中卷积核的大小分别为11×11和12×12。The sizes of the convolution kernels in this embodiment are 11×11 and 12×12, respectively.

依次使用Y中的元素与原图Image进行卷积,如公式(5)所示:Convolve with the original image Image using the elements in Y in turn, as shown in formula (5):

Ii,1=conv2(Image,yi) (5)I i, 1 =conv2(Image, y i ) (5)

式中conv2()为卷积函数。where conv2() is the convolution function.

使用平均池化函数对卷积后的矩阵进行池化:Pool the convolutional matrix using the average pooling function:

Ii,2=averagePooling(Ii,1) (6)I i, 2 = averagePooling(I i, 1 ) (6)

其中,averagePooling()为平均池化函数。Among them, averagePooling() is the average pooling function.

其中i=1,2,...5,依次循环执行公式(5),(6),where i=1, 2, ... 5, and execute formulas (5), (6) in sequence,

每次进行卷积和池化后生成矩阵大小的计算公式为分别为(7)和8():The formulas for calculating the size of the generated matrix after each convolution and pooling are (7) and 8(), respectively:

Figure BDA0002918144340000141
Figure BDA0002918144340000141

Figure BDA0002918144340000142
Figure BDA0002918144340000142

其中

Figure BDA0002918144340000143
Figure BDA0002918144340000144
分别为第i次卷积和池化后的矩阵的高和宽。in
Figure BDA0002918144340000143
and
Figure BDA0002918144340000144
are the height and width of the matrix after the i-th convolution and pooling, respectively.

对输入的原始明文Image进行5次卷积、池化和激活后最后生成大小为6×6的矩阵,记为MCNN。并将生成的MCNN矩阵的每个值映射为0到255的整数,映射函数由公式(9)所示:After 5 times of convolution, pooling and activation of the input original plaintext Image, a matrix of size 6 × 6 is finally generated, which is recorded as MCNN. And map each value of the generated MCNN matrix to an integer from 0 to 255, the mapping function is shown by formula (9):

MCNN1=mod(floor(MCNN/1020),28) (9)MCNN1=mod(floor(MCNN/10 20 ), 2 8 ) (9)

把MCNN1转为一维矩阵,如公式(10)所示:Convert MCNN1 to a one-dimensional matrix, as shown in formula (10):

MCNN2=reshape(MCNN1,1,36) (10)MCNN2=reshape(MCNN1, 1, 36) (10)

把MCNN2每个元素记为{k1k2k3......k36}Denote each element of MCNN2 as {k 1 k 2 k 3 ......k 36 }

步骤六、对步骤五获得的MCNN2矩阵进行计算,通过计算k1k2k3......k36后获得中间变量h1,h2,h3,h4,计算过程由公式(11)所示:Step 6: Calculate the MCNN2 matrix obtained in step 5, and obtain intermediate variables h 1 , h 2 , h 3 , h 4 by calculating k 1 k 2 k 3 ...... k 36 , the calculation process is determined by the formula ( 11) shown:

Figure BDA0002918144340000151
Figure BDA0002918144340000151

步骤七、通过步骤六的h1,h2,h3,h4计算混沌系统参数μ和λ,以及混沌系统的初始值x0和y0,计算规则如公式(12)所示:Step 7: Calculate the parameters μ and λ of the chaotic system, and the initial values x 0 and y 0 of the chaotic system through h 1 , h 2 , h 3 , and h 4 in step 6. The calculation rules are shown in formula (12):

Figure BDA0002918144340000152
Figure BDA0002918144340000152

其中,本实施方式中μ′0=3.0,λ′0=4.5,x′0=0.4,y′0=0.5。Wherein, in this embodiment, μ′ 0 =3.0, λ′ 0 =4.5, x′ 0 =0.4, and y′ 0 =0.5.

步骤八、使用非线性交叉耦合超混沌系统获得混沌序列,混沌系统由公式(13)表示:Step 8. Use the nonlinear cross-coupling hyper-chaotic system to obtain the chaotic sequence. The chaotic system is represented by formula (13):

Figure BDA0002918144340000153
Figure BDA0002918144340000153

其中,xj和yj表示非线性交叉耦合超混沌系统的第j个状态变量的值。xj-1和yj-1为第j-1个状态变量的值。δ为混沌系统控制参数,本实施方式中δ=9.999。Among them, x j and y j represent the value of the jth state variable of the nonlinear cross-coupled hyperchaotic system. x j-1 and y j-1 are the values of the j-1 th state variable. δ is the control parameter of the chaotic system, and δ=9.999 in this embodiment.

步骤九、使用步骤七中的获得的μ,λ作为非线性交叉耦合超混沌系统的控制参数,x0,y0作为非线性交叉耦合超混沌系统的初值,迭代512×512次,生成长度为512×512的混沌序列X′和Y′,如公式(14)所示:Step 9. Use μ and λ obtained in Step 7 as the control parameters of the nonlinear cross-coupling hyperchaotic system, x 0 , y 0 as the initial values of the nonlinear cross-coupling hyper-chaotic system, and iterate 512×512 times to generate a length of are the chaotic sequences X′ and Y′ of 512×512, as shown in formula (14):

Figure BDA0002918144340000154
Figure BDA0002918144340000154

步骤十、从步骤九生成的X′序列的第3000个元素开始,截取长度为M的M′序列,由公式(15)表示:Step 10. Starting from the 3000th element of the X' sequence generated in step 9, intercept the M' sequence of length M, which is represented by formula (15):

M′=X′(3000:3000+512-1) (15)M'=X'(3000:3000+512-1) (15)

从步骤九生成的Y′序列的第5000个元素开始,截取长度为N的N′序列,由公式(16)表示:Starting from the 5000th element of the Y' sequence generated in step 9, intercept the N' sequence of length N, which is represented by formula (16):

N′=Y′(5000:5000+512-1) (16)N'=Y'(5000:5000+512-1) (16)

分别对M′和N′序列进行从小到大排序,得到M′和N′的索引序列INDM和INDN,排序由公式(17)表示:Sort the M' and N' sequences from small to large, respectively, to obtain the index sequences INDM and INDN of M' and N', and the sorting is represented by formula (17):

Figure BDA0002918144340000161
Figure BDA0002918144340000161

步骤十一、使用INDM序列对原图Image进行行循环移位,如果INDM序列第i个元素值为奇数则将对应第i行进行循环左移该奇数值位,如果INDM序列第个元素值为偶数则将对应第i行进行循环右移该偶数值位,行循环移位结束后得到矩阵Image1。Step 11. Use the INDM sequence to perform a row cyclic shift on the original image. If the i-th element value of the INDM sequence is an odd number, the corresponding i-th row will be cyclically shifted to the left by the odd value bit. If the INDM sequence's first element value is If the number is even, the even-valued bits will be shifted to the right of the i-th row, and the matrix Image1 will be obtained after the row cyclic shift is completed.

步骤十二、使用INDN序列对矩阵Image1进列行循环移位,如果INDN序列第i个元素值为奇数将对应第i列进行循环上移该奇数值位,如果INDN序列第I个元素值为偶数将对应第I列进行循环下移该偶数值位,列循环移位结束后得到矩阵Image2。Step 12. Use the INDN sequence to perform a column-row cyclic shift on the matrix Image1. If the i-th element value of the INDN sequence is an odd number, the odd-valued bit will be cyclically shifted up corresponding to the i-th column. If the i-th element value of the INDN sequence is an odd number, The even number will be cyclically shifted down the even-valued bits corresponding to the first column, and the matrix Image2 will be obtained after the column cyclic shift is completed.

步骤十三、使用步骤九生成的长度为512×512的混沌序列X′。将X′序列的每个元素值映射到0到7之间,由公式(18)所示:Step 13, use the chaotic sequence X' with a length of 512×512 generated in step 9. Map each element value of the X' sequence to a value between 0 and 7, as shown by Equation (18):

XR=mod(floor(X′×104,8) (18)XR=mod(floor(X′×10 4 , 8) (18)

把序列XR分割成512×512/8块,每块8个元素,由公式(19)表示:Divide the sequence XR into 512×512/8 blocks, each block has 8 elements, which is represented by formula (19):

XR=XR1XR2XR3...XRi...XR32767XR32768 (19)XR=XR 1 XR 2 XR 3 ... XR i ... XR 32767 XR 32768 (19)

步骤十四、对单层全连接神经网络进行改造,全连接神经网络是一种最基本的神经网络结构,神经网络中除输入层之外的每个节点都和上一层的所有节点有连接。生成一个大小为8×8的每行元素都是1到8随机排列的矩阵W,W的第c行wc由公式(20)所示:Step 14. Transform the single-layer fully-connected neural network. The fully-connected neural network is the most basic neural network structure. Every node in the neural network except the input layer is connected to all nodes in the previous layer. . Generate a matrix W of size 8 × 8 in which each row of elements is randomly arranged from 1 to 8, and the c-th row w c of W is given by formula (20):

wc=randperm(8) (20)w c = randperm(8) (20)

式中randperm(8)为生成一个1到8的随机排列的数列。where randperm(8) is to generate a random sequence of 1 to 8.

改造后的网络有8个输入和有8个输出。使用W和步骤十三描述的XR序列生成8位的新序列作为该网络的权值,使用一种改进的s-box算法作为该网络的激活函数。通过对单层全连接神经网络进行改造生成单层类全连接网络,使用该网络对图像进行比特级的扩散;The transformed network has 8 inputs and 8 outputs. Use W and the XR sequence described in step 13 to generate a new sequence of 8 bits as the weight of the network, and use an improved s-box algorithm as the activation function of the network. A single-layer fully-connected network is generated by transforming a single-layer fully-connected neural network, and the network is used to diffuse images at the bit level;

步骤十五、将步骤十二获得的Image2转换为一维矩阵,转换公式为(21):Step 15: Convert the Image2 obtained in step 12 into a one-dimensional matrix, and the conversion formula is (21):

P=reshape(Image2,1,512×512) (21)P=reshape(Image2, 1, 512×512) (21)

将P分割为512×512/8块,每块8个元素,由公式(22)表示:Divide P into 512×512/8 blocks, each with 8 elements, represented by formula (22):

P=P1P2P3P4...Pi...P32767P32768 (22)P=P 1 P 2 P 3 P 4 ...P i ...P 32767 P 32768 (22)

步骤十六、把步骤十五描述的Pb使用8位的二进制表示,由公式(23)所示:Step 16: Use 8-bit binary representation of P b described in Step 15, as shown by formula (23):

Figure BDA0002918144340000171
Figure BDA0002918144340000171

依次把Pb作为类全连接网络的输入。依次使用XRb序列对步骤十四的矩阵W循环移位。XRb序列第b个元素值为s,如果s为奇数就把W矩阵对应的第i行循环左移s个元素,如果s为偶数就把W矩阵对应的第c行循环右移s个元素,把此操作后得到的矩阵,作为类全连接网络的权值。根据每行wc序列上的值依次选取输入的Pb每一位二进制数,然后把选取的每一位数放到要输出的每个元素上。最后把每个输出元素的8位的二进制数用十进制数表示,然后把每个十进制数通过激活函数s-box计算后得到值作为类全连接网络的输出值。每次输入一个Pb就输出一个PCb,把P的所有元素经过类全连接网络处理后得到一维矩阵PC。Take P b as the input of the fully connected network in turn. The matrix W of step fourteen is cyclically shifted using the XR b sequence in turn. The value of the b-th element of the XR b sequence is s. If s is an odd number, the i-th row corresponding to the W matrix is shifted to the left by s elements; if s is an even number, the c-th row corresponding to the W matrix is rotated to the right by s elements. , and use the matrix obtained after this operation as the weight of the fully connected network. According to the value of each row w c sequence, select each binary digit of input P b in turn, and then put each selected digit on each element to be output. Finally, the 8-bit binary number of each output element is represented by a decimal number, and then each decimal number is calculated by the activation function s-box to obtain the value as the output value of the fully connected network. Each time a P b is input, a PC b is output, and all elements of P are processed by a quasi-fully connected network to obtain a one-dimensional matrix PC.

步骤十七、把步骤八生成的Y′序列,映射到0到255之间。由公式(24)表示:Step 17: Map the Y' sequence generated in step 8 to between 0 and 255. It is represented by formula (24):

YR=mod(floor(Y′×104,28)) (24)YR=mod(floor(Y′×10 4 , 2 8 )) (24)

步骤十八、把步骤十七中长度为512×512的序列YR分割为长度为512×512/2的序列YR1和YR2,由公式(25)表示:Step 18: Divide the sequence YR with a length of 512×512 in Step 17 into sequences YR 1 and YR 2 with a length of 512×512/2, which are represented by formula (25):

Figure BDA0002918144340000181
Figure BDA0002918144340000181

步骤十九、使用步骤十六生成的一维矩阵PC={pct}与步骤十八生成的YR1={yr1t}和YR2={yr2t}序列进行异或,由公式(26)所示:Step 19, use the one-dimensional matrix PC={pc t } generated in step 16 and the sequence of YR 1 ={yr 1t } and YR 2 ={yr 2t } generated in step 18 to perform XOR, according to formula (26) shown:

Figure BDA0002918144340000182
Figure BDA0002918144340000182

式中XOR为异或函数。异或后得到的PC1矩阵。where XOR is the exclusive OR function. The PC1 matrix obtained after XORing.

步骤二十、将步骤十九生成的PC1矩阵,转换成512×512大小的矩阵,由公式(27)所示:Step 20: Convert the PC1 matrix generated in Step 19 into a matrix of size 512×512, as shown by formula (27):

PC2=reshape(PC1,512,512) (27)PC2=reshape(PC1, 512, 512) (27)

转换后生成的矩阵PC2为最终的加密图。The converted matrix PC2 is the final encrypted image.

解密步骤:Decryption steps:

步骤二十一、解密时使用步骤七中的μ,λ,x0,y0和给定初始值的δ以步骤十、十三和十八相同的方法得到伪随机序列INDM、INDN、XR、YR1和YR2Step 21: Use μ, λ, x 0 , y 0 in step 7 and δ of the given initial value to obtain pseudo-random sequences INDM, INDN, XR, YR 1 and YR 2 .

步骤二十二、使用步骤十四生成的矩阵W。Step 22, use the matrix W generated in step 14.

步骤二十三、将步骤二十中得到的加密图像PC2转换成一维矩阵,方法如公式(28):Step 23: Convert the encrypted image PC2 obtained in step 20 into a one-dimensional matrix, the method is as formula (28):

PC1=reshape(PC2,1,M×N) (28)PC1=reshape(PC2, 1, M×N) (28)

步骤二十四、将步骤二十三得到的一维矩阵PC1={PC1t}与步骤二十一生成的YR1={yr1t}和YR2={yr2t}序列进行异或操作,方法如公式(29)所示:Step 24: Perform XOR operation on the one-dimensional matrix PC1={PC1 t } obtained in step 23 and the sequence of YR 1 ={yr 1t } and YR 2 ={yr 2t } generated in step 21, method As shown in formula (29):

Figure BDA0002918144340000191
Figure BDA0002918144340000191

异或后得到PC矩阵。The PC matrix is obtained after XORing.

步骤二十五、将步骤二十四得到PC矩阵分成l块,每块8个元素,由公式(30)表示:Step 25: Divide the PC matrix obtained in step 24 into l blocks, each of which has 8 elements, represented by formula (30):

PC=PC1PC2PC3PC4...,...PCt-1PCt (30)PC = PC 1 PC 2 PC 3 PC 4 ..., ... PC t-1 PC t (30)

其中,t表示块号,t=1,2,...l。Wherein, t represents the block number, t=1, 2, . . . l.

步骤二十六、依次将步骤二十五得到的PCt输入到步骤十四描述的类全连接网络,进行逆的操作。依次将PCt的每个元素输入逆的类全连接网络,先把PCt的每个值使用成8位二进制表示,使用XRb序列修改W矩阵每行wc的值,根据wc的值选取输入的PCt的对应位置的数,最后生成8个元素的Pb序列。将PC所有元素经过逆的类全连接网络处理后得到P矩阵。In step 26, the PC t obtained in step 25 is sequentially input into the fully connected network described in step 14, and the inverse operation is performed. Input each element of PC t into the inverse fully connected network in turn, first use each value of PC t as an 8-bit binary representation, and use the XR b sequence to modify the value of w c in each row of the W matrix, according to the value of w c Select the number of corresponding positions of the input PC t , and finally generate a Pb sequence of 8 elements. The P matrix is obtained by processing all elements of the PC through an inverse fully connected network.

步骤二十七、将步骤二十四得到的P矩阵转换成M×N大小的矩阵,由公式(31)所示:Step 27: Convert the P matrix obtained in step 24 into a matrix of M×N size, as shown by formula (31):

Image2=reshape(P,M,N) (31)Image2=reshape(P, M, N) (31)

步骤二十八、将步骤二十七得到的Image2矩阵和INDM、INDN序列进行逆的循环移位操作。首先进行逆的列循环移位得到Image1矩阵,然后经过逆的行循环移位得到Image矩阵。Image矩阵就是得到的解密图像。Step 28: Perform an inverse cyclic shift operation on the Image2 matrix and the INDM and INDN sequences obtained in step 27. First perform the inverse column cyclic shift to obtain the Image1 matrix, and then obtain the Image matrix through the inverse row cyclic shift. The Image matrix is the resulting decrypted image.

Claims (5)

1.基于明文相关的类全连接网络图像的加密方法,其特征是:该方法由以下步骤实现:1. the encryption method based on the relevant class fully connected network image of plaintext, it is characterized in that: this method is realized by the following steps: 步骤一、选择大小为M×N的灰度图像作为原始明文图像Image,计算所述原始明文图像Image的平均像素值a,并对所述平均像素值a进行精度处理,获得处理后的像素值
Figure FDA0002918144330000011
Step 1: Select a grayscale image with a size of M×N as the original plaintext image Image, calculate the average pixel value a of the original plaintext image Image, and perform precision processing on the average pixel value a to obtain the processed pixel value.
Figure FDA0002918144330000011
步骤二、将所述像素值
Figure FDA0002918144330000012
作为初值迭代混沌系统,生成长度为m的混沌序列X,X={x1x2x3......xm-1xm};
Step 2, convert the pixel value
Figure FDA0002918144330000012
As the initial value iterative chaotic system, a chaotic sequence X with length m is generated, X={x 1 x 2 x 3 ...... x m-1 x m };
采用混沌序列X计算序列Y={y1,y2,y3,y4,......yn},Y中的每个元素作为卷积核,与原始明文图像Image进行卷积核运算;The chaotic sequence X is used to calculate the sequence Y= { y 1 , y 2 , y 3 , y 4 ,... nuclear operation; 对原始明文图像Image进行n次卷积和池化后最终生成大小为
Figure FDA0002918144330000018
的矩阵,MCNN;并将生成的矩阵MCNN的每个值映射到0到
Figure FDA0002918144330000013
的整数中,映射矩阵MCNN2的每个元素记为
Figure FDA0002918144330000014
After performing n convolution and pooling on the original plaintext image Image, the final generated size is
Figure FDA0002918144330000018
matrix, MCNN; and map each value of the resulting matrix MCNN to 0 to
Figure FDA0002918144330000013
In the integers of , each element of the mapping matrix MCNN2 is denoted as
Figure FDA0002918144330000014
步骤三、对步骤二获得映射矩阵MCNN2进行计算,通过计算
Figure FDA0002918144330000015
后获得中间变量h1,h2,h3,h4,通过所述中间变量h1,h2,h3,h4计算混沌系统参数μ和λ,以及混沌系统的初始值x0和y0,计算规则如下式所示:
Step 3: Calculate the mapping matrix MCNN2 obtained in step 2, and calculate
Figure FDA0002918144330000015
After obtaining the intermediate variables h 1 , h 2 , h 3 , h 4 , the chaotic system parameters μ and λ are calculated through the intermediate variables h 1 , h 2 , h 3 , h 4 , and the initial values of the chaotic system x 0 and y 0 , the calculation rule is as follows:
Figure FDA0002918144330000016
Figure FDA0002918144330000016
其中μ′0,λ′0,x′0,y′0是给定的初始值;Where μ′ 0 , λ′ 0 , x′ 0 , y′ 0 are the given initial values; 步骤四、采用非线性交叉耦合超混沌系统获得混沌序列,所述非线性交叉耦合超混沌系统由下式表示:Step 4: Obtain a chaotic sequence by adopting a nonlinear cross-coupling hyper-chaotic system, and the nonlinear cross-coupling hyper-chaotic system is represented by the following formula:
Figure FDA0002918144330000017
Figure FDA0002918144330000017
式中,xj和yj表示非线性交叉耦合超混沌系统的第j个状态变量的值,xj-1和yj-1为第j-1个状态变量的值,δ为混沌系统控制参数;In the formula, x j and y j represent the value of the j-th state variable of the nonlinear cross-coupled hyperchaotic system, x j-1 and y j-1 are the values of the j-1-th state variable, and δ is the chaotic system control parameter; 步骤五、采用步骤三中的μ,λ作为非线性交叉耦合超混沌系统的控制参数,x0,y0作为非线性交叉耦合超混沌系统的初值,迭代M×N次,生成长度为M×N的混沌序列X′和Y′,如下式:Step 5. Use μ and λ in step 3 as the control parameters of the nonlinear cross-coupled hyperchaotic system, x 0 , y 0 as the initial values of the nonlinear cross-coupled hyper-chaotic system, iterate M×N times, and the generation length is M The chaotic sequences X′ and Y′ of ×N are as follows:
Figure FDA0002918144330000021
Figure FDA0002918144330000021
步骤六、从步骤五生成的混沌序列X′的第td个元素开始,截取长度为M的M′序列,从步骤五生成的混沌序列Y′的第td个元素开始,截取长度为N的N′序列,分别对M′和N′序列进行从小到大排序,分别获得M′和N′的索引序列INDM和INDN;Step 6: Starting from the td-th element of the chaotic sequence X' generated in step 5, intercept the M' sequence with a length of M, starting from the td-th element of the chaotic sequence Y' generated in step 5, intercept N with a length of N ' sequence, sort the M' and N' sequences from small to large respectively, and obtain the index sequences INDM and INDN of M' and N' respectively; 步骤七、采用索引序列INDM对原始明文图像Image进行行循环移位,如果索引序列INDM第g个元素值为奇数,则将对应第g行进行循环左移该奇数值位,如果索引序列INDM第g个元素值为偶数,则将对应第g行进行循环右移该偶数值位,行循环移位结束后,获得矩阵Image1;Step 7. Use the index sequence INDM to perform row cyclic shift on the original plaintext image Image, if the gth element of the index sequence INDM is odd, then the gth row corresponding to the gth row is shifted to the left by the odd value, if the index sequence INDM has an odd value If the value of g elements is even, then the corresponding gth row will be cyclically shifted to the right by the even-valued bit, and after the row cyclic shift is completed, the matrix Image1 will be obtained; 采用索引序列INDN对矩阵Image1进行列循环移位,如果索引序列INDN序列第h个元素值为奇数,将对应第h列进行循环上移该奇数值位,如果索引序列INDN序列第h个元素值为偶数,将对应第h列进行循环下移该偶数值位,列循环移位结束后,获得矩阵Image2;Use the index sequence INDN to perform a column cyclic shift on the matrix Image1. If the value of the h-th element of the index sequence INDN sequence is odd, the odd-valued bit will be cyclically shifted up corresponding to the h-th column. If the value of the h-th element of the index sequence INDN sequence is an odd number If it is an even number, the even value bit is cyclically shifted down corresponding to the hth column, and after the column cyclic shift is completed, the matrix Image2 is obtained; 步骤八、采用步骤五生成的长度为M×N的混沌序列X′,将X′序列的每个元素值映射到0到7之间,生成序列XR,将所述序列XR分割成l块,每块8个元素,用下式表示为:Step 8: Using the chaotic sequence X' with a length of M×N generated in step 5, map each element value of the X' sequence to between 0 and 7, generate a sequence XR, and divide the sequence XR into 1 blocks, Each block has 8 elements, expressed as: XR=XR1XR2XR3......XRb-1XRb XR=XR 1 XR 2 XR 3 ......XR b-1 XR b 其中,b表示块号,b=1,2,...l;Among them, b represents the block number, b=1, 2, ... l; 步骤九、对单层全连接神经网络进行改造,生成单层类全连接网络,所述单层类全连接网络八个输入和八个输出,生成一个每行元素均是1到8随机排列的矩阵W,采用矩阵W和步骤八所述的XR序列生成八位的新序列作为改造后的网络的权值;Step 9. Transform the single-layer fully-connected neural network to generate a single-layer fully-connected network. The single-layer fully-connected network has eight inputs and eight outputs to generate a random arrangement of elements in each row from 1 to 8. Matrix W, adopts matrix W and the XR sequence described in step 8 to generate a new sequence of eight bits as the weight of the transformed network; 步骤十、将步骤七获得的Image2转换为一维矩阵P,将一维矩阵P分割为l块,每块8个元素,P=P1P2P3P4......Pb-1PbStep 10. Convert the Image2 obtained in Step 7 into a one-dimensional matrix P, and divide the one-dimensional matrix P into l blocks, each with 8 elements, P=P 1 P 2 P 3 P 4 ......P b -1 P b ; 将所述Pi采用八位的二进制表示,由下式为:The eight-bit binary representation is used for the Pi , which is represented by the following formula:
Figure FDA0002918144330000031
Figure FDA0002918144330000031
依次把Pb作为类全连接网络的输入,依次使用XRb序列对步骤九的矩阵W循环移位;XRb序列第e个元素值为s,如果s为奇数就把W矩阵对应的第e行循环左移s个元素,如果s为偶数就把W矩阵对应的第e行循环右移s个元素,把此操作后得到的矩阵,作为类全连接网络的权值;Take P b as the input of the fully connected network in turn, and use the XR b sequence to cyclically shift the matrix W in step 9; the value of the e-th element of the XR b sequence is s. If s is an odd number, set the e-th element corresponding to the W matrix. The row is shifted to the left by s elements. If s is an even number, the e-th row corresponding to the W matrix is circularly shifted to the right by s elements, and the matrix obtained after this operation is used as the weight of the fully connected network; 根据每行wc序列上的值依次选取输入的Pb每一位二进制数,然后把选取的每一位二进制数放到要输出的每个元素上;According to the value on the w c sequence of each row, select each binary number of the input P b in turn, and then put each selected binary number on each element to be output; 最后把每个输出元素的八位的二进制数用十进制数表示,然后把每个十进制数通过激活函数s-box计算后获得的值作为类全连接网络的输出值;每次输入一个Pb就输出一个PCb,把矩阵P的所有元素经过类全连接网络处理后得到一维矩阵PC;Finally, the eight-bit binary number of each output element is represented by a decimal number, and then the value obtained by each decimal number calculated by the activation function s-box is used as the output value of the fully connected network; each time a P b is input, it is A PC b is output, and all elements of the matrix P are processed by a fully connected network to obtain a one-dimensional matrix PC; 步骤十一、将步骤五生成的混沌序列Y′,映射到0到
Figure FDA0002918144330000032
之间;生成长度为M×N的序列YR,将序列YR分割为长度分别为M×N/2的序列YR1和YR2
Step 11. Map the chaotic sequence Y′ generated in step 5 to 0 to
Figure FDA0002918144330000032
between; generate a sequence YR with a length of M×N, and divide the sequence YR into sequences YR 1 and YR 2 with a length of M×N/2 respectively;
将步骤十生成的一维矩阵PC={pct}与YR1={yr1t}和YR2={yr2t}序列进行异或,用下式表示为:The one-dimensional matrix PC={pct} generated in step 10 is XORed with the sequence of YR 1 ={yr 1t } and YR 2 ={yr 2t }, which is expressed as:
Figure FDA0002918144330000041
Figure FDA0002918144330000041
式中XOR为异或函数,异或后获得矩阵PC1;In the formula, XOR is the XOR function, and the matrix PC1 is obtained after the XOR; 步骤十二、将所述矩阵PC1转换成M×N大小的矩阵,生成的矩阵PC2为最终的加密图像。Step 12: Convert the matrix PC1 into an M×N matrix, and the generated matrix PC2 is the final encrypted image.
2.根据权利要求1所述的基于明文相关的类全连接网络图像的加密方法,其特征在于:步骤二中,卷积核的计算方法由下式表示为:2. the encryption method based on the relevant class fully connected network image of plaintext according to claim 1, it is characterized in that: in step 2, the calculation method of convolution kernel is represented by following formula as:
Figure FDA0002918144330000042
Figure FDA0002918144330000042
式中,
Figure FDA0002918144330000043
为卷积核的大小;reshape为截取函数;
In the formula,
Figure FDA0002918144330000043
is the size of the convolution kernel; reshape is the interception function;
首先使用Y中的元素y1与原始明文图像Image进行卷积运算,如下式表示为:First, use the element y 1 in Y to perform a convolution operation with the original plaintext image Image, which is expressed as: I1,1=conv2(Image,y1)I 1,1 =conv2(Image,y 1 ) 式中conv2()为卷积函数;where conv2() is the convolution function; 采用平均池化函数对卷积后的矩阵进行池化:The convolutional matrix is pooled using the average pooling function: I1,2=averagePooling(I1,1)I 1,2 =averagePooling(I 1,1 ) 其中,averagePooling()为平均池化函数;Among them, averagePooling() is the average pooling function; 依次循环执行上述两个公式,对卷积池化的结果再进行计算,如下式为:Execute the above two formulas in turn, and then calculate the result of the convolution pooling, as follows:
Figure FDA0002918144330000044
Figure FDA0002918144330000044
其中,i=2,3...n,Ii,1,为第i次卷积的结果,Ii,2,为第i次池化的结果,Ii-1,2,表示第i-1次池化后的结果;Among them, i=2, 3...n, I i,1 , is the result of the ith convolution, I i,2 , is the result of the ith pooling, I i-1,2 , represents the ith - The result after 1 pooling; 每次进行卷积和池化后生成矩阵的大小计算公式分别如下:The formulas for calculating the size of the generated matrix after each convolution and pooling are as follows:
Figure FDA0002918144330000051
Figure FDA0002918144330000051
Figure FDA0002918144330000052
Figure FDA0002918144330000052
式中,
Figure FDA0002918144330000053
Figure FDA0002918144330000054
分别为第i次卷积后的矩阵的高和宽;
Figure FDA0002918144330000055
Figure FDA0002918144330000056
分别为第i次池化后的矩阵的高和宽;
In the formula,
Figure FDA0002918144330000053
and
Figure FDA0002918144330000054
are the height and width of the matrix after the i-th convolution, respectively;
Figure FDA0002918144330000055
and
Figure FDA0002918144330000056
are the height and width of the matrix after the i-th pooling, respectively;
对输入的原始明文图像Image进行n次卷积和池化后最终生成大小为
Figure FDA00029181443300000511
的矩阵MCNN;并将生成的MCNN矩阵的每个值映射到0到
Figure FDA0002918144330000057
的整数之间,映射函数由下式表示为:
After performing n convolutions and pooling on the input original plaintext image Image, the final generated size is
Figure FDA00029181443300000511
the matrix of MCNN; and map each value of the resulting MCNN matrix to 0 to
Figure FDA0002918144330000057
Between integers of , the mapping function is expressed as:
Figure FDA0002918144330000058
Figure FDA0002918144330000058
把矩阵MCNN1转为一维矩阵MCNN2,如下式:Convert the matrix MCNN1 to a one-dimensional matrix MCNN2, as follows:
Figure FDA0002918144330000059
Figure FDA0002918144330000059
将一维矩阵MCNN2的每个元素记为
Figure FDA00029181443300000510
Denote each element of the one-dimensional matrix MCNN2 as
Figure FDA00029181443300000510
3.根据权利要求1所述的基于明文相关的类全连接网络图像的加密方法,其特征在于:步骤三所述的中间变量h1,h2,h3,h4,计算过程为:3. The encryption method based on plaintext correlation class fully connected network image according to claim 1, is characterized in that: the intermediate variables h 1 , h 2 , h 3 , h 4 described in step 3, the calculation process is:
Figure FDA0002918144330000061
Figure FDA0002918144330000061
4.根据权利要求1所述的基于明文相关的类全连接网络图像的加密方法,其特征在于:步骤十一所述的长度分别为M×N/2的序列YR1和YR2,由下式表示为:4. The encryption method based on plaintext correlation-like fully connected network images according to claim 1, characterized in that: the lengths described in step 11 are respectively M×N/2 sequences YR 1 and YR 2 , by the following The formula is expressed as:
Figure FDA0002918144330000062
Figure FDA0002918144330000062
5.根据权利要求1所述的基于明文相关的类全连接网络图像的加密方法,其特征在于:还包括解密步骤,具体为:5. the encryption method based on the relevant class fully connected network image of plaintext according to claim 1, is characterized in that: also comprises decryption step, is specially: 步骤A、采用步骤三中的μ,λ,x0,y0和给定初始值的δ以根据步骤六、步骤八以及步骤十一相同的方法获得伪随机序列NINDM、NINDN、NXR、NYR1和NYR2Step A. Use μ, λ, x 0 , y 0 in step 3 and δ of a given initial value to obtain pseudo-random sequences NINDM, NINDN, NXR, NYR 1 according to the same method as step 6, step 8 and step 11 and NYR 2 ; 步骤B、使用步骤九生成的矩阵W;将步骤十二中生成的加密图像PC2转换成一维矩阵PC1,如下式为:Step B, use the matrix W that step 9 generates; The encrypted image PC2 that generates in step 12 is converted into one-dimensional matrix PC1, and the following formula is: PC1=reshape(PC2,1,M×N)PC1=reshape(PC2, 1, M×N) 步骤C、将步骤B获得的一维矩阵PC1={PC1t}与步骤A生成的YR1={yr1t}和YR2={yr2t}序列进行异或操作获得矩阵PC;Step C, perform XOR operation on the one-dimensional matrix PC1={PC1 t } obtained in step B and YR 1 ={yr 1t } and YR 2 ={yr 2t } sequence generated in step A to obtain matrix PC; 步骤D、将获得的矩阵PC分成l块,每块8个元素,采用下式表示为:Step D, the obtained matrix PC is divided into 1 blocks, each block has 8 elements, and the following formula is used to express as: PC=PC1PC2PC3PC4...,...PCb-1PCb PC = PC 1 PC 2 PC 3 PC 4 ..., ... PC b-1 PC b 步骤E、依次将PCb输入到步骤九的类全连接网络,进行逆的操作;Step E, input PC b to the class fully connected network of step 9 successively, and carry out inverse operation; 依次将PCb的每个元素输入逆的类全连接网络,先把PCb的每个值使用成8位二进制表示,使用XRb序列修改W矩阵每行wc的值,根据wc的值选取输入的PCb的对应位置的数,最后生成8个元素的Pb序列;将PC所有元素经过逆的类全连接网络处理后得到矩阵P;Input each element of PC b into the inverse fully connected network in turn, first use each value of PC b as an 8-bit binary representation, and use the XR b sequence to modify the value of w c in each row of the W matrix, according to the value of w c Select the number of the corresponding positions of the input PC b , and finally generate a P b sequence of 8 elements; after all the elements of the PC are processed by the inverse class fully connected network, the matrix P is obtained; 步骤F、将获得的矩阵P转换成M×N大小的矩阵Image2;Step F, convert the obtained matrix P into a matrix Image2 of M×N size; 步骤G、将获得的矩阵Image2和步骤A中的NINDM,NINDN序列进行逆的循环移位操作,首先进行逆的列循环移位得到Image1矩阵,然后经过逆的行循环移位得到Image矩阵,Image矩阵则为解密图像。Step G. Perform an inverse cyclic shift operation on the obtained matrix Image2 and the NINDM and NINDN sequences in step A, first perform an inverse column cyclic shift to obtain the Image1 matrix, and then obtain an Image matrix through an inverse row cyclic shift, Image The matrix is the decrypted image.
CN202110107767.4A 2021-01-27 2021-01-27 Encryption method of similar full-connection network image based on plaintext correlation Active CN112887075B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110107767.4A CN112887075B (en) 2021-01-27 2021-01-27 Encryption method of similar full-connection network image based on plaintext correlation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110107767.4A CN112887075B (en) 2021-01-27 2021-01-27 Encryption method of similar full-connection network image based on plaintext correlation

Publications (2)

Publication Number Publication Date
CN112887075A CN112887075A (en) 2021-06-01
CN112887075B true CN112887075B (en) 2022-06-24

Family

ID=76052608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110107767.4A Active CN112887075B (en) 2021-01-27 2021-01-27 Encryption method of similar full-connection network image based on plaintext correlation

Country Status (1)

Country Link
CN (1) CN112887075B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277978B (en) * 2022-09-26 2022-12-16 南通德辰智能科技有限公司 Image information security management method based on state coding table
CN118101846A (en) * 2024-04-16 2024-05-28 安阳师范学院 Novel image encryption method based on DNA strand displacement rule

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109379510A (en) * 2018-09-13 2019-02-22 桂林电子科技大学 An Image Encryption Method Based on Two-dimensional Logistic Chaotic System Algorithm
KR20190104728A (en) * 2018-03-02 2019-09-11 인천대학교 산학협력단 Apparatus and Method for Encrypting Based on Combined Chaos in Body Area Network
CN112084517A (en) * 2020-09-15 2020-12-15 郑州轻工业大学 An Image Encryption Method Based on Chaos Map and Bit-Level Permutation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190104728A (en) * 2018-03-02 2019-09-11 인천대학교 산학협력단 Apparatus and Method for Encrypting Based on Combined Chaos in Body Area Network
CN109379510A (en) * 2018-09-13 2019-02-22 桂林电子科技大学 An Image Encryption Method Based on Two-dimensional Logistic Chaotic System Algorithm
CN112084517A (en) * 2020-09-15 2020-12-15 郑州轻工业大学 An Image Encryption Method Based on Chaos Map and Bit-Level Permutation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
An Image Segmentation Encryption Algorithm Based on Hybrid Chaotic System;li jinqing,di xiaoqiang;《IEEE Access》;20190729;全文 *
Spatiotemporal chaos in improved cross coupled map lattice;wang mingxu 等;《Information Sciences》;20201001;全文 *

Also Published As

Publication number Publication date
CN112887075A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN110086601B (en) Joseph traversal and hyperchaotic system image encryption method based on pixel value association
CN113297606B (en) Color quantum image encryption and decryption method based on multiple chaos and DNA operation
Kumar et al. A survey on chaos based image encryption techniques
CN109376540B (en) An Image Encryption Method Based on Duffing Mapping and Genetic Operation
CN106570815A (en) Image encryption method based on double-chaos system and blocking
CN106296561B (en) Image encryption method and device, decryption method and device based on hyperchaotic system
CN104008520A (en) Color image encryption method based on SHA-384 function, spatiotemporal chaotic system, quantum chaotic system and neural network
CN110086600B (en) An Image Encryption Method Based on Hyperchaotic System and Variable Step Joseph Problem
CN109803063A (en) A kind of image encryption method based on five dimension ultra-chaos systems
CN107590394A (en) A kind of image encryption method based on chaotic maps and bit recombination
CN107437266A (en) Image encryption method based on chaos system Yu DNA chain displacement model
CN112887075B (en) Encryption method of similar full-connection network image based on plaintext correlation
CN110519037A (en) The image encryption method of ultra-chaos pseudo random sequence
CN117499005A (en) Image encryption method based on 4D chaotic system
CN109361830B (en) Image encryption method based on plaintext
CN117440101A (en) Image encryption algorithm and electronic equipment based on multi-chaotic system and circular DNA operation
Zhang et al. The unified image cryptography algorithm based on finite group
Iqbal et al. An efficient hybrid encryption model based on deep convolutional neural networks, deoxyribonucleic acid computing and chaotic system
CN112788196B (en) A Double Image Encryption Method Based on Dynamic Adaptive Diffusion of Convolutional Neural Networks
Kumar et al. SOCIET: Second-order cellular automata and chaotic map-based hybrid image encryption technique
CN113259089A (en) Image encryption method based on combination of chaos principle and genetic algorithm
CN118055195A (en) Image encryption method based on improved chaotic system and compressed sensing
Balaji et al. VLSI Implementation of Optimized 2D SIMM Chaotic Map for Image Encryption.
Chattopadhyay et al. Encoding by DNA relations and randomization through chaotic sequences for image encryption
CN117494182A (en) A facial image regional information encryption method based on four-dimensional chaotic system

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