CN115733933A - Network security encryption method based on artificial intelligence - Google Patents

Network security encryption method based on artificial intelligence Download PDF

Info

Publication number
CN115733933A
CN115733933A CN202211506473.XA CN202211506473A CN115733933A CN 115733933 A CN115733933 A CN 115733933A CN 202211506473 A CN202211506473 A CN 202211506473A CN 115733933 A CN115733933 A CN 115733933A
Authority
CN
China
Prior art keywords
pixel
pixel value
pixel point
value difference
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211506473.XA
Other languages
Chinese (zh)
Other versions
CN115733933B (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.)
Nanjing Xianwei Information Technology Co ltd
Original Assignee
Guangzhou Taolu Technology Co ltd
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 Guangzhou Taolu Technology Co ltd filed Critical Guangzhou Taolu Technology Co ltd
Priority to CN202211506473.XA priority Critical patent/CN115733933B/en
Publication of CN115733933A publication Critical patent/CN115733933A/en
Application granted granted Critical
Publication of CN115733933B publication Critical patent/CN115733933B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image encryption, in particular to a network security encryption method based on artificial intelligence. The method comprises the following steps: acquiring two bit layers corresponding to each pixel point in a color plaintext image to be encrypted, wherein each type of bit layer corresponds to one element; counting the frequency of each element appearing in the color plaintext image and carrying out descending arrangement; the frequency ordering comprises a first element and a second element; self-defining the scanning mode of each first primitive and each second primitive so as to construct a sequence, and encrypting the sequence to obtain a key; constructing corresponding sub-blocks by the corresponding primitives of each pixel point in the color plaintext image; assigning values to the sub-blocks according to the scanning modes of the primitives corresponding to the pixel points to obtain gray blocks; obtaining a gray ciphertext image according to gray blocks corresponding to all pixel points in the color plaintext image; the security and defensiveness of image encryption are improved and the key space is increased.

Description

Network security encryption method based on artificial intelligence
Technical Field
The invention relates to the technical field of image encryption, in particular to a network security encryption method based on artificial intelligence.
Background
With the development of communication technology and the popularization of the internet, the form of transmitted information is more diversified, and information carriers with various formats such as text, images, audio, video and the like can be conveniently transmitted and acquired; however, due to the neglect of information security, the problem of information leakage is more and more, so that the application of the digital image encryption technology is more and more extensive, the probability of malicious tampering of image data can be effectively reduced by encrypting the digital image, and the threat to network security is reduced.
Because the digital image data volume is large, the correlation between adjacent pixels is strong, and the statistical characteristics are obvious, the encryption difficulty of the digital image is far greater than that of text information. The common digital image encryption algorithm has weak resistance to common attacks such as information analysis, noise, shearing and the like, and has small key space and low safety.
Disclosure of Invention
In order to solve the above technical problem, the present invention aims to provide a network security encryption method based on artificial intelligence, which comprises the following steps:
acquiring a color plaintext image to be encrypted; acquiring eight-bit binary digits corresponding to each pixel point in the color plaintext image; dividing each of the eight-bit binary digits into two bit layers, the bit layers including 16 types; each type of the bit layer corresponds to one element;
counting the frequency of each primitive appearing in the color plain text image, and performing descending order based on the frequency of all the primitives; the first N primitives in the frequency ordering are first primitives, and the remaining 16-N primitives are second primitives; n is a positive integer and N is less than 16; customizing a scan pattern of each first primitive and a scan pattern of each second primitive, the scan patterns comprising 24 forms;
constructing a sequence based on the first element and the corresponding scanning mode thereof, and the second element and the corresponding scanning mode thereof, and encrypting the sequence to obtain a key; constructing corresponding sub-blocks by the corresponding elements of each pixel point in the color plaintext image;
assigning values to the sub-blocks according to the scanning mode of the corresponding elements of the pixel points to obtain gray blocks; and obtaining a gray ciphertext image according to the gray blocks corresponding to all the pixel points in the color plaintext image, wherein the gray ciphertext image is an encrypted image of the color plaintext image.
Preferably, the method for constructing a corresponding sub-block from the corresponding primitive of each pixel point in the color plaintext image includes:
obtaining a basic element corresponding to each pixel point in the color plaintext image, wherein the basic elements comprise 6 basic elements under a red channel, a green channel and a blue channel; obtaining a scanning mode corresponding to each primitive according to the key;
obtaining 6 corresponding color blocks which are respectively red blocks R according to the scanning mode corresponding to each element 1 Red block R 2 Green color block G 1 Green color block G 2 Blue block B 1 And blue color block B 2 (ii) a Red color block R 1 And red block R 2 Transversely splicing to obtain red blocks, and combining the green blocks G 1 And green color block G 2 Transversely splicing to obtain green blocks, and combining blue blocks B 1 And blue block B 2 Transversely splicing to obtain a blue block;
and splicing the red block, the green block and the blue block up and down, wherein the last row of the red block is overlapped with the first row of the green block, the last row of the green block is overlapped with the first row of the blue block, and the spliced image block is a sub-block corresponding to the pixel point in the color plaintext image.
Preferably, the method for assigning values to the sub-blocks according to the scanning mode of the corresponding primitive of the pixel point to obtain the gray block includes:
sequentially marking the pixel points in the scanning mode according to the direction of the directed line segment in any scanning mode; and constructing a limiting condition according to the marked pixel points, assigning values to the sub-blocks according to the limiting condition, and enabling the assigned sub-blocks to be gray blocks.
Preferably, the method for sequentially marking the pixels in the scanning mode according to the direction of the directed line segment in any scanning mode includes:
the scanning mode is constructed based on 2-by-2 pixel blocks, and the direction of the directed line segment is obtained based on pixel difference values between pixel points in the pixel blocks;
the starting scanning point in the pixel block is marked as s 1 The pixel points pointed by the directed line segment starting from the scanning starting point are marked as s 2 From a pixel point s 2 The pixel point pointed by the initial directed line segment is marked as s 3 From a pixel point s 3 The pixel point pointed by the initial directed line segment is marked as s 4
Preferably, the method for constructing the constraint condition according to the marked pixel points includes:
obtaining the pixel point s in the marked pixel points 2 And a pixel point s 1 The difference between the pixel values is recorded as d 1 (ii) a Pixel point s 3 And a pixel point s 1 The difference between the pixel values is recorded as d 2 (ii) a Pixel point s 4 And a pixel point s 1 The difference between the pixel values is recorded as d 3
The limiting conditions are as follows: pixel point s 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4 The corresponding pixel value is monotonically increasing or monotonically decreasing and d 1 <d 2 <d 3
Preferably, the method for assigning values to sub-blocks according to the constraint condition includes:
based on green color block G 1 The scanning mode obtains the pixel point s therein 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4
Optionally giving a numerical value in a preset range to the green color block G 1 Middle pixel point s 1 Pixel value of
Figure BDA0003969214640000021
Based on the pixel value
Figure BDA0003969214640000022
And a pixel point s 2 And a pixel point s 1 Pixel value difference d between 1 Obtaining a pixel point s 2 Pixel value of
Figure BDA0003969214640000023
The pixel point s 2 And pixel point s 1 Pixel value difference d therebetween 1 Is any value selected within a first preset distance range;
selecting any value in a second preset distance range to give a pixel point s 3 And a pixel point s 1 Pixel value difference d between 2 And selecting any value in a third preset distance range to give the pixel point s 4 And a pixel point s 1 Pixel value difference d between 3 (ii) a According to the pixel value difference d 2 And a pixel point s 1 Pixel value of
Figure BDA0003969214640000031
Obtaining a pixel point s 3 Pixel value of
Figure BDA0003969214640000032
According to the pixel value difference d 3 And a pixel point s 1 Pixel value of
Figure BDA0003969214640000033
Obtaining a pixel point s 4 Pixel value of
Figure BDA0003969214640000034
Finish the green color block G 1 Assigning values of (1);
based on green color block G 2 The scanning mode obtains the pixel point s therein 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4 (ii) a Optionally giving a numerical value in a preset range to the green color block G 2 Middle pixel point s 1 Pixel value of
Figure BDA0003969214640000035
Selecting any numerical value in the first preset distance range, the second preset distance range and the third preset distance range as a green color block G 2 Middle pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According toGreen block G 2 Pixel value difference d in 1 Pixel value difference d 2 Pixel value difference d 3 And a pixel point s 1 Pixel value of
Figure BDA0003969214640000036
Obtaining a pixel point s 2 Pixel value of
Figure BDA0003969214640000037
Pixel point s 3 Pixel value of
Figure BDA0003969214640000038
And a pixel point s 4 Pixel value of (2)
Figure BDA0003969214640000039
Finish Pair Green color Block G 2 The value of (2);
the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 Satisfies the constraint;
based on the assigned green color block G 1 For red block R 1 And blue block B 1 Assigning values based on the assigned green color blocks G 2 For red block R 2 And blue block B 2 Carrying out assignment; assigned red block R 1 Red block R 2 'Green' color block G 1 Green color block G 2 Blue block B 1 And blue color block B 2 The sub-blocks formed are gray blocks.
Preferably, the green color block G based on the value after assignment 1 For red block R 1 And blue block B 1 Assigning values based on the assigned green color blocks G 2 For red block R 2 And blue block B 2 The method for assigning the value comprises the following steps:
based on the green color block G after assignment 1 Obtaining the red color block R 1 The pixel values of the last row of the middle-row pixels; calculating the red color block R 1 The pixel value difference value between the last line of pixel points in the red color block R is adjusted according to the type of the pixel value difference value 1 Value assignment is performedThe types of the pixel value difference values include: pixel value difference d 1 Pixel value difference d 2 Pixel value difference d 3 Pixel value difference d 4 Pixel value difference d 5 And a pixel value difference d 6 (ii) a The pixel value difference d 4 Is a pixel point s 3 And a pixel point s 2 Pixel value difference therebetween; the pixel value difference d 5 Is a pixel point s 4 And a pixel point s 2 Pixel value difference therebetween; the pixel value difference d 6 Is a pixel point s 4 And pixel point s 3 Pixel value difference therebetween;
based on the green color block G after assignment 1 Obtaining the blue color block B 1 The pixel values of the pixels in the first row are calculated; calculating the blue color block B 1 The pixel value difference value between the first row of pixel points in the middle is used for aligning the blue block B according to the type of the pixel value difference value 1 Carrying out assignment;
based on the green color block G after assignment 2 Obtaining the red color block R 2 The pixel values of the last row of the middle-row pixels; calculating the red color block R 2 The pixel value difference value between the last line of pixel points in the red color block R is adjusted according to the type of the pixel value difference value 2 Carrying out assignment;
based on the green color block G after assignment 2 Obtaining the blue color block B 2 The pixel values of the pixels in the first row are calculated; calculating the blue color block B 2 The pixel value difference value between the first row of pixel points in the middle is used for aligning the blue block B according to the type of the pixel value difference value 2 And carrying out assignment.
Preferably, the red color block R is paired according to the type of the pixel value difference 1 The method for assigning the value comprises the following steps:
if the pixel value difference is d 1 Said red color block R 1 Middle pixel point s 1 And a pixel point s 2 Is known, based on said pixel point s 1 And a pixel point s 2 Determines the red block R 1 Monotonicity of (2); setting a pixel value difference d 2 And a pixel value difference d 3 Value range ofAnd selecting any value in the value range as a pixel value difference d 2 And the pixel value difference d 3 (ii) a According to the pixel point s 1 Pixel value, pixel value difference d 2 Pixel value difference d 3 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 3 Pixel value and pixel point s 4 A pixel value of (a);
if the pixel value difference is d 2 Said red color block R 1 Middle pixel point s 1 And a pixel point s 3 Is known, based on said pixel point s 1 And a pixel point s 3 Determines the red block R 1 Monotonicity of (2); setting a pixel value difference d 1 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 And the pixel value difference d 3 (ii) a According to the pixel point s 1 Pixel value, pixel value difference d 1 Pixel value difference d 3 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 2 Pixel value and pixel point s 4 A pixel value of (a);
if the pixel value difference is d 3 Said red color block R 1 Middle pixel point s 1 And a pixel point s 4 Is known, based on said pixel point s 1 And a pixel point s 4 Determines the red block R 1 Monotonicity of (2); setting a pixel value difference d 1 And a pixel value difference d 2 In which an optional value is taken as the pixel value difference d 1 And the pixel value difference d 2 (ii) a According to the pixel point s 1 Pixel value and pixel value difference d 1 Pixel value difference d 2 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 2 Pixel value and pixel point s 3 A pixel value of (a);
if the pixel value difference is d 4 Said red color block R 1 Middle pixel point s 2 And a pixel point s 3 Is known, based on said pixel point s 2 And a pixel point s 3 The pixel value of (2) is judgedRed block R 1 Monotonicity of (2); obtaining a pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According to the pixel point s 2 Pixel value, pixel value difference d 1 Pixel value difference d 3 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 1 Pixel value and pixel point s 4 A pixel value of (a);
if the pixel value difference is d 5 Said red color block R 1 Middle pixel point s 4 And a pixel point s 2 Is known, based on said pixel point s 4 And a pixel point s 2 Determines the red block R 1 Monotonicity of (2); obtaining a pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According to the pixel point s 2 Pixel value, pixel value difference d 1 Pixel value difference d 2 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 1 And a pixel value and a pixel point s 3 A pixel value of (a);
if the pixel value difference is d 6 Said red color block R 1 Middle pixel point s 4 And a pixel point s 3 According to said pixel point s 4 And pixel point s 3 Determines the red block R 1 Monotonicity of (2); obtaining a pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According to the pixel point s 3 Pixel value and pixel value difference d 1 Pixel value difference d 2 And obtaining the pixel point s by the monotonicity 1 And a pixel value and a pixel point s 2 The pixel value of (2).
The invention has the following beneficial effects: in the embodiment of the invention, the eight-bit binary digit conversion is carried out on the pixel value of each pixel point in the colorful plaintext image, and then the corresponding bit layer and the corresponding element are obtained; and a plurality of scanning modes are set, and the correspondence between the primitives and the scanning modes is set by self-definition so as to construct a key, thereby increasing the key space; each pixel point in the colorful plaintext image is further converted into a sub-block, the sub-blocks are assigned according to the scanning mode of the pixel points to obtain gray blocks, and the gray blocks corresponding to all the pixel points form a gray ciphertext image, so that the encryption operation of the colorful ciphertext image is completed, and the encryption defensiveness and the encryption safety are effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart of an artificial intelligence-based network security encryption method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of 24 types of scanning patterns according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the network security encryption method based on artificial intelligence according to the present invention, its specific implementation, structure, features and effects will be given with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The method is suitable for encryption processing of the color plaintext image, and aims to solve the problems of poor key space and poor defense force of the existing digital image encryption technology.
The following describes a specific scheme of the network security encryption method based on artificial intelligence in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of an artificial intelligence-based network security encryption method according to an embodiment of the present invention is shown, where the method includes the following steps:
step S100, acquiring a color plaintext image to be encrypted; acquiring eight-bit binary digits corresponding to each pixel point in a color plaintext image; dividing each eight-bit binary digit into two bit layers, wherein the bit layers comprise 16 types; one primitive for each type of bit layer.
Specifically, any one color plaintext image to be encrypted is obtained, and each pixel point in the color plaintext image is processed and encrypted; because the color plaintext image is an RGB image, each pixel point corresponds to pixel values of three color channels, namely a red channel, a green channel and a blue channel; and analyzing each pixel point in the color plaintext image under each color channel.
Taking the red channel as an example, the pixel value ranges of any pixel points in the color plaintext image are all [0, 255 ]]Therefore, the pixel value of each pixel point is represented by 8-bit binary digits, and the binary digits corresponding to each pixel point are segmented to obtain two bit layers corresponding to the pixel point; as an example, assume an imageThe binary digit corresponding to the prime point is r 8 r 7 r 6 r 5 r 4 r 3 r 2 r 1 The binary digits are divided in the order from left to right, that is, the 4-bit digit is a bit layer, and then the two bit layers are: c. C 1 =r 8 r 7 r 6 r 5 ,c 2 =r 4 r 3 r 2 r 1 (ii) a And in the same way, 2 bit layers corresponding to each pixel point in the color plaintext image are obtained.
Each bit layer corresponds to 4 numbers, namely 4 bits, and the value of each bit is 0 or 1; therefore, the value taking condition of each bit layer has 16 types, the bit layer of each type is marked as a primitive, so that the primitive has 16 forms in total, and the 16 primitives are respectively marked as y 1 ,y 2 ,...,y 16 (ii) a Wherein, y 1 =0000;y 2 =0001; by analogy, y 16 =1111。
And acquiring the bit layer and the element of each pixel point in the color plaintext image under the green channel and the bit layer and the element of each pixel point in the color plaintext image under the blue channel based on the same method as the red channel.
S200, counting the frequency of each primitive appearing in the color plaintext image, and performing descending order arrangement based on the frequencies of all the primitives; the first N elements in the frequency sorting are first elements, and the rest 16-N elements are second elements; n is a positive integer and N is less than 16; and customizing the scanning mode of each first primitive and the scanning mode of each second primitive, wherein the scanning modes comprise 24 forms.
The method in step S100 can obtain the primitive corresponding to each pixel point in the color plaintext image in different color channels, and then count the frequency of each type of primitive in each color channel appearing in the color plaintext image. Taking the red channel as an example, the frequency of occurrence of each type of primitive in the red channel is counted, and the frequencies of the 16 primitives are sequentially marked as: p (y) 1 ),p(y 2 ),...,p(y 16 );p(y 1 ) Representing primitive y 1 Corresponding frequencyRate; p (y) 16 ) Representation primitive y 16 A corresponding frequency; and sorting is carried out based on the frequency corresponding to each element, the sorting is arranged according to the descending order of the frequency, and the sorting position of the element with larger frequency domain is closer to the front. The first N primitives with high frequency are selected to be recorded as a first primitive, the other 16-N primitives are recorded as a second primitive, N is a positive integer and is less than 16, and different scanning modes are respectively allocated to the first primitive and the second primitive.
Preferably, in the embodiment of the present invention, N is set to be 8, that is, the primitive corresponding to the first 8 sorted frequency values is the first primitive, and the primitive corresponding to the last 8 sorted frequency values is the second primitive; each first primitive is assigned 2 scan patterns and each second primitive is assigned 1 scan pattern.
The specific acquisition method of the scanning mode comprises the following steps:
selecting any pixel block with the size of 2 x 2, determining a scanning mode based on pixel values of pixel points in the pixel block, assuming that the upper left-corner pixel point of the pixel block with the size of 2 x 2 is a scanning starting point, calculating differences between other three pixel points in the pixel block and the pixel values of the scanning starting point, wherein the direction with the minimum pixel value difference is the direction of primary scanning, and representing the direction with a directed line segment, wherein the starting point of the directed line segment is the scanning starting point, and the end point of the directed line segment is the pixel point with the minimum pixel value difference between the starting point and the scanning starting point. By analogy, using 3 directed line segments to connect 4 pixel points in the pixel block without repetition, and the formed pattern is the scanning mode at the moment; therefore, when the upper left corner is taken as a scanning starting point, a total of 6 scanning modes can be obtained according to different values among 4 pixel points in the pixel block. Each pixel point in the pixel block can be used as a scanning starting point, so that each scanning starting point can correspond to 6 types of scanning modes, and then the pixel blocks with the sizes of 2 x 2 correspond to 24 types of scanning modes; referring specifically to fig. 2, a schematic diagram of 24 types of scanning modes is fully illustrated.
Thereby, 24 types of scan patterns are used to distribute the first primitive and the second primitive, and each first primitive is selected two kinds of scan patterns which are not repeated at will in the 24 types of scan patterns, namely, the scan pattern corresponding to the first primitive can be selectedThe kind of energy is
Figure BDA0003969214640000071
Seed growing; the possible types of scan patterns corresponding to the second first primitive are
Figure BDA0003969214640000072
By analogy, the scanning mode distribution and selection corresponding to the 8 first primitives are completed; the remaining 8 scan patterns are randomly associated with the 8 second primitives without repetition, so as to obtain scan patterns corresponding to the 8 second primitives respectively.
It should be noted that the scanning modes of the first primitive and the second primitive are both self-defined, randomly distributed and marked, so as to achieve better encryption effect.
As a preferred example, it is assumed that the sequence after the descending order according to the frequency corresponding to each primitive is: y is 2 ,y 14 ,y 1 ,y 3 ,y 12 ,y 6 ,y 11 ,y 7 ,y 9 ,y 16 ,y 10 ,y 8 ,y 15 ,y 4 ,y 13 ,y 5 (ii) a The first 8 high frequency primitives are: y is 2 ,y 14 ,y 1 ,y 3 ,y 12 ,y 6 ,y 11 ,y 7 (ii) a The 8 second primitives with lower frequencies are y 9 ,y 16 ,y 10 ,y 8 ,y 15 ,y 4 ,y 13 ,y 5 (ii) a Two scanning modes are selected and allocated for each first primitive, and the scanning modes corresponding to the 8 first primitives are respectively as follows: (3, 5), (1, 11), (8, 24), (6, 7), (2, 12), (13, 15), (23, 17), (4, 20); wherein (3, 5) represents the first element y with the largest frequency 2 The two corresponding scanning modes are respectively a scanning mode 3 and a scanning mode 5; (4, 20) represents two scan patterns corresponding to the first primitive y7 of the 8 th frequency ordering, scan pattern 4 and scan pattern 20 respectively. The scan patterns corresponding to the lower 8 second primitives are: 19 14, 21,9, 18, 22, 10, 16; it is composed ofIn, 19 denotes the second primitive y 9 The corresponding scan pattern 19;16 denotes the second primitive y 5 And obtaining the corresponding scanning modes of the 16 primitives by analogy with the corresponding scanning modes of the 16 primitives.
Step S300, constructing a sequence based on a first primitive and a corresponding scanning mode thereof, and a second primitive and a corresponding scanning mode thereof, and encrypting the sequence to obtain a key; and constructing a corresponding sub-block by the corresponding element of each pixel point in the color plaintext image.
Obtaining the scan patterns corresponding to the 16 primitives respectively by the method in step S200, and then constructing a sequence according to the obtained primitive sorting sequence and the corresponding scan pattern, where the sequence includes 40 elements, and the first 16 elements are sequence numbers of the 16 primitives sorted according to frequency; the remaining 24 elements are the sequence numbers of the scan patterns corresponding to each primitive in the primitive ordering respectively. As an example, the order of the descending order according to the frequency corresponding to each primitive obtained by the preferred example in step S200 is: y is 2 ,y 14 ,y 1 ,y 3 ,y 12 ,y 6 ,y 11 ,y 7 ,y 9 ,y 16 ,y 10 ,y 8 ,y 15 ,y 4 ,y 13 ,y 5 (ii) a Then, the sequence numbers of the scanning modes which are self-defined and distributed to each element after sequencing are respectively as follows: (3,5), (1, 11), (8, 24), (6,7), (2, 12), (13, 15), (23, 17), (4, 20),19, 14, 21,9, 18, 22, 10, 16.
Then, the sequence constructed according to the labels of the sorted primitive sequences and the labels of the corresponding scan modes is:
Figure BDA0003969214640000081
wherein l 1 Represents a sequence; the first 16 elements of the sequence are the primitive numbers after the primitives are arranged according to a descending frequency order, 2 denotes primitive y 2 And 5 denotes a primitive y 5 (ii) a The last 24 elements of the sequence are the serial numbers of the scan patterns corresponding to each arranged primitive, 3 tableScan modes 3,5 denote scan mode 5, and scan mode 3 and scan mode 5 are both primitives y 2 Corresponding scan pattern.
Based on the method for obtaining the same sequence in the red channel, the corresponding frequencies of the primitives in the green channel and the blue channel are calculated, and further, based on the frequency distribution scanning mode of the primitives, the sequence is constructed, and the corresponding sequence l in the green channel 2 Corresponding sequence l under blue channel 3
Then, the constructed sequence is encrypted, and in the embodiment of the invention, the sequence l is encrypted by an AES (advanced encryption Standard) encryption algorithm 1 The encryption yields a key 1, and likewise the sequence l is encrypted by the AES cipher algorithm 2 And the sequence l 3 The encryption respectively obtains a secret key 2 and a secret key 3, and the secret key space is
Figure BDA0003969214640000082
And (4) seed selection.
Further, the color plaintext image is encrypted according to the obtained secret key 1, the obtained secret key 2 and the obtained secret key 3, and each pixel point in the color plaintext image is encrypted during encryption; in the embodiment of the present invention, each pixel point in the color plaintext image is converted into a 4 × 4 sub-block, and taking any one pixel point as an example, the pixel point is marked as a plaintext pixel, and a specific conversion method for converting the plaintext pixel into the sub-block is as follows:
from step S100 and step S200, it can be known that each plaintext pixel corresponds to 2 bit layers, each bit layer corresponds to one primitive, and each primitive corresponds to a specific scan pattern; and the scanning mode corresponding to each primitive can be known according to the key 1, the key 2 and the key 3; since the first primitive corresponds to 2 scan modes and the second primitive corresponds to 1 scan mode, if any one scan mode is selected as the scan mode corresponding to each primitive, 6 scan modes corresponding to plaintext pixels can be obtained according to the key 1, the key 2, and the key 3, that is, 2 scan modes in the red channel, 2 scan modes in the green channel, and 2 scan modes in the blue channel.
Since each scanning mode is obtained by corresponding 2 x 2 pixel blocks, the pixel can be obtained according to the plain text pixelThe 6 color blocks obtained by the corresponding 6 scanning modes are respectively red blocks R 1 Red block R 2 'Green' color block G 1 Green color block G 2 Blue block B 1 And blue color block B 2 (ii) a The size of each color block is 2 x 2; therefore, sub-blocks corresponding to plaintext pixels are constructed according to 6 color blocks with the size of 2 x 2, and red color blocks R are formed 1 And red block R 2 Transverse splicing to obtain 2 x 4 red blocks and green blocks 1 And green color block G 2 Transversely splicing to obtain 2-4 green blocks and blue blocks B 1 And blue block B 2 Transversely splicing to obtain 2 × 4 blue blocks, and then splicing the 2 × 4 red blocks, the 2 × 4 green blocks and the 2 × 4 blue blocks up and down to obtain 4 × 4 sub-blocks, namely, overlapping the second row of the red blocks with the first row of the green blocks, and overlapping the second row of the green blocks with the first row of the blue blocks; thus, a 4 × 4 sub-block corresponding to the plaintext pixels is obtained.
By analogy, 4 × 4 sub-blocks corresponding to each pixel point in the color plaintext image are obtained, and then each sub-block is encrypted.
Step S400, assigning values to the sub-blocks according to the scanning modes of the primitives corresponding to the pixel points to obtain gray blocks; and obtaining a gray scale ciphertext image according to the gray scale blocks corresponding to all the pixel points in the color plaintext image, wherein the gray scale ciphertext image is the encrypted image of the color plaintext image.
In step S300, the 4 × 4 sub-blocks corresponding to each pixel point in the color plaintext image are obtained, where the obtained sub-blocks are obtained based on the primitive of each pixel point and the corresponding scanning mode of the primitive in the key, and the pixel value of each pixel point in the 4 × 4 sub-blocks is unknown, so that the pixel value of each pixel point needs to be assigned.
Because each scanning mode is formed by the pointing of 3 directed line segments, and the pointing of the directed line segments is the direction with the minimum difference value between pixel values, in order to avoid the inaccuracy of the result caused by the difference between the scanning modes, in the embodiment of the invention, the sequencing marking is firstly carried out on the pixel points in the 2 x 2 pixel blocks, and the scanning starting point is marked as s 1 And the pixel points pointed by the directed line segment starting from the scanning starting point are marked as s 2 From a pixel point s 2 Starting directed line segmentThe pointed pixel point is marked as s 3 By a pixel point s 3 The pixel point pointed by the initial directed line segment is marked as s 4 . Therefore, can be based on the red block R 1 Red block R 2 'Green' color block G 1 'Green' color block G 2 Blue block B 1 And blue color block B 2 And assigning each pixel point to obtain the pixel value of each pixel point in the 4 x 4 subblocks.
Marking the pixel points s according to the scanning mode corresponding to each color block 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4 When each pixel point is assigned, the corresponding limiting condition is satisfied, and the first directed line segment is formed by the pixel points s 1 Pointing to a pixel point s 2 When it is satisfied with d 1 <d 2 And d is 1 <d 3 (ii) a Wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003969214640000091
Figure BDA0003969214640000092
representing a pixel point s 1 A pixel value of (a);
Figure BDA0003969214640000093
representing a pixel point s 2 A pixel value of (a);
Figure BDA0003969214640000094
representing a pixel point s 3 The pixel value of (a);
Figure BDA0003969214640000095
representing a pixel point s 4 A pixel value of (a); d is a radical of 1 Representing a pixel point s 1 And pixel point s 2 Pixel value difference therebetween; d 2 Representing a pixel point s 3 And pixel point s 1 Pixel value difference therebetween; d 3 Representing a pixel point s 4 And a pixel point s 1 Pixel value difference therebetween; second directed line segment is composed of pixels s 2 Pointing to a pixel point s 3 When it is required to satisfy d 4 <d 5 (ii) a Wherein the content of the first and second substances,
Figure BDA0003969214640000096
d 4 representing a pixel point s 3 And a pixel point s 2 Pixel value difference therebetween; d 5 Representing a pixel point s 4 And a pixel point s 2 Pixel value difference therebetween; the third directed line segment is formed by pixel points s 3 Pointing to a pixel point s 4 When it is used
Figure BDA0003969214640000097
No limitation; d is a radical of 6 Representing a pixel point s 4 And pixel point s 3 Pixel value difference therebetween; wherein when
Figure BDA0003969214640000098
Monotonically increasing or monotonically decreasing, d 1 、d 2 、d 3 、d 4 、d 5 And d 6 Also satisfies the following conditions:
Figure BDA0003969214640000099
thus satisfying d 4 <d 5 When d is satisfied 2 -d 1 <d 3 -d 1 I.e. d 2 <d 3 (ii) a Then finally each color block needs to satisfy the constraint:
Figure BDA0003969214640000101
monotonically increasing or monotonically decreasing and d 1 <d 2 <d 3 And (4) finishing.
Assigning a value to each color block based on the constraint condition, and giving the green block G first because the green block overlaps with the red block and the blue block 1 Assignment is made, known to be based on green block G 1 The corresponding scanning mode can obtain the pixel point s therein 1 And a pixel point s 2 Pixel point s 3 And a pixel point s 4 And the value range of each pixel point is 0-255, so the value assignment is firstly carried out in the embodiment of the inventionFrom [45, 205 ]]Randomly selecting 1 number in the range of (1) to give a green block G 1 Middle pixel point s 1 To obtain
Figure BDA0003969214640000102
Then in [11, 15 ]]Randomly selecting 1 number from the range of (1) to give d1, thereby obtaining
Figure BDA0003969214640000103
In [16, 20 ]]Randomly selecting 1 number from the range of (1) to assign d 2 Thereby obtaining
Figure BDA0003969214640000104
Finally in [21, 25 ]]Randomly selecting 1 number from the range of (1) to assign d 3 Thereby obtaining
Figure BDA0003969214640000105
So far, the green color block G is realized 1 Middle pixel point s 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4 An assignment of (2).
Further, since green color block G 1 First row of pixel points in (1) and red block R 1 The second row of pixels of (2) is overlapped, so that the red block R 1 Of which two pixel point values are known, i.e. red block R 1 D in the difference of pixel values between the pixel points 1 ,d 2 ,d 3 ,d 4 ,d 5 ,d 6 There is a known value, from the red block R 1 The scanning pattern of (2) is known, so that the red block R can be mapped according to the scanning pattern 1 The pixel point of the middle second line belongs to the pixel point s 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4 Which one of the pixels in the second row is the pixel s 1 And a pixel point s 2 Then red block R 1 D in (1) 1 The method comprises the following steps of (1) knowing; when the second row of pixels are respectively pixels s 1 And a pixel point s 3 Then red block R 1 D in (1) 2 The method comprises the following steps of (1) knowing; by analogy, based on 6 possible conditions of pixel value difference between pixels in the second row and d 1 <d 2 <d 3 Determining d in the pixel value difference 1 ,d 2 ,d 3 And assigning a value to the range of (1), the specific method comprising:
(1) When the red color block R 1 Neutral and green color block G 1 The pixel value difference between the overlapped pixel points in (1) is d 1 When it is, then d 2 ,d 3 The value range of (A) should satisfy:
Figure BDA0003969214640000106
wherein d is 1 Representing a pixel point s 1 And a pixel point s 2 Pixel value difference therebetween; d 2 Representing a pixel point s 3 And a pixel point s 1 Pixel value difference therebetween; d is a radical of 3 Representing a pixel point s 4 And pixel point s 1 Pixel value difference therebetween.
At the same time, the red color block R can be determined 1 Middle pixel point s 1 And a pixel point s 2 And based on the pixel point s 1 And a pixel point s 2 Determines the red block R at that time 1 Middle pixel point s 1 Pixel value of
Figure BDA0003969214640000107
Pixel point s 2 Pixel value of
Figure BDA0003969214640000108
Pixel point s 3 Pixel value of
Figure BDA0003969214640000109
And a pixel point s 4 Pixel value of
Figure BDA00039692146400001010
Monotonicity of (2); if it is
Figure BDA00039692146400001011
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA00039692146400001012
Monotonically increases, and
Figure BDA00039692146400001013
if it is
Figure BDA00039692146400001014
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA00039692146400001015
Monotonically decreases, and
Figure BDA00039692146400001016
(2) If red color block R 1 Neutral and green color block G 1 The pixel value difference between the overlapped pixel points in (1) is d 2 When it is, then d 1 ,d 3 The value range of (A) should satisfy:
Figure BDA0003969214640000111
wherein, d 1 Representing a pixel point s 1 And a pixel point s 2 Pixel value difference therebetween; d 2 Representing a pixel point s 3 And a pixel point s 1 Pixel value difference therebetween; d 3 Representing a pixel point s 4 And pixel point s 1 Pixel value difference therebetween.
The same can determine the red block R 1 Middle pixel point s 1 And a pixel point s 3 And based on the pixel point s 1 And a pixel point s 3 Determines the red block R at that time 1 Middle pixel point s 1 Pixel value of
Figure BDA0003969214640000112
Pixel point s 2 Pixel value of
Figure BDA0003969214640000113
Pixel point s 3 Pixel value of (2)
Figure BDA0003969214640000114
And a pixel point s 4 Pixel value of
Figure BDA0003969214640000115
Monotonicity of (2); if it is
Figure BDA0003969214640000116
Red block R 1 The pixel values of the middle pixel points respectively
Figure BDA0003969214640000117
Monotonically increases, and
Figure BDA0003969214640000118
if it is
Figure BDA0003969214640000119
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA00039692146400001110
Monotonically decreases, and
Figure BDA00039692146400001111
(3) If red color block R 1 Neutral and green color block G 1 The pixel value difference between the overlapped pixel points in (1) is d 3 When it is, then d 1 ,d 2 The value range of (A) should satisfy:
Figure BDA00039692146400001112
wherein d is 1 Representing a pixel point s 1 And a pixel point s 2 Pixel value difference therebetween; d is a radical of 2 Representing a pixel point s 3 And pixel point s 1 Pixel value difference therebetween; d is a radical of 3 Representing a pixel point s 4 And a pixel point s 1 Pixel value difference therebetween.
In the same way, the red color block R can be determined 1 Middle pixel point s 1 And a pixel point s 4 And based on the pixel point s 1 And a pixel point s 4 Determines the red block R at that time 1 Middle pixel point s 1 Pixel value of
Figure BDA00039692146400001113
Pixel point s 2 Pixel value of
Figure BDA00039692146400001114
Pixel point s 3 Pixel value of (2)
Figure BDA00039692146400001115
And a pixel point s 4 Pixel value of
Figure BDA00039692146400001116
Monotonicity of (2); if it is
Figure BDA00039692146400001117
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA00039692146400001118
Monotonically decreases, and
Figure BDA00039692146400001119
if it is
Figure BDA00039692146400001120
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA00039692146400001121
Monotonically increases, and
Figure BDA00039692146400001122
(4) If red color block R 1 Neutral and green color block G 1 The pixel value difference between the overlapped pixel points in (1) is d 4 Then d is 1 ,d 2 ,d 3 The value range of (A) should satisfy:
Figure BDA00039692146400001123
wherein, d 1 Representing a pixel point s 1 And pixel point s 2 Pixel value difference therebetween; d 2 Representing a pixel point s 3 And a pixel point s 1 Pixel value difference therebetween; d 3 Representing a pixel point s 4 And a pixel point s 1 Pixel value difference therebetween; d 4 Representing a pixel point s 3 And a pixel point s 2 Pixel value difference therebetween.
The same can determine the red block R 1 Middle pixel point s 2 And a pixel point s 3 And based on the pixel point s 2 And a pixel point s 3 Determines the red block R at that time 1 Middle pixel point s 1 Pixel value of
Figure BDA0003969214640000121
Pixel point s 2 Pixel value of (2)
Figure BDA0003969214640000122
Pixel point s 3 Pixel value of
Figure BDA0003969214640000123
And a pixel point s 4 Pixel value of
Figure BDA0003969214640000124
Monotonicity of (2); if it is
Figure BDA0003969214640000125
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA0003969214640000126
Monotonically decreases, and
Figure BDA0003969214640000127
if it is
Figure BDA0003969214640000128
Red block R 1 The pixel values of the middle pixel points respectively
Figure BDA0003969214640000129
Monotonically increases, and
Figure BDA00039692146400001210
(5) If red color block R 1 Neutral and green color block G 1 The pixel value difference between the overlapped pixel points in (1) is d 5 Then d is 1 ,d 2 ,d 3 The value range of (A) should satisfy:
Figure BDA00039692146400001211
wherein, d 1 Representing a pixel point s 1 And pixel point s 2 Pixel value difference therebetween; d 2 Representing a pixel point s 3 And pixel point s 1 Pixel value difference therebetween; d 3 Representing a pixel point s 4 And a pixel point s 1 Pixel value difference therebetween; d 5 Representing a pixel point s 4 And a pixel point s 2 Pixel value difference therebetween.
The same can determine the red block R 1 Middle pixel point s 4 And pixel point s 2 And based on the pixel point s 2 And a pixel point s 4 Determines the red block R at that time 1 Middle pixel point s 1 Pixel value of (2)
Figure BDA00039692146400001212
Pixel point s 2 Pixel value of (2)
Figure BDA00039692146400001213
Pixel point s 3 Pixel value of
Figure BDA00039692146400001214
And a pixel point s 4 Pixel value of (2)
Figure BDA00039692146400001215
Monotonicity of (2); if it is
Figure BDA00039692146400001216
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA00039692146400001217
Monotonically decreases, and
Figure BDA00039692146400001218
if it is
Figure BDA00039692146400001219
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA00039692146400001220
Monotonically increases, and
Figure BDA00039692146400001221
(6) If red color block R 1 Neutral and green color block G 1 The pixel value difference between the overlapped pixel points in (1) is d 6 Then d is 1 ,d 2 ,d 3 The value range of (A) should satisfy:
Figure BDA00039692146400001222
wherein, d 1 Representing a pixel point s 1 And a pixel point s 2 Pixel value difference therebetween; d 2 Representing a pixel point s 3 And a pixel point s 1 Pixel value difference therebetween; d is a radical of 3 Representing a pixel point s 4 And a pixel point s 1 Pixel value difference therebetween; d 6 Representing a pixel point s 4 And a pixel point s 3 Pixel value difference therebetween.
In the same way, the red color block R can be determined 1 Middle pixel point s 4 And a pixel point s 3 And based on the pixel point s 4 And a pixel point s 3 Determines the red block R at that time 1 Middle pixel point s 1 Pixel value of
Figure BDA00039692146400001223
Pixel point s 2 Pixel value of
Figure BDA00039692146400001224
Pixel point s 3 Pixel value of (2)
Figure BDA00039692146400001225
And a pixel point s 4 Pixel value of (2)
Figure BDA00039692146400001226
Monotonicity of (2); if it is
Figure BDA00039692146400001227
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA0003969214640000131
Monotonically decreases, and
Figure BDA0003969214640000132
if it is
Figure BDA0003969214640000133
Red block R 1 Pixel values respectively corresponding to middle pixel points
Figure BDA0003969214640000134
Monotonically increases, and
Figure BDA0003969214640000135
in combination with the various cases described in (1) to (6) above, the green block G can be used 1 And red block R 1 Two overlapped pixel points finish red color block R 1 An assignment of (2).
Based on the above red block R 1 Assign the same method since the green block G 1 Second row of pixel dots in (B) and blue block B 1 The first row of pixels in (A) is overlapped, so that the pair of red blocks R can be utilized 1 Assign the same method to the blue block B 1 And carrying out assignment. Then using the green color block G 1 Assigning the same value to the green color block G 2 Assigning values, and based on the assigned green color blocks G 2 For red block R 2 And blue color block B 2 Carrying out assignment; thereby completing the red block R corresponding to each pixel point in the color plaintext image 1 Red block R 2 'Green' color block G 1 'Green' color block G 2 Blue block B 1 And blue color block B 2 And assigning each pixel point to obtain the pixel value of the pixel point in the 4 x 4 sub-blocks corresponding to each pixel point, and recording the assigned sub-blocks as gray blocks.
And forming a corresponding gray scale ciphertext image according to the 4 × 4 gray scale blocks corresponding to each pixel point in the color plaintext image, wherein the gray scale ciphertext image is the image obtained by encrypting the color plaintext image.
Furthermore, when the method in the embodiment of the present invention is used for decrypting the encrypted color plaintext image, the gray ciphertext image is decrypted, and each gray block in the gray ciphertext image is restored to a corresponding pixel point in the color plaintext image, so as to decrypt the gray ciphertext image; the method for restoring each gray block to a corresponding pixel point in a color plaintext image specifically comprises the following steps: dividing 4 × 4 gray blocks into 6 color blocks, which are red blocks R 1 Red block R 2 'Green' color block G 1 'Green' color block G 2 Blue block B 1 And blue color block B 2 (ii) a And then acquiring a scanning mode corresponding to each color block, acquiring a primitive corresponding to the scanning mode according to a key corresponding to each color channel, and further restoring a bit layer corresponding to the pixel point according to the primitive, so that a pixel value corresponding to the pixel point is acquired according to 2 bit layers of the binary system, and the step of restoring the gray block into the corresponding pixel point is completed.
In summary, in the embodiment of the present invention, each pixel point in the color plaintext image to be encrypted is subjected to bit layer segmentation to obtain a corresponding primitive, then a self-defined scanning mode is allocated to each primitive to obtain a specific key, each pixel point in the color plaintext image to be encrypted is converted into a sub-block according to the scanning mode corresponding to each primitive in the key, the sub-block is assigned based on the key to obtain a final gray block, and a combination of the gray blocks corresponding to all the pixel points in the color plaintext image forms a gray ciphertext image, so as to achieve the purpose of encrypting the color plaintext image, improve the space of the key, and ensure the security and the defensive performance of encryption.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the scope of the present invention, which is intended to cover any modifications, equivalents, improvements, etc. within the spirit of the present invention.

Claims (8)

1. A network security encryption method based on artificial intelligence is characterized by comprising the following steps:
acquiring a color plaintext image to be encrypted; acquiring eight-bit binary digits corresponding to each pixel point in the color plaintext image; dividing each of the eight-bit binary digits into two bit layers, the bit layers comprising 16 types; each type of the bit layer corresponds to one element;
counting the frequency of each primitive appearing in the color plain text image, and performing descending order based on the frequency of all the primitives; the first N primitives in the frequency ordering are first primitives, and the remaining 16-N primitives are second primitives; n is a positive integer and N is less than 16; customizing a scan pattern of each first primitive and a scan pattern of each second primitive, the scan patterns comprising 24 forms;
constructing a sequence based on the first element and the corresponding scanning mode thereof, and the second element and the corresponding scanning mode thereof, and encrypting the sequence to obtain a key; constructing corresponding sub-blocks by the corresponding primitives of each pixel point in the color plaintext image;
assigning values to the sub-blocks according to the scanning mode of the corresponding elements of the pixel points to obtain gray blocks; and obtaining a gray ciphertext image according to the gray blocks corresponding to all the pixel points in the color plaintext image, wherein the gray ciphertext image is the encrypted image of the color plaintext image.
2. The artificial intelligence based network security encryption method of claim 1, wherein the method for constructing corresponding sub-blocks from the corresponding primitives of each pixel point in the color plaintext image comprises:
obtaining a basic element corresponding to each pixel point in the color plaintext image, wherein the basic elements comprise 6 basic elements under a red channel, a green channel and a blue channel; obtaining a scanning mode corresponding to each primitive according to the key;
obtaining 6 corresponding color blocks R which are respectively red blocks according to the scanning mode corresponding to each element 1 Red block R 2 Green color block G 1 'Green' color block G 2 Blue block B 1 And blue color block B 2 (ii) a Red color block R 1 And red block R 2 Transversely splicing to obtain red blocks, and combining the green blocks 1 And green color block G 2 Transversely splicing to obtain green block, and combining blue block B 1 And blue block B 2 Transversely splicing to obtain a blue block;
and splicing the red block, the green block and the blue block up and down, wherein the last row of the red block is overlapped with the first row of the green block, the last row of the green block is overlapped with the first row of the blue block, and the spliced image block is a sub-block corresponding to the pixel point in the color plaintext image.
3. The artificial intelligence based network security encryption method according to claim 1, wherein the method for assigning the sub-blocks to obtain the gray blocks according to the scanning pattern of the corresponding primitives of the pixel points comprises:
sequentially marking pixel points in any scanning mode according to the direction of a directed line segment in the scanning mode; and constructing a limiting condition according to the marked pixel points, assigning sub-blocks according to the limiting condition, and enabling the assigned sub-blocks to be gray blocks.
4. The artificial intelligence based network security encryption method of claim 3, wherein the method for sequentially marking the pixels in the scanning mode according to the direction of the directed line segment in any scanning mode comprises:
the scanning mode is constructed based on 2-by-2 pixel blocks, and the direction of the directed line segment is obtained based on pixel difference values between pixel points in the pixel blocks;
the starting scanning point in the pixel block is marked as s 1 The pixel points pointed by the directed line segment starting from the scanning starting point are marked as s 2 By a pixel point s 2 The pixel point pointed by the initial directed line segment is marked as s 3 From a pixel point s 3 The pixel point pointed by the initial directed line segment is marked as s 4
5. The artificial intelligence based network security encryption method according to claim 4, wherein the method for constructing the constraint condition according to the marked pixel points comprises:
obtaining the pixel point s in the marked pixel points 2 And a pixel point s 1 Pixel value in betweenThe difference is recorded as d 1 (ii) a Pixel point s 3 And a pixel point s 1 The difference between the pixel values is recorded as d 2 (ii) a Pixel point s 4 And a pixel point s 1 The difference between the pixel values is recorded as d 3
The limiting conditions are as follows: pixel point s 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4 The corresponding pixel value is monotonically increasing or monotonically decreasing and d 1 <d 2 <d 3
6. The artificial intelligence based network security encryption method according to claim 5, wherein the method for assigning the sub-blocks according to the limiting conditions comprises:
based on green color block G 1 The scanning mode obtains the pixel point s therein 1 Pixel point s 2 Pixel point s 3 And a pixel point s 4
Optionally giving a numerical value in a preset range to the green color block G 1 Middle pixel point s 1 Pixel value of
Figure FDA0003969214630000021
Based on the pixel value
Figure FDA0003969214630000022
And a pixel point s 2 And a pixel point s 1 Pixel value difference d between 1 Obtaining a pixel point s 2 Pixel value of
Figure FDA0003969214630000023
The pixel point s 2 And a pixel point s 1 Pixel value difference d between 1 Is any value selected within a first preset distance range;
selecting any value in a second preset distance range to give a pixel point s 3 And a pixel point s 1 Pixel value difference d between 2 And selecting any value in a third preset distance range to give the pixel point s 4 And a pixel point s 1 Pixel value difference d between 3 (ii) a According to the pixel value difference d 2 And a pixel point s 1 Pixel value of
Figure FDA0003969214630000024
Obtaining a pixel point s 3 Pixel value of
Figure FDA0003969214630000025
According to the pixel value difference d 3 And a pixel point s 1 Pixel value of
Figure FDA0003969214630000026
Obtaining a pixel point s 4 Pixel value of
Figure FDA0003969214630000027
Finish the green color block G 1 The value of (2);
based on green color block G 2 Obtaining the pixel point s in the scanning mode 1 And a pixel point s 2 Pixel point s 3 And a pixel point s 4 (ii) a Optionally giving the green color block G a numerical value within a preset range 2 Middle pixel point s 1 Pixel value of (2)
Figure FDA00039692146300000212
Taking any numerical value in the first preset distance range, the second preset distance range and the third preset distance range as a green color block G 2 Middle pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According to the green color block G 2 Pixel value difference d in (2) 1 Pixel value difference d 2 Pixel value difference d 3 And a pixel point s 1 Pixel value of (2)
Figure FDA0003969214630000028
Obtaining a pixel point s 2 Pixel value of
Figure FDA0003969214630000029
Pixel point s 3 Pixel value of
Figure FDA00039692146300000210
And a pixel point s 4 Pixel value of
Figure FDA00039692146300000211
Finish Pair Green color Block G 2 Assigning values of (1);
the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 Satisfies the restriction condition;
based on the evaluated green color block G 1 For red block R 1 And blue block B 1 Assigning values based on the assigned green color blocks G 2 For red block R 2 And blue block B 2 Carrying out assignment; assigned red block R 1 Red block R 2 Green color block G 1 Green color block G 2 Blue block B 1 And blue color block B 2 The sub-blocks formed are gray blocks.
7. The artificial intelligence based network security encryption method of claim 6, wherein the green color block G based on assignment is obtained by a method of a value-added method 1 For red block R 1 And blue block B 1 Assigning values based on the assigned green color blocks G 2 For red block R 2 And blue block B 2 A method of assigning values, comprising:
based on the green color block G after assignment 1 Obtaining the red color block R 1 The pixel value of the last row of the middle-row pixels; calculating the red color block R 1 The pixel value difference value between the last line of pixel points in the red color block R is compared with the red color block R according to the type of the pixel value difference value 1 And assigning, wherein the types of the pixel value difference values comprise: pixel value difference d 1 Pixel value difference d 2 Pixel value difference d 3 Pixel value difference d 4 Pixel value difference d 5 And a pixel value difference d 6 (ii) a The pixel value difference d 4 Is a pixel point s 3 And a pixel point s 2 Pixel value difference therebetween; the pixel value difference d 5 Is a pixel point s 4 And a pixel point s 2 Pixel value difference therebetween; the pixel value difference d 6 Is a pixel point s 4 And a pixel point s 3 Pixel value difference therebetween;
based on the green color block G after assignment 1 Obtaining the blue color block B 1 The pixel values of the pixels in the first row are calculated; calculating the blue color block B 1 The pixel value difference value between the first row of pixel points in the middle is used for aligning the blue block B according to the type of the pixel value difference value 1 Carrying out assignment;
based on the green color block G after assignment 2 Obtaining the red color block R 2 The pixel values of the last row of the middle-row pixels; calculating the red color block R 2 The pixel value difference value between the last line of pixel points in the red color block R is adjusted according to the type of the pixel value difference value 2 Carrying out assignment;
based on the green color block G after assignment 2 Obtaining the blue color block B 2 The pixel values of the middle first row of pixel points; calculating the blue color block B 2 The pixel value difference between the first row of middle pixels and the first row of pixels is calculated according to the type of the pixel value difference, and the blue block B is subjected to color matching 2 And carrying out assignment.
8. The artificial intelligence based network security encryption method of claim 7, wherein the red color block R is subjected to the classification of the pixel value difference 1 The method for assigning the value comprises the following steps:
if the pixel value difference is d 1 Said red color block R 1 Middle pixel point s 1 And a pixel point s 2 According to said pixel point s 1 And a pixel point s 2 Determines the red block R 1 Monotonicity of (2); setting a pixel value difference d 2 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 2 And the pixel value difference d 3 (ii) a According to pixel point s 1 Pixel value, pixel value difference d 2 Pixel value difference d 3 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 3 And a pixel value and a pixel point s 4 A pixel value of (a);
if the pixel value difference is d 2 Said red color block R 1 Middle pixel point s 1 And a pixel point s 3 Is known, based on said pixel point s 1 And a pixel point s 3 Determines the red block R 1 Monotonicity of (2); setting a pixel value difference d 1 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 And the pixel value difference d 3 (ii) a According to the pixel point s 1 Pixel value, pixel value difference d 1 Pixel value difference d 3 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 2 Pixel value and pixel point s 4 A pixel value of (a);
if the pixel value difference is d 3 Said red color block R 1 Middle pixel point s 1 And a pixel point s 4 According to said pixel point s 1 And a pixel point s 4 Determines the red block R 1 Monotonicity of (2); setting a pixel value difference d 1 And a pixel value difference d 2 In which an optional value is taken as the pixel value difference d 1 And the pixel value difference d 2 (ii) a According to the pixel point s 1 Pixel value, pixel value difference d 1 Pixel value difference d 2 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 2 Pixel value and pixel point s 3 A pixel value of (a);
if the pixel value difference is d 4 Said red color block R 1 Middle pixel point s 2 And a pixel point s 3 According to said pixel point s 2 And a pixel point s 3 Determines the red block R 1 Monotonicity of (2); obtaining a pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According to the pixel point s 2 Pixel value and pixel value difference d 1 Pixel value difference d 3 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 1 Pixel value and pixel point s 4 A pixel value of (a);
if the pixel value difference is d 5 Said red color block R 1 Middle pixel point s 4 And pixel point s 2 Is known, based on said pixel point s 4 And a pixel point s 2 Determines the red block R 1 Monotonicity of (2); obtaining a pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According to the pixel point s 2 Pixel value, pixel value difference d 1 Pixel value difference d 2 And obtaining the red color block R by the monotonicity 1 Middle pixel point s 1 Pixel value and pixel point s 3 A pixel value of (a);
if the pixel value difference is d 6 Said red color block R 1 Middle pixel point s 4 And a pixel point s 3 According to said pixel point s 4 And a pixel point s 3 Determines the red block R 1 Monotonicity of (2); obtaining a pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 In which an optional value is taken as the pixel value difference d 1 Pixel value difference d 2 And a pixel value difference d 3 (ii) a According to the pixel point s 3 Pixel value, pixel value difference d 1 Pixel value difference d 2 And obtaining the pixel point s by the monotonicity 1 Pixel value and pixel point s 2 The pixel value of (2).
CN202211506473.XA 2022-11-29 2022-11-29 Network security encryption method based on artificial intelligence Active CN115733933B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211506473.XA CN115733933B (en) 2022-11-29 2022-11-29 Network security encryption method based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211506473.XA CN115733933B (en) 2022-11-29 2022-11-29 Network security encryption method based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN115733933A true CN115733933A (en) 2023-03-03
CN115733933B CN115733933B (en) 2023-10-31

Family

ID=85299072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211506473.XA Active CN115733933B (en) 2022-11-29 2022-11-29 Network security encryption method based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN115733933B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003304522A (en) * 2002-04-11 2003-10-24 Sony Corp Image signal transmission apparatus and method, and image signal receiving apparatus and method
US20050238260A1 (en) * 2004-04-16 2005-10-27 Dave Coleman Image and optical mark scanner with encryption
CN103546750A (en) * 2013-10-22 2014-01-29 中国人民解放军重庆通信学院 H.264 video encryption method based on region of interest
CN110086601A (en) * 2019-04-28 2019-08-02 郑州轻工业学院 Based on the associated Josephus traversing of pixel value and hyperchaotic system image encryption method
US20210044431A1 (en) * 2018-08-08 2021-02-11 Shandong University Of Science And Technology Gray image visual encription method
CN115242931A (en) * 2022-09-16 2022-10-25 江苏司笠泰信息科技有限公司 Data storage method of ERP management system
CN115277974A (en) * 2022-08-01 2022-11-01 南京交通职业技术学院 Management system and encryption method of intelligent traffic monitoring video based on Internet of things

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003304522A (en) * 2002-04-11 2003-10-24 Sony Corp Image signal transmission apparatus and method, and image signal receiving apparatus and method
US20050238260A1 (en) * 2004-04-16 2005-10-27 Dave Coleman Image and optical mark scanner with encryption
CN103546750A (en) * 2013-10-22 2014-01-29 中国人民解放军重庆通信学院 H.264 video encryption method based on region of interest
US20210044431A1 (en) * 2018-08-08 2021-02-11 Shandong University Of Science And Technology Gray image visual encription method
CN110086601A (en) * 2019-04-28 2019-08-02 郑州轻工业学院 Based on the associated Josephus traversing of pixel value and hyperchaotic system image encryption method
CN115277974A (en) * 2022-08-01 2022-11-01 南京交通职业技术学院 Management system and encryption method of intelligent traffic monitoring video based on Internet of things
CN115242931A (en) * 2022-09-16 2022-10-25 江苏司笠泰信息科技有限公司 Data storage method of ERP management system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SURA F. YOUSIF: "Robust Image Encryption With Scanning Technology, the El-Gamal Algorithm and Chaos Theory", 《 IEEE ACCESS》 *
谭芳芳;张剑;刘黎辉;李巍;: "改进的置乱扩散同步实现的图像加密算法", 湖南科技大学学报(自然科学版), no. 01 *

Also Published As

Publication number Publication date
CN115733933B (en) 2023-10-31

Similar Documents

Publication Publication Date Title
CN115272502B (en) Software research and development data security management method based on code conversion
CN112800444B (en) Color image encryption method based on two-dimensional chaotic mapping
Peng et al. Reversible data hiding based on RSBEMD coding and adaptive multi-segment left and right histogram shifting
CN110166784B (en) Adaptive image texture area steganography method based on pixel blocks
CN112597519A (en) Non-key decryption method based on convolutional neural network in OFDM (orthogonal frequency division multiplexing) encryption system
Srinivasan et al. A novel approach for color image, steganography using nubasi and randomized, secret sharing algorithm
Essa et al. Steganography technique using genetic algorithm
CN111082919B (en) Dynamic probability 16cap mapping encryption method
CN110677552B (en) Carrier-free information hiding method based on complete packet bases
CN115567329A (en) Data security encryption method for network information
CN109586895B (en) Novel color image encryption method
Elshare et al. Modified multi-level steganography to enhance data security
Kumar et al. Selective colour image encryption using Hénon chaotic system with a keyless substitution cipher.
CN115733933A (en) Network security encryption method based on artificial intelligence
CN115861034B (en) Wireless routing data intelligent management system
Chen et al. Multi-layer mini-sudoku based high-capacity data hiding method
Solak et al. A new approach for Steganography: Bit shifting operation of encrypted data in LSB (SED-LSB)
CN114969796A (en) Image steganography method and system combining QR (quick response) code and S-box chaotic scrambling
Munir Chaos-based modified “EzStego” algorithm for improving security of message hiding in GIF image
Luo et al. Robust and progressive color image visual secret sharing cooperated with data hiding
Ali A Review of Image Steganography Techniques
Prabhakar Enhancing Privacy-preserving Image Sharing-A Supervised Machine Learning Approach for Reversible Data Hiding in Encrypted Images with Multiple Data Embedders
Perumal et al. Robust multitier spatial domain secured color image steganography in server environment
Waghmare et al. Holo-entropy and advanced encryption standard for wavelet-based image steganography
CN111934845B (en) Image encryption method based on DNA coding

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20231008

Address after: Room 501, Building D, Tengfei Building, No. 88 Jiangmiao Road, Yanchuangyuan, Nanjing Area, China (Jiangsu) Pilot Free Trade Zone, Nanjing City, Jiangsu Province, 210000

Applicant after: Nanjing Xianwei Information Technology Co.,Ltd.

Address before: Room 202, No. 14, Tangtou Road, Huangpu District, Guangzhou, Guangdong, 510000

Applicant before: Guangzhou Taolu Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant