CN111294481A - Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation - Google Patents

Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation Download PDF

Info

Publication number
CN111294481A
CN111294481A CN202010037335.6A CN202010037335A CN111294481A CN 111294481 A CN111294481 A CN 111294481A CN 202010037335 A CN202010037335 A CN 202010037335A CN 111294481 A CN111294481 A CN 111294481A
Authority
CN
China
Prior art keywords
image
sequence
dna
matrix
dimensional
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
Application number
CN202010037335.6A
Other languages
Chinese (zh)
Other versions
CN111294481B (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.)
Henan University
Original Assignee
Henan University
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 Henan University filed Critical Henan University
Priority to CN202010037335.6A priority Critical patent/CN111294481B/en
Publication of CN111294481A publication Critical patent/CN111294481A/en
Application granted granted Critical
Publication of CN111294481B publication Critical patent/CN111294481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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
    • 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/44Secrecy systems
    • H04N1/448Rendering the image unintelligible, e.g. scrambling
    • H04N1/4486Rendering the image unintelligible, e.g. scrambling using digital data encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Image Processing (AREA)

Abstract

The invention provides an image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation. The method comprises the following steps: giving an initial value of a 4D memristor chaotic system to generate a chaotic sequence, and calculating a hash value of a plaintext image; selecting elements from the chaotic sequence according to the hash value to form a new chaotic sequence; performing self-updating transformation on the plaintext image P (M multiplied by N) to obtain a self-updating transformed image P3(ii) a Image P using a DNA coding rule sequence3Dynamic coding of DNA to obtain DNA sequence P5And converting it into a three-dimensional DNA matrix P6(ii) a Generating three-dimensional orthogonal Latin cube Lz1Generating a three-dimensional cat mapping sequence Mp, constructing a double random three-dimensional matrix scrambling rule, and performing a three-dimensional DNA matrix P6Scrambling is carried out to obtain three-dimensional after scramblingMatrix P7(ii) a For three-dimensional matrix P7Performing plane diffusion on the plane to be diffused to obtain a diffused three-dimensional DNA matrix P8(ii) a For three-dimensional DNA matrix P8The DNA is dynamically decoded and then converted into a two-dimensional matrix of size M × N as the ciphertext image C.

Description

Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation
Technical Field
The invention relates to the technical field of image encryption, in particular to an image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation.
Background
Digital images have become one of the main ways of information communication because of their characteristics of intuition, image and reality. The digital image has the characteristics of high redundancy, high data volume, strong adjacent pixel correlation and the like. Conventional encryption schemes such as Data Encryption Standard (DES) and Advanced Encryption Standard (AES) are designed for text information, and have a problem of low encryption efficiency when used for images.
The chaotic system is widely used in the field of image encryption because of its dynamic characteristics such as sensitivity, ergodicity, non-periodicity, and determinacy to initial conditions and parameters. With the development of multidisciplinary cross fusion, DNA calculation is widely concerned by people due to the characteristics of capability of parallel calculation, large storage capacity, low power consumption and the like. Some scholars introduce DNA calculation into chaotic image encryption algorithm design and provide an image encryption algorithm based on DNA coding and a chaotic system. For example, Sun (Sun SL. A novel hyperchaotic image encryption scheme based on DNA encoding, pixel-level coding and bit-level coding. IEEE Photonics Journal,2018,10(2):7201714.) proposes a hyperchaotic image encryption algorithm based on DNA encoding and scrambling. Firstly, a chaos sequence is generated by a 5D hyper-chaos system, then pixel level scrambling and bit level scrambling of an image are realized by the chaos sequence, and finally image diffusion is completed by DNA exclusive OR operation. Feng et al (Feng W, He Y. Cryptology analysis and improvement of hyper-textual image encryption scheme on DNA encoding and encryption, IEEE Photonics Journal,2018,10(6):7909215.) indicate that the encryption algorithm proposed by Sun has the problem that the key is irrelevant to the plaintext image, and an attacker can obtain an equivalent diffusion matrix and an equivalent scrambling matrix by selecting a plaintext attack, so that the plaintext image can be completely recovered without knowing any security key information. Recently, Li et al (Li T Y, Shi J Y, Li X S, Wu J, Pan F. image encryption based on pixel-level differentiation with dynamic filtering and DNA-level mutation with 3D Latin Cubes. Encopy, 2019,21(3):319.) proposed a DNA coding image encryption algorithm based on dynamic filter diffusion and three-dimensional Latin cube scrambling. Firstly, generating a chaotic sequence by using a new 5D hyper-chaotic system; secondly, converting the chaotic sequence into a one-dimensional filtering sequence, and performing filtering operation on each pixel point of the image to complete pixel-level diffusion; then, carrying out DNA coding on the image, then converting the image into a three-dimensional DNA matrix, and carrying out DNA level scrambling on a plaintext by using a three-dimensional Latin method; and finally, performing DNA decoding on the three-dimensional matrix, and converting the three-dimensional matrix into a two-dimensional ciphertext image. However, the filtering operation of the algorithm is not effective when operating on special images (such as all-zero images), so that the security of the encryption algorithm is not high. Therefore, highly secure image encryption algorithms are urgently under study.
Disclosure of Invention
The invention provides an image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA (deoxyribonucleic acid) calculation, aiming at solving the problems that a secret key is irrelevant to a plaintext image and filtering operation is invalid to a special image, so that the algorithm safety is low in the existing image encryption method.
The invention provides an image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation, which comprises the following steps:
step 1: will be given an initial value (x)0,y0,z0,u0) The chaotic sequence X, Y, Z and U are generated in a 4D memristive chaotic system according to a given plaintext image P (M multiplied by N)Calculating to obtain a plaintext image hash value;
step 2: selecting elements from the chaotic sequences X, Y, Z and U according to the hash value to form a new chaotic sequence X1、Y1、Z1And U1
And step 3: according to the chaos sequence X1And the hash value carries out self-updating transformation on the plaintext image P (M multiplied by N) to obtain the self-updating transformed image P3(M×N);
And 4, step 4: according to the chaotic sequence Y1And generating a DNA coding rule sequence by the hash value, and using the DNA coding rule sequence to the image P3Dynamic coding of DNA to obtain DNA sequence P5(1×4MN);
And 5: the DNA sequence P5(1X 4MN) into a three-dimensional DNA matrix P6(lr×lr×lr);
Step 6: according to the chaotic sequence Z1Generating three-dimensional orthogonal Latin cube Lz1Calculating to obtain an initial value and parameters of the three-dimensional cat mapping according to the hash value, and generating a three-dimensional cat mapping sequence Mp;
and 7: using said three-dimensional orthogonal latin cube Lz1And constructing a double random three-dimensional matrix scrambling rule by the three-dimensional cat mapping sequence Mp, and performing scrambling on the three-dimensional DNA matrix P6Scrambling (lr × lr × lr) to obtain a three-dimensional matrix P after scrambling7
And 8: the chaos sequence U is coded by the DNA coding rule sequence1Carrying out DNA dynamic coding to obtain a key matrix U2Using said key matrix U2For the three-dimensional matrix P7Performing plane diffusion on the plane to be diffused to obtain a diffused three-dimensional DNA matrix P8(lr×lr×lr);
And step 9: for the three-dimensional DNA matrix P8(lr × lr × lr) is subjected to DNA dynamic decoding, and then converted into a two-dimensional matrix of size M × N as the ciphertext image C.
Further, the calculating the plaintext image hash value according to the given plaintext image P (M × N) in step 1 includes:
calculating SHA256 hash value hv of the plaintext image P (M × N);
averagely dividing the Hash values hv into eight groups, converting each group of elements into decimal numbers, and recording the decimal numbers as k1、k2、k3、k4、k5、k6、k7And k8
Further, the step 2 comprises:
step 2.1: respectively generating selection parameters T by using formula (2)1、T2、T3And T4
Figure BDA0002366502990000031
Step 2.2: from the chaotic sequences X, Y, Z and U, the Tth sequence is selected1+1 to T1+4MN, from T2+1 to T2+4MN, from T3+1 to T3+4MN and from T4+1 to T4+4MN elements to obtain new chaos sequence X1、Y1、Z1And U1
Further, the step 3 comprises:
step 3.1: generating a matrix W (M multiplied by N) by using a 4D memristive chaotic system, and performing XOR operation on a plaintext image P (M multiplied by N) by using the matrix W (M multiplied by N) to update the image to obtain an updated image P1
Step 3.2: calculating according to formula (4) to obtain a filtering direction parameter Dir, and obtaining the filtering direction parameter Dir in the image P according to the value of Dir1Adding random number to obtain image P2
Dir=1+k5mod 4 (4)
Step 3.3: aligning the chaotic sequence X according to formula (5)1Carrying out quantization operation to obtain a new sequence X2
X2(n)=mod[floor(X1(n)×1014),256],n∈[0,4MN-1](5)
Step 3.4: from said sequence X2Randomly selecting 3MN number, and recording as X3Then the sequence X3Conversion into MN matrices W of size 1X 3 or 3X 11Then the matrix W1Setting the value of the last element of the medium three-digit number as 1 to obtain a new matrix W2
Step 3.5: determining a filtering direction according to the value of Dir, using the matrix W2For the image P2Performing convolution operation according to the filtering direction, and obtaining an operated image P after the convolution operation3
Further, the values according to Dir in step 3.2 are in the image P1Adding random number to obtain image P2The method specifically comprises the following steps:
when Dir is 1, in the image P1Two columns of random numbers with the size of M are added on the left side of the image P to obtain an image P2(M×(N+2));
When Dir is 2, in the image P1Adding two rows of random numbers with the size of M to the right side of the image P to obtain an image P2(M×(N+2));
When Dir is 3, in the image P1Adding two rows of random numbers with the size of N on the upper side of the image P to obtain an image P2((M+2)×N);
When Dir is 4, in the image P1Adding two rows of random numbers with the size of N at the lower side of the image P to obtain an image P2((M+2)×N);
Correspondingly, the step 3.5 is specifically:
when Dir is 1, the matrix W is used2For the image P2Filtering according to the left-to-right direction;
when Dir is 2, the matrix W is used2For the image P2Filtering in the right-to-left direction;
when Dir is 3, the matrix W is used2For the image P2Filtering according to the direction from top to bottom;
when Dir is 4, the matrix W is used2For the image P2Filtering is performed in the bottom-up direction.
Further, the step 4 comprises:
step 4.1: generating a DNA coding rule sequence De according to the formula (6):
De=1+mod[floor(Y1×1010+k4),8](6)。
step 4.2: for the image P3Is binary decomposed to obtain the image P3Conversion into a one-dimensional binary sequence P of size 1X 8MN4
Step 4.3: according to De to the binary sequence P4Carrying out DNA coding to obtain a DNA sequence P5(1×4MN)。
Further, the step 5 comprises:
step 5.1: computing
Figure BDA0002366502990000041
If the value of l is a positive integer, skipping to step 5.5, otherwise executing step 5.2;
step 5.2: definition of R ═ R3Finding a condition R satisfying in S ═ mxnx4<The maximum R value of S is n × R3Obtaining n and r meeting the condition, wherein r is a positive integer;
step 5.3: constructing n cubes with the size of r multiplied by r, and then jumping to the step 5.6;
step 5.4: if the conditions in step 5.1 and step 5.2 are not satisfied and the cube cannot be directly constructed, the image P is processed3Zero padding is carried out (M multiplied by N), and then the step 4 is skipped to start again;
step 5.5: constructing a cube with the size of l multiplied by l;
step 5.6: outputting the constructed cube, wherein the output cube is the three-dimensional DNA matrix P6(lr×lr×lr)。
Further, the calculating in step 6 according to the hash value to obtain an initial value and a parameter of the three-dimensional cat mapping specifically includes:
step 6.1: using a hash value k7Calculating the parameter ax、ayAnd az
When k is7mod3 is 0,
Figure BDA0002366502990000051
When k is7When mod3 is equal to 1,
Figure BDA0002366502990000052
when k is7When mod3 is 2,
Figure BDA0002366502990000053
step 6.2: using a hash value k8Calculating the parameter bx、byAnd bz
When k is8When mod3 is 0,
Figure BDA0002366502990000061
when k is8When mod3 is equal to 1,
Figure BDA0002366502990000062
when k is8When mod3 is 2,
Figure BDA0002366502990000063
step 6.3: using a hash value k1To k is6Calculating an initial value mx0、my0And mz0
Figure BDA0002366502990000064
Wherein x, y and z represent state variables of the 4D memristive chaotic system.
Further, the step 7 of utilizing the three-dimensional orthogonal Latin cube Lz1And the three-dimensional cat mappingConstructing a double random three-dimensional matrix scrambling rule by using the sequence Mp, which specifically comprises the following steps:
step 7.1: according to P6(lr × lr × lr × lr) position sequences (i, j, k) and Lz1Position sequence L ofz1(i, j, k) establishing a correspondence relationship according to equation (17):
Figure BDA0002366502990000065
step 7.2: according to P6(lr × lr × lr × lr) position sequences (i, j, k) and MpPosition sequence M ofp(i, j, k) establishing a correspondence relationship according to equation (18):
Figure BDA0002366502990000066
step 7.3: establishing a random position sequence according to equation (19)
Figure BDA0002366502990000067
And random position sequence
Figure BDA0002366502990000068
The mapping relationship between:
Figure BDA0002366502990000071
wherein (i, j, k) represents P6The element position in (lr × lr × lr),
Figure BDA0002366502990000072
indicates that (i, j, k) corresponds to Lz1A random position in (a);
Figure BDA0002366502990000073
indicates that (i, j, k) corresponds to MpAt random positions in (a).
Further, the step 8 includes:
step 8.1: using the DNA coding rule sequence to encode the chaotic sequence U according to a formula (20)1Carrying out DNA dynamic coding to obtain a key matrix U2
U2=DNA_enc(mod[floor(U1×1014),4],De) (20)
Wherein, DNA _ enc (a, b) represents that the element in the sequence a is subjected to DNA coding operation by using the sequence b;
step 8.2: calculating to obtain a diffusion plane parameter Pm according to a formula (21), and determining a three-dimensional matrix P according to the value of Pm7Plane to be diffused Q in (1):
Pm=1+(k1+k3+k5)mod3 (21)
step 8.3: DNA diffusion of Q was performed using equations (22) and (23):
Pd=1+cemod3 (22)
Figure BDA0002366502990000074
wherein ce represents a three-dimensional matrix P7The number of planes of (1) ce lr,
Figure BDA0002366502990000075
representing an exclusive or operation.
The invention has the beneficial effects that:
(1) the invention designs an image self-updating transformation operation based on filtering operation, which comprises the following steps: firstly, carrying out XOR operation on a plaintext image by using a sequence generated by a chaotic system, then embedding a random number into the plaintext image, and carrying out filtering convolution operation on the plaintext image by using a filtering matrix, thereby realizing the change of image pixels. The operation solves the problem that the conventional filtering convolution operation is ineffective to the operation of special images such as all zeros, and the like, so that the safety of the algorithm is not high.
(2) The invention designs a double random three-dimensional matrix scrambling rule, establishes a double random three-dimensional matrix position mapping relation through three-dimensional cat mapping and an orthogonal Latin cube, realizes random scrambling of three-dimensional DNA matrix elements of a plaintext image, solves the problem that an attacker easily reversely pushes and breaks a scrambling process according to sequence positions in the traditional sequential scrambling method, and improves the security of an encryption algorithm.
(3) The invention designs a plain text information controlled three-dimensional DNA matrix plane diffusion method, diffusion operation is directly carried out on a scrambled three-dimensional matrix plane, the hash value of a plain text image is utilized to determine the operation plane of the three-dimensional DNA matrix, and corresponding diffusion modes (namely DNA addition, subtraction and XOR operation) are determined by means of the plane sequence number information of the three-dimensional matrix, so that the sensitivity of an encryption algorithm to the plain text information is improved, the conversion among matrix dimensions is reduced, the calculated amount is reduced, and the encryption efficiency is improved.
(4) The invention designs a safe and efficient chaotic key stream generation method, which is particularly suitable for encrypting a large batch of images: firstly, generating a chaotic sequence at one time by using an initial value of a chaotic system irrelevant to plaintext information; then, when a specific plaintext image is encrypted, the SHA256 hash value of the plaintext image is used for selecting a corresponding chaotic sequence segment from the chaotic sequence, and the chaotic sequence segment is used as a key stream in the encryption process. The method solves the problem that time is wasted due to the fact that chaos sequences are repeatedly generated when different images are encrypted in part of encryption algorithms, ensures that different chaos sequences are used when different images are encrypted, and increases the plaintext relevance of the algorithms.
Drawings
FIG. 1 is a schematic flow chart of an image encryption method based on self-updating transformation, dual random three-dimensional matrix scrambling and DNA calculation according to an embodiment of the present invention;
FIG. 2 is a second schematic flowchart of an image encryption method based on self-updating transformation, dual random three-dimensional matrix scrambling and DNA calculation according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a hash value partitioning method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating random number embedding and filtering directions provided by an embodiment of the present invention;
FIG. 5 is a diagram illustrating a filtering convolution operation process according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of converting a two-dimensional image subjected to self-updating transformation into a three-dimensional DNA matrix according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of the construction of an orthogonal Latin cube provided by an embodiment of the present invention;
in fig. 8: (a) a schematic diagram of a conventional three-dimensional matrix scrambling rule, (b) a schematic diagram of a dual random three-dimensional matrix scrambling rule provided by the embodiment of the present invention;
FIG. 9 is a schematic diagram of a planar diffusion provided by an embodiment of the present invention;
in fig. 10: (a) the image encryption method comprises the steps of (a) encrypting a plaintext image for Airfield, (b) encrypting a ciphertext image for the image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation provided by the embodiment of the invention, and (c) decrypting the image corresponding to the step (b);
FIG. 11 is a schematic diagram of a test result of an image encryption method based on self-updating transformation, dual random three-dimensional matrix scrambling and DNA calculation in terms of key sensitivity according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of a test result of an image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation in terms of statistical attack resistance according to an embodiment of the present invention;
fig. 13 is a schematic diagram of a test result of the image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation in terms of anti-noise attack capability according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 1, an embodiment of the present invention provides an image encryption method based on self-updating transformation, dual random three-dimensional matrix scrambling, and DNA calculation, including the following steps:
s101: will be given an initial value (x)0,y0,z0,u0) Substituting the chaotic sequence into a 4D memristive chaotic system to generate a chaotic sequence X, Y, Z and a chaotic sequence U, and calculating according to a given plaintext image P (M multiplied by N) to obtain a plaintext image hash value;
s102: selecting elements from the chaotic sequences X, Y, Z and U according to the hash value to form a new chaotic sequence X1、Y1、Z1And U1
S103: according to the chaos sequence X1And the hash value carries out self-updating transformation on the plaintext image P (M multiplied by N) to obtain the self-updating transformed image P3
S104: according to the chaotic sequence Y1And generating a DNA coding rule sequence by the hash value, and using the DNA coding rule sequence to the image P3Dynamic coding of DNA to obtain DNA sequence P5(1×4MN);
S105: the DNA sequence P5(1X 4MN) into a three-dimensional DNA matrix P6(lr×lr×lr);
S106: according to the chaotic sequence Z1Generating three-dimensional orthogonal Latin cube Lz1Calculating to obtain an initial value and parameters of the three-dimensional cat mapping according to the hash value, and generating a three-dimensional cat mapping sequence Mp;
in this step, since the parameters of the three-dimensional cat mapping are generated by using the plaintext image information, different plaintext images generate different mapping sequences.
S107: using said three-dimensional orthogonal latin cube Lz1And constructing a double random three-dimensional matrix scrambling rule by the three-dimensional cat mapping sequence Mp, and performing scrambling on the three-dimensional DNA matrix P6Scrambling (lr × lr × lr) to obtain a three-dimensional matrix P after scrambling7
S108: the chaos sequence U is coded by the DNA coding rule sequence1Carrying out DNA dynamic coding to obtain a key matrix U2Using said key matrix U2For the three-dimensional matrix P7The plane to be diffused in the (C) is subjected to plane diffusion to obtain diffusionThe latter three-dimensional DNA matrix P8(lr×lr×lr);
S109: for the three-dimensional DNA matrix P8(lr × lr × lr) is subjected to DNA dynamic decoding, and then converted into a two-dimensional matrix of size M × N as the ciphertext image C.
In the chaotic image encryption algorithm, a chaotic sequence generated by a chaotic system is usually used as a key stream for scrambling and diffusing images. In a traditional image encryption algorithm, in order to enhance the resistance of the algorithm to plaintext attack, plaintext image information is generally used as an initial value to disturb the generation of a chaotic sequence, so that different chaotic sequences can be adopted for encrypting different plaintext images to ensure the security of the encryption algorithm. When a large amount of images need to be encrypted, if a traditional image encryption algorithm is adopted, different chaotic sequences need to be generated aiming at different plaintext images, and the generation of the chaotic sequences wastes a large amount of time and is not efficient.
Compared with the traditional image encryption algorithm, the chaos sequence is generated at one time by using the initial value of the chaos system irrelevant to the plaintext information, so that the generated chaos sequence can be directly used when different plaintext images are encrypted, then corresponding segments are selected in the chaos sequence by using the information (namely the hash value) of the plaintext images, and different chaos sequence segments are selected from different plaintext images. The method for generating the key stream not only solves the problem that time is wasted when the chaotic sequence is repeatedly generated when different images are encrypted, but also ensures that different chaotic sequences are adopted for different plaintext images, and enhances the correlation between the algorithm and the plaintext.
Example 2
On the basis of the above embodiment 1, as shown in fig. 2, an embodiment of the present invention further provides an image encryption method based on self-updating transformation, dual random three-dimensional matrix and DNA calculation, including the following steps:
s201: will be given an initial value (x)0,y0,z0,u0) The chaotic sequence X, Y, Z and U are generated in a 4D memristive chaotic system, and a plaintext image hash value is calculated according to a given plaintext image P (M multiplied by N).
Specifically, the 4D memristive chaotic system can adopt a new 4D memristive chaotic system proposed by karthikey Rajagopal et al in 2018. The 4D memristive chaotic system is shown as a formula (1):
Figure BDA0002366502990000111
wherein x, y, z and u represent state variables of the 4D memristive chaotic system; w (u) ═ e + hu2And a, b, c, d, e and h are system parameters. When the parameters a is 32, b is 17, c is 15, d is 0.3, e is 4, and h is 0.01, Lyapunov indexes calculated by the Wolf method are 3.105221, 0, -0.280985, and-24.130975, respectively, which indicates that the system is a chaotic system.
The chaotic sequences X, Y, Z and U generated in this step are specifically: initial value x of given 4D memristive chaotic system0、y0、z0And u0Iterating N using equation (1)0(N0More than or equal to 2500+4MN), discarding the previous t (t is more than or equal to 500) values, avoiding transient effect, and obtaining the chaotic sequences X, Y, Z and U.
In this step, the hash value of the plaintext image is calculated according to the given plaintext image P (M × N), which specifically includes: computing SHA256 hash value hv (i.e., hv) of plaintext image P (M N)1,hv2,…,hv256) (ii) a Grouping every 32 elements, equally dividing the hash value hv into eight groups (for example, the hash value hv may be equally divided into eight groups in the manner shown in fig. 3), and converting each group of elements into decimal numbers, denoted as k1、k2、k3、k4、k5、k6、k7And k8
S202: according to the hash value (e.g. k)1、k2、k3And k4) Selecting elements from the chaotic sequences X, Y, Z and U respectively to form a new chaotic sequence X1、Y1、Z1And U1. Specifically, the present step includes the following substeps:
s2021: respectively generating selection parameters T by using formula (2)1、T2、T3And T4
Figure BDA0002366502990000112
S2022: from the chaotic sequences X, Y, Z and U, the Tth sequence is selected1+1 to T1+4MN, from T2+1 to T2+4MN, from T3+1 to T3+4MN and from T4+1 to T4+4MN elements to obtain new chaos sequence X1、Y1、Z1And U1
As can be known from an algorithm for generating selection parameters, the selection of the chaotic sequence is determined by the hash value of the plaintext image, and different chaotic sequences can be selected from different plaintext images.
S203: according to the chaos sequence X1And the hash value (e.g., k)5) Performing self-updating transformation on the plaintext image P (M multiplied by N) to obtain a self-updating transformed image P3
In the step, a self-updating transformation operation of a plaintext drive filtering process is designed by utilizing the plaintext image information and the chaotic system, and is used for updating and transforming the plaintext image pixels for the first time. Specifically, the present step includes the following substeps:
s2031: generating a matrix W (M multiplied by N) by using a 4D memristive chaotic system, and performing XOR operation on a plaintext image P (M multiplied by N) by using the matrix W (M multiplied by N) to update the image to obtain an updated image P1As shown in equation (3):
P1(i,j)=XOR[W(i,j),P(i,j)](3)
wherein i belongs to [1, M ], j belongs to [1, N ].
S2032: calculating according to formula (4) to obtain a filtering direction parameter Dir, and obtaining the filtering direction parameter Dir in the image P according to the value of Dir1Adding random number to obtain image P2
Dir=1+k5mod4 (4)
Specifically, when Dir is 1, in the image P1Two columns of random numbers with the size of M are added on the left side of the image P to obtain an image P2(M × (N + 2)); as shown in FIG. 4(a)Shown in the figure. When Dir is 2, in the image P1Adding two rows of random numbers with the size of M to the right side of the image P to obtain an image P2(M × (N + 2)); as shown in fig. 4 (b). When Dir is 3, in the image P1Adding two rows of random numbers with the size of N on the upper side of the image P to obtain an image P2((M + 2). times.N); as shown in fig. 4 (c). When Dir is 4, in the image P1Adding two rows of random numbers with the size of N at the lower side of the image P to obtain an image P2((M + 2). times.N); as shown in fig. 4 (d).
S2033: aligning the chaotic sequence X according to formula (5)1Carrying out quantization operation to obtain a new sequence X2
X2(n)=mod[floor(X1(n)×1014),256],n∈[0,4MN-1](5)
S2034: from said sequence X2Randomly selecting 3MN number, and recording as X3Then the sequence X3Conversion into MN matrices W of size 1X 3 or 3X 11Then the matrix W1Setting the value of the last element of the medium three-digit number as 1 to obtain a new matrix W2
S2035: determining a filtering direction according to the value of Dir, using the matrix W2For the image P2Performing convolution operation according to the filtering direction, and obtaining an operated image P after the convolution operation3
Specifically, when Dir is 1, the matrix W is utilized2For the image P2Filtering according to the left-to-right direction; as indicated by the arrows in fig. 4 (a). When Dir is 2, the matrix W is used2For the image P2Filtering in the right-to-left direction; as indicated by the arrow in fig. 4 (b). When Dir is 3, the matrix W is used2For the image P2Filtering according to the direction from top to bottom; as indicated by the arrow in fig. 4 (c). When Dir is 4, the matrix W is used2For the image P2Filtering according to the direction from bottom to top; as indicated by the arrow in fig. 4 (d).
To facilitate understanding of the convolution operation of the filtering process, assume that a plaintext image is P (M in M)N), the image to which the random number is added is P2(M × (N +2)), and the chaotic matrix used for filtering is W2(1X 3 MN). Two pixels in the plaintext image P are selected as an example for illustration, and the operation of filtering is shown in fig. 5: first, from a filter matrix W of size 1 × 3MN2Two 1 x 3 filter matrices are selected. Then, the image P added with the random number is subjected to filtering matrix2The filtering operation is performed in such a way that mod (78 × 14+156 × 32+1 × 65,256) is 5 and mod (12 × 32+9 × 65+1 × 71,256) is 16, resulting in two pixels of the filtered image. Image P2The filtering operation process of other pixels in the system is the same as the operation process, and the filtering matrix participating in the operation is generated by the chaotic system and is dynamic and random. Image P2Two rows of random numbers added in the image P are removed after convolution operation to obtain an image P3(M×N)。
S204: according to the chaotic sequence Y1And generating a DNA coding rule sequence by the hash value, and using the DNA coding rule sequence to the image P3Dynamic coding of DNA to obtain DNA sequence P5(1×4MN);
The DNA coding is to code and convert pixels in a digital image into DNA sequences according to a certain DNA coding rule. The decoding of the DNA is the reverse process of the encoding of the DNA, and the corresponding pixel value can be recovered through the decoding of the DNA. In a digital image with 256 gray levels, a pixel may be converted into an eight-bit binary string, each two-bit binary string being represented using one DNA encoding value (a, T, G, C). The DNA sequence A, T, G, C is represented by binary numbers 00, 01, 10, 11, and there are 24 representation schemes in total, but only 8 according to Watson-Crick rules, and the specific rules are shown in Table 1.
The pixels of the image may be encoded according to the DNA encoding rules of Table 1. For example, a pixel of the image is 199, which may be represented by a binary number as 11000111, assuming that DNA encoding is performed according to rule 3 first, the resulting DNA sequence is ATCA, and then DNA decoding is performed according to rule 8, resulting in a corresponding pixel of 158, and the binary number is represented as 10011110. Thus, encoding and decoding the image pixels by DNA is also an effective encryption means for changing the image pixel values. After the binary sequence is converted into a DNA sequence in the digital image, the DNA sequence may be subjected to DNA addition (see Table 2 for rules), DNA subtraction (see Table 3 for rules), and DNA exclusive-OR (see Table 4 for rules).
Figure BDA0002366502990000141
Specifically, the present step includes the following substeps:
s2041: generating a DNA coding rule sequence De according to the formula (6):
De=1+mod[floor(Y1×1010+k4),8](6)。
s2042: for image P3Is binary decomposed to obtain an image P3Conversion into a one-dimensional binary sequence P of size 1X 8MN4
S2043: according to De to P4DNA coding to obtain DNA sequence P with size of 1X 4MN5
As known from the algorithm for generating the DNA coding rule sequence De, the step introduces the plaintext image information into the generation process of the DNA coding rule, so that different plaintext images have different DNA coding rules.
S205: the DNA sequence P5(1X 4MN) into a three-dimensional DNA matrix P6(lr×lr×lr);
In the step, the two-dimensional plaintext image subjected to DNA dynamic coding is converted into a three-dimensional DNA matrix so as to carry out subsequent scrambling and diffusion. Specifically, as shown in fig. 6, this step includes the following substeps:
s2051: computing
Figure BDA0002366502990000142
If the value of l is a positive integer, jumping to step S2055, otherwise executing S2052;
s2052: definition of R ═ R3Finding a condition R satisfying in S ═ mxnx4<The maximum R value of S is n × R3Obtaining n and r meeting the condition, wherein r is a positive integer;
s2053: constructing n cubes with the size of r multiplied by r, and then jumping to S2056;
s2054: if the conditions in step S2051 and step S2052 are not satisfied and the cube cannot be directly constructed, the image P is subjected to3Zero padding is carried out (M multiplied by N), and then S204 is jumped to and started again;
s2055: constructing a cube with the size of l multiplied by l;
s2056: outputting the constructed cube, wherein the output cube is the three-dimensional DNA matrix P6(lr×lr×lr)。
As can be seen from the above, step S205 can convert a plaintext image with any size into a three-dimensional DNA matrix, and in the conversion process, there are three cases as follows:
case 1: the size of the plaintext image can be directly converted into a three-dimensional DNA matrix
For example: a grayscale image of 256 × 256 size can be converted into a DNA matrix of 64 × 64 × 64 size. The process is as follows:
the 256 × 256 gray image P will be self-refresh transformed according to step S203; self-updating transformed image P according to step S2043First converted into a one-dimensional binary sequence P of size 1 × (256 × 256 × 8)4P is expressed according to the DNA coding rule sequence4Changed into a DNA sequence P having a size of 1X (256X 4)5(ii) a Calculating l to 64 according to step S2051, that is, l is a positive integer, performing step S2055, that is, constructing a cube having a size of 64 × 64 × 64, and then performing step S2056, that is, outputting the cube, where the cube is output, and the three-dimensional DNA matrix P is obtained6(64×64×64)。
Case 2: the image needs to be blocked so as to be just converted into a plurality of three-dimensional DNA matrixes
For example: a grayscale image of 512 x 512 can be converted into 4 three-dimensional DNA matrices of 64 x 64. The process is as follows:
the 512 × 512 grayscale image P will be self-updating transformed according to step S203; self-updating transformed image P according to step S2043First converted to one dimension of 1 × (5)12 × 512 × 8) binary sequence P4P is expressed according to the DNA coding rule sequence4Changed to a DNA sequence P of 1X (512X 4) in size5(ii) a According to the step S2051
Figure BDA0002366502990000151
Since it is known that the value of l is not a positive integer, step S2052 is executed to calculate n and r, that is, n is 4 and r is 64; according to step S2053, 4 three-dimensional DNA matrices of size 64X 64 are constructed, and then step S2056 is performed, i.e., the cube, three-dimensional DNA matrix P is output6Namely 4 three-dimensional DNA matrixes with the size of 64 multiplied by 64.
Case 3: the size of the image can not meet the above conditions, and the image can be converted into a three-dimensional DNA matrix only by zero filling operation
For example: a gray image with the size of 1 x 1 cannot be directly converted into a three-dimensional DNA matrix, zero filling operation is carried out on the image, and then the image is converted into 1 DNA matrix with the size of 2 x 2. The process is as follows:
the 1 × 1 grayscale image P will be self-refresh transformed according to step S203; self-updating transformed image P according to step S2043First converted into a one-dimensional binary sequence P of size 1X (1X 8)4P is expressed according to the DNA coding rule sequence4Changed to a DNA sequence P of 1X (1X 4) in size5Finding P by performing step S2051 and step S20525Can not be converted into a three-dimensional DNA matrix; thus, image P is processed according to step S20543Zero-filling, picture P3Binary sequence P of size 1X (1X 16) becoming one-dimensional4A DNA sequence P having a size of 1X (1X 8) which is converted into one dimension by using a DNA coding rule sequence5If l is 2, i.e. the value of l is a positive integer, calculated in step S2051, step S2055 is performed, i.e. a cube with a size of 2 × 2 × 2 is constructed, and step S2056 is performed, i.e. the cube is output, and the output cube is the three-dimensional DNA matrix P6(2×2×2)。
S206: according to the chaotic sequence Z1Generating three-dimensional orthogonal Latin cube Lz1Calculating to obtain an initial value and a parameter of the three-dimensional cat mapping according to the hash valueCounting and generating a three-dimensional cat mapping sequence Mp;
in particular, an L-th order latin cube L ═ (a)i,j,k) Is a cube of size l x l (l rows, l columns and l steps), with only l different elements, with each element appearing exactly once in each row and column of each step of the cube. Fig. 7 shows the process of building a 3D orthogonal latin square using a 3 x 3 cube.
FIG. 7(a) is an orthogonal Latin cube L constructed from 3 different elements, L0、L1And L2And (4) showing. FIG. 7(b) is L0、L1、L2Corresponding position M0、M1、M2A cube M made up of a set of three elements. FIG. 7(c) is a cross-sectional view of a rectangular Latin cube L0、L1、L2Construct the corresponding position cube M0、M1、M2The process of (1).
According to the construction process, the three-dimensional orthogonal Latin cube Lz constructed in the step1Can be expressed by the following formula (7):
LZ1(i,j,k)=M(M0(i,j,k),M1(i,j,k),M2(i,j,k)) (7)
wherein i is more than or equal to 0, j and k is more than or equal to lr.
With each triplet occurring exactly once in the cube M, a positional scrambling of the 3D matrix elements can be achieved. For example, move the element at (1,1,2) to the (2,2,0) position.
The three-dimensional cat mapping can be regarded as an extension of the two-dimensional cat mapping, has better chaos sequence randomness, and is more suitable for image encryption. The mathematical expression of the three-dimensional cat map is shown in equation (8):
Figure BDA0002366502990000171
the parameter matrix a in the above formula can be described by the following formula (9),
Figure BDA0002366502990000172
a in formula (9)x、ay、az、bx、byAnd bzIs a system parameter, mx0、my0And mz0Is the initial value of the three-dimensional cat map.
The step of calculating the initial value and the parameter of the three-dimensional cat mapping according to the hash value comprises the following substeps:
s2061: using a hash value k7Calculating the parameter ax、ayAnd az
When k is7When mod3 is 0,
Figure BDA0002366502990000173
when k is7When mod3 is equal to 1,
Figure BDA0002366502990000174
when k is7When mod3 is 2,
Figure BDA0002366502990000175
s2062: using a hash value k8Calculating the parameter bx、byAnd bz
When k is8When mod3 is 0,
Figure BDA0002366502990000181
when k is8When mod3 is equal to 1,
Figure BDA0002366502990000182
when k is8When mod3 is 2,
Figure BDA0002366502990000183
s2063: using a hash value k1To k is6Calculating an initial value mx0、my0And mz0
Figure BDA0002366502990000184
Wherein x, y and z represent state variables of the 4D memristive chaotic system.
S207: using said three-dimensional orthogonal latin cube Lz1And constructing a double random three-dimensional matrix scrambling rule by the three-dimensional cat mapping sequence Mp, and performing scrambling on the three-dimensional DNA matrix P6Scrambling (lr × lr × lr) to obtain a three-dimensional matrix P after scrambling7
In particular, the use of said three-dimensional orthogonal latin cubes L in this stepz1And constructing a double random three-dimensional matrix scrambling rule by the three-dimensional cat mapping sequence Mp, comprising the following substeps:
s2071: according to P6(lr × lr × lr × lr) position sequences (i, j, k) and Lz1Position sequence L ofz1(i, j, k) establishing a correspondence relationship according to equation (17):
Figure BDA0002366502990000185
s2072: according to P6(lr × lr × lr × lr) position sequences (i, j, k) and MpPosition sequence M ofp(i, j, k) establishing a correspondence relationship according to equation (18):
Figure BDA0002366502990000191
s2073: establishing a random position sequence according to equation (19)
Figure BDA0002366502990000192
And random position sequence
Figure BDA0002366502990000193
The mapping relationship between:
Figure BDA0002366502990000194
wherein (i, j, k) represents P6In the element positions (lr x lr) i is not less than 1 and not more than lr, j is not less than 1 and not more than lr, k is not less than 1 and not more than lr,
Figure BDA0002366502990000195
indicates that (i, j, k) corresponds to Lz1A random position in (a);
Figure BDA0002366502990000196
indicates that (i, j, k) corresponds to MpFor example, i, j, and k correspond to mx, my, and mz, respectively, in equation (8).
To facilitate the understanding of the double random three-dimensional matrix scrambling rule in this step, assume that the orthogonal Latin square Lz1The first element of (4, 9, 46) and the second element of (7, 6, 32); the first element of the three-dimensional cat mapping sequence Mp is (6, 25, 35) and the second element is (36, 24, 16). The scrambling procedure of step 207 is as follows: three-dimensional DNA matrix P constructed in plaintext image6In (lr × lr × lr), the element in the position (4, 9, 46) is moved to the position (6, 25, 35), and the element in the position (7, 6, 32) is moved to (36, 24, 16), thus completing the position scrambling.
Fig. 8(a) shows a general three-dimensional matrix scrambling, in which elements in a three-dimensional matrix are sequentially subjected to position scrambling using an index vector obtained by chaotic sequence ordering; fig. 8(b) shows a double random three-dimensional matrix scrambling rule proposed in the embodiment of the present invention, which is established by using orthogonal latin squares and three-dimensional cat mapping, and the positions before and after scrambling are random, so that when an attacker obtains the position of one of the elements, the attacker cannot reversely deduce the position information of the previous element, thereby improving the security of the algorithm.
S208: the chaos sequence U is coded by the DNA coding rule sequence1Carrying out DNA dynamic coding to obtain a key matrix U2Using said key matrix U2For the three-dimensional matrix P7Performing plane diffusion on the plane to be diffused to obtain a diffused three-dimensional DNA matrix P8(lr × lr × lr × lr); specifically, the present step includes the following substeps:
s2081: using the DNA coding rule sequence to encode the chaotic sequence U according to a formula (20)1Carrying out DNA dynamic coding to obtain a key matrix U2
U2=DNA_enc(mod[floor(U1×1014),4],De) (20)
Wherein, DNA _ enc (a, b) represents that the element in the sequence a is subjected to DNA coding operation by using the sequence b, and a key matrix U2Also referred to as a DNA mask matrix, as is clear from equation (20), the encoding rule of the DNA mask matrix is De as well as the encoding rule of the plain text image.
S2082: calculating to obtain a diffusion plane parameter Pm according to a formula (21), and determining a three-dimensional matrix P according to the value of Pm7Plane to be diffused Q in (1):
Pm=1+(k1+k3+k5)mod3 (21)
specifically, when the parameter Pm is 1,2, 3, the planes Q to be diffused correspond to the three-dimensional matrices P, respectively7Plane x-y, plane x-z, plane y-z.
S2083: DNA diffusion of Q was performed using equations (22) and (23):
Pd=1+cemod3 (22)
Figure BDA0002366502990000201
wherein ce represents a three-dimensional matrix P7The number of planes of (1) ce lr,
Figure BDA0002366502990000202
representing an exclusive or operation.
That is, when the parameter Pd is 1,2, 3, the DNA mask matrix U2And respectively carrying out DNA addition, subtraction and exclusive or operations with the plane Q to be diffused. After DNA operation is carried out on all the planes, a matrix P after diffusion is obtained8
The diffusion process of step S208 can be referred to as shown in fig. 9. According to the content of the step, the embodiment of the invention is different from most current image encryption algorithms based on DNA sequences, and the chaos system is used for generating the key matrix and the plaintext image to perform single operations of DNA addition, DNA subtraction or DNA exclusive OR to diffuse the image. In the diffusion method, different planes of the three-dimensional matrix adopt different DNA operation modes, so that the difficulty of algorithm cracking is increased; and the plain text information controls the plane diffusion operation of the three-dimensional DNA matrix, the hash value of the plain text image is used for selecting the plane direction of diffusion in the scrambled three-dimensional matrix, and then the DNA operation is carried out on the plane in the direction to realize encryption, so that the sensitivity of the algorithm to the plain text information is enhanced.
S209: for the three-dimensional DNA matrix P8(lr × lr × lr) is subjected to DNA dynamic decoding, and then converted into a two-dimensional matrix of size M × N as the ciphertext image C.
Specifically, the DNA decoding rule matrix Dc can be obtained using equation (24):
Dc=1+(8-De) (24)
if the image is partitioned into a plurality of three-dimensional DNA matrixes, each three-dimensional DNA matrix completes the encryption process according to the steps to obtain the corresponding ciphertext image. And finally, combining the images into a final ciphertext image.
The security analysis of the image encryption method provided by the invention is performed through experimental simulation.
The experimental environment was as follows: a CPU: intel Core i 5-8300H, 2.30 GHz; memory: 8 GB; operatingsystem: windows 10; coding tool: matlab 2016 a. Table 5 shows the initial values of the chaotic system, the parameters of the chaotic system, and the initial iteration parameter t required for running the encryption algorithm.
TABLE 5 simulation test parameters
Categories Parameter value
4D memristor chaotic system initial value x0=0.3,y0=0.3,z0=0.3,u0=0.3
Initial iteration parameter t=500
Parameters of 4D memristive chaotic system a=32,b=17,c=15,d=0.3,e=4,h=0.01
In this experiment, 256 × 256 grayscale images Airfield are selected as plaintext images, and the images are operated by using the encryption algorithm and the corresponding decryption algorithm provided by the present invention, so that the encryption and decryption effects are shown in fig. 10. In fig. 10: (a) is an Airfield plaintext image; (b) is a ciphertext image; (c) the corresponding decrypted image. As can be seen from fig. 10, the ciphertext image is similar to the noise image, and people cannot visually acquire any information of the plaintext image. Meanwhile, it can be observed that the decrypted image and the plaintext image have no difference. This shows that the image encryption method provided by the invention can effectively protect plaintext information.
1 key space analysis
In general, good image encryption algorithms need to be able to resist various brute force attacks. In order to resist brute force attack, the encryption algorithm is required to have a larger key space and a better key space, so that the encryption algorithm has a stronger capability of resisting brute force attack. The key in the algorithm provided by the invention comprises the following components: (1) initial value x of chaotic system0、y0、z0、u0(ii) a (2) A 256-bit hash key generated by SHA256 function of the plaintext image; (3) and (3) initial iteration parameters t of the chaotic system. If the computer precision is set to 10-14Then the encryption algorithm key space is at least 104×14=1056>2168. So the key of the algorithmThe space is large enough to resist violent attacks.
2 Key sensitivity analysis
The decryption process is the reverse process of the encryption process, and the decryption method of the invention is used for the key x0、y0Respectively making a numerical difference delta-10-14To obtain a new key K1(x0`=x0+△),K2(y0`=y0△) decrypting the ciphertext image of FIG. 10(b) using the modified key, the test result is shown in FIG. 11, and in FIG. 11 (a) is the modified key K1(x0`=x0+ △) and (b) is the modified key K2(y0`=y0△) in the image, it can be seen from fig. 11 that the plaintext image information cannot be obtained by the decryption operation after slight modification of the key, so the image encryption method proposed by the present invention has good key sensitivity.
3 histogram analysis
In fig. 12: (a) a histogram of a plaintext image that is a gray-scale image Airfield, and (b) a histogram of a corresponding ciphertext image. As can be seen from fig. 12, the histogram distribution of the plaintext image is uneven, while the histogram distribution of the ciphertext image is very uniform, which makes it very difficult for an attacker to analyze the ciphertext image through statistical attack, thereby obtaining plaintext information, and improves the statistical attack resistance of the algorithm.
4 entropy analysis of information
The entropy reflects the randomness and unpredictability of the test information. The information entropy h (m) of the information source m can be defined as:
Figure BDA0002366502990000221
in the formula, p (m)i) Represents miThe probability of (c). For an image with 256 gray levels, the theoretical value of the information entropy obtained by equation (25) is h (m) -8. Therefore, the closer the entropy of the image information is to 8, the more random the image is represented. Information entropy testing is carried out on plaintext image and ciphertext image of 256 multiplied by 256 gray level image AirfieldIt can be known that the information entropy of the plaintext image is 7.1187, and the information entropy of the ciphertext image is 7.9972, which shows that the ciphertext image obtained by using the image encryption algorithm provided by the invention has high randomness, so that the attack to the information entropy can be effectively resisted.
5 anti-noise attack analysis
During network transmission, images may be contaminated with different types of noise. Salt and Pepper Noise (SPN), Gaussian Noise (GN), and Speckle Noise (SN) are three typical types of noise in transmission. In order to evaluate the noise resistance of the algorithm of the present invention, a gray image Airfield with a size of 256 × 256 is selected as a plaintext image, the plaintext image is encrypted by using the algorithm of the present invention to obtain a ciphertext image, then SPN, GN, and SN noises with a noise intensity of 0.0001 are respectively added to the ciphertext image, and then the ciphertext image is decrypted, so as to obtain a decrypted image as shown in fig. 13. In fig. 13: (a) a decrypted image with an intensity of 0.0001 SPN; (b) a decrypted image with an intensity of 0.0001 SN; (c) a decrypted image of intensity 0.0001 GN. As can be seen from fig. 13, the decrypted image is still recognizable under noise pollution. The influence of speckle noise and Gaussian noise on the quality of the decrypted image is the largest among the three types of noise, the PSNR values of the corresponding decrypted image and the plaintext image are 18.4651dB and 12.3028dB, and the PSNR value under the influence of salt and pepper noise is 34.8909dB, which shows that the algorithm has stronger capability of resisting salt and pepper noise attack.
Simulation results and security analysis show that the encryption method provided by the invention has larger key space, high key sensitivity and certain capability of resisting various attacks, and can be applied to the field of image secret communication.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. The image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation is characterized by comprising the following steps:
step 1: will be given an initial value (x)0,y0,z0,u0) Substituting the chaotic sequence into a 4D memristive chaotic system to generate a chaotic sequence X, Y, Z and a chaotic sequence U, and calculating according to a given plaintext image P (M multiplied by N) to obtain a plaintext image hash value;
step 2: selecting elements from the chaotic sequences X, Y, Z and U according to the hash value to form a new chaotic sequence X1、Y1、Z1And U1
And step 3: according to the chaos sequence X1And the hash value carries out self-updating transformation on the plaintext image P (M multiplied by N) to obtain the self-updating transformed image P3
And 4, step 4: according to the chaotic sequence Y1And generating a DNA coding rule sequence by the hash value, and using the DNA coding rule sequence to the image P3Dynamic coding of DNA to obtain DNA sequence P5(1×4MN);
And 5: the DNA sequence P5(1X 4MN) into a three-dimensional DNA matrix P6(lr×lr×lr);
Step 6: according to the chaotic sequence Z1Generating three-dimensional orthogonal Latin cube Lz1Calculating to obtain an initial value and parameters of the three-dimensional cat mapping according to the hash value, and generating a three-dimensional cat mapping sequence Mp;
and 7: using said three-dimensional orthogonal latin cube Lz1And constructing a double random three-dimensional matrix scrambling rule by the three-dimensional cat mapping sequence Mp, and performing scrambling on the three-dimensional DNA matrix P6Scrambling (lr × lr × lr) to obtain a three-dimensional matrix P after scrambling7
And 8: the chaos sequence U is coded by the DNA coding rule sequence1Carrying out DNA dynamic coding to obtain a key matrix U2Using said key matrix U2For the three-dimensional matrix P7To be expanded inPerforming plane diffusion on the scattered plane to obtain a diffused three-dimensional DNA matrix P8(lr×lr×lr);
And step 9: for the three-dimensional DNA matrix P8(lr × lr × lr) is subjected to DNA dynamic decoding, and then converted into a two-dimensional matrix of size M × N as the ciphertext image C.
2. The method according to claim 1, wherein the calculating a plaintext image hash value according to a given plaintext image P (mxn) in step 1 comprises:
calculating SHA256 hash value hv of the plaintext image P (M × N);
averagely dividing the Hash values hv into eight groups, converting each group of elements into decimal numbers, and recording the decimal numbers as k1、k2、k3、k4、k5、k6、k7And k8
3. The method of claim 2, wherein step 2 comprises:
step 2.1: respectively generating selection parameters T by using formula (2)1、T2、T3And T4
Figure FDA0002366502980000021
Step 2.2: from the chaotic sequences X, Y, Z and U, the Tth sequence is selected1+1 to T1+4MN, from T2+1 to T2+4MN, from T3+1 to T3+4MN and from T4+1 to T4+4MN elements to obtain new chaos sequence X1、Y1、Z1And U1
4. The method of claim 2, wherein step 3 comprises:
step 3.1: generating a matrix W (M multiplied by N) by using a 4D memristive chaotic system, and carrying out exclusive OR operation on a plaintext image P (M multiplied by N) by using the matrix W (M multiplied by N)To update the image to obtain an updated image P1
Step 3.2: calculating according to formula (4) to obtain a filtering direction parameter Dir, and obtaining the filtering direction parameter Dir in the image P according to the value of Dir1Adding random number to obtain image P2
Dir=1+k5mod 4 (4)
Step 3.3: aligning the chaotic sequence X according to formula (5)1Carrying out quantization operation to obtain a new sequence X2
X2(n)=mod[floor(X1(n)×1014),256],n∈[0,4MN-1](5)
Step 3.4: from said sequence X2Randomly selecting 3MN number, and recording as X3Then the sequence X3Conversion into MN matrices W of size 1X 3 or 3X 11Then the matrix W1Setting the value of the last element of the medium three-digit number as 1 to obtain a new matrix W2
Step 3.5: determining a filtering direction according to the value of Dir, using the matrix W2For the image P2Performing convolution operation according to the filtering direction, and obtaining an operated image P after the convolution operation3(M×N)。
5. Method according to claim 4, characterized in that the values according to Dir in step 3.2 are in the image P1Adding random number to obtain image P2The method specifically comprises the following steps:
when Dir is 1, in the image P1Two columns of random numbers with the size of M are added on the left side of the image P to obtain an image P2(M×(N+2));
When Dir is 2, in the image P1Adding two rows of random numbers with the size of M to the right side of the image P to obtain an image P2(M×(N+2));
When Dir is 3, in the image P1Adding two rows of random numbers with the size of N on the upper side of the image P to obtain an image P2((M+2)×N);
When Dir is 4, in the image P1Is added with two rows of random with the size of NCounting to obtain an image P2((M+2)×N);
Correspondingly, the step 3.5 is specifically:
when Dir is 1, the matrix W is used2For the image P2Filtering according to the left-to-right direction;
when Dir is 2, the matrix W is used2For the image P2Filtering in the right-to-left direction;
when Dir is 3, the matrix W is used2For the image P2Filtering according to the direction from top to bottom;
when Dir is 4, the matrix W is used2For the image P2Filtering is performed in the bottom-up direction.
6. The method of claim 2, wherein step 4 comprises:
step 4.1: generating a DNA coding rule sequence De according to the formula (6):
De=1+mod[floor(Y1×1010+k4),8](6)
step 4.2: for the image P3Is binary decomposed to obtain the image P3Conversion into a one-dimensional binary sequence P of size 1X 8MN4
Step 4.3: according to De to the binary sequence P4Carrying out DNA coding to obtain a DNA sequence P5(1×4MN)。
7. The method of claim 1, wherein said step 5 comprises:
step 5.1: computing
Figure FDA0002366502980000031
If the value of l is a positive integer, skipping to step 5.5, otherwise executing step 5.2;
step 5.2: definition of R ═ R3Finding a condition R satisfying in S ═ mxnx4<The maximum R value of S is n × R3Obtaining n andr, r are positive integers;
step 5.3: constructing n cubes with the size of r multiplied by r, and then jumping to the step 5.6;
step 5.4: if the conditions in step 5.1 and step 5.2 are not satisfied and the cube cannot be directly constructed, the image P is processed3Zero padding is carried out (M multiplied by N), and then the step 4 is skipped to start again;
step 5.5: constructing a cube with the size of l multiplied by l;
step 5.6: outputting the constructed cube, wherein the output cube is the three-dimensional DNA matrix P6(lr×lr×lr)。
8. The method according to claim 2, wherein the calculating in step 6 based on the hash value to obtain initial values and parameters of the three-dimensional cat map specifically comprises:
step 6.1: using a hash value k7Calculating the parameter ax、ayAnd az
When k is7When mod3 is 0,
Figure FDA0002366502980000041
when k is7When mod3 is equal to 1,
Figure FDA0002366502980000042
when k is7When mod3 is 2,
Figure FDA0002366502980000043
step 6.2: using a hash value k8Calculating the parameter bx、byAnd bz
When k is8When mod3 is 0,
Figure FDA0002366502980000044
when k is8When mod3 is equal to 1,
Figure FDA0002366502980000045
when k is8When mod3 is 2,
Figure FDA0002366502980000046
step 6.3: using a hash value k1To k is6Calculating an initial value mx0、my0And mz0
Figure FDA0002366502980000051
Wherein x, y and z represent state variables of the 4D memristive chaotic system.
9. Method according to claim 1, characterized in that said step 7 of using said three-dimensional orthogonal latin cubes Lz1And constructing a double random three-dimensional matrix scrambling rule by the three-dimensional cat mapping sequence Mp, which specifically comprises the following steps:
step 7.1: according to P6(lr × lr × lr × lr) position sequences (i, j, k) and Lz1Position sequence L ofz1(i, j, k) establishing a correspondence relationship according to equation (17):
Figure FDA0002366502980000052
step 7.2: according to P6(lr × lr × lr × lr) position sequences (i, j, k) and MpPosition sequence M ofp(i, j, k) establishing a correspondence relationship according to equation (18):
Figure FDA0002366502980000053
step 7.3: according to the formula(19) Establishing random position sequences
Figure FDA0002366502980000054
And random position sequence
Figure FDA0002366502980000055
The mapping relationship between:
Figure FDA0002366502980000056
wherein (i, j, k) represents P6The element position in (lr × lr × lr),
Figure FDA0002366502980000057
indicates that (i, j, k) corresponds to Lz1A random position in (a);
Figure FDA0002366502980000058
indicates that (i, j, k) corresponds to MpAt random positions in (a).
10. The method of claim 6, wherein the step 8 comprises:
step 8.1: using the DNA coding rule sequence to encode the chaotic sequence U according to a formula (20)1Carrying out DNA dynamic coding to obtain a key matrix U2
U2=DNA_enc(mod[floor(U1×1014),4],De) (20)
Wherein, DNA _ enc (a, b) represents that the element in the sequence a is subjected to DNA coding operation by using the sequence b;
step 8.2: calculating to obtain a diffusion plane parameter Pm according to a formula (21), and determining a three-dimensional matrix P according to the value of Pm7Plane to be diffused Q in (1):
Pm=1+(k1+k3+k5)mod3 (21)
step 8.3: DNA diffusion of Q was performed using equations (22) and (23):
Pd=1+cemod3 (22)
Figure FDA0002366502980000061
wherein ce represents a three-dimensional matrix P7The number of planes of (1) ce lr,
Figure FDA0002366502980000062
representing an exclusive or operation.
CN202010037335.6A 2020-01-14 2020-01-14 Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation Active CN111294481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010037335.6A CN111294481B (en) 2020-01-14 2020-01-14 Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010037335.6A CN111294481B (en) 2020-01-14 2020-01-14 Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation

Publications (2)

Publication Number Publication Date
CN111294481A true CN111294481A (en) 2020-06-16
CN111294481B CN111294481B (en) 2021-06-22

Family

ID=71029107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010037335.6A Active CN111294481B (en) 2020-01-14 2020-01-14 Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation

Country Status (1)

Country Link
CN (1) CN111294481B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767581A (en) * 2020-06-22 2020-10-13 重庆渝抗医药科技有限公司 Data encryption and encapsulation working method for block chain data security
CN112001834A (en) * 2020-08-24 2020-11-27 浙江农林大学 Image encryption method and system based on pulse differential equation chaotic system
CN113098676A (en) * 2021-03-27 2021-07-09 兰州交通大学 Vector map two-position random scrambling encryption method based on four-dimensional chaos
CN115842619A (en) * 2022-11-30 2023-03-24 珠海城市职业技术学院 Image encryption method, system, computer device and medium based on DNA coding

Citations (11)

* 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
WO2010046104A2 (en) * 2008-10-23 2010-04-29 University Of Ulster An encryption method
US20150341174A1 (en) * 2014-05-25 2015-11-26 Fujitsu Limited Relational Encryption
CN106023052A (en) * 2016-05-09 2016-10-12 河南大学 Image encryption algorithm based on memoristor hyper-chaotic system, cellular automaton and DNA calculation
CN107492064A (en) * 2017-07-06 2017-12-19 河南大学 Image encryption method based on memristor chaos system, elementary cellular automata and compressed sensing
CN107657579A (en) * 2017-09-19 2018-02-02 中国矿业大学 Image encryption method based on DNA encoding and chaos
CN108898025A (en) * 2018-06-25 2018-11-27 河南大学 New chaotic image encryption method based on dual scramble and DNA encoding
CN109242751A (en) * 2018-08-16 2019-01-18 电子科技大学 A kind of image encryption method based on chaos tent maps and DNA decoding
CN110149200A (en) * 2019-06-06 2019-08-20 四川大学 A kind of color image encrypting method based on dynamic DNA and 4D chaos
CN110225222A (en) * 2019-06-06 2019-09-10 河南大学 A kind of image encryption method based on 3D orthogonal Latin square and chaos system
CN110570344A (en) * 2019-08-27 2019-12-13 河南大学 Image encryption method based on random number embedding and DNA dynamic coding

Patent Citations (11)

* 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
WO2010046104A2 (en) * 2008-10-23 2010-04-29 University Of Ulster An encryption method
US20150341174A1 (en) * 2014-05-25 2015-11-26 Fujitsu Limited Relational Encryption
CN106023052A (en) * 2016-05-09 2016-10-12 河南大学 Image encryption algorithm based on memoristor hyper-chaotic system, cellular automaton and DNA calculation
CN107492064A (en) * 2017-07-06 2017-12-19 河南大学 Image encryption method based on memristor chaos system, elementary cellular automata and compressed sensing
CN107657579A (en) * 2017-09-19 2018-02-02 中国矿业大学 Image encryption method based on DNA encoding and chaos
CN108898025A (en) * 2018-06-25 2018-11-27 河南大学 New chaotic image encryption method based on dual scramble and DNA encoding
CN109242751A (en) * 2018-08-16 2019-01-18 电子科技大学 A kind of image encryption method based on chaos tent maps and DNA decoding
CN110149200A (en) * 2019-06-06 2019-08-20 四川大学 A kind of color image encrypting method based on dynamic DNA and 4D chaos
CN110225222A (en) * 2019-06-06 2019-09-10 河南大学 A kind of image encryption method based on 3D orthogonal Latin square and chaos system
CN110570344A (en) * 2019-08-27 2019-12-13 河南大学 Image encryption method based on random number embedding and DNA dynamic coding

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
A. U. REHMAN, H. WANG, M. M. ALI SHAHID, S. IQBAL, Z. ABBAS AND: "《A Selective Cross-Substitution Technique for Encrypting Color Images Using Chaos, DNA Rules and SHA-512》", 《IEEE ACCESS》 *
R. V. U. AND T. V.: "《Image Encryption using DNA rules & Transmission of an encrypted digital image using USRP-2901 and MATLAB》", 《2019 INTERNATIONAL CONFERENCE ON VISION TOWARDS EMERGING TRENDS IN COMMUNICATION AND NETWORKING (VITECON)》 *
柴秀丽,甘志华: "《基于超混沌系统的位级自适应彩色图像加密新算法》", 《计算机科学》 *
柴秀丽,程云龙: "《一种新的基于四维忆阻超混沌系统的医学图像加密算法研究》", 《计算机时代》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767581A (en) * 2020-06-22 2020-10-13 重庆渝抗医药科技有限公司 Data encryption and encapsulation working method for block chain data security
CN112001834A (en) * 2020-08-24 2020-11-27 浙江农林大学 Image encryption method and system based on pulse differential equation chaotic system
CN113098676A (en) * 2021-03-27 2021-07-09 兰州交通大学 Vector map two-position random scrambling encryption method based on four-dimensional chaos
CN115842619A (en) * 2022-11-30 2023-03-24 珠海城市职业技术学院 Image encryption method, system, computer device and medium based on DNA coding
CN115842619B (en) * 2022-11-30 2023-08-15 珠海城市职业技术学院 Image encryption method, system, computer device and medium based on DNA coding

Also Published As

Publication number Publication date
CN111294481B (en) 2021-06-22

Similar Documents

Publication Publication Date Title
CN111294481B (en) Image encryption method based on self-updating transformation, double random three-dimensional matrix scrambling and DNA calculation
CN113225449B (en) Image encryption method based on chaos sequence and DNA coding
Wang et al. A novel chaotic algorithm for image encryption utilizing one-time pad based on pixel level and DNA level
Chai et al. Combining improved genetic algorithm and matrix semi-tensor product (STP) in color image encryption
CN111105339B (en) Image encryption method based on multidimensional chaotic system and Joseph scrambling
CN111614455B (en) Color image compression and encryption method
CN110086601B (en) Joseph traversal and hyperchaotic system image encryption method based on pixel value association
CN108366181B (en) A kind of image encryption method based on hyperchaotic system and multistage scramble
CN109903212B (en) Image encryption method based on H geometric fractal and Hilbert curve
CN106023051B (en) DNA image encryption method and system based on cloud model and hyperchaotic system
CN113904764B (en) Image encryption method based on multi-scale compressed sensing and Markov model
CN110139000B (en) Image compression encryption method based on compressed sensing and life game scrambling
CN110570344B (en) Image encryption method based on random number embedding and DNA dynamic coding
CN107590842B (en) Image encryption method and device based on pixel and DNA cross dynamic chaotic password
CN107292184B (en) Image encryption method, device and key stream generating method and key stream generator
CN107094072B (en) Mixed chaotic encryption method based on generalized Henon mapping
CN112637441A (en) Color image compression encryption method based on compressed sensing
CN110120079B (en) Color image encryption method based on three-dimensional Logistic mapping and generalized Cat mapping
CN110837651B (en) Color image encryption method based on fractional order discrete neural network and DNA operation
CN112202545B (en) Image encryption method based on Y-type filling curve and variable-step Joseph traversal
CN113129196B (en) Image encryption method based on DNA sequence and memristor chaos
CN113691362B (en) Bit plane image compression encryption method based on hyperchaotic system and DNA coding
CN106780282A (en) Resume image based on piecemeal DNA encoding and uniform scramble
CN109242751B (en) Image encryption method based on chaotic tent mapping and DNA decoding
CN112887509A (en) Fusion encryption method based on multiple chaotic systems

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