CN116226891B - Face image data encryption method - Google Patents

Face image data encryption method Download PDF

Info

Publication number
CN116226891B
CN116226891B CN202310508002.0A CN202310508002A CN116226891B CN 116226891 B CN116226891 B CN 116226891B CN 202310508002 A CN202310508002 A CN 202310508002A CN 116226891 B CN116226891 B CN 116226891B
Authority
CN
China
Prior art keywords
image
binary
images
bit
double
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310508002.0A
Other languages
Chinese (zh)
Other versions
CN116226891A (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.)
Ningbo Institute of Finance and Economics
Original Assignee
Ningbo Institute of Finance and Economics
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 Ningbo Institute of Finance and Economics filed Critical Ningbo Institute of Finance and Economics
Priority to CN202310508002.0A priority Critical patent/CN116226891B/en
Publication of CN116226891A publication Critical patent/CN116226891A/en
Application granted granted Critical
Publication of CN116226891B publication Critical patent/CN116226891B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/08Computing arrangements based on specific mathematical models using chaos models or non-linear system models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Abstract

The invention discloses a face image data encryption method, which relates to the technical field of image encryption, and comprises the following steps: acquiring three single-channel images of a face image and four double-bit images of each single-channel image; acquiring four binary images of each double-bit image; obtaining the assigned set size of the binary image by using the number of white pixel points in the binary image and the area of the connected domain; scrambling the gray value sequence by using the chaotic sequence obtained by the chaotic mapping model to obtain a scrambling sequence; sequentially dividing a scrambling sequence by using the value set size of each binary image in the double-bit image to obtain a value set of the binary image; assigning values to white pixel points in the binary image by using the assignment set, and superposing the assigned binary image to obtain an assignment image of the double-bit image; the invention improves the security of the encryption of the face image by utilizing the assignment image to combine to obtain the ciphertext image of the face image.

Description

Face image data encryption method
Technical Field
The invention relates to the technical field of image encryption, in particular to a face image data encryption method.
Background
Face image recognition is considered to be the most natural and reliable technique in all biometric measurements and is therefore used in more and more applications such as face punching, face payment, face ticket checking, etc. With the increase of application scenes of face image recognition, face image data are acquired by more programs, the risk of face image information leakage is increased, and in order to ensure the safety of the face image information, the face image data need to be encrypted.
The adjacent pixels of the face image have higher correlation, and an attacker can predict the gray value of the next pixel by utilizing any one pixel in the encrypted image and the correlation reasoning among the pixels, so that the recovery of the whole face image is realized. The conventional image encryption method for scrambling based on chaotic mapping is only scrambling of pixel coordinate positions, and although the correlation among the pixel points in the image can be broken to a certain extent, the analysis attack of an attacker cannot be completely resisted.
Disclosure of Invention
The invention provides a face image data encryption method to solve the existing problems.
The invention relates to a face image data encryption method, which adopts the following technical scheme:
acquiring a face image and three single-channel images of the face image, converting each single-channel image into four double-bit images, wherein the face image is an RGB image;
each time, marking one type of code in each double-bit image as a white pixel point, and marking the other coded pixel points as black pixel points to obtain four binary images corresponding to each double-bit image;
taking the number of white pixel points in each binary image as the statistical characteristic of the binary image; carrying out connected domain analysis on white pixel points in each binary image to obtain a plurality of connected domains, and using a box diagram drawn by the area of each connected domain in the binary image, wherein a numerical value corresponding to the upper quartile bit line of the box diagram is used as the continuous characteristic of the binary image;
calculating the assigned set size of the corresponding binary image according to the statistical feature and the continuous feature of each binary image;
obtaining a chaotic sequence according to a preset safety key and a chaotic mapping model, and matching according to the chaotic sequenceScrambling the gray value sequence of (2) to obtain a scrambling sequence;
dividing the disordered sequence according to the sequence by using the value set size of each binary image in the double-bit image to obtain the value set of each binary image in the double-bit image;
assigning white pixel points in the binary images by using values in an assignment set of each binary image in the double-bit image to obtain assigned binary images, wherein the values of the white pixel points in each assigned binary image are positioned in the assignment set of the corresponding binary image; superposing all assigned binary images in each double-bit image to obtain assigned images of the corresponding double-bit images;
splicing assigned images corresponding to the four double-bit images of each single-channel image to obtain assigned component images of the single-channel image; and combining assigned component images corresponding to the three single-channel images in the face image to obtain a ciphertext image of the face image.
Further, the step of obtaining three single-channel images of the face image and converting each single-channel image into four double-bit images includes:
three single-channel images of the face image are obtained, wherein the three single-channel images comprise a red channel image, a green channel image and a blue channel image;
converting the pixel value of the pixel point in each single-channel image into a numerical value formed by 8 bits;
dividing 8 bits of pixel points in each single-channel image into 4 groups, and recombining a double-bit image by utilizing corresponding numerical values of each group of all the pixel points in the single-channel image;
the 4 sets of values for the pixels in each single channel image correspond to four two-bit images.
Further, the step of obtaining four binary images corresponding to each two-bit image includes:
the coding of pixel points in the double-bit image is 00, 01, 10 and 11;
marking a type of pixel point coded as 00 in the double-bit image as a white pixel point, and marking the rest pixel points in the double-bit image as black pixel points to obtain a first binary image of the double-bit image;
similarly, one type of pixel points coded into 01, 10 and 11 in the double-bit image are marked as white pixel points, and the other pixel points in the double-bit image are marked as black pixel points, so that three different binary images are obtained;
i.e. four binary images per bit image.
Further, the formula for calculating the assigned set size of each binary image according to the statistical feature and the continuous feature of the binary image is as follows:
wherein, the liquid crystal display device comprises a liquid crystal display device,indicate->The assigned set size of the binary images; />Indicate->Successive features of the binary images;indicate->Statistical features of the two binary images; />Representing the sum of the products of the continuous features and the statistical features of the four binary images in the two-bit image.
Further, the step of dividing the disordered sequence in sequence by using the value set size of each binary image in the two-bit image to obtain the value set of each binary image in the two-bit image includes:
the method comprises the steps of arranging the assigned set sizes of binary images according to the sequence of the binary images corresponding to 00, 01, 10 and 11 to obtain a assigned set size sequence of the double-bit image;
and dividing the scrambling sequence into four sections by using the assignment set size sequence of the double-bit image, and taking the divided four sections of scrambling sequence as the assignment set of the corresponding binary image.
Further, the sequence of assigned set sizes for each two-bit image is stored encrypted.
Further, the step of assigning white pixels in the binary image by using the assignment set of each binary image to obtain an assigned binary image includes:
the connected domain with the area not larger than the assigned set size of the binary image in the binary image is marked as a first connected domain;
randomly selecting a number of values which are equal to the area of a first communication domain from a value assignment set of a binary image as a target value assignment set of the first communication domain, and randomly assigning values to white pixel points in the first communication domain by using the values in the target value assignment set;
the connected domain with the area larger than the assigned set size of the binary image in each binary image is marked as a second connected domain;
uniformly dividing the second connected domain into a plurality of small connected domains according to the area of the second connected domain and the assigned set size of the binary image where the second connected domain is located;
randomly selecting a number of values equal to the area of the small connected domain from a value assignment set of the binary image as a target value assignment set of the small connected domain, and randomly assigning values to white pixel points in the small connected domain by using the values in the target value assignment set;
and all the white pixel points of all the connected domains in the binary image are assigned to obtain an assigned binary image.
Further, the method for decrypting the ciphertext image of the face image comprises the following steps:
obtaining three ciphertext single-channel images of the ciphertext image, and uniformly dividing each ciphertext single-channel image to obtain four block images of each ciphertext single-channel image, wherein the block images of the ciphertext single-channel image correspond to assigned images of the face image;
obtaining a scrambling sequence by using the security key, the chaotic mapping model and the gray value sequence;
decrypting the encrypted assigned set size sequence to obtain an assigned set size sequence; obtaining an assignment set sequence of the block image according to the assignment set size sequence and the scrambling sequence of the double-bit image corresponding to the block image;
obtaining the code of the ciphertext pixel point in the double-bit image according to the assignment set sequence of each block image and the gray value of the ciphertext pixel point in the block image, updating the ciphertext pixel point in the block image by utilizing the code, and marking the updated block image as a new double-bit image, wherein the ciphertext pixel point refers to a white pixel point for assignment in the encryption process;
sequentially splicing codes of each pixel point in the ciphertext single-channel image in four new double-bit images to obtain 8-bit binary values, and converting the binary values into decimal values to obtain gray values of each pixel point in the decrypted single-channel image;
and according to the gray values of the pixel points in the decrypted three single-channel images, decrypting the face image.
The beneficial effects of the invention are as follows: according to the face image data encryption method, different values are given to the same pixel points coded in the same communication domain, so that stronger correlation between adjacent pixel points of a face image is broken, an attacker cannot deduce the gray value of the next pixel point by utilizing the correlation of the adjacent pixel points, and the face image is encrypted; and different values are given to the white pixels in the same connected domain, so that assignment results of the white pixels in the same connected domain are very chaotic, and therefore correlation analysis attacks of attackers can be furthest resisted, and the safety of face information is improved. In addition, the invention encrypts the double-bit image of the face image and recombines the encrypted double-bit image to obtain the ciphertext image, and the method ensures that the gray level histogram of the ciphertext image is completely different from the gray level histogram of the face image, so the face image can not be obtained by carrying out statistical analysis summarization rules on the gray level value of the ciphertext image, thereby the invention can resist the statistical analysis attack of an attacker and increase the safety of the face image information.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart showing the overall steps of embodiment 1 of a face image data encryption method according to the present invention;
FIG. 2 is a value component image;
fig. 3 is a flowchart of the general steps of embodiment 2 for decrypting ciphertext images to obtain face images.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment 1 of a face image data encryption method of the present invention, as shown in fig. 1, includes:
s1, acquiring a face image and three single-channel images of the face image, and converting each single-channel image into four double-bit images, wherein the face image is an RGB image.
Specifically, the collected face image is a color RGB image, and three single-channel images are extracted from the color face image: red channel image, green channel image, and blue channel image.
The pixel value range of the pixel points in each single-channel image is as followsConverting decimal pixel values of pixel points in each single-channel image intoBinary pixel values with interval of +.>The binary pixel value of each pixel point is converted into a numerical value formed by 8 bits, namely, each pixel point in the single-channel image corresponds to a numerical value formed by 8 bits.
And carrying out bit plane decomposition on 8 bits of the pixel point of the single-channel image to obtain four double-bit images of each single-channel image. The specific mode is that 8 bits of each pixel point are sequentially divided into 4 groups of codes of two bits and one group, for example 10010001 should be divided into 10, 01, 00 and 01, each group of codes of all pixel points in a single-channel image is utilized to reconstruct a double-bit image, each group of codes of the pixel points in each single-channel image corresponds to one double-bit image, four groups of codes correspond to four double-bit images, and a first group of codes in sequence, namely 10 corresponds to a first double-bit image, and a second, third and fourth double-bit images are sequentially used.
S2, marking one type of codes in each double-bit image as white pixel points each time, and marking the other coded pixel points as black pixel points to obtain four binary images corresponding to each double-bit image.
There are 4 cases of encoding pixel points in a two-bit image: 00. 01, 10, 11; marking a type of pixel point coded as 00 in each double-bit image as a white pixel point, marking 1, marking the rest pixel points in each double-bit image as black pixel points, marking 0, and obtaining a first binary image of each double-bit image, wherein the binary image is a binary image corresponding to the coded 00;
in the same way, a class of pixel points coded as 01, 10 and 11 in each double-bit image are marked as white pixel points, marked as 1, the rest pixel points in the double-bit image are marked as black pixel points, marked as 0, and the codes 01, 10 and 11 correspond to a binary image respectively; then there are four binary images per two-bit image.
S3, taking the number of white pixel points in each binary image as the statistical characteristic of the binary image; carrying out connected domain analysis on white pixel points in each binary image to obtain a plurality of connected domains, and using a box diagram drawn by the area of each connected domain in the binary image, wherein a numerical value corresponding to the upper quartile bit line of the box diagram is used as the continuous characteristic of the binary image; and calculating the assigned set size of the corresponding binary image according to the statistical feature and the continuous feature of each binary image.
And carrying out connected domain analysis on the white pixel points in each binary image to obtain a plurality of connected domains, namely the connected domains are the white pixel points.
In order to ensure that the encrypted ciphertext image can break the strong correlation of the face image, the correlation analysis attack of an attacker is prevented to the greatest extent, different values are required to be assigned to the white pixels of the same connected domain in the binary image, so that the white pixels of the same connected domain become disordered after assignment, and the strong correlation of the face image is broken. If different values are to be assigned to different white pixels in the same connected domain, the number of the values in the assigned set, namely the size of the assigned set, is not smaller than the number of the white pixels in the connected domain, and for the convenience of calculation, the size of the assigned set is not smaller than the largest area of the connected domain in the binary image, the size of the assigned set can meet each connected domain, and enough confusion after assignment of each connected domain in the binary image is ensured.
The two-bit image has four binary images, so that the assignment sets of the four binary images of the two-bit image cannot be intersected with each other for facilitating the subsequent restoration of the encrypted ciphertext image, but the selectable assignment sets of the four binary images have limited size (because of the need to restore fromThe number of pixels to be assigned, that is, the number of white pixels, is greater, the length of the assignment set is greater, that is, the size of the assignment set is greater, so as to ensure the overall chaotic degree of the ciphertext image.
Therefore, the size of the assignment set of each binary image needs to be determined according to the number of white pixels in each binary image and the area of the connected domain.
Specifically, the number of white pixels in each binary image is obtained as the statistical feature of the binary image.
Drawing a box diagram according to the area of each connected domain in the binary image, wherein the drawing of the box diagram is a known technology, and the upper four-way line of the box diagram is marked as the continuous characteristic of the binary image.
The formula for calculating the assigned set size of the corresponding binary image according to the statistical feature and the continuous feature of each binary image is as follows:
wherein, the liquid crystal display device comprises a liquid crystal display device,indicate->The assigned set size of the binary images; />Indicate->Successive features of the binary images;indicate->Statistical features of the two binary images; />Representing the sum of products of continuous features and statistical features of four binary images in the two-bit image; />Indicate->The larger the duty ratio of the continuous feature and the statistical feature products of the binary images in the product sum, the larger the duty ratio is, the larger the number of white pixel points in the binary images is considered, the larger the area of the connected domain is, and the larger the corresponding assigned set size is supposed to be; the duty cycle of each binary image is multiplied by 256 because of the need to multiply the binary image by the binary imageThe gray values of the four binary images are obtained, and 256 selectable assignment values are obtained.
Thus, the assigned set size of each binary image in the two-bit image is obtained. The obtained assigned set sizes are sequenced in the following specific modes: four binary images are arranged in the double-bit image, and the codes of white pixel points in each binary image are respectively 00, 01, 10 and 11, namely 00, 01, 10 and 11 respectively correspond to one binary image; and arranging the assigned set sizes of the binary images according to the sequence of the binary images corresponding to 00, 01, 10 and 11 to obtain a corresponding assigned set size sequence of the double-bit image.
And respectively encrypting and storing the assignment set size sequences of twelve double-bit images corresponding to the three single-channel images of the face image for subsequent decryption of the ciphertext image, and optionally encrypting the assignment set size sequences of the double-bit images by using a conventional RSA encryption algorithm for encrypting the text data.
S4, obtaining a chaotic sequence according to a preset safety key and a chaotic mapping model, and performing mapping on the chaotic sequenceScrambling the gray value sequence of (2) to obtain a scrambling sequence.
Specifically, a chaotic sequence and a secret key are acquired by using a logistic chaotic map. The model of the logistic chaotic map is as followsWhen the coefficient->When the system enters a chaotic state, the +.>A chaotic sequence therebetween. At->、/>、/>Randomly generated key within the range of (2)>And stores the encryption key for the purpose of decrypting the encrypted ciphertext image later, iterating the chaotic mapping model ++>Next, to prevent the initial value interference, the former +.>Numerical value, let->Since the first 30 values obtained by the chaotic mapping model are not chaotic enough, the values are chosen from 30 values later, since the 256 values remaining after the removal of these 30 values are +.>The number of the chaos sequences is multiplied by the integer, so that the 256 values are multiplied by the integer and then rounded, and optionally, the 256 values are multiplied by 20 and then rounded, so that the chaos sequences with the length of 256 are obtained.
Using chaotic sequence pairsScrambling the gray value sequence of (2) to obtain a scrambling sequence. Will->The integers are arranged in order from small to large as a gray value sequence to obtain a first numerical value +.>The +.>The integer is taken out, put into the scrambling sequence as the first value, and the +.>The integers are removed from the sequence of integers; obtaining a second value +.>The +.>The integer is taken out, put into the scrambling sequence as the second value, and the +.>The integers are removed from the sequence of integers and so on, and the operation is repeated until the sequence of gray values is null, resulting in a scrambling sequence of the sequence of gray values.
S5, dividing the disordered sequence according to the sequence by using the value set size of each binary image in the double-bit image to obtain the value set of each binary image in the double-bit image.
Specifically, the scrambling sequence is divided into four sections by using the assignment set size sequence of the double-bit image, and the divided four sections of scrambling sequence are used as the assignment set of the corresponding binary image.
For example, the assigned set sizes of binary images in the two-bit image are arranged in the order of 00, 01, 10, 11, and the assigned set size sequence of the two-bit image is thatThen->Assigned set size for binary image corresponding to 00,/->Assigning a set size for the binary image corresponding to 01,/->The set of values for the binary image corresponding to 10 is sized,and assigning a set size to the binary image corresponding to 11. Before in scrambling sequence>The set formed by the numerical values is used as a value set of binary images corresponding to 00; the scrambling sequence is +.>To->The set formed by the numerical values is used as a value set of the binary image corresponding to 01; before in scrambling sequence>The set formed by the numerical values is used as a value set of binary images corresponding to 00; the scrambling sequence is +.>To->The set formed by the numerical values is used as a value set of binary images corresponding to 10; the remainder of the scrambling sequence +.>The set of numerical values is used as the assigned set of binary images corresponding to 11.
And ordering the assignment set of each binary image in the two-bit images according to the order of 00, 01, 10 and 11 to obtain an assignment set sequence of the two-bit images.
S6, using the numerical value in the assignment set of each binary image in the double-bit image to assign the white pixel point in the binary image to obtain an assigned binary image, wherein the value of the white pixel point in each assigned binary image is positioned in the assignment set of the corresponding binary image; and superposing all the valued binary images in each double-bit image to obtain an assigned image of the corresponding double-bit image.
The method of assigning a white pixel point to each binary image in each binary image is the same, and this step is illustrated by taking one of the binary images as an example.
Specifically, a connected domain with the area not larger than the assigned set size of the binary image in the binary image is marked as a first connected domain; randomly selecting the numerical value with the same number as the area of the first communication domain from the assignment set of the binary image as a target assignment set of the first communication domain, and randomly assigning the white pixel points in the first communication domain by using the numerical value in the target assignment set.
The connected domain with the area larger than the assigned set size of the binary image in each binary image is marked as a second connected domain; uniformly dividing the second connected domain into a plurality of small connected domains according to the area of the second connected domain and the assigned set size of the binary image where the second connected domain is located, namely uniformly dividing the second connected domain into a plurality of small connected domainsSmall connected domains of the same area, wherein ∈>For the area of the connected domain, +.>Assigning a set size +.>Representing an upward rounding; from binary mapsAnd randomly selecting the numerical values with the same number as the area of the small connected domain from the assignment set of the image as a target assignment set of the small connected domain, and randomly assigning the white pixel points in the small connected domain by using the numerical values in the target assignment set.
The method is used for finishing the assignment of each binary image in each double-bit image, and the assigned binary images in the double-bit images are overlapped to obtain assigned images of the double-bit images.
S7, splicing assignment images corresponding to the four double-bit images of each single-channel image to obtain assignment component images of the single-channel image; and combining assigned component images corresponding to the three single-channel images in the face image to obtain a ciphertext image of the face image.
Specifically, in step S6, the assigned image of each two-bit image is obtained, the face image has three single-channel images, each single-channel image corresponds to four two-bit images, each single-channel image corresponds to four assigned images after assignment, the four assigned images of the single-channel images are respectively used as the upper left corner image block, the upper right corner image block, the lower left corner image block and the lower right corner image block of the spliced image in sequence, and the image after the four assigned images of the single-channel images are spliced is recorded as the assigned component image of the single-channel image as shown in fig. 2.
And combining the assigned component images of the three single-channel images to obtain the ciphertext image of the face image.
Embodiment 2, embodiment 2 is a method for decrypting a ciphertext image to obtain a face image, as shown in fig. 3, where the method includes:
s101, acquiring three ciphertext single-channel images of the ciphertext image, and uniformly dividing each ciphertext single-channel image to obtain four block images of each ciphertext single-channel image.
Specifically, three ciphertext single-channel images of the ciphertext image are obtained, and the three ciphertext single-channel images correspond to three assigned component images in encryption respectively; dividing each ciphertext single-channel image to obtain four block images of each ciphertext single-channel image, wherein the positions of the four block images in the ciphertext single-channel image correspond to the positions of assignment images in assignment component images when the face images are encrypted respectively, and each assignment image corresponds to a double-bit image, so that each block image corresponds to a double-bit image in one face image; and obtaining twelve block images corresponding to the three ciphertext single-channel images of the ciphertext image after all the division.
S102, obtaining a scrambling sequence by using a secret key, a chaotic mapping model and a gray value sequence; and obtaining the assignment set sequence of the block image according to the assignment set size sequence and the scrambling sequence of the double-bit image corresponding to the block image.
The secure key is stored at the time of encryption, so the scrambling sequence at the time of decryption is obtained according to the method for obtaining scrambling sequence in embodiment 1 using the stored key, the chaotic mapping model, and the gray value sequence.
Decrypting the stored assigned set size sequence to obtain an assigned set size sequence of each double-bit image, corresponding the block images to the double-bit images to obtain an assigned set size sequence of each block image, and dividing the disorder sequence by using the assigned set size sequence to obtain the assigned set sequence of each block image.
S103, obtaining codes of the ciphertext pixel points in the double-bit image according to the assignment set sequence of each block image and gray values of the ciphertext pixel points in the block image, updating the ciphertext pixel points in the block image by utilizing the codes, and marking the updated block image as a new double-bit image, wherein the ciphertext pixel points refer to white pixel points for assignment in the encryption process.
The block images are encoded according to the assignment set sequences of the block images, and the assignment set sequences corresponding to each block image are formed by assignment sets of binary images with white pixel point codes of 00, 01, 10 and 11 respectively during encryption, so that assignment sets corresponding to codes 00, 01, 10 and 11 are respectively arranged in the assignment set sequences of each block image.
Coding all ciphertext pixel points with gray values in a value set corresponding to coding 00 into 00 in each block image; coding all ciphertext pixel points in the assignment set corresponding to the gray value of 01 into 01 in the block image; coding all ciphertext pixel points with gray values in a value set corresponding to 10 into 10 in a block image; coding all ciphertext pixel points with gray values in an 11 assignment set into 11 in the block image; the block image after the code update is noted as a new double-bit image, which is the same as the double-bit image in embodiment 1, i.e. the block image has been restored back to the double-bit image, and is noted as a new double-bit image only for naming distinction from the double-bit image of the single-channel image in embodiment 1.
S104, sequentially splicing codes of each pixel point in the ciphertext single-channel image in four new double-bit images to obtain 8-bit binary values, and converting the binary values into decimal values to obtain gray values of each pixel point in the decrypted single-channel image; and according to the gray values of the pixel points in the decrypted three single-channel images, decrypting the face image.
Specifically, in step S103, encoding of four block images of each ciphertext single-channel image has been completed, and four new double-bit images of each ciphertext single-channel image are obtained; four codes of four pixels of the same position of four new double-bit images of each ciphertext single-channel image are spliced into an 8-bit binary number according to sequence, the 8-bit binary number is converted into a decimal number, the decimal number is reset to the gray value of the pixel of the position in the ciphertext single-channel image, the gray value of the pixel in the ciphertext single-channel image is reset to obtain a single-channel image after the ciphertext single-channel image is decrypted, and the decrypted three single-channel images are combined into a color image, namely a face image after the ciphertext image is decrypted.
In summary, the invention provides a method for encrypting face image data, which is characterized in that different values are given to the same pixel points coded in the same connected domain, so that stronger correlation between adjacent pixel points of the face image is broken, an attacker cannot infer the gray value of the next pixel point by utilizing the correlation of the adjacent pixel points, and the face image is encrypted; and different values are given to the white pixels in the same connected domain, so that assignment results of the white pixels in the same connected domain are very chaotic, and therefore correlation analysis attacks of attackers can be furthest resisted, and the safety of face information is improved. In addition, the invention encrypts the double-bit image of the face image and recombines the encrypted double-bit image to obtain the ciphertext image, and the method ensures that the gray level histogram of the ciphertext image is completely different from the gray level histogram of the face image, so the face image can not be obtained by carrying out statistical analysis summarization rules on the gray level value of the ciphertext image, thereby the invention can resist the statistical analysis attack of an attacker and increase the safety of the face image information.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.

Claims (6)

1. A method for encrypting face image data is characterized in that:
acquiring a face image and three single-channel images of the face image, and converting each single-channel image into four double-bit images, wherein the face image is an RGB image;
each time, marking one type of code in each double-bit image as a white pixel point, and marking the other coded pixel points as black pixel points to obtain four binary images corresponding to each double-bit image;
taking the number of white pixel points in each binary image as the statistical characteristic of the binary image; carrying out connected domain analysis on white pixel points in each binary image to obtain a plurality of connected domains, and using a box diagram drawn by the area of each connected domain in the binary image, wherein a numerical value corresponding to the upper quartile bit line of the box diagram is used as the continuous characteristic of the binary image;
calculating the assigned set size of the corresponding binary image according to the statistical feature and the continuous feature of each binary image;
obtaining a chaotic sequence according to a preset safety key and a chaotic mapping model, and matching according to the chaotic sequenceScrambling the gray value sequence of (2) to obtain a scrambling sequence;
dividing the disordered sequence according to the sequence by using the value set size of each binary image in the double-bit image to obtain the value set of each binary image in the double-bit image;
assigning white pixel points in the binary images by using values in an assignment set of each binary image in the double-bit image to obtain assigned binary images, wherein the values of the white pixel points in each assigned binary image are positioned in the assignment set of the corresponding binary image; superposing all assigned binary images in each double-bit image to obtain assigned images of the corresponding double-bit images;
splicing assigned images corresponding to the four double-bit images of each single-channel image to obtain assigned component images of the single-channel image; combining assigned component images corresponding to three single-channel images in the face image to obtain a ciphertext image of the face image;
the step of obtaining three single-channel images of the face image and converting each single-channel image into four double-bit images comprises the following steps:
three single-channel images of the face image are obtained, wherein the three single-channel images comprise a red channel image, a green channel image and a blue channel image;
converting the pixel value of the pixel point in each single-channel image into a numerical value formed by 8 bits;
dividing 8 bits of pixel points in each single-channel image into 4 groups, and recombining a double-bit image by utilizing corresponding numerical values of each group of all the pixel points in the single-channel image;
the 4 groups of numerical values of the pixel points in each single-channel image correspond to four double-bit images;
the step of obtaining four binary images corresponding to each two-bit image comprises the following steps:
the coding of pixel points in the double-bit image is 00, 01, 10 and 11;
marking a type of pixel point coded as 00 in the double-bit image as a white pixel point, and marking the rest pixel points in the double-bit image as black pixel points to obtain a first binary image of the double-bit image;
similarly, one type of pixel points coded into 01, 10 and 11 in the double-bit image are marked as white pixel points, and the other pixel points in the double-bit image are marked as black pixel points, so that three different binary images are obtained;
i.e. four binary images per bit image.
2. The method according to claim 1, wherein the formula for calculating the assigned set size of each binary image based on the statistical feature and the continuous feature of the binary image is:wherein->Indicate->The assigned set size of the binary images; />Indicate->Successive features of the binary images; />Indicate->Statistical features of the two binary images; />Representing the sum of the products of the continuous features and the statistical features of the four binary images in the two-bit image.
3. The method for encrypting face image data according to claim 1, wherein the step of dividing the disordered sequence in order by using the value set size of each binary image in the two-bit image to obtain the value set of each binary image in the two-bit image comprises:
the method comprises the steps of arranging the assigned set sizes of binary images according to the sequence of the binary images corresponding to 00, 01, 10 and 11 to obtain a assigned set size sequence of the double-bit image;
and dividing the scrambling sequence into four sections by using the assignment set size sequence of the double-bit image, and taking the divided four sections of scrambling sequence as the assignment set of the corresponding binary image.
4. A face image data encryption method according to claim 3, wherein the sequence of assigned set sizes for each two-bit image is stored encrypted.
5. The method for encrypting face image data according to claim 1, wherein the step of assigning white pixels in the binary image by using the assigned set of each binary image to obtain the assigned binary image comprises:
the connected domain with the area not larger than the assigned set size of the binary image in the binary image is marked as a first connected domain;
randomly selecting a number of values which are equal to the area of a first communication domain from a value assignment set of a binary image as a target value assignment set of the first communication domain, and randomly assigning values to white pixel points in the first communication domain by using the values in the target value assignment set;
the connected domain with the area larger than the assigned set size of the binary image in each binary image is marked as a second connected domain;
uniformly dividing the second connected domain into a plurality of small connected domains according to the area of the second connected domain and the assigned set size of the binary image where the second connected domain is located;
randomly selecting a number of values equal to the area of the small connected domain from a value assignment set of the binary image as a target value assignment set of the small connected domain, and randomly assigning values to white pixel points in the small connected domain by using the values in the target value assignment set;
and all the white pixel points of all the connected domains in the binary image are assigned to obtain an assigned binary image.
6. The method according to claim 4, further comprising a decryption method for ciphertext images of the face image:
obtaining three ciphertext single-channel images of a ciphertext image, uniformly dividing each ciphertext single-channel image to obtain four block images of each ciphertext single-channel image, wherein the block images of the ciphertext single-channel image correspond to assigned images of a face image;
obtaining a scrambling sequence by using the security key, the chaotic mapping model and the gray value sequence;
decrypting the encrypted assigned set size sequence to obtain an assigned set size sequence; obtaining an assignment set sequence of the block image according to the assignment set size sequence and the scrambling sequence of the double-bit image corresponding to the block image;
obtaining the code of the ciphertext pixel point in the double-bit image according to the assignment set sequence of each block image and the gray value of the ciphertext pixel point in the block image, updating the ciphertext pixel point in the block image by utilizing the code, and marking the updated block image as a new double-bit image, wherein the ciphertext pixel point is a white pixel point for assigning in the encryption process;
sequentially splicing codes of each pixel point in the ciphertext single-channel image in four new double-bit images to obtain 8-bit binary values, and converting the binary values into decimal values to obtain gray values of each pixel point in the decrypted single-channel image;
and according to the gray values of the pixel points in the decrypted three single-channel images, decrypting the face image.
CN202310508002.0A 2023-05-08 2023-05-08 Face image data encryption method Active CN116226891B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310508002.0A CN116226891B (en) 2023-05-08 2023-05-08 Face image data encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310508002.0A CN116226891B (en) 2023-05-08 2023-05-08 Face image data encryption method

Publications (2)

Publication Number Publication Date
CN116226891A CN116226891A (en) 2023-06-06
CN116226891B true CN116226891B (en) 2023-09-01

Family

ID=86579103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310508002.0A Active CN116226891B (en) 2023-05-08 2023-05-08 Face image data encryption method

Country Status (1)

Country Link
CN (1) CN116226891B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116467730B (en) * 2023-06-16 2023-08-15 北京东联世纪科技股份有限公司 Intelligent park digital operation and maintenance management system based on CIM architecture

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706946A (en) * 2009-11-26 2010-05-12 大连大学 Digital image encryption method based on DNA sequence and multi-chaotic mapping
CN110753226A (en) * 2019-09-25 2020-02-04 宁波工程学院 High-capacity ciphertext domain image reversible data hiding method
CN110990186A (en) * 2018-10-02 2020-04-10 三星电子株式会社 System on chip, method of operating system on chip, and memory system
CN113889232A (en) * 2021-10-19 2022-01-04 南京工程学院 Privacy protection method based on medical image
CN115205320A (en) * 2022-09-19 2022-10-18 江苏广海检验检测有限公司 Encryption transmission method based on environment monitoring data
CN115955570A (en) * 2023-03-10 2023-04-11 武汉同创万智数字科技有限公司 Video remote system
CN116033089A (en) * 2023-03-31 2023-04-28 探长信息技术(苏州)有限公司 Remote intelligent monitoring method for security engineering

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8155442B2 (en) * 2008-02-04 2012-04-10 The Neat Company, Inc. Method and apparatus for modifying the histogram of an image

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706946A (en) * 2009-11-26 2010-05-12 大连大学 Digital image encryption method based on DNA sequence and multi-chaotic mapping
CN110990186A (en) * 2018-10-02 2020-04-10 三星电子株式会社 System on chip, method of operating system on chip, and memory system
CN110753226A (en) * 2019-09-25 2020-02-04 宁波工程学院 High-capacity ciphertext domain image reversible data hiding method
CN113889232A (en) * 2021-10-19 2022-01-04 南京工程学院 Privacy protection method based on medical image
CN115205320A (en) * 2022-09-19 2022-10-18 江苏广海检验检测有限公司 Encryption transmission method based on environment monitoring data
CN115955570A (en) * 2023-03-10 2023-04-11 武汉同创万智数字科技有限公司 Video remote system
CN116033089A (en) * 2023-03-31 2023-04-28 探长信息技术(苏州)有限公司 Remote intelligent monitoring method for security engineering

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Bang-Tao Liu 等.Optimal image fusion algorithm based on wavelet transforms.《2012 International Conference on Wavelet Active Media Technology and Information Processing (ICWAMTIP)》.2012,第4-7页. *

Also Published As

Publication number Publication date
CN116226891A (en) 2023-06-06

Similar Documents

Publication Publication Date Title
Liu et al. Cryptanalyzing a RGB image encryption algorithm based on DNA encoding and chaos map
Yuan et al. A new parallel image cryptosystem based on 5D hyper-chaotic system
Zhu et al. A chaos-based symmetric image encryption scheme using a bit-level permutation
Ren et al. Reversible data hiding in encrypted binary images by pixel prediction
CN116226891B (en) Face image data encryption method
CN113194213B (en) PNG image information hiding and recovering method based on secret sharing and chaotic mapping
Yi et al. Parametric reversible data hiding in encrypted images using adaptive bit-level data embedding and checkerboard based prediction
CN114422830B (en) Video encryption method, video display method, device and equipment
CN114567711A (en) Large-capacity encrypted image information hiding method based on block capacity label
CN101843087B (en) Encryption by pixel property separation
CN110225222B (en) Image encryption method based on 3D orthogonal Latin square and chaotic system
Gan et al. Exploiting compressed sensing and polynomial-based progressive secret image sharing for visually secure image selection encryption with authentication
Rafat et al. Secure steganography for digital images
CN111260532B (en) Privacy image encryption method, device, electronic equipment and computer readable storage medium
Yang et al. Enhancing multi-factor cheating prevention in visual cryptography based minimum (k, n)-connected graph
CN111131657B (en) Chaos medical image tamper-proof encryption method based on self-verification matrix
Shakir et al. A new four-dimensional hyper-chaotic system for image encryption
Rani et al. A novel and efficient approach to encrypt images using chaotic logistic map and stream cipher
CN115719300A (en) Personnel information management method for big data
CN115408665A (en) Image encryption technology based on chaos theory
Mohamed et al. Improving image encryption using 3d cat map and turing machine
CN114969796A (en) Image steganography method and system combining QR (quick response) code and S-box chaotic scrambling
CN115134471A (en) Image encryption and decryption method and related equipment
CN110009703B (en) Image encryption and decryption method and device based on chaotic system
CN111400731A (en) DNACNott-based quantum image encryption method

Legal Events

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