CN109361830B - Image encryption method based on plaintext - Google Patents

Image encryption method based on plaintext Download PDF

Info

Publication number
CN109361830B
CN109361830B CN201810897213.7A CN201810897213A CN109361830B CN 109361830 B CN109361830 B CN 109361830B CN 201810897213 A CN201810897213 A CN 201810897213A CN 109361830 B CN109361830 B CN 109361830B
Authority
CN
China
Prior art keywords
mapping
plaintext
image data
pseudo
random number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810897213.7A
Other languages
Chinese (zh)
Other versions
CN109361830A (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.)
Xidian University
Original Assignee
Xidian 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 Xidian University filed Critical Xidian University
Priority to CN201810897213.7A priority Critical patent/CN109361830B/en
Publication of CN109361830A publication Critical patent/CN109361830A/en
Application granted granted Critical
Publication of CN109361830B publication Critical patent/CN109361830B/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

Abstract

The invention relates to a plaintext-based image encryption method, which comprises the following steps: constructing a three-dimensional cat mapping key according to the plaintext image data and the logic mapping initial value; obtaining a three-dimensional cat mapping pseudo-random number sequence according to the three-dimensional cat mapping key, and obtaining a logic mapping pseudo-random number sequence according to the logic mapping initial value; scrambling the plaintext image data according to the three-dimensional cat mapping pseudo-random number sequence to obtain scrambled image data; and diffusing the scrambled image data to obtain ciphertext image data. The embodiment of the invention constructs the key stream based on the plaintext, so that an attacker can generate different key streams when selecting different plaintexts each time when using the selected plaintexts, thereby fundamentally resisting the attack of selecting the plaintexts.

Description

Image encryption method based on plaintext
Technical Field
The invention belongs to the technical field of digital image processing, and particularly relates to a plaintext-based image encryption method.
Background
Digital images, also known as digital images or digital images, are representations of two-dimensional images with finite digital number pixels. Represented by an array or matrix, whose illumination locations and intensities are discrete. Digital images are pixel-based images digitized from analog images that can be stored and processed by digital computers or digital circuits. Image encryption is an important problem in the field of information security, and therefore image information transmission and image encryption technologies have attracted extensive attention. For the security requirement of digital image information, four aspects are mainly considered at present, namely: confidentiality, integrity, authentication, and non-repudiation. The chaos has the characteristics of low power consumption, low complexity, high safety, convenience, easiness in software simulation realization and the like, and the four requirements which need to be met by the digital image encryption can be well met by using the chaos image encryption, so that the image data can be effectively protected, and the image information is prevented from being stolen by attackers, so that the chaos encryption technology is used for image encryption more frequently.
At present, a plurality of chaos maps which are widely applied in image encryption comprise a cat map and a logic map, wherein the cat map can be considered to be generated by a mass point which does one-dimensional motion in an external field and changes along with a time cycle, and can also be described as transformation which repeatedly does stretching and folding in a limited area; the logic mapping is a very simple chaotic mapping in mathematical form, but the system has extremely complex dynamic behavior and is widely applied in the field of secure communication.
In recent years, an image encryption algorithm based on a chaotic system is a research hotspot. These encryption algorithms can be divided into two categories, one is that the key stream is independent of the plaintext, depending on whether the pseudo-random number generator relies on the plaintext or not; the second type is that the key stream is associated with the plaintext. The researchers found that the first class of encryption algorithms are mostly insecure, because these encryption algorithms either have only one round of scrambling diffusion, or have small key space or are unrelated to plaintext, etc., so that they cannot effectively resist attacks. Although the second type of encryption algorithm is based on plaintext, many pseudo-random number generators have a small key space due to the invariance of the sum of pixel values, which makes them not resistant to chosen-plaintext attacks and the like.
Therefore, it is important how to make the encryption algorithm resistant to chosen-plaintext attacks.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a plaintext-based image encryption method. The technical problem to be solved by the invention is realized by the following technical scheme:
the embodiment of the invention provides a plaintext-based image encryption method, which comprises the following steps:
constructing a three-dimensional cat mapping key according to the plaintext image data and the logic mapping initial value;
obtaining a three-dimensional cat mapping pseudo-random number sequence according to the three-dimensional cat mapping key, and obtaining a logic mapping pseudo-random number sequence according to the logic mapping initial value;
scrambling the plaintext image data according to the three-dimensional cat mapping pseudo-random number sequence to obtain scrambled image data;
and diffusing the scrambled image data to obtain ciphertext image data.
In one embodiment of the invention, constructing a three-dimensional cat mapping key from plaintext image data and a logical mapping initial value comprises:
will be clearThe last column of pixel values of the image data is subjected to exclusive OR operation with the first N-1 columns of pixel values in sequence to obtain a column of exclusive OR values which are marked as
Figure BDA0001758485520000021
Wherein lnRepresenting pixel values, N being the number of columns of the plaintext image data;
carrying out XOR operation on the last line of pixel values of the plaintext image data and the first M-1 lines of pixel values in sequence to obtain a line of XOR values, and marking the line of XOR values as
Figure BDA0001758485520000031
Wherein h ismRepresenting pixel values, M being the number of lines of said plaintext image data;
according to the formula Lv ═ L · LT=l1 2+l2 2+...+lN 2Calculating to obtain an inner product value Lv, wherein LTRepresents L transpose;
according to the formula Hv ═ H.HT=h1 2+h2 2+...+hM 2Calculating to obtain an inner product value Hv, wherein HTRepresents H transpose;
calculating the three-dimensional cat mapping key according to the following formula:
Figure BDA0001758485520000032
wherein mod represents a modulo operation; x is the number of0,y0,z0And mapping a key for the three-dimensional cat.
In an embodiment of the present invention, obtaining a three-dimensional cat mapping pseudo-random number sequence according to the three-dimensional cat mapping key includes:
performing iterative operation on the three-dimensional cat mapping key for preset times to obtain the three-dimensional cat mapping pseudo-random number sequence, wherein the number of pseudo-random numbers in the three-dimensional cat mapping pseudo-random number sequence is as follows:
3 xn (M + N), where N is a preset number of times, and M, N is the number of rows and columns of the plaintext image data, respectively.
In an embodiment of the present invention, obtaining a logical mapping pseudo random number sequence according to the logical mapping initial value includes:
according to the logic mapping pseudo-random number sequence formula: q. q.si+1=Rqi(1-qi) Generating the logical mapping pseudo-random number sequence, wherein R is a system parameter, q is a logical mapping value, and q is a logical mapping valueiIs the ith q value, qi+1For the (i + 1) th q value, the number of pseudo-random numbers in the logic mapping pseudo-random number sequence is as follows:
m × N, M, N are the number of rows and columns, respectively, of the plaintext image data.
In one embodiment of the invention, scrambling the plaintext image data according to the three-dimensional cat mapping pseudo-random number sequence comprises:
layering the plaintext image data to obtain a plurality of bit planes;
respectively performing row scrambling and column scrambling on each bit plane according to the three-dimensional cat mapping pseudo-random number sequence;
rearranging each bit plane after scrambling according to a preset rule to obtain an arranged pixel image;
and performing line scrambling and column scrambling on the arranged pixel images according to the three-dimensional cat mapping pseudo-random number sequence to obtain scrambled image data.
In one embodiment of the present invention, diffusing the scrambled image data comprises:
using a formula
Figure BDA0001758485520000041
Diffusing the scrambled image data, wherein C (i) is the ith pixel of the ciphertext C, P (i) is the ith pixel of the plaintext image P, K (i) is the ith random number of the key stream K,
Figure BDA0001758485520000042
is an integer field between 2 and M × N.
Compared with the prior art, the invention has the beneficial effects that:
1. the embodiment of the invention constructs the key stream based on the plaintext, so that an attacker can generate different key streams when selecting different plaintexts each time when using the selected plaintexts, thereby fundamentally resisting the attack of selecting the plaintexts;
2. the embodiment of the invention enables the key stream generated by the key related to the plaintext to act on the scrambling stage and the diffusion stage simultaneously, thereby strengthening the relevance between the encryption process and the plaintext;
3. the embodiment of the invention uses different chaotic mappings in the scrambling and diffusion stages, and further improves the encryption security by combining scrambling and diffusion;
4. in the embodiment of the invention, bit position-based scrambling, bit position plane-based scrambling and pixel position-based scrambling are comprehensively used in the scrambling stage, so that the complexity of a ciphertext is increased;
5. the embodiment of the invention comprehensively uses the one-dimensional chaotic mapping and the three-dimensional cat mapping, is beneficial to enlarging the key space, improving the key sensitivity and enhancing the randomness of the ciphertext image;
6. experimental results show that the image encryption method designed by the embodiment of the invention can resist various attacks and has a good encryption effect.
Drawings
Fig. 1 is a schematic flowchart of a plaintext-based image encryption method according to an embodiment of the present invention;
fig. 2 is a detailed flowchart of a plaintext-based image encryption method according to an embodiment of the present invention;
FIGS. 3(a) -3(c) are graphs of the sensitivity analysis test results of the encryption key provided by the embodiment of the present invention;
FIGS. 4(a) -4(c) are graphs of the sensitivity analysis test results of the decryption key provided by the embodiment of the present invention;
FIG. 5(a) is a histogram of an original plaintext image according to an embodiment of the present invention;
fig. 5(b) is a histogram of a ciphertext image corresponding to a plaintext provided by an embodiment of the present invention;
FIGS. 6(a) -6(f) are graphs showing simulation experiment results of an image "camera" provided by an embodiment of the present invention;
fig. 7(a) -7(f) are graphs showing simulation experiment results of the image "babon" provided by the embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to specific examples, but the embodiments of the present invention are not limited thereto.
Example one
Referring to fig. 1, fig. 1 is a schematic flow chart of an image encryption method based on plaintext according to an embodiment of the present invention, where the encryption method specifically includes the following steps:
constructing a three-dimensional cat mapping key according to the plaintext image data and the logic mapping initial value;
wherein constructing the three-dimensional cat mapping key comprises:
carrying out XOR operation on the last column of pixel values of the plaintext image data and the first N-1 columns of pixel values in sequence to obtain a column of XOR values, and marking the XOR values as
Figure BDA0001758485520000061
Wherein lnRepresenting pixel values, N being the number of columns of the plaintext image data;
carrying out XOR operation on the last line of pixel values of the plaintext image data and the first M-1 lines of pixel values in sequence to obtain a line of XOR values, and marking the line of XOR values as
Figure BDA0001758485520000062
Wherein h ismRepresenting pixel values, M being the number of lines of said plaintext image data;
according to the formula Lv ═ L · LT=l1 2+l2 2+...+lN 2Calculating to obtain an inner product value Lv, wherein LTRepresents L transpose;
according to the formula Hv ═ H.HT=h1 2+h2 2+...+hM 2Calculating to obtain an inner product value Hv, wherein HTRepresents H transpose;
calculating the three-dimensional cat mapping key according to the following formula:
wherein mod represents a modulo operation; x is the number of0,y0,z0And mapping a key for the three-dimensional cat.
The key construction scheme based on the plaintext can effectively resist the chosen plaintext attack, namely different plaintexts have different keys, and different keys generate different pseudo-random number sequences.
Obtaining a three-dimensional cat mapping pseudo-random number sequence according to the three-dimensional cat mapping key, wherein the three-dimensional cat mapping pseudo-random number sequence comprises the following steps:
performing iterative operation on the three-dimensional cat mapping key for preset times to obtain the three-dimensional cat mapping pseudo-random number sequence, wherein the number of pseudo-random numbers in the three-dimensional cat mapping pseudo-random number sequence is as follows:
3 xn (M + N), where N is a preset number of times, and M, N is the number of rows and columns of the plaintext image data, respectively.
In particular, the three-dimensional cat maps a key (x)0,y0,z0) Substituting into the following equation:
Figure BDA0001758485520000071
iterating 3 times (M + N +200) times to obtain three pseudo-random number sequences with the length of 3 times (M + N +200), and respectively removing the first 192 data to eliminate adverse effects to obtain 9 times (M + N) three-dimensional cat mapping pseudo-random numbers, which are marked as X.
Wherein the content of the first and second substances,
Figure BDA0001758485520000072
called transformation matrix, a, b are two different parameters of the transformation matrix; x is the number ofi、yi、ziRespectively an abscissa and an ordinate before transformation; x is the number ofi+1、yi+1、zi+1Respectively representing the abscissa and the ordinate after the mapping action of the three-dimensional cat; mod denotes a modulo operation.
Obtaining a logic mapping pseudo-random number according to the logic mapping initial value, comprising:
according to the logic mapping pseudo-random number sequence formula: q. q.si+1=Rqi(1-qi) Generating the logical mapping pseudo-random number sequence, wherein R is a system parameter, q is a logical mapping value, and q is a logical mapping valueiIs the ith q value, qi+1For the (i + 1) th q value, the number of pseudo-random numbers in the logic mapping pseudo-random number sequence is as follows:
m × N, M, N are the number of rows and columns, respectively, of the plaintext image data.
Specifically, a logical mapping initial value q is set0Substituting into the following equation:
qi+1=Rqi(1-qi)
m N logistic pseudo-random numbers are obtained, which are denoted as K.
Wherein R and q0Respectively, system parameter and system initial value, when 3.57<R<4 and 0<qi<1, the logistic map has chaotic characteristics. The encryption algorithm sets R to 3.78, q0Is a key value.
Scrambling the plaintext image data according to the three-dimensional cat mapping pseudo-random number sequence to obtain scrambled image data, wherein the scrambling comprises the following steps:
layering the plaintext image data to obtain a plurality of bit planes;
specifically, the plaintext image data is divided into 8 layers.
Respectively performing row scrambling and column scrambling on each bit plane according to the three-dimensional cat mapping pseudo-random number sequence;
specifically, take the lowest bit plane B1And a pseudorandom number sequence X of length N1,X2,…,XNTo B1Scrambling the columns of (a); then M pseudo random numbers X are takenN+1,XN+2,…,XN+MTo B1The line scrambling is performed. Get the inferior low level plane B2And a pseudorandom number sequence X of length NM+N+1,XM+N+2,…,XM+2NTo B2Scrambling the columns of (a); then taking M pseudo random numbersXM+2N+1,XM+2N+2,…,X2M+2NTo B1The line scrambling is performed. By analogy, for other bit planes B3,B4,…,B8The rows and columns are sequentially scrambled.
Rearranging each bit plane after scrambling according to a preset rule to obtain an arranged pixel image;
specifically, B after scrambling the matrix1,B2,…,B8According to X8M+8N+1,X8M+8N+2,…,X8M+8N+8The 8 bit planes are then combined into one pixel image.
And performing line scrambling and column scrambling on the arranged pixel images according to the three-dimensional cat mapping pseudo-random number sequence to obtain scrambled image data.
Taking N pseudo-random numbers X from the pixel image8M+8N+8+1,X8M+8N+8+2,…,X8M+9N+8Scrambling columns of the pixel image; then M pseudo random numbers X are taken8M+9N+8+1,X8M+9N+8+2,…,X9M+9N+8The rows of the pixel image are scrambled.
Diffusing the scrambled image data to obtain ciphertext image data, wherein the diffusing comprises:
using a formula
Figure BDA0001758485520000081
Diffusing the scrambled image data, wherein C (i) is the ith pixel of the ciphertext C, P (i) is the ith pixel of the plaintext image P, K (i) is the ith random number of the key stream K,
Figure BDA0001758485520000082
is an integer field between 2 and M × N.
Specifically, the diffusion process includes:
the first and last pixel values of the scrambled image data are taken, denoted as P (1) and P (M N). Diffusing the scrambled image data using the following formula:
and summing the first pixel value P (1) of the scrambled image data and the first random number K (1) in the logistic pseudo-random numbers K (wherein the numerical values in the logistic pseudo-random numbers K are integers belonging to [0, 255 ]) and performing modulo 256, and performing exclusive OR with the last pixel P (M multiplied by N) of the scrambled image data to obtain the first pixel C (1) of the ciphertext C.
Further, the ith pixel P (i) of the scrambled image data, the ith random number K (i) of the logistic pseudorandom number K and the ciphertext C (i-1) at the previous position are summed and modulo 256 by adopting the following recursion formula, and then the sum is subjected to XOR with the ciphertext C (i-1) to obtain the ith pixel C (i) of the ciphertext C.
Figure BDA0001758485520000092
And i is taken from 2 to M multiplied by N, all pixels of the image are traversed, and the encryption of the whole image is completed.
Example two
The present embodiment focuses on the detailed description of the image encryption method based on plaintext according to the present invention on the basis of the above-mentioned embodiments. Specifically, referring to fig. 2, fig. 2 is a detailed flowchart of an image encryption method based on plaintext according to an embodiment of the present invention, where the method includes:
and S1, generating a pseudo-random number sequence.
S11, inputting plaintext image with size of M multiplied by N and initial value q of logistic0Generating a three-dimensional cat mapping key (x) according to a key construction method0,y0,z0);
S11a, respectively taking the pixel values of the last column and the pixel values of the last row of the plaintext, wherein the plaintext has M rows and N columns;
s11b, carrying out XOR operation on the last column (row) and the first N-1 column (the first M-1 row) in sequence to obtain a column (row) XOR value which is marked as
Figure BDA0001758485520000093
Wherein ln(hm) Representing a pixel value;
s11c, calculating inner products of L (H) according to the formula (1), wherein two inner product values are respectively expressed as Lv and Hv;
Figure BDA0001758485520000101
s11d, calculating three initial values (x) of the 3-dimensional cat mapping according to the formula (2)0,y0,z0) I.e. a key.
Figure BDA0001758485520000102
The key construction scheme based on the plaintext can effectively resist the chosen plaintext attack, namely different plaintexts have different keys, and different keys generate different pseudo-random number sequences.
S12, substituting the key into the formula (5), iterating for 3 x (M + N +200) times to obtain three pseudo-random number sequences with the length of 3 x (M + N +200), and respectively removing the first 200 data in order to eliminate adverse effects;
the arnold cat mapping expression is as follows:
Figure BDA0001758485520000103
wherein xi,yiE (0, 1). Equation (3) is generalized by introducing two new parameters a and b as follows:
Figure BDA0001758485520000104
by introducing six control parameters ax,ay,az,bx,byAnd bzEquation (4) can be extended to three-dimensional discrete chaotic maps.
Figure BDA0001758485520000105
Wherein, A is represented by the following formula,
Figure BDA0001758485520000106
when setting ax=bx=1,ay=by=2,az=bz3, det (a) can be easily verified as 1, i.e.:
Figure BDA0001758485520000111
by numerical calculation, the three characteristic values of A are σ1=25.1314,σ2=0.0215,σ31.8470. Due to the principal eigenvalues σ1Greater than 1, so equation (5) has chaotic behavior.
Substituting the initial value of locality into formula (6) to generate (M × N +200) random numbers;
the logical map (logical map) formulation is expressed as follows:
qi+1=Rqi(1-qi) (6)
wherein R and q0Respectively, system parameter and system initial value, when 3.57<R<4 and 0<qi<1, the logistic map has chaotic characteristics. The encryption algorithm sets R to 3.78, q0Is a key value.
S13, 9 × (M + N) three-dimensional cat mapping pseudo random numbers and M × N logistic pseudo random numbers are obtained, and are denoted as X and K, respectively.
And S2, scrambling.
S21, dividing the plaintext image into 8 layers;
the image is layered according to formula (7) and divided into 8 bit planes, the data of the bit planes consists of 0 or 1, and formula (7) is as follows:
P(x,y)=b(7)×27+b(6)×26+...+b(0)×20(7)
and S22, bit position scrambling. Taking the lowest bit plane B1And a pseudorandom number sequence X of length N1,X2,…,XNTo B1Scrambling the columns of (a); then M pseudo random numbers X are takenN+1,XN+2,…,XN+MTo B1The line scrambling is performed. Get the inferior low level plane B2And a pseudorandom number sequence X of length NM+N+1,XM+N+2,…,XM+2NTo B2Scrambling the columns of (a); then M pseudo random numbers X are takenM+2N+1,XM+2N+2,…,X2M+2NTo B1The line scrambling is performed. By analogy, for other bit planes B3,B4,…,B8The rows and columns are sequentially scrambled. And will not be described in detail herein.
And S23, bit plane scrambling. B after the array is scrambled1,B2,…,B8Rearranging, and then synthesizing 8 bit planes into a pixel image;
and S24, pixel position scrambling. The pixel image is obtained by processing in step S22 and step S23, and N pseudo random numbers X are taken8M+8N+1,X8M+8N+2,…,X8M+9NScrambling columns of the pixel image; then M pseudo random numbers X are taken8M+9N+1,X8M+9N+2,…,X9M+9NThe rows of the pixel image are scrambled.
And S3, diffusion.
S31, the first and last pixel values of the scrambled image are taken and denoted as P (1) and P (M × N). The diffusion process is as follows:
Figure BDA0001758485520000121
Figure BDA0001758485520000122
formula (8) is to sum and modulo 256 the first pixel P (1) in the plaintext image P and the first random number K (1) in the key stream K (where the values in the key stream K are all integers belonging to [0, 255 ]), and then xor with the last pixel P (M × N) in the plaintext image P to obtain the first pixel C (1) of the ciphertext C. Formula (9) is a recurrence formula, i (i) th pixel P (i) in the plaintext image P, i (i) th random number K (i) in the key stream K and ciphertext C (i-1) at a previous position are summed and modulo 256, and then exclusive-or performed with C (i-1) to obtain i (i) th pixel C (i) of the ciphertext C. And i is taken from 2 to M multiplied by N, all pixels of the image are traversed, and the encryption of the whole image is completed.
And S32, outputting the ciphertext.
The reverse operation of the encryption scheme is the decryption scheme.
The theoretical effect of the invention can be further illustrated by the following theoretical analysis and simulation experiments:
1. the safety analysis of the invention:
1) key space
Key space is a criterion to gauge whether a cryptographic system is superior. The key space of the encryption algorithm is 1012×1012×1012×1012=1048Because of the secret key (x)0,y0,z0,q0) All have 12 decimal places. The key space of the cryptographic system is sufficient to resist exhaustive attacks.
2) Key sensitivity
A good quality encryption algorithm is extremely sensitive to key changes. A slight change in the key can result in a large change in the ciphertext image. Therefore, the difference of our usage is only 1/1048The two groups of Key values are tested, the Key values are respectively Key1(0.023375003456, 0.977158907167, 0.645123789455, 0.457895612345) and key2(0.023375003456, 0.977158907167, 0.645123789455, 0.457895612346). The encryption key sensitivity analysis test results are shown in fig. 3(a) -3 (c). FIG. 3(a) shows a plaintext image, and FIG. 3(b) shows a plaintext image using Key1The ciphertext graph obtained by encryption, FIG. 3(c) is a graph obtained by using key2And encrypting the obtained ciphertext graph. The difference between fig. 3(b) and fig. 3(c) was 99.52%. The decryption key sensitivity analysis test results are shown in fig. 4(a) -4 (c). FIG. 4(a) shows Key for representation1The ciphertext graph obtained by encryption, FIG. 4(b) is a graph obtained by using Key1The resulting decrypted image, FIG. 4(c) is by key2The resulting decrypted image. The difference ratio between fig. 4(b) and fig. 4(c) was 99.5%. Test proves that the encryption and decryption are performedThe program has key sensitivity.
3) Histogram and correlation analysis
Fig. 5(a) is a histogram of an original plain text image, and as shown in fig. 5(a), the distribution of the gradation values is extremely nonuniform. Peaks and valleys are obvious and such histograms reveal a lot of information about the plaintext. Fig. 5(b) is a histogram of a ciphertext image corresponding to a plaintext. Obviously, the histogram distribution of its ciphertext image is sufficiently consistent. The experiment proves that the encryption method can effectively resist statistical attack and ciphertext-only attack.
4) Entropy of information
The entropy of information is an important feature of randomness. The entropy h(s) of the source s can be calculated by the following formula:
Figure BDA0001758485520000131
wherein, P(s)i) Denotes siThe probability of (c). The pixel values of the gray image belong to
Figure BDA0001758485520000141
And 2N-1 ═ 255. Ideally, siEqual in probability and entropy h(s) 8. The closer the information entropy is to 8, the stronger the randomness. The information entropy of the plaintext image is 7.2184, and the information entropy thereof is 7.9993 after encryption. This data confirms that the encryption algorithm can resist information entropy attacks.
5) Differential analysis
The attacker can obtain favorable information by changing some pixels in the plaintext, and the attack method is differential attack. Two criteria measure whether an encryption algorithm can resist differential attacks, namely, the pixel change rate (NPCR) and the average change strength (UACI). The NPCR value for a good quality encryption algorithm should be close to 100% and the UACI value should exceed 30%. The calculation formula for NPCR and UACI is as follows:
Figure BDA0001758485520000142
Figure BDA0001758485520000143
wherein, C1(i, j) and C2(i, j) are the gray values of the two images, if C1(i,j)≠C2(i, j), D (i, j) is 1, otherwise D (i, j) is 0. Table 1 shows that both NPCR and UACI values exceed 99% and 33%. Table 1 demonstrates that small changes in the plaintext image result in large changes in the ciphertext image, i.e., the encryption algorithm has a very strong avalanche effect to resist differential attacks.
TABLE 1 NPCR and UACI values for different images
Figure BDA0001758485520000144
2. Simulation experiment example:
the validity of the encryption algorithm was verified by encrypting an image "camera" of 256 × 256 and an image "baboon" of 512 × 512, respectively. Fig. 6(a) -6(f) are graphs showing results of simulation experiments for the image "camera", and fig. 7(a) -7(f) are graphs showing results of simulation experiments for the image "baboon". Where fig. 6(a) is a plaintext image "camera", 6(b) is a scrambled image, 6(c) is a final ciphertext image, and 6(d), 6(e), and 6(f) are grayscale histograms of 6(a), 6(b), and 6(c), respectively. Fig. 7(a) is a plaintext image "babon", 7(b) is an image obtained by scrambling, 7(c) is a final ciphertext image, and 7(d), 7(e), and 7(f) are grayscale histograms of 7(a), 7(b), and 7(c), respectively. When the gray level histogram is more uniform, the better the encryption effect of the ciphertext image is proved to be, and the higher the security of the encryption algorithm is. As can be seen from fig. 6(f) and 7(f), the encryption algorithm has extremely high security and can effectively encrypt images.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (5)

1. A plaintext-based image encryption method, comprising:
constructing a three-dimensional cat mapping key based on the plaintext image data and the initial logical mapping value, including,
carrying out XOR operation on the last column of pixel values of the plaintext image data and the first N-1 columns of pixel values in sequence to obtain a column of XOR values, and marking the XOR values as
Figure FDA0002181494660000011
Wherein lnRepresenting pixel values, N being the number of columns of the plaintext image data;
carrying out XOR operation on the last line of pixel values of the plaintext image data and the first M-1 lines of pixel values in sequence to obtain a line of XOR values, and marking the line of XOR values as
Figure FDA0002181494660000012
Wherein h ismRepresenting pixel values, M being the number of lines of said plaintext image data;
according to the formula Lv ═ L · LT=l1 2+l2 2+...+lN 2Calculating to obtain an inner product value Lv, wherein LTRepresents L transpose;
HH according to the formulaT=h1 2+h2 2+...+hM 2Calculating to obtain an inner product value Hv, wherein HTRepresents H transpose;
calculating the three-dimensional cat mapping key according to the following formula:
Figure FDA0002181494660000013
wherein mod represents a modulo operation; x is the number of0,y0,z0Mapping a key for the three-dimensional cat;
obtaining a three-dimensional cat mapping pseudo-random number sequence according to the three-dimensional cat mapping key, and obtaining a logic mapping pseudo-random number sequence according to the logic mapping initial value;
scrambling the plaintext image data according to the three-dimensional cat mapping pseudo-random number sequence to obtain scrambled image data;
and diffusing the scrambled image data according to the logic mapping pseudo-random number sequence to obtain ciphertext image data.
2. The plaintext-based image encryption method of claim 1, wherein obtaining a three-dimensional cat mapping pseudo-random number sequence from the three-dimensional cat mapping key comprises:
performing iterative operation on the three-dimensional cat mapping key for preset times to obtain the three-dimensional cat mapping pseudo-random number sequence, wherein the number of pseudo-random numbers in the three-dimensional cat mapping pseudo-random number sequence is as follows:
3 xn (M + N), where N is a preset number of times, and M, N is the number of rows and columns of the plaintext image data, respectively.
3. The plaintext-based image encryption method as claimed in claim 1, wherein obtaining a sequence of logical mapping pseudo-random numbers from the logical mapping initial value comprises:
according to a logic mapping pseudo-random number sequence formula: q. q.si+1=Rqi(1-qi) Generating the logical mapping pseudo-random number sequence, wherein R is a system parameter, q is a logical mapping value, and q is a logical mapping valueiIs the ith q value, qi+1For the (i + 1) th q value, the number of pseudo-random numbers in the logic mapping pseudo-random number sequence is as follows:
m × N, M, N are the number of rows and columns, respectively, of the plaintext image data.
4. The plaintext-based image encryption method of claim 1, wherein scrambling the plaintext image data according to the three-dimensional cat mapping pseudorandom number sequence comprises:
layering the plaintext image data to obtain a plurality of bit planes;
respectively performing row scrambling and column scrambling on each bit plane according to the three-dimensional cat mapping pseudo-random number sequence;
rearranging each bit plane after scrambling according to a preset rule to obtain an arranged pixel image;
and performing line scrambling and column scrambling on the arranged pixel images according to the three-dimensional cat mapping pseudo-random number sequence to obtain scrambled image data.
5. The plaintext-based image encryption method of claim 1, wherein diffusing the scrambled image data according to the sequence of logical mapping pseudo-random numbers comprises:
using a formula
Figure FDA0002181494660000021
Diffusing the scrambled image data, wherein C (i) is the ith pixel of the ciphertext C, P (i) is the ith pixel of the plaintext image P, K (i) is the ith random number in the logically mapped pseudo-random number sequence K,
Figure FDA0002181494660000031
is an integer field between 2 and M × N.
CN201810897213.7A 2018-08-08 2018-08-08 Image encryption method based on plaintext Active CN109361830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810897213.7A CN109361830B (en) 2018-08-08 2018-08-08 Image encryption method based on plaintext

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810897213.7A CN109361830B (en) 2018-08-08 2018-08-08 Image encryption method based on plaintext

Publications (2)

Publication Number Publication Date
CN109361830A CN109361830A (en) 2019-02-19
CN109361830B true CN109361830B (en) 2020-02-14

Family

ID=65349847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810897213.7A Active CN109361830B (en) 2018-08-08 2018-08-08 Image encryption method based on plaintext

Country Status (1)

Country Link
CN (1) CN109361830B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110046521B (en) * 2019-04-24 2023-04-18 成都派沃特科技股份有限公司 Decentralized privacy protection method
CN112636895A (en) * 2020-09-07 2021-04-09 长沙理工大学 Image encryption and decryption method and image encryption and decryption system
CN114285560B (en) * 2021-12-27 2024-03-29 安徽华云安科技有限公司 Data processing method, device, electronic equipment and computer readable storage medium
CN116684535B (en) * 2023-06-08 2024-02-27 燕山大学 Novel image encryption algorithm based on delayed chaotic synchronization update logic Boolean network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007264147A (en) * 2006-03-27 2007-10-11 Fukuoka Institute Of Technology Pseudo random number sequence generating device, encryption and decryption device, pseudo random number sequence generating method, encryption and decryption method, pseudo random number sequence generating program, and encryption and decryption program
CN101739695B (en) * 2009-11-26 2011-09-14 西北工业大学 Three-dimensional Arnold mapping-based image grouping encryption method
CN106228504B (en) * 2016-07-17 2019-04-23 西安电子科技大学 Digital image encryption method based on plaintext and key structure encryption parameter
CN108133445A (en) * 2016-12-01 2018-06-08 钦州市晶通科技有限公司 A kind of image encryption method for spreading mapping scramble and being combined with chaos system

Also Published As

Publication number Publication date
CN109361830A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
Lu et al. An efficient image encryption scheme based on the LSS chaotic map and single S-box
Xian et al. Double parameters fractal sorting matrix and its application in image encryption
CN110086601B (en) Joseph traversal and hyperchaotic system image encryption method based on pixel value association
CN109361830B (en) Image encryption method based on plaintext
Rohith et al. Image encryption and decryption using chaotic key sequence generated by sequence of logistic map and sequence of states of Linear Feedback Shift Register
CN107330338B (en) Color image encryption and decryption method and system based on double-chaos cross diffusion
CN102196320A (en) Image encrypting and decrypting system
CN112199690A (en) Image encryption method for synchronously realizing fractional order complex system based on mixed time lag
CN109803063A (en) A kind of image encryption method based on five dimension ultra-chaos systems
Ni et al. A novel image encryption algorithm based on bit-level improved Arnold transform and hyper chaotic map
CN113556223A (en) Image encryption method based on fractional order drive response system finite time synchronization
Kanwal et al. Analytic study of a novel color image encryption method based on the chaos system and color codes
Fang et al. A secure chaotic block image encryption algorithm using generative adversarial networks and DNA sequence coding
Huang et al. Duple color image encryption system based on 3D non-equilateral Arnold transform for IIoT
Choi et al. Color image encryption based on PC-MLCA and 3-D chaotic cat map
Das et al. Diffusion and encryption of digital image using genetic algorithm
CN113300827A (en) Latin square-based chaotic image encryption method
Budiman et al. A Combination of Block-Based Chaos with Dynamic Iteration Pattern and Stream Cipher for Color Image Encryption.
Debbarma et al. 2D Chaos based color image encryption using pseudorandom key generation
Mohammed et al. Secure image encryption scheme using chaotic maps and rc4 algorithm
Kaur et al. A review of image encryption schemes based on the chaotic map
CN113992811A (en) Image encryption method based on novel three-dimensional fractional order discrete chaotic mapping
Nasir et al. High security nested PWLCM chaotic map bit-level permutation based image encryption
Hassan et al. Henon chaotic map-based image encryption scheme using bit-level circular shift
CN111737712B (en) Color image encryption method based on three-dimensional dynamic integer tent mapping

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant