Image encryption storage method and system based on big data

文档序号:1908441 发布日期:2021-11-30 浏览:13次 中文

阅读说明:本技术 一种基于大数据的图像加密存储方法及系统 (Image encryption storage method and system based on big data ) 是由 干怡树 于 2021-09-06 设计创作,主要内容包括:本发明提供一种基于大数据的图像加密存储方法及系统,首先,利用外部密钥和明文信息产生初始值,并通过迭代混沌映射产生密钥流。其次,对明文图像进行分解,对每个分量依次进行层内置乱和层间置乱。最后,经过执行扩散操作获得密文图像。本发明不仅具有良好的加密效果,能够有效抵抗裁剪攻击,而且与同类型的加密算法相比,本发明具有更高的加密效率和更强的安全性。(The invention provides an image encryption storage method and system based on big data. And decomposing the plaintext image, and sequentially performing intra-layer scrambling and inter-layer scrambling on each component. And finally, performing diffusion operation to obtain a ciphertext image. The invention not only has good encryption effect and can effectively resist cutting attack, but also has higher encryption efficiency and stronger safety compared with the encryption algorithm of the same type.)

1. An image encryption storage method based on big data is characterized by comprising the following steps:

acquiring a plaintext image to be encrypted, performing RGB decomposition on the plaintext image to be encrypted according to the size of the image, and decomposing the plaintext image to be encrypted into R subimages, G subimages and B subimages with the same size;

acquiring an initial value of a two-dimensional coupled chaotic mapping equation, inputting the initial value into the two-dimensional coupled chaotic mapping equation for iteration, and acquiring a first chaotic sequence x and a second chaotic sequence y; the lengths of the first chaotic sequence x and the second chaotic sequence y are the same as the image size of the plaintext image to be encrypted;

equally dividing the first chaotic sequence x into 3 first chaotic subsequences, and equally dividing the second chaotic sequence y into 3 second chaotic subsequences;

quantizing the 3 first chaotic subsequences to obtain 3 interlayer interactive scrambling control sequences;

arranging the 3 second chaotic subsequences according to an ascending order to obtain 3 random index sequences for interlayer interaction scrambling;

acquiring partial elements in the second chaotic sequence y, and arranging the partial elements according to an ascending order to acquire 3 index sequences for in-layer scrambling;

preprocessing the R sub-image to obtain a one-dimensional sequence R1 with the length same as the size of the R sub-image, preprocessing the G sub-image to obtain a one-dimensional sequence G1 with the length same as the size of the G sub-image, preprocessing the B sub-image to obtain a one-dimensional sequence B1 with the length same as the size of the B sub-image;

performing in-layer scrambling on the one-dimensional sequence R1, the one-dimensional sequence G1 and the one-dimensional sequence B1 by using the generated 3 index sequences to obtain scrambled sequences R2, G2 and B2;

quantizing the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X;

accumulating all pixels in a plaintext image to be encrypted, and taking the remainder of the accumulation result to obtain a corresponding diffusion parameter D;

carrying out double random position interlayer interactive scrambling on 3 sequences R2, G2 and B2 obtained after the interlayer scrambling, and obtaining a combined sequence L1 according to the scrambled sequences R2, G2 and B2;

and obtaining an encrypted sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combined sequence L1, equally dividing the encrypted sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

2. The image encryption storage method based on big data according to claim 1, wherein the two-dimensional coupled chaotic mapping equation is as follows:

in the formula, theta is a control parameter, theta belongs to [0, 1], and i is a natural number.

3. The image encryption storage method based on big data according to claim 2, wherein the process of obtaining the initial value of the two-dimensional coupled chaotic mapping equation comprises:

decomposing a plaintext image to be encrypted into an R subgraph component, a G subgraph component and a B subgraph component;

accumulating the R, G, and B sub-graph components to obtain a (mod (sum (i), 256);

the accumulated sum a is left to obtain a1、a2、a3And according to a, a1、a2、a3Obtaining an intermediate parameter A1、A2、A3The method comprises the following steps:

in the formula (I), the compound is shown in the specification,represents exclusive or, mod (x, y) represents a remainder;

in the formula, t1And t2Is an external key; x is the number of0And y0Is the initial value of the two-dimensional coupled chaotic mapping equation.

4. The big data-based image encryption storage method according to claim 1, wherein the process of equally dividing the first chaotic sequence x into 3 first chaotic subsequences and equally dividing the second chaotic sequence y into 3 second chaotic subsequences comprises:

in the formula, the image size of the plaintext image is m × n × 3, and the image sizes of the R sub-image, the G sub-image, and the B sub-image are m × n.

5. The image encryption storage method based on big data according to claim 1, wherein the process of quantizing the 3 first chaotic sub-sequences and obtaining the 3 inter-layer cross scrambling control sequences comprises:

in the formula, floor represents rounding down; k is a radical of1、k2、k3Indicating a control sequence.

6. The image encryption storage method based on big data according to claim 1, wherein the process of arranging the 3 second chaotic subsequences in ascending order and obtaining 3 random index sequences for inter-layer interaction scrambling comprises:

where sort denotes the rank, p1、p2、p3Indicating a control sequence.

7. The image encryption storage method based on big data according to claim 1, wherein partial elements in the second chaotic sequence y are obtained and arranged in ascending order, and the process of obtaining 3 index sequences for intra-layer scrambling comprises:

where sort denotes the rank, c1、c2、c3Representing a random index sequence.

8. The big-data-based image encryption storage method according to claim 1, wherein the process of obtaining the encrypted sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combination sequence L1, equally dividing the encrypted sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain the encrypted ciphertext image comprises:

quantizing the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X, which comprises the following steps:

X=floor(mod((x+y)×1015,256);

accumulating all pixels in a plaintext image to be encrypted, and taking the remainder of an accumulation result to obtain a corresponding diffusion parameter D, wherein the method comprises the following steps: d ═ mod (sum (i), 256);

when i ∈ [2, 3mn ], the remaining pixels are encrypted, i.e.:

the encrypted sequence L2 is equally divided into 3 subsequences R3, G3 and B3, and a two-dimensional matrix is reconstructed from the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

9. The big data based image encryption storage method according to claim 1 or 8, wherein the method further comprises: and acquiring the encrypted ciphertext image, and storing the acquired encrypted ciphertext image into a preset memory.

10. An image encryption storage system based on big data is characterized by comprising:

the image acquisition module is used for acquiring a plaintext image to be encrypted, carrying out RGB decomposition on the plaintext image to be encrypted according to the size of the image, and decomposing the plaintext image to be encrypted into R subimages, G subimages and B subimages with the same size;

the iteration module is used for acquiring an initial value of a two-dimensional coupled chaotic mapping equation, inputting the initial value into the two-dimensional coupled chaotic mapping equation for iteration, and acquiring a first chaotic sequence x and a second chaotic sequence y; the lengths of the first chaotic sequence x and the second chaotic sequence y are the same as the image size of the plaintext image to be encrypted;

the chaotic sequence equally dividing module is used for equally dividing the first chaotic sequence x into 3 first chaotic subsequences and equally dividing the second chaotic sequence y into 3 second chaotic subsequences;

the first quantization module is used for quantizing the 3 first chaotic subsequences to obtain 3 interlayer interactive scrambling control sequences;

the first index module is used for arranging the 3 second chaotic subsequences according to an ascending order to obtain 3 random index sequences used for interlayer interaction scrambling;

the second indexing module is used for acquiring partial elements in the second chaotic sequence y, and arranging the partial elements according to an ascending order to acquire 3 indexing sequences for in-layer scrambling;

the preprocessing module is used for preprocessing the R sub-image, acquiring a one-dimensional sequence R1 with the length being the same as the size of the R sub-image, preprocessing the G sub-image, acquiring a one-dimensional sequence G1 with the length being the same as the size of the G sub-image, preprocessing the B sub-image, and acquiring a one-dimensional sequence B1 with the length being the same as the size of the B sub-image;

the in-layer scrambling module is used for performing in-layer scrambling on the one-dimensional sequence R1, the one-dimensional sequence G1 and the one-dimensional sequence B1 by using the generated 3 index sequences to obtain scrambled sequences R2, G2 and B2;

the second quantization module is used for quantizing the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X;

the accumulation and remainder taking module is used for accumulating all pixels in the plaintext image to be encrypted and obtaining a corresponding diffusion parameter D by taking the remainder of an accumulation result;

the combined module is used for carrying out double random position interlayer interactive scrambling on 3 sequences R2, G2 and B2 obtained after the interlayer scrambling, and obtaining a combined sequence L1 according to the scrambled sequences R2, G2 and B2;

and the encryption module is used for obtaining an encryption sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combination sequence L1, equally dividing the encryption sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

Technical Field

The invention relates to the technical field of image processing, in particular to an image encryption storage method and system based on big data.

Background

With the rapid development of internet technology, information security is increasingly emphasized. Digital images are the carriers of most information, so that the research on image encryption technology is of great significance. The optical multi-image asymmetric encryption technology is widely researched due to the characteristics of large encryption capacity, high speed, high safety and the like. Although the multi-image encryption technology can encrypt more information at the same time, the encrypted information also needs more transmission bandwidth.

The prior art CN107392971A discloses an image encryption effect evaluation method based on gap detection, which comprises reading an encrypted image file, and obtaining a one-dimensional image data vector by block scanning; uniformly quantizing the grade of an element value in the one-dimensional image data, and converting the element value into a one-dimensional vector; binarizing element values in the one-dimensional vector to obtain a binarized vector; regarding 0 in the binary vector as a gap between 1, calculating a gap observation probability, and obtaining an observation probability vector according to ascending arrangement of the gap length j; calculating prior probabilities of gaps with different lengths in an ideal randomly distributed binary vector, and obtaining prior probability vectors according to ascending arrangement of the gap lengths j; and calculating the chi-square distance between the observation probability vector and the prior probability vector to serve as a quantized image encryption effect evaluation result, and finishing image encryption effect evaluation based on gap detection. However, the prior art has certain limitations and cannot meet the requirements of image encryption researchers for subjective and objective evaluation of the quality of the encryption scheme.

Disclosure of Invention

In view of the above-mentioned shortcomings of the prior art, the present invention aims to provide a method and a system for encrypting and storing images based on big data, which are used for solving the problems existing in the prior art when images are encrypted.

In order to achieve the above objects and other related objects, the present invention provides a big data based image encryption storage method, including the steps of:

acquiring a plaintext image to be encrypted, performing RGB decomposition on the plaintext image to be encrypted according to the size of the image, and decomposing the plaintext image to be encrypted into R subimages, G subimages and B subimages with the same size;

acquiring an initial value of a two-dimensional coupled chaotic mapping equation, inputting the initial value into the two-dimensional coupled chaotic mapping equation for iteration, and acquiring a first chaotic sequence x and a second chaotic sequence y; the lengths of the first chaotic sequence x and the second chaotic sequence y are the same as the image size of the plaintext image to be encrypted;

equally dividing the first chaotic sequence x into 3 first chaotic subsequences, and equally dividing the second chaotic sequence y into 3 second chaotic subsequences;

quantizing the 3 first chaotic subsequences to obtain 3 interlayer interactive scrambling control sequences;

arranging the 3 second chaotic subsequences according to an ascending order to obtain 3 random index sequences for interlayer interaction scrambling;

acquiring partial elements in the second chaotic sequence y, and arranging the partial elements according to an ascending order to acquire 3 index sequences for in-layer scrambling;

preprocessing the R sub-image to obtain a one-dimensional sequence R1 with the length same as the size of the R sub-image, preprocessing the G sub-image to obtain a one-dimensional sequence G1 with the length same as the size of the G sub-image, preprocessing the B sub-image to obtain a one-dimensional sequence B1 with the length same as the size of the B sub-image;

performing in-layer scrambling on the one-dimensional sequence R1, the one-dimensional sequence G1 and the one-dimensional sequence B1 by using the generated 3 index sequences to obtain scrambled sequences R2, G2 and B2;

quantizing the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X;

accumulating all pixels in a plaintext image to be encrypted, and taking the remainder of the accumulation result to obtain a corresponding diffusion parameter D;

carrying out double random position interlayer interactive scrambling on 3 sequences R2, G2 and B2 obtained after the interlayer scrambling, and obtaining a combined sequence L1 according to the scrambled sequences R2, G2 and B2;

and obtaining an encrypted sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combined sequence L1, equally dividing the encrypted sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

Optionally, the two-dimensional coupled chaotic mapping equation is:

in the formula, theta is a control parameter, theta belongs to [0, 1], and i is a natural number.

Optionally, the process of obtaining the initial value of the two-dimensional coupled chaotic mapping equation includes:

decomposing a plaintext image to be encrypted into an R subgraph component, a G subgraph component and a B subgraph component;

accumulating the R, G, and B sub-graph components to obtain a (mod (sum (i), 256);

the accumulated sum a is left to obtain a1、a2、a3And according to a, a1、a2、a3Obtaining an intermediate parameter A1、A2、A3The method comprises the following steps:

in the formula (I), the compound is shown in the specification,represents exclusive or, mod (x, y) represents a remainder;

in the formula, t1And t2Is an external key; x is the number of0And y0Is the initial value of the two-dimensional coupled chaotic mapping equation.

Optionally, the process of equally dividing the first chaotic sequence x into 3 first chaotic subsequences and equally dividing the second chaotic sequence y into 3 second chaotic subsequences includes:

in the formula, the image size of the plaintext image is m × n × 3, and the image sizes of the R sub-image, the G sub-image, and the B sub-image are m × n.

Optionally, the process of quantizing the 3 first chaotic subsequences to obtain 3 inter-layer interactive scrambling control sequences includes:

in the formula, floor represents rounding down; k is a radical of1、k2、k3Indicating a control sequence.

Optionally, the process of arranging the 3 second chaotic subsequences in an ascending order to obtain 3 random index sequences for inter-layer scrambling includes:

where sort denotes the rank, p1、p2、p3Indicating a control sequence.

Optionally, the obtaining of partial elements in the second chaotic sequence y and the sorting according to an ascending order, and the obtaining of the 3 index sequences for intra-layer scrambling includes:

where sort denotes the rank, c1、c2、c3Representing a random index sequence.

Optionally, the process of obtaining the encrypted sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combination sequence L1, equally dividing the encrypted sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image includes:

quantizing the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X, which comprises the following steps:

X=floor(mod((x+y)×1015,256);

accumulating all pixels in a plaintext image to be encrypted, and taking the remainder of an accumulation result to obtain a corresponding diffusion parameter D, wherein the method comprises the following steps: d ═ mod (sum (i), 256);

when i ∈ [2, 3mn ], the remaining pixels are encrypted, i.e.:

the encrypted sequence L2 is equally divided into 3 subsequences R3, G3 and B3, and a two-dimensional matrix is reconstructed from the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

Optionally, the method further comprises: and acquiring the encrypted ciphertext image, and storing the acquired encrypted ciphertext image into a preset memory.

The invention also provides an image encryption storage system based on big data, which comprises:

the image acquisition module is used for acquiring a plaintext image to be encrypted, carrying out RGB decomposition on the plaintext image to be encrypted according to the size of the image, and decomposing the plaintext image to be encrypted into R subimages, G subimages and B subimages with the same size;

the iteration module is used for acquiring an initial value of a two-dimensional coupled chaotic mapping equation, inputting the initial value into the two-dimensional coupled chaotic mapping equation for iteration, and acquiring a first chaotic sequence x and a second chaotic sequence y; the lengths of the first chaotic sequence x and the second chaotic sequence y are the same as the image size of the plaintext image to be encrypted;

the chaotic sequence equally dividing module is used for equally dividing the first chaotic sequence x into 3 first chaotic subsequences and equally dividing the second chaotic sequence y into 3 second chaotic subsequences;

the first quantization module is used for quantizing the 3 first chaotic subsequences to obtain 3 interlayer interactive scrambling control sequences;

the first index module is used for arranging the 3 second chaotic subsequences according to an ascending order to obtain 3 random index sequences used for interlayer interaction scrambling;

the second indexing module is used for acquiring partial elements in the second chaotic sequence y, and arranging the partial elements according to an ascending order to acquire 3 indexing sequences for in-layer scrambling;

the preprocessing module is used for preprocessing the R sub-image, acquiring a one-dimensional sequence R1 with the length being the same as the size of the R sub-image, preprocessing the G sub-image, acquiring a one-dimensional sequence G1 with the length being the same as the size of the G sub-image, preprocessing the B sub-image, and acquiring a one-dimensional sequence B1 with the length being the same as the size of the B sub-image;

the in-layer scrambling module is used for performing in-layer scrambling on the one-dimensional sequence R1, the one-dimensional sequence G1 and the one-dimensional sequence B1 by using the generated 3 index sequences to obtain scrambled sequences R2, G2 and B2;

the second quantization module is used for quantizing the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X;

the accumulation and remainder taking module is used for accumulating all pixels in the plaintext image to be encrypted and obtaining a corresponding diffusion parameter D by taking the remainder of an accumulation result;

the combined module is used for carrying out double random position interlayer interactive scrambling on 3 sequences R2, G2 and B2 obtained after the interlayer scrambling, and obtaining a combined sequence L1 according to the scrambled sequences R2, G2 and B2;

and the encryption module is used for obtaining an encryption sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combination sequence L1, equally dividing the encryption sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

As described above, the present invention provides an image encryption storage method and system based on big data, which has the following beneficial effects:

the invention provides a novel color image encryption algorithm based on coupled chaotic mapping according to the characteristic of strong correlation among three components of a color image. Firstly, an initial value is generated by using an external secret key and plaintext information, and a key stream is generated through iterative chaotic mapping. And decomposing the plaintext image, and sequentially performing intra-layer scrambling and inter-layer scrambling on each component. And finally, performing diffusion operation to obtain a ciphertext image. The invention not only has good encryption effect and can effectively resist cutting attack, but also has higher encryption efficiency and stronger safety compared with the encryption algorithm of the same type.

Drawings

FIG. 1 is a schematic flowchart of an image encryption storage method based on big data according to an embodiment;

FIG. 2 is a schematic diagram of an embodiment of pretreatment;

FIG. 3 is a diagram illustrating packet ordering scrambling according to an embodiment;

FIG. 4 is a schematic diagram illustrating an inter-layer scrambling process according to an embodiment;

FIG. 5 is a diagram illustrating inter-layer scrambling results according to an embodiment;

fig. 6 is a schematic hardware structure diagram of an image encryption storage system based on big data according to an embodiment.

Detailed Description

The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.

It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.

Referring to fig. 1 to 5, the present invention provides an image encryption storage method based on big data, including the following steps:

s110, acquiring a plaintext image to be encrypted, performing RGB decomposition on the plaintext image to be encrypted according to the size of the image, and decomposing the plaintext image to be encrypted into R sub-images, G sub-images and B sub-images with the same size;

s120, obtaining an initial value of a two-dimensional coupled chaotic mapping equation, inputting the initial value into the two-dimensional coupled chaotic mapping equation for iteration, and obtaining a first chaotic sequence x and a second chaotic sequence y; the lengths of the first chaotic sequence x and the second chaotic sequence y are the same as the image size of the plaintext image to be encrypted;

s130, equally dividing the first chaotic sequence x into 3 first chaotic subsequences, and equally dividing the second chaotic sequence y into 3 second chaotic subsequences;

s140, quantizing the 3 first chaotic subsequences to obtain 3 interlayer interactive scrambling control sequences;

s150, arranging the 3 second chaotic subsequences according to an ascending order to obtain 3 random index sequences for interlayer interaction scrambling;

s160, acquiring partial elements in the second chaotic sequence y, and arranging the partial elements according to an ascending order to acquire 3 index sequences for in-layer scrambling;

s170, preprocessing the R sub-image to obtain a one-dimensional sequence R1 with the length same as the size of the R sub-image, preprocessing the G sub-image to obtain a one-dimensional sequence G1 with the length same as the size of the G sub-image, preprocessing the B sub-image to obtain a one-dimensional sequence B1 with the length same as the size of the B sub-image;

s180, performing in-layer scrambling on the one-dimensional sequence R1, the one-dimensional sequence G1 and the one-dimensional sequence B1 by using the generated 3 index sequences to obtain scrambled sequences R2, G2 and B2;

s190, quantizing the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X;

s200, accumulating all pixels in a plaintext image to be encrypted, and taking the remainder of an accumulation result to obtain a corresponding diffusion parameter D;

s210, performing double random position interlayer interactive scrambling on 3 sequences R2, G2 and B2 obtained after the in-layer scrambling, and obtaining a combined sequence L1 according to the scrambled sequences R2, G2 and B2;

s220, obtaining an encrypted sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combination sequence L1, equally dividing the encrypted sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

According to the record, the method provides a novel color image encryption algorithm based on the coupled chaotic mapping according to the characteristic that three components of the color image have strong correlation. Firstly, an initial value is generated by using an external secret key and plaintext information, and a key stream is generated through iterative chaotic mapping. And decomposing the plaintext image, and sequentially performing intra-layer scrambling and inter-layer scrambling on each component. And finally, performing diffusion operation to obtain a ciphertext image. The method has good encryption effect, can effectively resist cutting attack, and has higher encryption efficiency and stronger safety compared with the encryption algorithm of the same type.

In an exemplary embodiment, the two-dimensional coupled chaotic mapping equation is:

in the formula, theta is a control parameter, theta belongs to [0, 1], and i is a natural number.

Specifically, the process of obtaining the initial value of the two-dimensional coupled chaotic mapping equation includes:

decomposing a plaintext image to be encrypted into an R subgraph component, a G subgraph component and a B subgraph component;

accumulating the R, G, and B sub-graph components to obtain a (mod (sum (i), 256);

the accumulated sum a is left to obtain a1、a2、a3And according to a, a1、a2、a3Obtaining an intermediate parameter A1、A2、A3The method comprises the following steps:

in the formula (I), the compound is shown in the specification,represents exclusive or, mod (x, y) represents a remainder;

in the formula, t1And t2Is an external key; x is the number of0And y0Is the initial value of the two-dimensional coupled chaotic mapping equation.

Further, the process of equally dividing the first chaotic sequence x into 3 first chaotic subsequences and equally dividing the second chaotic sequence y into 3 second chaotic subsequences includes:

in the formula, the image size of the plaintext image is m × n × 3, and the image sizes of the R sub-image, the G sub-image, and the B sub-image are m × n. In this embodiment, the initial values x0 and y0 are substituted into the two-dimensional coupled chaotic mapping equation to iterate m × n × 3+500 times, and in order to avoid transient effects, the previous 500 values are discarded to obtain a first chaotic sequence x and a second chaotic sequence y, where the lengths of the first chaotic sequence x and the second chaotic sequence y are both m × n × 3.

Further, the process of quantizing the 3 first chaotic subsequences to obtain 3 inter-layer cross scrambling control sequences includes:

in the formula, floor represents rounding down; k is a radical of1、k2、k3Indicating a control sequence. Control sequence k1、k2、k3The values of (A) are all 1 or 2, and the length is m multiplied by n.

Further, the process of arranging the 3 second chaotic subsequences in an ascending order to obtain 3 random index sequences for interlayer interaction scrambling includes:

where sort denotes the rank, p1、p2、p3Indicating a control sequence.

Further, acquiring partial elements in the second chaotic sequence y, and arranging the partial elements in an ascending order, wherein the process of acquiring 3 index sequences for in-layer scrambling includes:

where sort denotes the rank, c1、c2、c3Representing a random index sequence.

In addition, preprocessing is performed on the R sub-image, the G sub-image and the B sub-image, wherein a schematic diagram of the preprocessing is shown in fig. 2. And sequentially taking out all pixels on the outermost circle in a clockwise direction to be used as a first subsequence, and sequentially taking out all pixels on the next outermost circle in a counterclockwise direction to be used as a second subsequence. The same preprocessing operation is performed from the outer to the inner circle of the image in an alternating clockwise and counterclockwise manner until all pixels of the innermost circle are fetched. And connecting the sequence numbers of each subsequence in a descending order to obtain a one-dimensional sequence R1 with the length of m multiplied by n, wherein the sequence comprises m/2 subsequences. Similarly, the same operation is performed on the G-layer and B-layer images, resulting in one-dimensional sequences G1 and B1, respectively. Fig. 2 shows a specific preprocessing process, in which the outermost circle of pixels is sequentially taken out in a clockwise direction, and then the next outer circle is entered, and all pixels in the circle are sequentially taken out in an anticlockwise direction. And the steps are sequentially carried out in a clockwise and anticlockwise alternating mode until all the pixels at the innermost circle are taken out.

Further, performing intra-layer scrambling, regarding m/2 subsequences with different lengths in the sequence R1 as m/2 elements, and performing group ordering scrambling on the sequence R1 by using an index sequence c1 generated by the chaotic sequence, that is, rearranging m/2 elements in R1 according to the sequence c1, so as to obtain a scrambled sequence R2. Assuming an image size of 8 × 8, 64 pixels are total. According to the preprocessing process, the data are reconstructed into a one-dimensional sequence, the sequence comprises 4 subsequences, and the length of the sequence is decreased in sequence. The pseudo-random sequence generated by iterative chaotic mapping is [0.94, 0.65, 0.27, 0.59], and the pseudo-random sequence is arranged in an ascending order to obtain a sequence [0.27, 0.59, 0.65, 0.94] after the sequence is ordered and an index sequence [3, 4, 2, 1 ]. The one-dimensional sequence is subjected to packet sequencing scrambling according to the index sequence to obtain a scrambled result, and a schematic diagram is shown in fig. 3. Similarly, performing corresponding operations on the sequences G1 and B1 using the index sequences c2 and c3 results in scrambled sequences G2 and B2, respectively.

Further, the 3 sequences R2, G2, and B2 obtained by the intra-layer scrambling are subjected to double random position inter-layer cross scrambling. The sequence R2 is first scrambled, and the pixels in the sequence R2 and the sequence G2 are swapped when the control sequence k1(i) ═ 1, i.e. the pixels in the sequence R2 and the sequence G2 are swappedOtherwise the pixel values in sequence R2 and sequence B2 are exchanged, i.e.Thus, the exchange object of the sequence R2 is randomly chosen. In addition, the index sequences p1, p2 and p3 represent the positions of the pixels in the sequences R2, G2 and B2 respectively, the index sequences are obtained by arranging pseudo-random sequences related to plaintext in ascending order, and different plaintext generates different index sequences. And in each exchange, the positions of the pixels to be exchanged in the two sequences are randomly selected, so that the double-random-position interlayer interactive scrambling scheme has good randomness. Fig. 4 shows the scrambling procedure when R2 has a length of 9, with the control sequence k1 ═ 1, 1, 2, 1, 1, 2, 2, 1, 2]The index sequence p1 ═ 1, 8, 4, 3, 7, 2, 6, 5, 9]Rope for securingThe primer sequence p2 ═ 3, 5, 6, 7, 9, 1, 4, 8, 2]The index sequence p3 ═ 3, 6, 8, 4, 5, 9, 1, 7, 2]. According to the above scrambling rule, when the value of the control sequence k1 is 1,namely, it isG2(3), the first pixel of the red layer (R2) exchanges positions with the third pixel of the green layer (G2). By analogy, the 9 pixels of R2 are exchanged with the pixels in the other two sequences in turn, and the final result is shown in fig. 5. After this step is completed, the updated sequences R2, G2, B2 are obtained.

Further, the sequence G2 is then scrambled according to the method in the above step. When the control sequence k2(i) ═ 1, the pixels in the sequence G2 and the sequence B2 are exchanged, i.e., theOtherwise the pixel values in the sequence G2 and the sequence R2 are exchanged, i.e.Finally, the sequence B2 is scrambled. When the control sequence k3(i) ═ 1, the pixels in sequence B2 and sequence R2 are swapped, i.e. theOtherwise the pixel values in sequence B2 and sequence G2 are swapped, i.e.The final sequences R2, G2 and B2 after scrambling were obtained.

Further, the 3 sequences R2, G2, B2 obtained above were combined into a sequence L1, and the sequences X and y were quantized to obtain a diffusion sequence X, namely:

X=floor(mod((x+y)×1015,256):

accumulating all pixels in a plaintext image to be encrypted, and taking the remainder of an accumulation result to obtain a corresponding diffusion parameter D, wherein the method comprises the following steps: d ═ mod (sum (i), 256);

when i ∈ [2, 3mn ], the remaining pixels are encrypted, i.e.:

the encrypted sequence L2 is equally divided into 3 subsequences R3, G3 and B3, and a two-dimensional matrix is reconstructed from the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

And after the encrypted ciphertext image is obtained, storing the obtained encrypted ciphertext image into a preset memory. As an example, the stored procedure may be:

acquiring the generated ciphertext image, and establishing communication connection between the user terminal equipment and the information authentication terminal equipment based on the ciphertext image;

after the communication connection is established, the information authentication terminal equipment is controlled to receive an authentication request from the user terminal equipment, the validity of a public key certificate of the user terminal equipment is authenticated according to the authentication request, and after the validity verification is passed, a central certificate and a corresponding authentication certificate chain in the information authentication terminal equipment are responded to the user terminal equipment; controlling the information authentication terminal equipment to receive an information authentication storage request from the user terminal equipment, and remotely injecting an encryption key into the user terminal equipment according to the information authentication storage request;

and encrypting the ciphertext image generated on the user terminal equipment by using the encryption key, transmitting the encrypted ciphertext image to the information authentication terminal equipment for information authentication according to the communication connection which is pre-established between the user terminal equipment and the information authentication terminal equipment, and storing the ciphertext image into the information authentication terminal equipment after the information authentication is finished.

The process of establishing communication connection between the user terminal equipment and the information authentication terminal equipment comprises the following steps: acquiring a serial number generated on the information authentication terminal equipment;

generating a communication access request of the information authentication terminal equipment according to the big data information;

acquiring verification information stored in a server by the user terminal equipment based on the communication access request;

verifying the serial number by using the verification information, and determining whether the serial number exists in a directory corresponding to the verification information; if the information authentication terminal device exists completely, establishing communication connection between the user terminal device and the information authentication terminal device; and if the information authentication terminal device does not exist completely, the communication connection between the user terminal device and the information authentication terminal device is not established.

In summary, the invention provides an image encryption storage method based on big data, and provides a novel color image encryption algorithm based on coupled chaotic mapping according to the characteristic that three components of a color image have strong correlation. Firstly, an initial value is generated by using an external secret key and plaintext information, and a key stream is generated through iterative chaotic mapping. And decomposing the plaintext image, and sequentially performing intra-layer scrambling and inter-layer scrambling on each component. And finally, performing diffusion operation to obtain a ciphertext image. The method has good encryption effect, can effectively resist cutting attack, and has higher encryption efficiency and stronger safety compared with the encryption algorithm of the same type.

As shown in fig. 6, the present invention further provides an image encryption storage system based on big data, which includes:

the image acquisition module M10 is used for acquiring a plaintext image to be encrypted, performing RGB decomposition on the plaintext image to be encrypted according to the size of the image, and decomposing the plaintext image to be encrypted into R subimages, G subimages and B subimages with the same size;

the iteration module M20 is used for acquiring an initial value of a two-dimensional coupled chaotic mapping equation, inputting the initial value into the two-dimensional coupled chaotic mapping equation for iteration, and acquiring a first chaotic sequence x and a second chaotic sequence y; the lengths of the first chaotic sequence x and the second chaotic sequence y are the same as the image size of the plaintext image to be encrypted;

a chaotic sequence equally dividing module M30, configured to equally divide the first chaotic sequence x into 3 first chaotic subsequences, and equally divide the second chaotic sequence y into 3 second chaotic subsequences;

a first quantization module M40, configured to quantize the 3 first chaotic subsequences to obtain 3 inter-layer interaction scrambling control sequences;

the first index module M50 is configured to arrange the 3 second chaotic subsequences in an ascending order, and obtain 3 random index sequences used for inter-layer scrambling;

the second index module M60 is configured to obtain partial elements in the second chaotic sequence y, and arrange the partial elements in an ascending order to obtain 3 index sequences for intra-layer scrambling;

the preprocessing module M70 is configured to preprocess the R sub-images, acquire a one-dimensional sequence R1 with the same length as the R sub-images, preprocess the G sub-images, acquire a one-dimensional sequence G1 with the same length as the G sub-images, preprocess the B sub-images, and acquire a one-dimensional sequence B1 with the same length as the B sub-images;

the in-layer scrambling module M80 is configured to perform in-layer scrambling on the one-dimensional sequence R1, the one-dimensional sequence G1, and the one-dimensional sequence B1 respectively by using the generated 3 index sequences, so as to obtain scrambled sequences R2, G2, and B2;

the second quantization module M90 is configured to quantize the first chaotic sequence X and the second chaotic sequence y to obtain a diffusion sequence X;

the accumulation and remainder taking module M100 is used for accumulating all pixels in the plaintext image to be encrypted and taking the remainder of the accumulation result to obtain a corresponding diffusion parameter D;

the combination module M110 is used for performing double random position interlayer interactive scrambling on 3 sequences R2, G2 and B2 obtained after the interlayer scrambling, and obtaining a combination sequence L1 according to the scrambled sequences R2, G2 and B2;

and the encryption module M120 is used for obtaining an encryption sequence L2 according to the diffusion sequence X, the diffusion parameter D and the combination sequence L1, equally dividing the encryption sequence L2 into 3 subsequences R3, G3 and B3, and reconstructing a two-dimensional matrix according to the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

According to the record, the system provides a novel color image encryption algorithm based on the coupled chaotic mapping according to the characteristic that three components of the color image have strong correlation. Firstly, an initial value is generated by using an external secret key and plaintext information, and a key stream is generated through iterative chaotic mapping. And decomposing the plaintext image, and sequentially performing intra-layer scrambling and inter-layer scrambling on each component. And finally, performing diffusion operation to obtain a ciphertext image. The system has a good encryption effect, can effectively resist cutting attack, and has higher encryption efficiency and stronger safety compared with the encryption algorithms of the same type.

In an exemplary embodiment, the two-dimensional coupled chaotic mapping equation is:

in the formula, theta is a control parameter, theta belongs to [0, 1], and i is a natural number.

Specifically, the process of obtaining the initial value of the two-dimensional coupled chaotic mapping equation includes:

decomposing a plaintext image to be encrypted into an R subgraph component, a G subgraph component and a B subgraph component;

accumulating the R, G, and B sub-graph components to obtain a (mod (sum (i), 256);

the accumulated sum a is left to obtain a1、a2、a3And according to a, a1、a2、a3Obtaining an intermediate parameter A1、A2、A3The method comprises the following steps:

in the formula (I), the compound is shown in the specification,represents exclusive or, mod (x, y) represents a remainder;

in the formula, t1And t2Is an external key; x is the number of0And y0Is the initial value of the two-dimensional coupled chaotic mapping equation.

Further, the process of equally dividing the first chaotic sequence x into 3 first chaotic subsequences and equally dividing the second chaotic sequence y into 3 second chaotic subsequences includes:

in the formula, the image size of the plaintext image is m × n × 3, and the image sizes of the R sub-image, the G sub-image, and the B sub-image are m × n. In this embodiment, the initial value x is set0And y0And (3) iterating m multiplied by n multiplied by 3+500 times in the two-dimensional coupled chaotic mapping equation, and discarding the previous 500 values to avoid transient effect to obtain a first chaotic sequence x and a second chaotic sequence y, wherein the lengths of the first chaotic sequence x and the second chaotic sequence y are both m multiplied by n multiplied by 3.

Further, the process of quantizing the 3 first chaotic subsequences to obtain 3 inter-layer cross scrambling control sequences includes:

in the formulaFloor means rounding down; k is a radical of1、k2、k3Indicating a control sequence. Control sequence k1、k2、k3The values of (A) are all 1 or 2, and the length is m multiplied by n.

Further, the process of arranging the 3 second chaotic subsequences in an ascending order to obtain 3 random index sequences for interlayer interaction scrambling includes:

in the formula, sort represents the sequence, and p1, p2, and p3 represent the control sequence.

Further, acquiring partial elements in the second chaotic sequence y, and arranging the partial elements in an ascending order, wherein the process of acquiring 3 index sequences for in-layer scrambling includes:

where sort denotes the rank, c1、c2、c3Representing a random index sequence.

In addition, preprocessing is performed on the R sub-image, the G sub-image and the B sub-image, wherein a schematic diagram of the preprocessing is shown in fig. 2. And sequentially taking out all pixels on the outermost circle in a clockwise direction to be used as a first subsequence, and sequentially taking out all pixels on the next outermost circle in a counterclockwise direction to be used as a second subsequence. The same preprocessing operation is performed from the outer to the inner circle of the image in an alternating clockwise and counterclockwise manner until all pixels of the innermost circle are fetched. And connecting the sequence numbers of each subsequence in a descending order to obtain a one-dimensional sequence R1 with the length of m multiplied by n, wherein the sequence comprises m/2 subsequences. Similarly, the same operation is performed on the G-layer and B-layer images, resulting in one-dimensional sequences G1 and B1, respectively. Fig. 2 shows a specific preprocessing process, in which the outermost circle of pixels is sequentially taken out in a clockwise direction, and then the next outer circle is entered, and all pixels in the circle are sequentially taken out in an anticlockwise direction. And the steps are sequentially carried out in a clockwise and anticlockwise alternating mode until all the pixels at the innermost circle are taken out.

Further, performing intra-layer scrambling, regarding m/2 subsequences with different lengths in the sequence R1 as m/2 elements, and performing group ordering scrambling on the sequence R1 by using an index sequence c1 generated by the chaotic sequence, that is, rearranging m/2 elements in R1 according to the sequence c1, so as to obtain a scrambled sequence R2. Assuming an image size of 8 × 8, 64 pixels are total. According to the preprocessing process, the data are reconstructed into a one-dimensional sequence, the sequence comprises 4 subsequences, and the length of the sequence is decreased in sequence. The pseudo-random sequence generated by iterative chaotic mapping is [0.94, 0.65, 0.27, 0.59], and the pseudo-random sequence is arranged in an ascending order to obtain a sequence [0.27, 0.59, 0.65, 0.94] after the sequence is ordered and an index sequence [3, 4, 2, 1 ]. The one-dimensional sequence is subjected to packet sequencing scrambling according to the index sequence to obtain a scrambled result, and a schematic diagram is shown in fig. 3. Similarly, performing corresponding operations on the sequences G1 and B1 using the index sequences c2 and c3 results in scrambled sequences G2 and B2, respectively.

Further, the 3 sequences R2, G2, and B2 obtained after intra-layer scrambling are subjected to double random position inter-layer scrambling. The sequence R2 is first scrambled, and the pixels in the sequence R2 and the sequence G2 are swapped when the control sequence k1(i) ═ 1, i.e. the pixels in the sequence R2 and the sequence G2 are swappedOtherwise the pixel values in sequence R2 and sequence B2 are exchanged, i.e.Thus, the exchange object of the sequence R2 is randomly chosen. In addition, the index sequences p1, p2 and p3 represent the positions of the pixels in the sequences R2, G2 and B2 respectively, the index sequences are obtained by arranging pseudo-random sequences related to plaintext in ascending order, and different plaintext generates different index sequences. And in each exchange, the positions of the pixels to be exchanged in the two sequences are randomly selected, so that the double-random-position interlayer interactive scrambling scheme has good randomness. FIG. 4 shows the scrambling process, control, when R2 is 9 in lengthSequence k1 ═ 1, 1, 2, 1, 1, 2, 2, 1, 2]The index sequence p1 ═ 1, 8, 4, 3, 7, 2, 6, 5, 9]The index sequence p2 ═ 3, 5, 6, 7, 9, 1, 4, 8, 2]The index sequence p3 ═ 3, 6, 8, 4, 5, 9, 1, 7, 2]. According to the above scrambling rule, when the value of the control sequence k1 is 1,namely, it is The first pixel of the red layer (R2) exchanges positions with the third pixel of the green layer (G2). By analogy, the 9 pixels of R2 are exchanged with the pixels in the other two sequences in turn, and the final result is shown in fig. 5. After this step is completed, the updated sequences R2, G2, B2 are obtained.

Further, the sequence G2 is then scrambled according to the method in the above step. When the control sequence k2(i) ═ 1, the pixels in the sequence G2 and the sequence B2 are exchanged, i.e., theOtherwise the pixel values in the sequence G2 and the sequence R2 are exchanged, i.e.Finally, the sequence B2 is scrambled. When the control sequence k3(i) ═ 1, the pixels in sequence B2 and sequence R2 are swapped, i.e. theOtherwise the pixel values in sequence B2 and sequence G2 are swapped, i.e.The final sequences R2, G2 and B2 after scrambling were obtained.

Further, the 3 sequences R2, G2, B2 obtained above were combined into a sequence L1, and the sequences X and y were quantized to obtain a diffusion sequence X, namely:

X=floor(mod((x+y)×1015,256);

accumulating all pixels in a plaintext image to be encrypted, and taking the remainder of an accumulation result to obtain a corresponding diffusion parameter D, wherein the method comprises the following steps: d ═ mod (sum (i), 256);

when i ∈ [2, 3mn ], the remaining pixels are encrypted, i.e.:

the encrypted sequence L2 is equally divided into 3 subsequences R3, G3 and B3, and a two-dimensional matrix is reconstructed from the subsequences R3, G3 and B3 to obtain an encrypted ciphertext image.

And after the encrypted ciphertext image is obtained, storing the obtained encrypted ciphertext image into a preset memory. As an example, the stored procedure may be:

acquiring the generated ciphertext image, and establishing communication connection between the user terminal equipment and the information authentication terminal equipment based on the ciphertext image;

after the communication connection is established, the information authentication terminal equipment is controlled to receive an authentication request from the user terminal equipment, the validity of a public key certificate of the user terminal equipment is authenticated according to the authentication request, and after the validity verification is passed, a central certificate and a corresponding authentication certificate chain in the information authentication terminal equipment are responded to the user terminal equipment; controlling the information authentication terminal equipment to receive an information authentication storage request from the user terminal equipment, and remotely injecting an encryption key into the user terminal equipment according to the information authentication storage request;

and encrypting the ciphertext image generated on the user terminal equipment by using the encryption key, transmitting the encrypted ciphertext image to the information authentication terminal equipment for information authentication according to the communication connection which is pre-established between the user terminal equipment and the information authentication terminal equipment, and storing the ciphertext image into the information authentication terminal equipment after the information authentication is finished.

The process of establishing communication connection between the user terminal equipment and the information authentication terminal equipment comprises the following steps: acquiring a serial number generated on the information authentication terminal equipment;

generating a communication access request of the information authentication terminal equipment according to the big data information;

acquiring verification information stored in a server by the user terminal equipment based on the communication access request;

verifying the serial number by using the verification information, and determining whether the serial number exists in a directory corresponding to the verification information; if the information authentication terminal device exists completely, establishing communication connection between the user terminal device and the information authentication terminal device; and if the information authentication terminal device does not exist completely, the communication connection between the user terminal device and the information authentication terminal device is not established.

In summary, the invention provides an image encryption storage method based on big data, and provides a novel color image encryption algorithm based on coupled chaotic mapping according to the characteristic that three components of a color image have strong correlation. Firstly, an initial value is generated by using an external secret key and plaintext information, and a key stream is generated through iterative chaotic mapping. And decomposing the plaintext image, and sequentially performing intra-layer scrambling and inter-layer scrambling on each component. And finally, performing diffusion operation to obtain a ciphertext image. The system has a good encryption effect, can effectively resist cutting attack, and has higher encryption efficiency and stronger safety compared with the encryption algorithms of the same type.

The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:打印系统、控制打印系统的方法、终端设备以及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类