CN112737763A - Efficient batch color image encryption/decryption method - Google Patents

Efficient batch color image encryption/decryption method Download PDF

Info

Publication number
CN112737763A
CN112737763A CN202010816309.3A CN202010816309A CN112737763A CN 112737763 A CN112737763 A CN 112737763A CN 202010816309 A CN202010816309 A CN 202010816309A CN 112737763 A CN112737763 A CN 112737763A
Authority
CN
China
Prior art keywords
image
images
stacked
dna
plaintext
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
CN202010816309.3A
Other languages
Chinese (zh)
Other versions
CN112737763B (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.)
Xian University of Technology
Original Assignee
Xian University of 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 Xian University of Technology filed Critical Xian University of Technology
Priority to CN202010816309.3A priority Critical patent/CN112737763B/en
Publication of CN112737763A publication Critical patent/CN112737763A/en
Application granted granted Critical
Publication of CN112737763B publication Critical patent/CN112737763B/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
    • 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/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • 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

Landscapes

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

Abstract

The invention discloses an efficient encryption/decryption method for color images in batches, which comprises the steps of firstly, stacking a plurality of color plaintext images by using a stacking algorithm to generate stacked images; generating an initial key by using a Hash function SHA-256, wherein the initial key is used for selecting a DNA coding rule and is used as an initial parameter and a control parameter of a piecewise linear chaotic mapping PWLCM, and then performing DNA coding on a stack image and a chaotic sequence obtained by the piecewise linear chaotic mapping PWLCM to obtain two coded DNA arrays; encrypting the stacked images to finally obtain ciphertext images; and finally, decrypting the ciphertext image: firstly, decrypting the ciphertext image to obtain a stacked image; and then separating the stacked images to recover the plaintext images. The invention has stronger robustness, can resist various attacks such as noise pollution, JPEG compression, image block loss and the like, and is very robust even in severe environment.

Description

Efficient batch color image encryption/decryption method
Technical Field
The invention belongs to the technical field of multimedia information security, and particularly relates to an efficient encryption/decryption method for color images in batches.
Background
With the advent of the information age, information security issues have affected various aspects of social life and become an important topic of international affairs all over the world. "cyberspace security" has become a strategic high ground of national security. The digital image is used as a main carrier of unstructured information, is transmitted, stored and used on the Internet, brings great convenience to people, and meanwhile, the digital image is inevitably subjected to illegal acquisition, tampering, copying, spreading and the like. How to protect the security of image data has become an urgent problem to be solved. As an effective technique for protecting privacy and authenticity of image contents, an image encryption technique has attracted extensive attention in academic and industrial fields, and has become a subject of intense research in the field of information security in recent years.
The image encryption technology is a technology for preventing image contents from being accessed without authorization, and is used for encrypting and hiding the image contents by technical means to enable the image contents to lose visual significance and to restore original contents without damage. The existing image encryption technology generally completes the encryption/decryption of one image content in one encryption/decryption operation, which is acceptable in general application. However, with the development of information technology, some applications such as the internet of things environment require reliable transmission of a large amount of image information on internet of things devices with limited memory, and in this case, the known image encryption technology is not lightweight enough, and since encryption of one image can only be completed by one-time operation, encryption/decryption processing of a large amount of images cannot be realized on internet of things devices with limited memory in a short time. Therefore, the image encryption mode one at a time cannot meet the application environment with high real-time transmission requirement, such as analog networking, and a special image encryption algorithm needs to be designed to realize simultaneous encryption/decryption of batch images.
Image encryption techniques have received a great deal of attention since their introduction. In recent years, many scholars have devoted themselves to research in this field and have proposed many image encryption algorithms. One of the key factors of an image encryption system is the generation of an encryption key. In view of the fact that the chaotic system has excellent characteristics of high sensitivity to initial values, high ergodicity, high pseudo-randomness and the like, and is very suitable for generating the image encryption key [1], many scholars have been devoted to research on image encryption methods based on the chaotic system in recent years. In the early stage, an image encryption key is mainly generated by using a one-dimensional or two-dimensional chaotic system [2,3,4,5 ]. With the increase of the demand, the defects of short key space and weak safety caused by the low-dimensional chaotic system are infinitely amplified. In order to improve the security of image encryption schemes, high-dimensional (equal to or greater than 3-dimensional) chaotic systems have been used in recent years to encrypt images [6,7 ]. The image encryption algorithm based on the high-dimensional chaotic system improves the safety of the algorithm, but the high-dimensional chaotic system has a complex structure and a plurality of parameters, so that the software and hardware cost and the calculation complexity of a computer are increased. Another commonly used method is the image encryption method based on DNA coding [8,9,10 ]. The principle of DNA coding is to convert all pixel values in an image into eight-digit binary numbers and then to express 256 gray levels with four nucleobases, adenine (A), guanine (G), cytosine (C) and thymine (T).
In practical applications, in order to improve the encryption efficiency, encryption of a plurality of images needs to be realized through one-time calculation. In 2018, a document [11] firstly proposes a multi-image encryption algorithm based on DNA coding. The main idea of this algorithm is to arrange a number of images into one large image and then encrypt this large image using some conventional image encryption algorithm. With this method, although encryption of a plurality of images can be achieved by one encryption calculation, the calculation cost is almost the same as that of encrypting a plurality of images. In addition, since the encrypted images need to be arranged, the method requires the encrypted images to be uniform in size, and if the encrypted images are not uniform in size, the method will fail.
Reference to the literature
[1]Matthews,R.ON THE DERIVATION OF A“CHAOTIC”ENCRYPTION ALGORITHM. Cryptologia,1989,13(1):29-42.
[2]X.-Y.Wang,L.Yang,R.Liu,A.Kadir.A chaotic image encryption algorithm based on perceptron model.Nonlinear Dynamics,2010,62(3):615-621.
[3]Akhshani,A.,Behnia,S.,Akhavan,A.,Hassan,H.A.,&Hassan,Z.A novel scheme for image encryption based on 2D piecewise chaotic maps.Optics Communications,2010,283 (17):3259-3266.
[4]C.Li,S.Li,G.Chen,W.A.Halang,A.Cryptanalysis of an image encryption scheme based on a compound chaotic sequence.Image and Vision Computing,2009,27(8):1035-1039.
[5]X.Ge,F.Liu,B.Lu,W.Wang.Cryptanalysis of a spatiotemporal chaotic image/video cryptosystem and its improved version.Physics Letters A,2011,375(5):908-913.
[6]Chen G,Mao Y,Chui C.A symmetric image encryption scheme based on 3D chaotic cat maps.Chaos,Solitons&Fractals,2004,21(3):749-761.
[7]Chai X-L,Gan Z.-H,Yuan K.An image encryption scheme based on three-dimensional Brownian motion and chaotic system.Chinese Physics B,2017,26(2):1674-1056.
[8]N.Kang.A Pseudo DNA Cryptography Method,2009,arXiv:0903.2693.
[9]Zhang Q,Guo L,&Wei,X.Image encryption using DNA addition combining with chaotic maps.Mathematical and Computer Modelling,2009,52(11-12):2028-2035.
[10]H.Liu,X.Wang,A.kadir.A novel color image encryption algorithm based on DNA sequence operation and hyper-chaotic system.Journal of Systems and Software,2012,85 (2):290-299.
[11]Zhang,X.,&Wang,X.Multiple-image encryption algorithm based on DNA encoding and chaotic system.Multimedia Tools and Applications,2018,78(6):7841-7869.
[12]Wu,X.,Kan,H.,&Kurths,J.A new color image encryption scheme based on DNA sequences and multiple improved 1D chaotic maps.Applied Soft Computing,2015,37: 24-39.
[13]Aqeel ur Rehman,Xiaofeng Liao,Rehan Ashraf,Saleem Ullah,Hueiwei Wang.A color image encryption technique using exclusive-OR with DNA complementary rules based on chaos theory and SHA-2.Optik,2018,159:348-367.
[14]Xiangjun Wu,Kunshu Wang,Xingyuan Wang,Haibin Kan,Jürgen Kurths.Color image DNA encryption using NCA map-based CML and one-time keys.Signal Processing,2018, 148:272-287.
[15]Liu,H.,&Wang,X.Color image encryption using spatial bit-level permutation and high-dimension chaotic system.Optics Communications,2011,284:3895-3903.
Disclosure of Invention
The invention aims to provide an efficient encryption/decryption method for color images in batches, which has stronger robustness, can resist various attacks such as noise pollution, JPEG compression, image block loss and the like, and is very robust even in a severe environment.
The technical scheme adopted by the invention is that the efficient batch color image encryption/decryption method is implemented according to the following steps:
step 1, stacking a plurality of color plaintext images by using a stacking algorithm to generate a stacked image;
step 2, generating an initial key by using a Hash function SHA-256, wherein the initial key is used for selecting a DNA coding rule and is used as an initial parameter and a control parameter of a piecewise linear chaotic mapping PWLCM, and any image is designated as the input of the SHA-256;
step 3, performing DNA coding on the stack image obtained in the step 1 and the chaotic sequence obtained by the step 2 by piecewise linear chaotic mapping (PWLCM) to obtain two coded DNA arrays;
step 4, carrying out encryption processing on the stacked image obtained in the step 1: a first stage, scrambling the DNA array corresponding to the stacked image in the step 3 by using an encryption key obtained by piecewise linear chaotic mapping (PWLCM); in the second stage, the DNA array generated by the chaotic sequence in the step 3 is used for carrying out DNA operation on the DNA array scrambled in the first stage so as to enable the pixel distribution to be more uniform and finally obtain a ciphertext image;
and 5, decrypting the ciphertext image obtained in the step 4: firstly, decrypting the ciphertext image to obtain a stacked image; and then separating the stacked images to recover the plaintext images.
The present invention is also characterized in that,
the step 1 is as follows:
step 1.1, assume that there are N sheets with size mi×niColor image T ofi', i-1, 2, …, N, let m-max (m)1,m2,…,mN),n=max(n1,n2,…,nN) (ii) a m and n respectively represent the height and width of the stacked image, and if the size of the color plaintext image is not equal to m × n, 0 is filled in the right side and bottom of the color plaintext image to obtain a filled image of size m × n, in such a way that all the images have the same size, and the filled image is represented as T1,T2,…,TN
Step 1.2, setting T0Representing stacked images, each image TiThe corresponding matrix is denoted MTiI 1,2, …, N, the matrix of stacked images is denoted as
Figure BDA0002632849220000051
The stacking algorithm is defined as follows:
order to
Figure BDA0002632849220000052
Figure BDA0002632849220000053
Wherein the content of the first and second substances,
Figure BDA0002632849220000054
the pixel value at the s-th row and T-th column of the i-th pad image is expressed, and the stacked image T with the size of m × n is obtained by the formula (2)0
Step 1.3, in order to realize the separation and recovery of the stacked images into the original color plaintext images during decryption, each color plaintext image needs to be recorded in a stackThe weight occupied in the overlay, and the weight matrix is denoted as QiThe weight matrix is defined as follows:
Figure BDA0002632849220000061
Figure BDA0002632849220000062
Qirecording the weight of each color plaintext image in the stacked image, wherein the decrypted image is a stacked image and the matrix QiThe method is used for separating the N color plaintext images from the stacked image and finally obtaining the decrypted color plaintext image.
The step 2 is as follows:
step 2.1, randomly selecting a plaintext image as a key image and recording the plaintext image as a T1
Let W be SHA-256 (T)1) W represents a 256-bit string generated by the hash function SHA-256, and the average division of W into 32 segments generates 4 components of the initial key:
W=w1||w2||…||w32 (5)
obtaining an initial key by the formulas (6) to (9), wherein the initial key comprises an initial value x0、y0And a control parameter p1,p2
Figure BDA0002632849220000063
Figure BDA0002632849220000064
Figure BDA0002632849220000065
Figure BDA0002632849220000066
floor (·) denotes a lower rounding function,
Figure BDA0002632849220000067
a bitwise exclusive-or operation representing a binary number;
step 2.2, generating two pseudo-random sequences A4mnAnd Dmn,A4mnFor scrambling DNA-encoded stacked images, DmnIs used for the operation of the DNA, and the operation is carried out,
the definition of the piecewise linear chaotic map PWLCM is specifically as follows:
Figure BDA0002632849220000071
wherein, x is more than 0iP < 1, 0 < 0.5 as control parameter, Fp(xi) Represents the result of the ith iteration when 0.5 < xiWhen < 1, let xi=1-xiRepeat iteration, x0Obtaining different chaos sequences when p takes different values, using two sets of control parameters x0,p1And y0,p2Generating two different sets of random sequences in step 2, wherein x0,p1Generating a chaotic sequence A with the length of 4mn4mn,y0,p2Generating a chaotic sequence D of length mnmn
Using an initial value x0And a control parameter p1Inputting the data into a formula (5) as an iteration initial value of a piecewise linear chaotic mapping PWLCM system, wherein the iteration number is 4 multiplied by m multiplied by n, and a chaotic sequence A with the length of 4 multiplied by m multiplied by n is obtained4mn,A4mnNamely a first encryption key;
using an initial value y0And a control parameter p2Inputting the data into a formula (5) as an iteration initial value of the piecewise linear chaotic mapping PWLCM system, and iterating the piecewise linear chaotic mapping PWLCM system m times by n times to obtain a chaotic sequence D with the length of m times by nmn=(d1,d2,…,dm×n),DmnI.e. the second encryption key.
The step 3 is as follows:
step 3.1, adding DmnThe value of (1) is mapped into 0-255, and the pair D is realizedmnAll elements d in (1)iDNA encoding was performed, i ═ 1,2, …, m × n, and the mapping procedure was performed using equation (11):
d′i=mod(floor(di×1015),256),i=1,2,…,mn (11)
floor (·) denotes a floor rounding function, d'iDenotes diMapped value, all di' rearranging to obtain a matrix D ' with the size of m × n ', the arranging process is realized by the formula (12):
Figure BDA0002632849220000081
step 3.2, selecting DNA coding rules by using initial parameters to increase randomness and reduce manual intervention:
g1=mod(floor(x0×1020),8)+1 (13)
g2=mod(floor(y0×1020),8)+1 (14)
floor (·) represents a lower rounding function, mod (·) represents a modulo operation; g1And g2Denotes the result obtained after the modulo operation, g1And g2The value is an integer between 1 and 8, and corresponds to the following 8 DNA coding rules, and the 8 DNA coding rules are defined as follows:
rule 1: a represents 00, C represents 01, G represents 10, T represents 11;
rule 2: a represents 00, C represents 11, G represents 01, T represents 11;
rule 3: a represents 01, C represents 00, G represents 11, T represents 10;
rule 4: a represents 01, C represents 11, G represents 00, T represents 10;
rule 5: a represents 10, C represents 11, G represents 00, T represents 01;
rule 6: a represents 10, C represents 00, G represents 11, T represents 01;
rule 7: a represents 11, C represents 01, G represents 10, T represents 00;
rule 8: a represents 11, C represents 10, G represents 01, and T represents 00;
according to g1Selecting the g-th code rule number corresponding to the code rule number1A pair of encoding rules for stacking images T0Coding is carried out, and the matrix after coding is marked as TZWhile according to g2Corresponding coding rule number, select g2D' is coded by a DNA coding rule to obtain a DNA array M with the size of M multiplied by 4nC(ii) a After DNA encoding, all decimal pixel values are expressed in the form of four bases A, C, G and T, that is, if a certain point in the image has a pixel value of 40 and its binary value is "00101000", according to the DNA encoding rule 1, A represents 00, C represents 01, G represents 10, T represents 11, and 40 is encoded into a DNA sequence of "AGGA".
The step 4 is as follows:
step 4.1, firstly, the matrix T coded in the step 3ZTransposing, and recording the transposed matrix as TDAs shown in formula (15):
TD=(TZ)' (15)
using equation (16) to assign TDConversion to a one-dimensional sequence:
Figure BDA0002632849220000091
R1=(c1,1,c1,2,…,c1,m,c2,1,c2,2,…,c2,m,…,c4n,1,c4n,2,…,c4n,m)
R1is to form an array TDA one-dimensional sequence converted according to equation (16);
sequence A is paired in order from small to large4mnSorting to obtain an ordered sequence A' and its corresponding index sequence SyAs shown in formula (17):
(A′,Sy)=sort(A4mn) (17)
sort (. cndot.) represents a sort function from small to large, using an index sequence SyFor sequence R1Scrambling is carried out, the scrambling rule is shown as formula (18), and the generated new sequence is marked as R2
R2(j)=R1(Sy(j)),j=1,2,…,4×m×n (18)
R2(j) Represents the sequence R2The jth element in (a);
step 4.2, R is compared according to the formula (19)2Rearranging to obtain matrix T with size of m × 4ns
Figure BDA0002632849220000101
Step 4.3, using formula (20) to TsPerforming DNA operation to obtain a final DNA matrix Te
Figure BDA0002632849220000102
Step 4.4, selecting the g-th time according to the formula (21)3A DNA decoding rule pair TeThe decoding is carried out in such a way that,
g3=mod(floor(p1×1020),8)+1 (21);
so that the DNA matrix TeVisualization is carried out to obtain a ciphertext image T with the size of mxnG
The step 5 is as follows:
step 5.1, ciphertext image TGAnd (3) decryption:
generating a chaos sequence which is the same as that generated during encryption by utilizing the piecewise linear chaos mapping PWLCM, and obtaining a stacked plaintext image T according to the inverse operation of the encryption processd
Step 5.2, separating the stacked images to recover the plaintext images
Order to
Figure BDA0002632849220000103
s=1,2,…,m;t=1,2,…,n
Figure BDA0002632849220000111
Using the weight matrix Q of each image calculated in step 1.3iThe stacked images are separated, as described in detail below,
order to
Figure BDA0002632849220000112
Figure BDA0002632849220000113
And (3) representing the pixel value of the s-th row and the t-th column in the ith weight matrix, obtaining N images with the same size by using an equation (23), cutting off 0 element filled in the N images, and obtaining N recovered color plaintext images, wherein the equation (24) is as follows:
Figure BDA0002632849220000114
Ti' expression vs. ciphertext image T in step 5GAnd (3) decrypting the N decrypted color images, wherein the decrypted images correspond to the N color plaintext images stacked in the step 1 one by one.
The invention has the advantages that the high-efficiency batch color image encryption/decryption method can realize the encryption/decryption of a plurality of color images through single encryption/decryption calculation, and the calculated amount is equal to the calculated amount for encrypting/decrypting one image. The method of the present invention has no limitation on the number and size of input images, can encrypt/decrypt any number of color images at one time, and has no limitation on the size and shape of the images and can be completely different. The method of the invention is a lossless batch color image encryption/decryption scheme. That is, the encryption/decryption process does not cause any pixel change, and the quality of the decrypted image is completely equal to that of the plaintext image. The method has strong robustness, can resist various attacks such as noise pollution, JPEG compression, image local content loss and the like, and has the characteristics of low calculation cost, good encryption effect, strong safety and the like. The method can provide an efficient image encryption/decryption scheme for a network environment with limited resources and more interference, and ensures the safe transmission of image data.
Drawings
FIG. 1 is a flow chart of a method for efficient encryption/decryption of color images in batch according to the present invention;
FIG. 2(a) is the original Test1 image; (b) is the original Test2 image; (c) is the original Test3 image; (d) is the original Test4 image; (e) is for (a) the post-filled Test1 image; (f) is for the (b) post-filled Test2 image; (g) is for the (c) post-filled Test3 image; (h) is the Test4 image after the filling of (d);
FIG. 3(a) is a stack diagram after stacking FIGS. 2 (e) - (h); (b) is an encrypted graph obtained by encrypting (a) by using the method of the present invention;
FIG. 4 is a decryption graph resulting from decrypting FIG. 3(b) using the method of the present invention;
FIG. 5 is a key sensitivity analysis, where (a) is the original color image Test 1; (b) is an encrypted graph after encrypting (a) using a key pair; (c) is a decrypted graph obtained by decrypting (b) by using the original key; (d) is a decryption graph obtained by decrypting (b) by using a key after key change;
fig. 6 is a scatter diagram of a plain text image and an encrypted image, wherein (a) is a scatter diagram of the plain text image Test1 in the horizontal direction; (b) is a scatter diagram in the vertical direction of the plaintext image Test 2; (c) is a scatter diagram of the plaintext image Test1 in the diagonal direction; (d) is a scatter plot of the encrypted image in the horizontal direction; (e) is a scatter plot of the encrypted image in the vertical direction; (f) is a scatter plot of the encrypted image in the diagonal direction;
FIG. 7 is a histogram statistical analysis experiment in which (a) is a histogram of the encrypted image Test 1; (b) is a histogram of the encrypted image Test 2; (c) is a histogram of the encrypted image Test 3; (d) is a histogram of the encrypted image Test 4; (e) is a histogram of the plaintext image Test 1; (f) is a histogram of the plaintext image Test 2; (g) is a histogram of the plaintext image Test 3; (h) is a histogram of the plaintext image Test 4;
fig. 8 is a ciphertext image with different salt and pepper noise contaminations and its corresponding decrypted image, where (a1) is the addition of salt and pepper noise with a noise density of 0.5 to the ciphertext image; (a2) adding salt and pepper noise with the noise density of 0.05 to the ciphertext image; (a3) adding salt and pepper noise with the noise density of 0.005 to the ciphertext image; (b1) is the Test1 image decrypted by the method of the invention (a 1); (b2) is the Test1 image decrypted by the method of the invention (a 2); (b3) is the Test1 image decrypted by the method of the invention (a 3); (c1) is the Test2 image decrypted by the method of the invention (a 1); (c2) is the Test2 image decrypted by the method of the present invention for (a 2); (c3) is the Test2 image decrypted by the method of the invention (a 3); (d1) is the Test3 image decrypted by the method of the invention (a 1); (d2) is the Test3 image decrypted by the method of the invention (a 2); (d3) is the Test3 image decrypted by the method of the invention (a 3); (e1) is the Test4 image decrypted by the method of the invention (a 1); (e2) is the Test4 image decrypted by the method of the invention (a 2); (e3) is the Test4 image decrypted by the method of the invention (a 3);
FIG. 9 is a ciphertext image and its corresponding decrypted image contaminated by different Gaussian noises, wherein (a1) is the addition of Gaussian noise with a mean of 0 and a variance of 0.3 to the ciphertext image; (a2) adding Gaussian noise with the mean value of 0 and the variance of 0.05 to the ciphertext image; (a3) gaussian noise with the mean value of 0 and the variance of 0.002 is added to the ciphertext image; (b1) is the Test1 image decrypted by the method of the invention (a 1); (b2) is the Test1 image decrypted by the method of the invention (a 2); (b3) is the Test1 image decrypted by the method of the invention (a 3); (c1) is the Test2 image decrypted by the method of the invention (a 1); (c2) is the Test2 image decrypted by the method of the invention (a 2); (c3) is the Test2 image decrypted by the method of the invention (a 3); (d1) is the Test3 image decrypted by the method of the invention (a 1); (d2) is the Test3 image decrypted by the method of the invention (a 2); (d3) is the Test3 image decrypted by the method of the invention (a 3); (e1) is the Test4 image decrypted by the method of the invention (a 1); (e2) is the Test4 image decrypted by the method of the invention (a 2); (e3) is the Test4 image decrypted by the method of the invention (a 3);
FIG. 10 is a cipher text image and its corresponding decrypted image compressed by different JPEG quality factors, wherein (a1) is the cipher text image being JPEG compressed by 30 quality factor; (a2) the method comprises the steps of carrying out JPEG compression image with the quality factor of 50 on a ciphertext image; (a3) the method comprises the steps of carrying out JPEG compression image with the quality factor of 80 on a ciphertext image; (b1) is the Test1 image decrypted by the method of the invention (a 1); (b2) is the Test1 image decrypted by the method of the invention (a 2); (b3) is the Test1 image decrypted by the method of the invention (a 3); (c1) is the Test2 image decrypted by the method of the invention (a 1); (c2) is the Test2 image decrypted by the method of the invention (a 2); (c3) is the Test2 image decrypted by the method of the present invention for (a 3); (d1) is the Test3 image decrypted by the method of the invention (a 1); (d2) is the Test3 image decrypted by the method of the invention (a 2); (d3) is the Test3 image decrypted by the method of the invention (a 3); (e1) is the Test4 image decrypted by the method of the invention (a 1); (e2) is the Test4 image decrypted by the method of the invention (a 2); (e3) is the Test4 image decrypted by the method of the invention (a 3);
fig. 11 is a data-missing ciphertext image. (a) Data is randomly missing 15% of the ciphertext image. (b) Ciphertext images with 50% of data missing;
FIG. 12 is a graph of the visual effect of a plaintext image obtained by decrypting the ciphertext image with the missing data of FIG. 11, wherein (a) - (d) are the plaintext images obtained by decrypting FIG. 11(a) by the method of the present invention; (e) - (h) is the plaintext image obtained by decrypting (b) of fig. 11 by the method of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
The method comprises 5 steps of image stacking, key generation, DNA encoding, image encryption and image decryption. Firstly, stacking a plurality of color images to be encrypted by using a stacking algorithm to generate a stacked image; meanwhile, an initial key is generated by using a Hash function SHA-256, and an encryption key is generated by using a piecewise linear chaotic mapping system. In the encryption stage, firstly, an initial key is used for selecting a DNA coding rule, the stacked image is coded into a DNA sequence, the DNA sequence is encrypted by using the encryption key, and then the DNA decoding rule is used for decoding to obtain a ciphertext image. Decryption is the reverse process of encryption, and firstly, the ciphertext image is decrypted to obtain a stacked image, and then the stacked image is separated to recover the plaintext image.
The invention discloses an efficient encryption/decryption method for color images in batches, which is implemented according to the following steps as shown in figure 1:
step 1, stacking a plurality of color plaintext images by using a stacking algorithm to generate a stacked image;
the step 1 is as follows:
step 1.1, assume that there are N sheets with size mi×niColor image T ofi', i-1, 2, …, N, let m-max (m)1,m2,…,mN),n=max(n1,n2,…,nN) (ii) a m and n respectively represent the height and width of the stacked image, and if the size of the color plaintext image is not equal to m × n, 0 is filled in the right side and bottom of the color plaintext image to obtain a filled image of size m × n, in such a way that all the images have the same size, and the filled image is represented as T1,T2,…,TN
Step 1.2, setting T0Representing stacked images, each image TiThe corresponding matrix is noted
Figure BDA0002632849220000151
1,2, …, N, the matrix of stacked images is denoted as
Figure BDA0002632849220000152
The stacking algorithm is defined as follows:
order to
Figure BDA0002632849220000161
Figure BDA0002632849220000162
Wherein the content of the first and second substances,
Figure BDA0002632849220000163
the pixel value at the s-th row and T-th column of the i-th pad image is expressed, and the stacked image T with the size of m × n is obtained by the formula (2)0
Step 1.3, in order to realize the separation and recovery of the stacked image into the original color plaintext image during decryption, the weight of each color plaintext image in the stacked image needs to be recorded, and the weight matrix is marked as QiThe weight matrix is defined as follows:
Figure BDA0002632849220000164
Figure BDA0002632849220000165
Qirecording the weight of each color plaintext image in the stacked image, wherein the decrypted image is a stacked image and the matrix QiThe method is used for separating the N color plaintext images from the stacked image and finally obtaining the decrypted color plaintext image.
Step 2, generating an initial key by using a Hash function SHA-256, wherein the initial key is used for selecting a DNA coding rule and is used as an initial parameter and a control parameter of a piecewise linear chaotic mapping PWLCM, and any image is designated as the input of the SHA-256;
the step 2 is as follows:
step 2.1, randomly selecting a plaintext image as a key image and recording the plaintext image as a T1
Let W be SHA-256(T1) W represents a 256-bit string generated by the hash function SHA-256, and the average division of W into 32 segments generates 4 components of the initial key:
W=w1||w2||…||w32 (5)
obtaining an initial key by the formulas (6) to (9), wherein the initial key comprises an initial value x0、y0And a control parameter p1,p2
Figure BDA0002632849220000171
Figure BDA0002632849220000172
Figure BDA0002632849220000173
Figure BDA0002632849220000174
floor (·) denotes a lower rounding function,
Figure BDA0002632849220000176
a bitwise exclusive-or operation representing a binary number;
step 2.2, generating two pseudo-random sequences A4mnAnd Dmn,A4mnFor scrambling DNA-encoded stacked images, DmnIs used for the operation of the DNA, and the operation is carried out,
the definition of the piecewise linear chaotic map PWLCM is specifically as follows:
Figure BDA0002632849220000175
wherein, x is more than 0iP < 1, 0 < 0.5 as control parameter, Fp(xi) Represents the result of the i-th iteration when 0.5 <xiWhen < 1, let xi=1-xiRepeat iteration, x0Obtaining different chaos sequences when p takes different values, using two sets of control parameters x0,p1And y0,p2Generating two different sets of random sequences in step 2, wherein x0,p1Generating a chaotic sequence A with the length of 4mn4mn,y0,p2Generating a chaotic sequence D of length mnmn
Using an initial value x0And a control parameter p1Inputting the data into a formula (5) as an iteration initial value of a piecewise linear chaotic mapping PWLCM system, wherein the iteration number is 4 multiplied by m multiplied by n, and a chaotic sequence A with the length of 4 multiplied by m multiplied by n is obtained4mn,A4mnNamely a first encryption key;
using an initial value y0And a control parameter p2Inputting the data into a formula (5) as an iteration initial value of the piecewise linear chaotic mapping PWLCM system, and iterating the piecewise linear chaotic mapping PWLCM system m times by n times to obtain a chaotic sequence D with the length of m times by nmn=(d1,d2,…,dm×n),DmnI.e. the second encryption key.
Step 3, performing DNA coding on the stack image obtained in the step 1 and the chaotic sequence obtained by the step 2 by piecewise linear chaotic mapping (PWLCM) to obtain two coded DNA arrays;
the step 3 is as follows:
step 3.1, adding DmnThe value of (1) is mapped into 0-255, and the pair D is realizedmnAll elements d in (1)iDNA encoding was performed, i ═ 1,2, …, m × n, and the mapping procedure was performed using equation (11):
d′i=mod(floor(di×1015),256),i=1,2,…,mn (11)
floor (·) denotes a floor rounding function, d'iDenotes diMapped value, all d'iRearranging to obtain a matrix D' with the size of m × n, wherein the arranging process is realized by the formula (12):
Figure BDA0002632849220000181
step 3.2, selecting DNA coding rules by using initial parameters to increase randomness and reduce manual intervention:
g1=mod(floor(x0×1020),8)+1 (13)
g2=mod(floor(y0×1020),8)+1 (14)
floor (·) represents a lower rounding function, mod (·) represents a modulo operation; g1And g2Denotes the result obtained after the modulo operation, g1And g2The value is an integer between 1 and 8, and corresponds to the following 8 DNA coding rules, and the 8 DNA coding rules are defined as follows:
rule 1: a represents 00, C represents 01, G represents 10, T represents 11;
rule 2: a represents 00, C represents 11, G represents 01, T represents 11;
rule 3: a represents 01, C represents 00, G represents 11, T represents 10;
rule 4: a represents 01, C represents 11, G represents 00, T represents 10;
rule 5: a represents 10, C represents 11, G represents 00, T represents 01;
rule 6: a represents 10, C represents 00, G represents 11, T represents 01;
rule 7: a represents 11, C represents 01, G represents 10, T represents 00;
rule 8: a represents 11, C represents 10, G represents 01, and T represents 00;
according to g1Selecting the g-th code rule number corresponding to the code rule number1A pair of encoding rules for stacking images T0Coding is carried out, and the matrix after coding is marked as TZWhile according to g2Corresponding coding rule number, select g2D' is coded by a DNA coding rule to obtain a DNA array M with the size of M multiplied by 4nC(ii) a After DNA encoding, all decimal pixel values are expressed in the form of four bases A, C, G, T, i.e. if the pixel value of a certain point in the image is 40 and its binary value is "00101000", then according to DNA encoding rule 1, A represents00, C represents 01, G represents 10, T represents 11, and 40 is encoded as a DNA sequence "AGGA".
Step 4, carrying out encryption processing on the stacked image obtained in the step 1: a first stage, scrambling the DNA array corresponding to the stacked image in the step 3 by using an encryption key obtained by piecewise linear chaotic mapping (PWLCM); in the second stage, the DNA array generated by the chaotic sequence in the step 3 is used for carrying out DNA operation on the DNA array scrambled in the first stage so as to enable the pixel distribution to be more uniform and finally obtain a ciphertext image;
the step 4 is as follows:
step 4.1, firstly, the matrix T coded in the step 3ZTransposing, and recording the transposed matrix as TDAs shown in formula (15):
TD=(TZ)' (15)
using equation (16) to assign TDConversion to a one-dimensional sequence:
Figure BDA0002632849220000201
R1=(c1,1,c1,2,…,c1,m,c2,1,c2,2,…,c2,m,…,c4n,1,c4n,2,…,c4n,m)
R1is to form an array TDA one-dimensional sequence converted according to equation (16);
sequence A is paired in order from small to large4mnSorting to obtain an ordered sequence A' and its corresponding index sequence SyAs shown in formula (17):
(A′,Sy)=sort(A4mn) (17)
sort (. cndot.) represents a sort function from small to large, using an index sequence SyFor sequence R1Scrambling is carried out, the scrambling rule is shown as formula (18), and the generated new sequence is marked as R2
R2(j)=R1(Sy(j)),j=1,2,…,4×m×n (18)
R2(j) Represents the sequence R2The jth element in (a);
step 4.2, R is compared according to the formula (19)2Rearranging to obtain matrix T with size of m × 4ns
Figure BDA0002632849220000202
Step 4.3, using formula (20) to TsPerforming DNA operation to obtain a final DNA matrix Te
Figure BDA0002632849220000211
Step 4.4, selecting the g-th time according to the formula (21)3A DNA decoding rule pair TeThe decoding is carried out in such a way that,
g3=mod(floor(p1×1020),8)+1 (21);
so that the DNA matrix TeVisualization is carried out to obtain a ciphertext image T with the size of mxnG
And 5, decrypting the ciphertext image obtained in the step 4: firstly, decrypting the ciphertext image to obtain a stacked image; and then separating the stacked images to recover the plaintext images.
The step 5 is as follows:
step 5.1, ciphertext image TGAnd (3) decryption:
generating a chaos sequence which is the same as that generated during encryption by utilizing the piecewise linear chaos mapping PWLCM, and obtaining a stacked plaintext image T according to the inverse operation of the encryption processd
Step 5.2, separating the stacked images to recover the plaintext images
Order to
Figure BDA0002632849220000212
bs,t=N×es,t
s=1,2,…,m;t=1,2,…,n
Figure BDA0002632849220000213
Using the weight matrix Q of each image calculated in step 1.3iThe stacked images are separated, as described in detail below,
order to
Figure BDA0002632849220000221
Figure BDA0002632849220000222
And (3) representing the pixel value of the s-th row and the t-th column in the ith weight matrix, obtaining N images with the same size by using an equation (23), cutting off 0 element filled in the N images, and obtaining N recovered color plaintext images, wherein the equation (24) is as follows:
Figure BDA0002632849220000223
Ti' expression vs. ciphertext image T in step 5GAnd (3) decrypting the N decrypted color images, wherein the decrypted images correspond to the N color plaintext images stacked in the step 1 one by one.
The safety analysis and simulation experiment of the method of the invention:
1. sensitivity analysis
The experiment is mainly used for testing the sensitivity of the key in the method. A good image encryption scheme should be very sensitive to the key, i.e. small changes in the key will result in significant changes in the output. In the sensitivity analysis of the keys, we slightly modified one key of the initial key set and kept the other keys unchanged in each test in order to evaluate the sensitivity of the keys. We randomly selected one image from a plurality of test images for analysis. Without loss of generality, we chose the Test1 image for analysis. Let x0Weak transformation occursChange, i.e. x1=x0+10-15. The decryption result is shown in fig. 5. In fig. 5, (a) is the original color Test1 image; (b) is to use a secret key x0,y0,p1,p2Encrypting the encrypted image of (a); (c) is to use the original key x0,y0,p1,p2Decrypting the decrypted image obtained in the step (b); (d) is to use a key-changed key x1,y0,p1,p2And (c) decrypting the (b) to obtain a decrypted image. The results of fig. 5 show that the method of the present invention is very sensitive to the key, and even if the key is slightly changed, the plaintext image cannot be correctly decrypted and recovered.
2. Neighboring pixel correlation analysis
It is well known that there is a strong correlation between adjacent pixels in an image. Therefore, an ideal image encryption algorithm should be able to reduce the correlation between adjacent pixels, so as to have the capability of resisting the statistical analysis attack. In order to study the statistical analysis attack resistance of the method of the invention, the correlation between adjacent pixels in the plaintext image and the ciphertext image is respectively tested and compared. In the experiment, 3000 pairs of pixels are randomly selected from the horizontal, vertical and diagonal directions of four pairs of original and ciphertext Test1, Test2, Test3 and Test4 images respectively, and scatter diagrams of the horizontal, vertical and diagonal directions of the plaintext image and the ciphertext image are drawn respectively. Due to space limitations, only a scatter plot of the Test1 image is shown, as shown in FIG. 6. FIG. 6(a) is a scatter plot of the original Test1 image in the horizontal direction; FIG. 6(b) is a scatter plot of the original Test1 image in the vertical direction; FIG. 6(c) is a scatter plot of the diagonal orientation of the original Test1 image; fig. 6(d) is a scatter diagram of the ciphertext Test1 in the image horizontal direction; fig. 6 (e) is a scatter diagram of the ciphertext Test1 in the vertical direction of the image; fig. 6(f) is a scatter diagram of the ciphertext Test1 image in the diagonal direction. As can be seen from fig. 6(a) - (c), the pixel pairs randomly selected from the three directions of horizontal, vertical and diagonal of the original Test1 image have strong correlation. Fig. 6(d) - (f) show that the pixel pairs selected at the same position in the ciphertext image have almost no correlation.
Table 1 shows the correlation coefficients of the horizontal, vertical, and diagonal directions of the test images before and after encryption. It can be seen from table 1 that the correlation coefficients of the four plaintext images are all close to 1, and the correlation coefficients of the encryption map are all close to 0, which indicates that there is almost no correlation between adjacent pixels of the ciphertext image after the image encryption method of the present invention is used for encryption.
Table 1 correlation coefficient between adjacent pixels before and after encryption
Figure BDA0002632849220000241
3. Gray level histogram analysis
An ideal image encryption scheme should be resistant to any statistical analysis attack. Considering that an image histogram is an effective statistical analysis tool and plays an important role in image analysis, we study the anti-statistical analysis function of the method through gray level histogram analysis. For an ideal image encryption algorithm, the histogram of the ciphertext image should be uniformly distributed. We give the grayscale histograms of the Test images Test1, Test2, Test3, and Test4, fig. 7(a) - (d) are histograms of the cipher text Test1, Test2, Test3, and Test4 images, and fig. 7(e) - (h) are histograms of the original Test1, Test2, Test3, and Test4 images. As can be seen from fig. 7, the histogram of the ciphertext image is very uniform, which means that the method of the present invention can resist statistical analysis attacks.
4. Differential analysis
In order to obtain useful information, an attacker typically slightly modifies the plaintext image and then encrypts the original plaintext image and the modified plaintext image separately using an encryption algorithm to obtain two image images. Differential attack refers to an attacker cracking the encryption system by comparing the differences between two ciphertext images. Secure image encryption methods should be very sensitive to both plaintext and key, so any slight change to plaintext or key affects the entire ciphertext. The rate of change of pixels (NPCR) and the uniform average intensity of change (UACI) are commonly used to measure the effect of pixel changes in a plaintext image on an encrypted image.
In order to investigate the capability of the method of the present invention to resist differential analysis attacks, a pixel point is randomly selected in a Test image Test1, the pixel value is increased by 1, the original Test1 image and the changed image are respectively encrypted by the method of the present invention, finally, the NPCR value and the UACI value of the two ciphertext images are calculated and compared with the methods in documents [11], [13] and [14], and the calculation results are shown in table 2.
TABLE 2 NPCR, UACI values of ciphertext images resulting from a 1-pixel change to Test1 images
Figure BDA0002632849220000251
As can be seen from Table 3, the NPCR and UACI values for the method of the present invention are highest compared to the comparative method, indicating that the method of the present invention is very sensitive to subtle changes in the plaintext image.
5. Information entropy analysis
Entropy is a measure of information uncertainty, which can also be used to represent randomness of image information. The information entropy can be used to measure the uniformity of the intensity distribution of the pixel, i.e. the larger the information entropy, the more uniform the intensity distribution of the pixel. For an ideal image encryption algorithm, the information entropy of the ciphertext image should be close to 8. We calculated the information entropy of the ciphertext Test1 image encrypted by the method of the present invention and compared it with other methods, and the results are shown in table 3.
TABLE 3 information entropy comparison results of original Test1 image and ciphertext Test1 image
Figure BDA0002632849220000252
Table 4 shows that the uniformity of the pixel intensity distribution of the ciphertext image obtained by the method of the present invention is higher than that of the contrast method.
6. Robust analysis
6.1 robust analysis against noise pollution
The robustness of anti-noise pollution is an important index for measuring the performance of an image encryption algorithm, and means that even if a ciphertext image suffers noise pollution, a decryption result can still keep good image quality. In order to evaluate the robustness of the method, salt and pepper noise and Gaussian noise are respectively added into a ciphertext image. And then, the ciphertext image polluted by the noise is decrypted by using the method. Fig. 8 and 9 illustrate the effect of decrypting noise contaminated images using the method of the present invention. Fig. 8 shows ciphertext images contaminated by different salt and pepper noises and corresponding decrypted images. In fig. 8, (a1) is the addition of salt-and-pepper noise with a noise density of 0.5 to the ciphertext image; (a2) adding salt and pepper noise with the noise density of 0.05 to the ciphertext image; (a3) adding salt and pepper noise with the noise density of 0.005 to the ciphertext image; (b1) is the Test1 image decrypted by the method of the invention (a 1); (b2) is the Test1 image decrypted by the method of the invention (a 2); (b3) is the Test1 image decrypted by the method of the invention (a 3); (c1) is the Test2 image decrypted by the method of the invention (a 1); (c2) is the Test2 image decrypted by the method of the invention (a 2); (c3) is the Test2 image decrypted by the method of the invention (a 3); (d1) is the Test3 image decrypted by the method of the invention (a 1); (d2) is the Test3 image decrypted from (a2) using the method of the present invention; (d3) is the Test3 image decrypted by the method of the invention (a 3); (e1) is the Test4 image decrypted by the method of the invention (a 1); (e2) is the Test4 image decrypted by the method of the invention (a 2); (e3) the Test4 image decrypted in (a3) by the method of the present invention. Fig. 9 shows ciphertext images with different gaussian noise contaminations and corresponding decrypted images. Fig. 9(a1) is a diagram in which gaussian noise having a mean value of 0 and a variance of 0.3 is added to a ciphertext image; (a2) adding Gaussian noise with the mean value of 0 and the variance of 0.05 to the ciphertext image; (a3) gaussian noise with the mean value of 0 and the variance of 0.002 is added to the ciphertext image; (b1) is the Test1 image decrypted by the method of the invention (a 1); (b2) is the Test1 image decrypted by the method of the invention (a 2); (b3) is the Test1 image decrypted by the method of the invention (a 3); (c1) is the Test2 image decrypted by the method of the invention (a 1); (c2) is the Test2 image decrypted by the method of the invention (a 2); (c3) is the Test2 image decrypted by the method of the invention (a 3); (d1) is the Test3 image decrypted by the method of the invention (a 1); (d2) is the Test3 image decrypted from (a2) using the method of the present invention; (d3) is the Test3 image decrypted by the method of the invention (a 3); (e1) is the Test4 image decrypted by the method of the invention (a 1); (e2) is the Test4 image decrypted by the method of the invention (a 2); (e3) the Test4 image decrypted in (a3) by the method of the present invention.
Table 4 lists the noise factors and PSNR values of the decrypted images Test1, Test2, Test3, and Test4 obtained by decrypting the noise-contaminated ciphertext image using the method of the present invention.
TABLE 4 PSNR values of plaintext images obtained after decryption of noise contaminated cryptographic images
Figure BDA0002632849220000271
The experimental result shows that when the ciphertext image is polluted by different noises, the decrypted image obtained by the decryption method still retains most of the information of the plaintext image. This shows that the method of the present invention has strong robustness to salt and pepper noise and Gaussian noise.
6.2 robust analysis against JPEG compression
Since the JPEG format is the most commonly used image storage format, robustness against JPEG compression is one of the important indicators for image encryption algorithms to measure the performance of the algorithms. The anti-JPEG compression robustness means that even if the ciphertext image is subjected to JPEG compression, the decryption result thereof can maintain good image quality. In order to study the robustness of the method of the present invention against JPEG compression, ciphertext images with different quality factors are compressed and then decrypted by using the method of the present invention, and fig. 10 illustrates the visual effect of a plaintext image obtained by decrypting the ciphertext images compressed by JPEG with different quality factors. In fig. 10, (a1) is a JPEG-compressed image with a quality factor of 30 applied to the ciphertext image; (a2) the method comprises the steps of carrying out JPEG compression image with the quality factor of 50 on a ciphertext image; (a3) the method comprises the steps of carrying out JPEG compression image with the quality factor of 80 on a ciphertext image; (b1) is the Test1 image decrypted by the method of the invention (a 1); (b2) is the Test1 image decrypted by the method of the invention (a 2); (b3) is the Test1 image decrypted by the method of the invention (a 3); (c1) is the Test2 image decrypted by the method of the invention (a 1); (c2) is the Test2 image decrypted by the method of the invention (a 2); (c3) is the Test2 image decrypted by the method of the invention (a 3); (d1) is the Test3 image decrypted by the method of the invention (a 1); (d2) is the Test3 image decrypted by the method of the invention (a 2); (d3) is the Test3 image decrypted by the method of the invention (a 3); (e1) is the Test4 image decrypted by the method of the present invention for (a 1); (e2) is the Test4 image decrypted by the method of the invention (a 2); (e3) the Test4 image decrypted in (a3) by the method of the present invention. In order to quantitatively evaluate the quality of the decrypted plaintext image, the PSNR value of the decrypted and recovered plaintext image is also calculated, and the result is shown in table 5.
TABLE 5 PSNR value of plaintext image restored after encrypting JPEG compressed ciphertext image by the method of the present invention
Figure BDA0002632849220000281
Table 5 shows that the method of the present invention has strong robustness to JPEG compression.
6.3 robust analysis against data loss
Data loss is a very common phenomenon in network transmission. In network transmission, due to various interferences, images are easily attacked or damaged in the transmission process, so that partial contents are lost. The robustness against data loss means that even if the ciphertext image lacks part of information, the plaintext image recovered by the decryption algorithm can still be visually identified. In order to test the robustness of the method against data loss, we delete image blocks with different sizes from the ciphertext image respectively, as shown in fig. 11, fig. 11(a) shows the ciphertext image with data loss (100 × 100), and fig. 11(b) shows the ciphertext image with data loss of 50%. Then decrypted by the method of the present invention, and fig. 12 shows the visual effect of the plaintext image obtained by decrypting (a) and (b) of fig. 11 by the method of the present invention. In fig. 12, (a) - (d) are the plaintext images obtained after decrypting fig. 11(a) by the method of the present invention; (e) - (h) is the plaintext image obtained by decrypting (b) of fig. 11 by the method of the present invention.
As can be seen from fig. 12, the decrypted plaintext image can still be identified, and the missing region introduces only a certain amount of noise into the decrypted plaintext image. This means that even if the ciphertext image has data loss, most of the plaintext information can be recovered and visually identified after decryption by the method of the present invention. In order to quantitatively evaluate the quality of the decrypted plaintext image, we also calculate the PSNR value of the decrypted recovered plaintext image, and the result is shown in table 6, and it can be seen from table 6 that the decrypted recovered plaintext image can still be identified.
TABLE 6 PSNR value of plaintext image restored after data missing ciphertext graph encryption by the method of the present invention
Figure BDA0002632849220000291
As can be seen from table 6, even if 50% of the pixels of the ciphertext image are missing, the image can still be decrypted by using the method of the present invention, and the decrypted image still retains the main information of the plaintext image. The method of the invention is shown to be robust against data loss.
The invention provides a batch image encryption/decryption algorithm based on DNA coding and piecewise linear chaotic mapping (PWLCM). Unlike existing image encryption schemes, the method of the present invention can encrypt any number of color images with only a single encryption calculation, with the computational overhead equivalent to encrypting one image. The invention has no size requirement on the encrypted image, namely, the image with any size can be encrypted. The image encryption method of the invention is a lossless scheme, namely, no pixel change is caused in the encryption/decryption process, and the quality of the decrypted image is completely equal to that of the plaintext image. Compared with the prior art, the method has stronger robustness, can resist various attacks such as noise pollution, JPEG compression, image block loss and the like, and is very robust even in a severe environment.

Claims (6)

1. An efficient encryption/decryption method for color images in batches is characterized by being implemented according to the following steps:
step 1, stacking a plurality of color plaintext images by using a stacking algorithm to generate a stacked image;
step 2, generating an initial key by using a Hash function SHA-256, wherein the initial key is used for selecting a DNA coding rule and is used as an initial parameter and a control parameter of a piecewise linear chaotic mapping PWLCM, and any image is designated as the input of the SHA-256;
step 3, performing DNA coding on the stack image obtained in the step 1 and the chaotic sequence obtained by the step 2 by piecewise linear chaotic mapping (PWLCM) to obtain two coded DNA arrays;
step 4, carrying out encryption processing on the stacked image obtained in the step 1: a first stage, scrambling the DNA array corresponding to the stacked image in the step 3 by using an encryption key obtained by piecewise linear chaotic mapping (PWLCM); in the second stage, the DNA array generated by the chaotic sequence in the step 3 is used for carrying out DNA operation on the DNA array scrambled in the first stage so as to enable the pixel distribution to be more uniform and finally obtain a ciphertext image;
and 5, decrypting the ciphertext image obtained in the step 4: firstly, decrypting the ciphertext image to obtain a stacked image; and then separating the stacked images to recover the plaintext images.
2. The efficient encryption/decryption method for color images in batches according to claim 1, wherein the step 1 is as follows:
step 1.1, assume that there are N sheets with size mi×niColor image T ofi', i-1, 2, …, N, let m-max (m)1,m2,…,mN),n=max(n1,n2,…,nN) (ii) a m and n respectively represent the height and width of the stacked image, and if the size of the color plaintext image is not equal to m × n, 0 is filled in the right side and bottom of the color plaintext image to obtain a filled image of size m × n, in such a way that all the images have the same size, and the filled image is represented as T1,T2,…,TN
Step 1.2, setting T0Representing stacked images, each image TiThe corresponding matrix is noted
Figure FDA0002632849210000021
1,2, …, N, the matrix of stacked images is denoted as
Figure FDA0002632849210000022
The stacking algorithm is defined as follows:
order to
Figure FDA0002632849210000023
Figure FDA0002632849210000024
Wherein the content of the first and second substances,
Figure FDA0002632849210000025
Figure FDA0002632849210000026
the pixel value at the s-th row and T-th column of the i-th pad image is expressed, and the stacked image T with the size of m × n is obtained by the formula (2)0
Step 1.3, in order to realize the separation and recovery of the stacked image into the original color plaintext image during decryption, the weight of each color plaintext image in the stacked image needs to be recorded, and the weight matrix is marked as QiThe weight matrix is defined as follows:
Figure FDA0002632849210000027
Figure FDA0002632849210000028
Qirecording the weight of each color plaintext image in the stacked image, wherein the decrypted image is a stacked image and the matrix QiThe method is used for separating the N color plaintext images from the stacked image and finally obtaining the decrypted color plaintext image.
3. The efficient encryption/decryption method for color images in batches according to claim 2, wherein the step 2 is as follows:
step 2.1, randomly selecting a plaintext image as a key image and recording the plaintext image as a T1Let W be SHA-256 (T)1) W represents a 256-bit string generated by the hash function SHA-256, and the average division of W into 32 segments generates 4 components of the initial key:
W=w1||w2||…||w32 (5)
obtaining an initial key by the formulas (6) to (9), wherein the initial key comprises an initial value x0、y0And a control parameter p1,p2
Figure RE-FDA0002848673990000031
Figure RE-FDA0002848673990000032
Figure RE-FDA0002848673990000033
Figure RE-FDA0002848673990000034
floor (·) denotes a lower rounding function,
Figure RE-FDA0002848673990000035
a bitwise exclusive-or operation representing a binary number;
step 2.2, generating two pseudo-random sequences A4mnAnd Dmn,A4mnFor scrambling DNA-encoded stacked images, DmnIs used for the operation of the DNA, and the operation is carried out,
the definition of the piecewise linear chaotic map PWLCM is specifically as follows:
Figure RE-FDA0002848673990000036
wherein, x is more than 0iP < 1, 0 < 0.5 as control parameter, Fp(xi) Represents the result of the ith iteration when 0.5 < xiWhen < 1, let xi=1-xiRepeat iteration, x0Obtaining different chaos sequences when p takes different values, using two sets of control parameters x0,p1And y0,p2Generating two different sets of random sequences in step 2, wherein x0,p1Generating a chaotic sequence A with the length of 4mn4mn,y0,p2Generating a chaotic sequence D of length mnmn
Using an initial value x0And a control parameter p1Inputting the data into a formula (5) as an iteration initial value of a piecewise linear chaotic mapping PWLCM system, wherein the iteration number is 4 multiplied by m multiplied by n, and a chaotic sequence A with the length of 4 multiplied by m multiplied by n is obtained4mn,A4mnNamely a first encryption key;
using an initial value y0And a control parameter p2Inputting the initial value of the iteration of the PWLCM system which is the piecewise linear chaotic mapping in the formula (5)Iterating the PWLCM system by linear chaotic mapping for m times and n times to obtain a chaotic sequence D with the length of m times and n timesmn=(d1,d2,…,dm×n),DmnI.e. the second encryption key.
4. The efficient batch color image encryption/decryption method according to claim 3, wherein the step 3 is as follows:
step 3.1, adding DmnThe value of (1) is mapped into 0-255, and the pair D is realizedmnAll elements d in (1)iDNA encoding was performed, i ═ 1,2, …, m × n, and the mapping procedure was performed using equation (11):
d′i=mod(floor(di×1015),256),i=1,2,…,mn (11)
floor (·) denotes a floor rounding function, d'iDenotes diMapped value, all d'iRearranging to obtain a matrix D' with the size of m × n, wherein the arranging process is realized by the formula (12):
Figure FDA0002632849210000041
step 3.2, selecting DNA coding rules by using initial parameters to increase randomness and reduce manual intervention:
g1=mod(floor(x0×1020),8)+1 (13)
g2=mod(floor(y0×1020),8)+1 (14)
floor (·) represents a lower rounding function, mod (·) represents a modulo operation; g1And g2Denotes the result obtained after the modulo operation, g1And g2The value is an integer between 1 and 8, and corresponds to the following 8 DNA coding rules, and the 8 DNA coding rules are defined as follows:
rule 1: a represents 00, C represents 01, G represents 10, T represents 11;
rule 2: a represents 00, C represents 11, G represents 01, T represents 11;
rule 3: a represents 01, C represents 00, G represents 11, T represents 10;
rule 4: a represents 01, C represents 11, G represents 00, T represents 10;
rule 5: a represents 10, C represents 11, G represents 00, T represents 01;
rule 6: a represents 10, C represents 00, G represents 11, T represents 01;
rule 7: a represents 11, C represents 01, G represents 10, T represents 00;
rule 8: a represents 11, C represents 10, G represents 01, and T represents 00;
according to g1Selecting the g-th code rule number corresponding to the code rule number1A pair of encoding rules for stacking images T0Coding is carried out, and the matrix after coding is marked as TZWhile according to g2Corresponding coding rule number, select g2D' is coded by a DNA coding rule to obtain a DNA array M with the size of M multiplied by 4nC(ii) a After DNA encoding, all decimal pixel values are expressed in the form of four bases A, C, G and T, that is, if a certain point in the image has a pixel value of 40 and its binary value is "00101000", according to the DNA encoding rule 1, A represents 00, C represents 01, G represents 10, T represents 11, and 40 is encoded into a DNA sequence of "AGGA".
5. The efficient encryption/decryption method for color images in batches according to claim 4, wherein the step 4 is as follows:
step 4.1, firstly, the matrix T coded in the step 3ZTransposing, and recording the transposed matrix as TDAs shown in formula (15):
TD=(TZ)' (15)
using equation (16) to assign TDConversion to a one-dimensional sequence:
Figure FDA0002632849210000061
R1=(c1,1,c1,2,…,c1,m,c2,1,c2,2,…,c2,m,…,c4n,1,c4n,2,…,c4n,m)
R1is to form an array TDA one-dimensional sequence converted according to equation (16);
sequence A is paired in order from small to large4mnSorting to obtain an ordered sequence A' and its corresponding index sequence SyAs shown in formula (17):
(A′,Sy)=sort(A4mn) (17)
sort (. cndot.) represents a sort function from small to large, using an index sequence SyFor sequence R1Scrambling is carried out, the scrambling rule is shown as formula (18), and the generated new sequence is marked as R2
R2(j)=R1(Sy(j)),j=1,2,…,4×m×n (18)
R2(j) Represents the sequence R2The jth element in (a);
step 4.2, R is compared according to the formula (19)2Rearranging to obtain matrix T with size of m × 4ns
Figure FDA0002632849210000062
Step 4.3, using formula (20) to TsPerforming DNA operation to obtain a final DNA matrix Te
Figure FDA0002632849210000063
Step 4.4, selecting the g-th time according to the formula (21)3A DNA decoding rule pair TeThe decoding is carried out in such a way that,
g3=mod(floor(p1×1020),8)+1 (21);
so that the DNA matrix TeVisualization is carried out to obtain ciphertext with the size of mxnImage TG
6. The efficient encryption/decryption method for color images in batches according to claim 5, wherein the step 5 is as follows:
step 5.1, ciphertext image TGAnd (3) decryption:
generating a chaos sequence which is the same as that generated during encryption by utilizing the piecewise linear chaos mapping PWLCM, and obtaining a stacked plaintext image T according to the inverse operation of the encryption processd
Step 5.2, separating the stacked images to recover the plaintext images
Order to
Figure FDA0002632849210000071
bs,t=N×es,t
s=1,2,…,m;t=1,2,…,n
Figure FDA0002632849210000072
Using the weight matrix Q of each image calculated in step 1.3iThe stacked images are separated, as described in detail below,
order to
Figure FDA0002632849210000073
Figure FDA0002632849210000081
And (3) representing the pixel value of the s-th row and the t-th column in the ith weight matrix, obtaining N images with the same size by using an equation (23), cutting off 0 element filled in the N images, and obtaining N recovered color plaintext images, wherein the equation (24) is as follows:
Figure FDA0002632849210000082
Ti' expression vs. ciphertext image T in step 5GAnd (3) decrypting the N decrypted color images, wherein the decrypted images correspond to the N color plaintext images stacked in the step 1 one by one.
CN202010816309.3A 2020-08-14 2020-08-14 Efficient batch color image encryption/decryption method Active CN112737763B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010816309.3A CN112737763B (en) 2020-08-14 2020-08-14 Efficient batch color image encryption/decryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010816309.3A CN112737763B (en) 2020-08-14 2020-08-14 Efficient batch color image encryption/decryption method

Publications (2)

Publication Number Publication Date
CN112737763A true CN112737763A (en) 2021-04-30
CN112737763B CN112737763B (en) 2022-05-27

Family

ID=75597112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010816309.3A Active CN112737763B (en) 2020-08-14 2020-08-14 Efficient batch color image encryption/decryption method

Country Status (1)

Country Link
CN (1) CN112737763B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046161A (en) * 2015-07-29 2015-11-11 河南大学 DNA dynamic coding based colored image encryption method
CN107659752A (en) * 2017-09-19 2018-02-02 中国矿业大学 More image encryption methods based on DNA encoding and chaos
US20180075569A1 (en) * 2017-09-27 2018-03-15 Ningbo University High dynamic range image information hiding method
CN108322622A (en) * 2018-02-23 2018-07-24 哈尔滨理工大学 A kind of color digital image encryption method based on 2D-VMD and octuple hyperchaotic system
AU2019100036A4 (en) * 2019-01-14 2019-02-28 Wenying Wen A symmetric encryption scheme for color light field image
CN109918923A (en) * 2019-01-25 2019-06-21 哈尔滨理工大学 A kind of multichannel color image chaos encrypting method based on DNA encoding

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046161A (en) * 2015-07-29 2015-11-11 河南大学 DNA dynamic coding based colored image encryption method
CN107659752A (en) * 2017-09-19 2018-02-02 中国矿业大学 More image encryption methods based on DNA encoding and chaos
US20180075569A1 (en) * 2017-09-27 2018-03-15 Ningbo University High dynamic range image information hiding method
CN108322622A (en) * 2018-02-23 2018-07-24 哈尔滨理工大学 A kind of color digital image encryption method based on 2D-VMD and octuple hyperchaotic system
AU2019100036A4 (en) * 2019-01-14 2019-02-28 Wenying Wen A symmetric encryption scheme for color light field image
CN109918923A (en) * 2019-01-25 2019-06-21 哈尔滨理工大学 A kind of multichannel color image chaos encrypting method based on DNA encoding

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AQEEL UR REHMAN等: "A Selective Cross-Substitution Technique for Encrypting Color Images Using Chaos, DNA Rules and SHA-512", 《IEEE ACCESS》 *
孙鹤鹏: "基于DNA编码的多图像加密算法", 《中国矿业大学信息与控制工程学院》 *

Also Published As

Publication number Publication date
CN112737763B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
Ghadirli et al. An overview of encryption algorithms in color images
Khan et al. DNA and plaintext dependent chaotic visual selective image encryption
Tang et al. Image encryption with double spiral scans and chaotic maps
CN108898025B (en) Chaotic image encryption method based on double scrambling and DNA coding
CN108322622B (en) Color digital image encryption method based on 2D-VMD and eight-dimensional hyper-chaotic system
Qian et al. A novel color image encryption algorithm based on three-dimensional chaotic maps and reconstruction techniques
Ahmad et al. A new algorithm of encryption and decryption of images using chaotic mapping
CN107094072B (en) Mixed chaotic encryption method based on generalized Henon mapping
Soleymani et al. A novel public key image encryption based on elliptic curves over prime group field
Yildirim A color image encryption scheme reducing the correlations between R, G, B components
Elsaid et al. A robust hybrid cryptosystem based on DNA and Hyperchaotic for images encryption
CN103440613A (en) Color-image encryption method for hyperchaotic Rossler system
CN113556223A (en) Image encryption method based on fractional order drive response system finite time synchronization
Singh et al. Image encryption scheme based on Knight's tour problem
CN114579993A (en) Image encryption method based on quantum key distribution and pixel scrambling
Kadhim New image encryption based on pixel mixing and generating chaos system
Maryoosh et al. Image confusion and diffusion based on multi-chaotic system and mix-column
CN113300827A (en) Latin square-based chaotic image encryption method
Khalaf Fast image encryption based on random image key
Jabbar et al. Property Comparison of Intellectual Property Rights of Image-Based on Encryption Techniques.
Gupta et al. An effective approach of secured medical image transmission using encryption method
Saleh et al. Information Hiding for Text Files by Adopting the Genetic Algorithm and DNA Coding
CN112737763B (en) Efficient batch color image encryption/decryption method
Ahmad et al. A multi-level blocks scrambling based chaotic image cipher
El Abbadi et al. Digital RGB image encryption based on 2D cat map and shadow numbers

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