Halftone secret sharing method and extraction method based on optimized data distribution
By optimizing the sharing data set generated by data allocation and polynomials, combining halftone self-hiding algorithm and check code, the coding error problem in halftone image sharing is solved, and the extraction accuracy of shared images and secret images is improved.
Patent Information
- Application Number
- CN202210428470.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-04-22
AI Technical Summary
In the prior art, in halftone image sharing, the accuracy of sharing image extraction and the accuracy of secret image extraction are low in the halftone image sharing, and there are coding error problems.
The optimized data allocation algorithm is used to generate shared images, and a shared data collection is generated by constructing a polynomial, and a half-tone self-hiding algorithm and check code are combined to ensure the correct hidden and extracted of shared images.
It significantly improves the extraction accuracy of shared images, ensures the extraction accuracy of secret images, and can generate correct half-tone secret sharing images in the case of wrong sharing.
Smart Images

Figure CN114913048B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image encryption, and in particular to a halftone secret sharing method and an extraction method based on optimized data distribution. Background Art
[0002] A halftone image is a special type of image carrier that represents an image using only two color values: black and white. Conceptually, a halftone image can be considered a binary image, but this binary image differs from the binary image obtained after image segmentation. The binary image obtained through image segmentation emphasizes the difference between foreground and background; while a halftone image, while only binary, aims to reproduce the original image with minimal distortion.
[0003] Image sharing is an important method for image encryption, offering significant advantages in security and convenience. The original binary secret image is used to generate N binary shared images through image sharing. By randomly selecting K of these N binary shared images, the original image can be extracted.
[0004] In the prior art, when hiding a shared image within a carrier image, the carrier image data must be intentionally modified to implement the hiding process. However, to ensure the quality of the halftone image, modifications to the hiding process must be subject to certain restrictions. This results in some of the shared data to be hidden not being effectively hidden. Therefore, a certain amount of bit errors will inevitably occur during the secret sharing extraction process. When the extracted shared image is subsequently used to calculate the secret image, the bit errors will increase significantly. The degree of bit errors in extracting the shared image here is related to the carrier image data. In the prior art, when generating the shared image to be hidden, the shared data is completely randomly assigned, without considering the carrier image, and thus the above problems are not effectively solved. Therefore, there is still significant room for improvement in the accuracy of extracting shared images and secret images. Summary of the Invention
[0005] The purpose of the present invention is to provide a halftone secret sharing method and extraction method based on optimized data allocation. The present invention can effectively overcome the situation where errors in extracting and sharing images due to quality limitations of halftone images, significantly improve the accuracy of extracting and sharing images, and thus ensure the accuracy of extracting secret images.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] A halftone secret sharing method based on optimized data distribution, the sharing method comprising the following steps:
[0008] Encrypt the original secret image T to generate an encrypted secret image D;
[0009] Constructing m k-1 degree polynomials, each polynomial is used to generate a shared data set for each constant coefficient value, generating a total of m groups of shared data sets, where m and k are positive integers greater than 1;
[0010] Based on the m sets of shared data and the encrypted secret image D, an optimized data allocation algorithm is used to generate n shared images X1-Xn suitable for hiding, where n is a positive integer greater than 1. The optimized data allocation algorithm first considers the data of the carrier image to be hidden and then generates the shared image suitable for hiding;
[0011] The n shared images X1-Xn suitable for hiding are respectively hidden in n halftone secret sharing images using a halftone self-hiding algorithm to obtain a first halftone secret sharing image O1-On;
[0012] Record the secret data that cannot be correctly shared in the corresponding first halftone secret sharing images O1-On to obtain second halftone secret sharing images P1-Pn;
[0013] The numbers and check codes of the n shared images suitable for hiding are recorded in the corresponding second halftone secret shared images P1-Pn to obtain final halftone secret shared images H1-Hn.
[0014] The present invention also provides a halftone secret extraction method based on optimized data distribution, the extraction method comprising:
[0015] Obtaining final halftone secret sharing images H1-Hn obtained by the above-mentioned halftone secret sharing method;
[0016] Extracting the final halftone secret sharing images H1-Hn using a halftone image self-extraction algorithm to obtain n extracted sharing images R1-Rn, where n is a positive integer greater than 1;
[0017] Extracting the shared image number and check code from the final halftone secret shared images H1-Hn;
[0018] Determine whether the n extracted shared images R1-Rn are correct based on the shared image number and check code;
[0019] If yes, record it as correctly sharing Ric;
[0020] If not, it is recorded as an error sharing Rie;
[0021] When the number of correct shares is greater than or equal to k, k shared images are randomly selected and the encrypted secret image D is extracted using the Lagrange interpolation method, where k is a positive integer greater than 1;
[0022] Decrypting the encrypted secret image D to obtain the original secret image T;
[0023] According to the encrypted secret image D, the correct share Ric and the incorrect share Rie, based on m groups of sharing data sets, an updated correct share Riec and a correct halftone secret sharing image Hic are generated. The m groups of sharing data sets are obtained by constructing m k-1 degree polynomials according to the halftone secret sharing method described above.
[0024] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0025] The present invention provides a halftone secret sharing method and extraction method based on optimized data allocation. This optimized data allocation method effectively overcomes errors in the shared image extraction caused by halftone image quality limitations, significantly improving the accuracy of the shared image extraction, thereby ensuring the accuracy of secret image extraction. Furthermore, even if an erroneous shared image is extracted, it can be combined with the extracted secret image to generate a correct halftone secret shared image without affecting other correct shared images. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0027] Figure 1 A flowchart of a halftone secret sharing method based on optimized data allocation provided in Example 1 of the present invention;
[0028] Figure 2 This is a flowchart of a halftone secret extraction method based on optimized data allocation provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0030] Halftone secret sharing refers to a polynomial-based (k,n) halftone secret sharing algorithm [1], where [1] is Ding Haiyang, Li Zichen, Bi Wei. (k,n) halftone visual cryptography based on Shamir's secret sharing. The Journal of China Universities of Posts and Telecommunications. 2018, 25 (2): 60-76. Through this algorithm, a binary secret pattern can be hidden in n halftone images. K halftone images can be arbitrarily selected to extract the secret pattern through Lagrangian interpolation. First, the original binary secret image is shared as n meaningless shared images using polynomial-based secret sharing; then, the n meaningless shared images are hidden in the n halftone images using the halftone image self-hiding algorithm; third, n shared images are extracted from the n halftone shared images using the halftone image self-extraction technology; finally, k shared images are arbitrarily selected from the n extracted shared images, and the secret image is extracted using the Lagrangian interpolation technology.
[0031] Although this algorithm has some advantages, there is still much room for improvement in terms of the accuracy of extracting shared images and the accuracy of extracting secret images.
[0032] The purpose of the present invention is to provide a halftone secret sharing method and extraction method based on optimized data allocation. The present invention can effectively overcome the situation where errors in extracting and sharing images due to quality limitations of halftone images, significantly improve the accuracy of extracting and sharing images, and thus ensure the accuracy of extracting secret images.
[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] Example 1:
[0035] See also Figure 1 The present invention provides a halftone secret sharing method based on optimized data distribution, which includes the following steps:
[0036] A1: Encrypt the original secret image T to generate the encrypted secret image D;
[0037] A2: Construct m k-1 degree polynomials, each of which is used to generate a shared data set for each constant coefficient value, generating a total of m groups of shared data sets, where m and k are positive integers greater than 1;
[0038] A3: Based on the m sets of shared data and the encrypted secret image D, an optimized data allocation algorithm is used to generate n shared images X1-Xn suitable for hiding, where n is a positive integer greater than 1. The optimized data allocation algorithm first considers the data of the carrier image to be hidden and then generates the shared images suitable for hiding;
[0039] A4: Using a halftone self-hiding algorithm, the n shared images X1-Xn suitable for hiding are hidden in n halftone secret sharing images respectively to obtain a first halftone secret sharing image O1-On;
[0040] A5: Record the secret data that cannot be correctly shared in the corresponding first halftone secret sharing images O1-On to obtain second halftone secret sharing images P1-Pn;
[0041] A6: Record the numbers and check codes of the n shared images suitable for hiding in the corresponding second halftone secret shared images P1-Pn to obtain final halftone secret shared images H1-Hn.
[0042] In step A1, the original secret image T is encrypted using Arnold scrambling. This involves shuffling the positions of the pixels in the original secret image, disrupting their coordinates and generating a new, chaotic image. The number of transformations, KN, required to return to the original image depends on the image's width and height. For example, if the image's width and height are 256×256, then KN = 192. After 192 transformations, the original image is returned.
[0043] In this embodiment, the original secret image T is scrambled key times to obtain the encrypted secret image D. Here, the original secret image T has a width and height of W × H, and the generated encrypted secret image D is also W × H. key is the encryption key. If image D is scrambled KN-key times, the original secret image T can be restored. This step can both increase the security of the original secret image and enhance the randomness of the image data distribution.
[0044] In step A2, m k-1 degree polynomials are constructed, and each polynomial is used to generate available shared data for each constant coefficient (a0), and a total of m sets of shared data sets A can be generated;
[0045] Taking the (3,4) sharing mode as an example (k=3, N=4), one original image D can generate four shared images X1-X4. Any three shared images (e.g., X1, X2, X4) can be selected to extract the original image D.
[0046] 8 (m=8) quadratic (k-1=2) polynomials can be generated, each polynomial generates multiple sets of available data for each a0 value, and sorts them from small to large according to the value of |number of 1-4| as the available shared data set A.
[0047] With the polynomial f(x)=(a0+2x+1x 2 ) mod 17 as an example, when a0 = 1 (0001), substitute different x values, calculate the y values, and then sort them according to |number of 1 - 4|. The resulting data set is shown in Table 1:
[0048] Table 1 When a0=1, the specific polynomial corresponds to the shared data set
[0049]
[0050]
[0051] In step A3, based on the m sets of shared data and the encrypted secret image D, an optimized data allocation algorithm is used to generate n shared images X1-Xn suitable for hiding, which specifically includes:
[0052] A31: Divide the encrypted secret image D into g parts to obtain g secret data, where g = (W × H) / 4, W and H are the width and height of the secret image respectively, and g is a positive integer greater than 1;
[0053] A32: Treat each secret data as a constant coefficient value and substitute it into the shared data set A in step A2 to obtain m shared data subsets;
[0054] A33: Select n groups of shared data from each shared data subset, and sequentially use the halftone self-hiding algorithm to hide the carrier images Y1-Yn;
[0055] A34: Determine whether the current n groups of shared data can be completely and correctly hidden, and obtain a first determination result;
[0056] A35: If the first judgment result is no, try the next combination in the current shared data set;
[0057] A36: Determine whether there is completely correctly hidden shared data in the current shared data set, and obtain a second determination result;
[0058] A37: If the second judgment result is no, continue searching in the next shared data set until a completely correctly hidden shared data set is found;
[0059] A38: Store the found completely correctly hidden shared data into the corresponding position of the shared images X1-Xn;
[0060] A39: If there is no completely correctly hidden shared data after traversing all shared data sets, the positions of the current secret data and the corresponding shared data are recorded, and the shared data at the corresponding positions of the shared images X1-Xn are set to all 0.
[0061] In this embodiment, the encrypted secret image D is decomposed into W / 4×H groups of 4-bit data, each group of 4-bit data constituting a secret data, which is denoted by a0. Before generating the shared data, the n carrier images Y1-Yn to be hidden, used to hide the shared image, are analyzed. An optimized data allocation algorithm is used to find n optimized groups of shared data based on a0, and these groups are stored in corresponding locations of the shared images X1-Xn. The resulting shared images X1-Xn have a width and height of 2W×H.
[0062] Data distribution algorithm in previous scheme:
[0063] Based on the secret data a0 at the current location, a polynomial is randomly selected, and the corresponding shared data set corresponding to a0 is found. From this set, n sets of shared data are randomly selected and shared to corresponding locations in n shared images. This generates n shared images X1-Xn. These shared images X1-Xn do not take into account the data of the carrier images Y1-Yn to be hidden. Therefore, when using the halftone self-hiding algorithm, excessive permutation interference is likely to result in the hidden image failing to be properly hidden, resulting in inaccuracies in the shared data and errors when extracting the shared images.
[0064] The optimal data allocation algorithm proposed in this solution is:
[0065] According to the secret data a0 value at the current position, find the shared data set corresponding to the a0 value in the generated m groups of polynomial data sets A, so that there are m shared data subsets; before determining the shared data, first analyze the carrier image Y1-Yn where the shared data is to be hidden; from the shared data subset corresponding to each polynomial, select n groups of shared data, which can have multiple permutations and combinations, and try to use the halftone self-hiding algorithm to hide the data at the corresponding position of the carrier image Y1-Yn for each combination in turn. If it cannot be completely hidden correctly, try the next combination; if a completely correct shared data combination cannot be found in the current polynomial, search in the shared data set of the next polynomial until a completely correct shared data is found; store the optimized n groups of shared data found in the corresponding positions of the shared images X1-Xn; if there is no completely correct situation after traversing the shared data sets of all polynomials, record the position of the current secret data and the corresponding shared data, and set the shared data at the corresponding positions of the shared images X1-Xn to all 0s.
[0066] Taking the (3,4) sharing mode as an example, if the current secret data value a0=1(0001), m=8, and the polynomial f(x)=(a0+2x+1x 2 )mod17 as an example, the generated sharing data is shown in Table 1.
[0067] If we follow the previous data allocation method and select any polynomial from the eight polynomials, we assume that the polynomial f(x) = (a0+2x+1x 2 )mod17, 4 groups of data are randomly selected from Table 1 (for example, 1, 2, 3, and 4 groups of shared data are selected), and the 4 groups of shared data are assigned to the corresponding positions of the shared images X1-X4; when executing the halftone self-hiding algorithm, the specific data of the carrier images Y1-Y4 are not considered, and the 4 groups of shared data are hidden in the corresponding positions of the carrier images Y1-Y4. Since the displacement interference is too large to be hidden, the shared data cannot be hidden correctly, resulting in errors in extracting the shared image.
[0068] If we follow the optimal data allocation method of this solution, we can find the corresponding shared data set according to a0=1 among the 8 polynomials, and there are 8 shared data subsets;
[0069] Before determining the shared data, first analyze the carrier images Y1-Y4 to hide the shared data; select 4 groups of shared data from the shared data subset corresponding to each polynomial, assuming that the selected polynomial f(x) = (a0+2x+1x 2 )mod17, then select 4 shared data from the 13 shared data in Table 1, for a total of P143 permutations and combinations. Try using the halftone self-hiding algorithm to hide the corresponding positions of the carrier image Y1-Y4 for each combination. If it cannot be completely hidden correctly, try the next combination until 4 sets of shared data that can be completely hidden are found;
[0070] If the correct shared data combination cannot be found in the current polynomial, the search continues in the shared data set of the next polynomial until a correct shared data combination is found. The four optimal shared data sets found are stored in the corresponding positions of the shared images X1-X4.
[0071] If all the shared data sets of the polynomials are traversed and none of them are completely correct, the positions of the current secret data and the corresponding shared data are recorded, and the shared data at the corresponding positions of the shared images X1-X4 are set to all 0.
[0072] In step A4, the n suitable shared images X1-Xn are respectively hidden in n halftone secret shared images using a halftone self-hiding algorithm to obtain a first halftone secret shared image O1-On, which specifically includes:
[0073] A41: Divide the carrier image Y1-Yn into a first upper portion Yi1 and a first lower portion Yi2, wherein the resolution of the carrier image Y1-Yn is 2W×2H, and the resolution of the first upper portion Yi1 and the first lower portion Yi2 are both 2W×H;
[0074] A42: Using a halftone self-hiding algorithm, hide the target shared image in the first upper part Yi1 and the first lower part Yi2, and obtain diffusion errors of the last two lines in the first upper part Yi1;
[0075] A43: Merge the diffusion errors of the last two rows in the first upper part Yi1 with the first lower part Yi2 to obtain a new first lower part Yi2′;
[0076] A44: Using a halftone self-hiding algorithm, the target shared image is re-hidden in the first upper part Yi1 and the new first lower part Yi2' to obtain an upper hidden image and a lower hidden image;
[0077] A45: If the shared data at the current position of the shared image X1-Xn is all 0, then no information hiding is performed at the corresponding position of the carrier image Y1-Yn;
[0078] A46: combining the upper hidden image and the lower hidden image to obtain a first halftone image;
[0079] A47: Obtain a first halftone secret shared image O1-On based on the first halftone image generated from all the shared images.
[0080] Through the above process, n shared images X1-Xn can be hidden in n first halftone secret shared images O1-On respectively, and each first halftone secret shared image has a width and height of 2W×2H.
[0081] In step A5, the secret data that cannot be correctly shared is recorded in the corresponding first halftone secret sharing images O1-On to obtain second halftone secret sharing images P1-Pn, which specifically includes:
[0082] A51: Record the secret data that cannot be correctly shared in the last line of each of the first halftone images O1-On, and fill the line that is less than one line with zeros to obtain a second halftone image;
[0083] A52: Obtain second halftone secret shared images P1-Pn according to all the second halftone images.
[0084] In this embodiment, for secret data that cannot be correctly shared, the corresponding position coordinates are recorded, and the secret data is used as a0 to generate shared data using the secret sharing method in the document [1]. That is, a data set a0 corresponding to a polynomial is arbitrarily selected, and n groups of shared data are arbitrarily selected from them and allocated to n carrier images; the positions of the shared data that cannot be correctly shared and the corresponding shared data are sequentially written directly into the end of the halftone secret shared image in binary form, that is, a line is added after the first halftone image generated to record the positions of the shared data that cannot be correctly shared and the shared data, and zeros are added after the line that is less than one line.
[0085] The width and height of each second halftone secret sharing image generated in this way are 2W×(2H+1).
[0086] In step A6, recording the numbers and check codes of the n shared images suitable for hiding in the corresponding second halftone secret shared images P1-Pn to obtain the final halftone secret shared images H1-Hn specifically includes:
[0087] A62: Record the shared image number and check code in the last line of each of the second halftone images P1-Pn, and fill the line with zeros if the line is less than one, to obtain a third halftone image;
[0088] A63: Obtain final halftone secret sharing images H1-Hn according to all the third halftone images.
[0089] In this embodiment, CRC cyclic check codes are generated for each of the n shared images X1-Xn generated in step A3, and the number i and CRC check code of the i-th shared image Xi are directly recorded at the end of the i-th halftone image Hi. That is, a line is added after the second halftone image generated to record the number and check code of the shared image, and zeros are added after the line that is less than one line.
[0090] The width and height of each third halftone secret sharing image generated in this way are 2W×(2H+2).
[0091] The present invention adopts the most optimized data allocation method, effectively overcomes the situation of bit errors in extracting and sharing images caused by the quality limitation of halftone images, and significantly improves the accuracy of extracting and sharing images, thereby ensuring the accuracy of extracting secret images.
[0092] Example 2:
[0093] See also Figure 2 The present invention provides a halftone secret extraction method based on optimized data allocation, the extraction method comprising:
[0094] B1: Obtaining the final halftone secret sharing images H1-Hn obtained by the halftone secret sharing method based on optimized data allocation described in Example 1;
[0095] B2: extracting the final halftone secret sharing images H1-Hn using a halftone image self-extraction algorithm to obtain n extracted sharing images R1-Rn, where n is a positive integer greater than 1;
[0096] B3: extracting the shared image number and check code from the final halftone secret shared images H1-Hn;
[0097] B4: judging whether the n extracted shared images R1-Rn are correct according to the shared image number and check code;
[0098] B5: If yes, record it as sharing Ric correctly;
[0099] B6: If not, record it as incorrect sharing Rie;
[0100] B7: When the number of correct shares is greater than or equal to k, randomly select k shared images and extract the encrypted secret image D using Lagrange interpolation, where k is a positive integer greater than 1;
[0101] B8: Decrypt the encrypted secret image D to obtain the original secret image T;
[0102] B9: Based on the encrypted secret image D, the correct share Ric and the incorrect share Rie, and based on m groups of sharing data sets, generate an updated correct share Riec and a correct halftone secret sharing image Hic, wherein the m groups of sharing data sets are obtained by constructing m k-1 degree polynomials according to the halftone secret sharing method described in Example 1.
[0103] In step B2, the halftone image self-extraction algorithm is used to extract the final halftone secret sharing images H1-Hn to obtain n extracted sharing images R1-Rn, which specifically includes:
[0104] B21: removing the bottom two rows of image data from the final halftone secret sharing images H1-Hn to obtain a fourth halftone image;
[0105] B22: Divide the n fourth halftone images into a second upper part Hi1' and a second lower part Hi2' respectively;
[0106] B23: performing an XOR operation on corresponding pixels of the second upper portion Hi1 ' and the second lower portion Hi2 ' in each of the fourth halftone images to obtain n initial extracted shared images;
[0107] B24: Obtain the second-to-last row of data in the final halftone secret sharing image H1-Hn, and extract the shared data position and shared data that cannot be shared correctly in sequence;
[0108] B25: replacing the shared data position and shared data that cannot be shared correctly into the n initially extracted shared images to obtain n extracted shared images R1-Rn.
[0109] In this embodiment, for the i-th final halftone secret sharing image Hi, the bottom two rows of image data are removed to obtain a fourth halftone image Hi', whose width and height are 2W×2H;
[0110] dividing the fourth halftone image Hi' into a second upper part Hi1' and a second lower part Hi2', wherein the resolutions of the second upper part Hi1' and the second lower part Hi2' are both 2W×H;
[0111] By performing an exclusive-or (XNOR) operation on corresponding pixels in the second upper part Hi1 ′ and the second lower part Hi2 ′, n initial extracted sharing images can be extracted.
[0112] Obtain the 2H+1th row data of the i-th final halftone shared image Hi, extract the shared data positions and shared data that cannot be shared correctly in sequence, and replace each shared data to the corresponding position of n extracted shared images R1-Rn to obtain n extracted shared images R1-Rn.
[0113] In step B3, the shared image number and check code in the final halftone secret shared images H1-Hn are extracted, specifically including:
[0114] B31: Obtain the last row of data in the final halftone secret sharing image H1-Hn;
[0115] B32: Extract the code i of the shared image and the check code CRC corresponding to the shared image according to the last row of data.
[0116] In this embodiment, the 2H+2th row of data of the i-th final halftone secret shared image Hi is obtained, the shared image number i is extracted, and the CRC check code corresponding to the shared image is extracted, which is recorded as CRCi1.
[0117] Calculate the CRC check code based on the i-th extracted and shared image Ri, denoted as CRCi2;
[0118] Compare CRCi1 and CRCi2 to see if they are the same. If they are the same, it means that the current shared image Ri is correctly extracted; if they are different, it means that the current shared image Ri is incorrectly extracted.
[0119] The correct sharing is recorded as Ric and the incorrect sharing is recorded as Rie. Note that the sequence number of the shared image remains unchanged regardless of correctness or error.
[0120] For example: extract shares R1-R4, and verify that the 1st, 2nd, and 4th shares are extracted correctly, and the 3rd share is extracted incorrectly, then the correct shares are recorded as R1c, R2c, and R4c, and the incorrect share is recorded as R3e.
[0121] In step B7, k shared images are randomly selected from the extracted correct shared images, and each shared image is decomposed into W / 4×H groups of 8-bit shared data. A total of k groups of shared data are obtained at the corresponding positions of the k shared images. The original data a0 is calculated through Lagrange interpolation, and a0 is 4 bits. The extracted encrypted secret image D is constructed with a0 as the extracted secret data, and the width and height of D are W×H.
[0122] For example, the correct shares are R1c, R2c, and R4c. Using these three correct shares, the encrypted secret image D is extracted through Lagrange interpolation.
[0123] In step B9, based on the encrypted secret image D, the correct share Ric, and the incorrect share Rie, an updated correct share Riec and a correct halftone secret shared image Hic are generated based on m sets of shared data, specifically including:
[0124] B91: Divide the encrypted secret image D into g parts to obtain g secret data, where g = (W × H) / 4, W and H are the width and height of the secret image respectively, and g is a positive integer greater than 1;
[0125] B92: Treat each secret data as a constant coefficient value and substitute it into the shared data set A in step A2 of embodiment 1 to obtain m shared data subsets;
[0126] B93: extracting correct sharing data from the current position of each correct sharing Ric, and determining a unique sharing data set based on the correct sharing data and the m sharing data sets;
[0127] B94: removing the used correct shared data from the unique shared data set to obtain a remaining shared data set;
[0128] B95: Based on the remaining shared data set, the optimal data allocation algorithm is used to obtain the completely correctly hidden shared data;
[0129] B96: Storing the completely correctly hidden shared data in the corresponding position of the correct share to obtain the updated correct share Riec;
[0130] B97: Hiding the updated correct shared image in the halftone secret shared image using a halftone self-hiding algorithm to obtain an updated first halftone secret shared image;
[0131] B98: Extracting the 2H+1th row of data from the original halftone secret shared image Hi corresponding to the incorrectly shared image Rie, where the row of data is used to record the location and shared data of the shared data that cannot be correctly shared, and recording the row of data in the corresponding updated first halftone secret shared image to obtain an updated second halftone secret shared image;
[0132] B99: Record the updated number and check code of the correct shared image Riec in the corresponding updated second halftone secret shared image to obtain the correct halftone secret shared image Hic.
[0133] In this embodiment, it is assumed that the number of shares with errors is 1 and the number of shares with correctness is n-1.
[0134] Decompose the extracted encrypted secret image D into W / 4×H groups of 4-bit data, each group of 4-bit data constitutes a secret data, let this secret data be a0; according to the secret data a0 value at the current position, find the shared data subsets corresponding to the a0 value in the generated m groups of polynomial data sets, so that there are m shared data subsets; find n-1 groups of shared data from the current position of the n-1 correct shared images, and search these shared data in the m shared data subsets. If a unique data subset can be found, it means that the shared data at the current position all comes from the data subset corresponding to this polynomial; from this data subset, exclude the n-1 groups of shared data that have been used, and from the remaining shared data, find suitable shared data according to the optimized data allocation algorithm and store them in the corresponding position of the correct shared Riec; if the n-1 groups of shared data at the current position are all 0, then the Riec at the current position is also all 0.
[0135] Using the halftone self-hiding algorithm, 2W×2H halftone image data is generated and placed in the first 2H rows of the correct halftone secret sharing image Hic; the 2H+1 row data of the i-th final halftone sharing image Hi is extracted and placed in the 2H+1 row of the correct halftone secret sharing image Hic; the shared image number and CRC check code are added and placed in the 2H+2 row of the correct halftone secret sharing image Hic.
[0136] Through the above process, the correct halftone secret sharing image Hic is generated.
[0137] Taking the (3,4) sharing mode as an example, if four shared images are extracted, the correct shares are recorded as R1c, R2c, and R4c, and the incorrect share is recorded as R3e. Without affecting other correct shares, the correct halftone secret shared image H3c is generated.
[0138] By extracting the encrypted secret image D, decompose the encrypted secret image D into W / 4×H groups of 4-bit data, denoted as a0; assuming the current secret data value a0=1(0001), m=8, find the data subsets corresponding to the 8 polynomials.
[0139] Assume that the shared data obtained from the correct sharing of R1c, R2c, and R4c is: 8(1000)13(1101), 14(1110)4(0100), 5(0101)2(0010). Search these 3 sets of data in 8 data subsets and find the unique polynomial f(x) = (a0+2x+1x 2 )mod17, and its corresponding sharing data are shown in Table 1.
[0140] Excluding the three sets of shared data that have been used by the current positions of R1c, R2c, and R4c, the remaining 10 sets of shared data are shown in Table 2. These 10 sets of data are all usable data.
[0141] Table 2 Remaining available shared datasets when a0=1
[0142] Serial number x y The number of 1s in x and y 1 11(1011) 8(1000) 4 2 2(0010) 9(1001) 3 3 10(1010) 2(0010) 3 4 13(1101) 9(1001) 5 5 15(1111) 1(0001) 5 6 1(0001) 4(0100) 2 7 4(0100) 8(1000) 2 8 6(0110) 15(1111) 6 9 7(0111) 13(1101) 6 10 9(1001) 15(1111) 6
[0143] Place these 10 sets of shared data in the corresponding positions of the carrier image Y3 to be hidden, analyze them, find the shared data that can be completely hidden correctly, and store them in the corresponding position of the updated correct shared data R3ec;
[0144] The updated correct shared image R3ec is subjected to a halftone self-hiding algorithm to generate 2W×2H halftone image data, which is placed in the first 2H rows of the correct halftone secret shared image H3c. The 2H+1 row of data from the original third halftone shared image H3 is extracted and placed in the 2H+1 row of the correct halftone secret shared image H3c. The shared data is numbered and CRC checksum is added and placed in the 2H+2 row of the correct halftone secret shared image H3c.
[0145] Through the above process, the correct halftone secret sharing image H3c is generated.
[0146] The present invention hides a secret image within n halftone secret-sharing images using a secret-sharing algorithm based on optimized data allocation. From these n halftone secret-sharing images, n shared images can be extracted, and correct and incorrect shared images can be distinguished. By selecting any k correct shared images, the secret image can be restored. Because the present invention utilizes an optimized data allocation method, it effectively overcomes the problem of errors in the extracted shared images caused by halftone image quality limitations, significantly improving the accuracy of the extracted shared images and thus ensuring the correct extraction of the secret image. Furthermore, for incorrectly extracted shared images, the extracted secret image and correct shared images are combined to generate a correct halftone secret-sharing image without affecting other correct shared images.
[0147] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0148] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A halftone secret sharing method based on optimized data distribution, characterized in that: The following steps are involved: Encrypt the original secret image T to generate an encrypted secret image D; Constructing m k-1 degree polynomials, each polynomial is used to generate a shared data set for each constant coefficient value, generating a total of m groups of shared data sets, where m and k are positive integers greater than 1; Based on the m sets of shared data and the encrypted secret image D, an optimized data allocation algorithm is used to generate n shared images X1-Xn suitable for hiding, where n is a positive integer greater than 1. The optimized data allocation algorithm first considers the data of the carrier image to be hidden and then generates the shared image suitable for hiding; The n shared images X1-Xn suitable for hiding are respectively hidden in n halftone secret sharing images using a halftone self-hiding algorithm to obtain a first halftone secret sharing image O1-On; Record the secret data that cannot be correctly shared in the corresponding first halftone secret sharing images O1-On to obtain second halftone secret sharing images P1-Pn; Recording the numbers and check codes of the n shared images suitable for hiding in the corresponding second halftone secret shared images P1-Pn to obtain final halftone secret shared images H1-Hn; Based on the m sets of shared data and the encrypted secret image D, an optimized data allocation algorithm is used to generate n shared images X1-Xn suitable for hiding, specifically including: Divide the encrypted secret image D into g parts to obtain g secret data, where g = (W×H) / 4, W and H are the width and height of the secret image respectively, and g is a positive integer greater than 1; Treat each secret data as a constant coefficient value and substitute it into the shared data set to obtain m shared data subsets; Select n groups of shared data from each shared data subset, and use the halftone self-hiding algorithm to hide the carrier images Y1-Yn in turn; Determine whether the current n groups of shared data can be completely and correctly hidden, and obtain a first judgment result; If the first judgment result is no, then try the next combination in the current shared data set; Determine whether there is completely correctly hidden shared data in the current shared data set, and obtain a second determination result; If the second judgment result is no, continue searching in the next shared data set until a completely correctly hidden shared data is found; The found completely correctly hidden shared data is stored in the corresponding position of the shared image X1-Xn; If there is no completely correctly hidden shared data after traversing all shared data sets, the positions of the current secret data and the corresponding shared data are recorded, and the shared data at the corresponding positions of the shared images X1-Xn are set to all 0s.
2. The halftone secret sharing method based on optimized data distribution according to claim 1, characterized in that: The encrypting of the secret image to generate the encrypted secret image specifically includes: The secret image is encrypted using Arnold scrambling.
3. The halftone secret sharing method based on optimized data distribution according to claim 1, characterized in that: The method of using a halftone self-hiding algorithm to hide the n shared images X1-Xn suitable for hiding in n halftone secret sharing images to obtain a first halftone secret sharing image O1-On specifically includes: Dividing the carrier image Y1-Yn into a first upper portion Yi1 and a first lower portion Yi2; Using a halftone self-hiding algorithm, the target shared image is hidden in the first upper part Yi1 and the first lower part Yi2, and diffusion errors of the last two lines in the first upper part Yi1 are obtained; The diffusion errors of the last two rows in the first upper part Yi1 are combined with the first lower part Yi2 to obtain a new first lower part Yi2 、 ; Adopting halftone self-hiding algorithm, the target shared image is re-hidden in the first upper part Yi1 and the new first lower part Yi2 、 , get the upper hidden image and the lower hidden image; combining the upper hidden image and the lower hidden image to obtain a first halftone image; The first halftone image generated according to all the shared images is used to obtain a first halftone secret shared image O1 -On.
4. The halftone secret sharing method based on optimized data distribution according to claim 3, characterized in that: The step of recording the secret data that cannot be correctly shared in the corresponding first halftone secret sharing images O1-On to obtain the second halftone secret sharing images P1-Pn specifically includes: Record the secret data that cannot be correctly shared in the last line of each of the first halftone images O1-On, and fill the line less than one line with zeros to obtain a second halftone image; Second halftone secret shared images P1-Pn are obtained according to all the second halftone images.
5. The halftone secret sharing method based on optimized data distribution according to claim 4, characterized in that: The step of recording the numbers and check codes of the n shared images suitable for hiding in the corresponding second halftone secret shared images P1-Pn to obtain the final halftone secret shared images H1-Hn specifically includes: Record the shared image number and check code in the last line of each of the second halftone images P1-Pn, and fill zeros after the line that is less than one line to obtain a third halftone image; Final halftone secret sharing images H1 -Hn are obtained according to all the third halftone images.
6. A halftone secret extraction method based on optimized data distribution, characterized in that: include: Obtaining final halftone secret sharing images H1-Hn obtained by the halftone secret sharing method according to any one of claims 1-5; Extracting the final halftone secret sharing images H1-Hn using a halftone image self-extraction algorithm to obtain n extracted sharing images R1-Rn, where n is a positive integer greater than 1; Extracting the shared image number and check code from the final halftone secret shared images H1-Hn; Determine whether the n extracted shared images R1-Rn are correct based on the shared image number and check code; If yes, record it as correctly sharing Ric; If not, it is recorded as an incorrect sharing Rie; When the number of correct shares is greater than or equal to k, k shared images are randomly selected and the encrypted secret image D is extracted using the Lagrange interpolation method; Decrypting the encrypted secret image D to obtain the original secret image T; According to the encrypted secret image D, the correct share Ric and the incorrect share Rie, based on m groups of sharing data sets, an updated correct share Riec and a correct halftone secret sharing image Hic are generated, and the m groups of sharing data sets are obtained by constructing m k-1 degree polynomials according to the halftone secret sharing method according to claim 1.
7. The halftone secret extraction method based on optimized data distribution according to claim 6, characterized in that: The method of extracting the final halftone secret sharing images H1-Hn using a halftone image self-extraction algorithm to obtain n extracted sharing images R1-Rn specifically includes: Remove the bottom two lines of image data from the final halftone secret sharing images H1-Hn to obtain a fourth halftone image; The n fourth halftone images are divided into second upper parts Hi1 、 and the second lower part Hi2 、 ; The second upper portion Hi1 in each of the fourth halftone images 、 and the second lower part Hi2 、 Perform XOR operation on the corresponding pixels to obtain n initial extracted shared images; Obtain the second-to-last row of data in the final halftone secret sharing image H1-Hn, and extract the shared data position and shared data that cannot be correctly shared in sequence; The n initially extracted shared images are replaced according to the location of the shared data that cannot be shared correctly and the shared data, to obtain n extracted shared images R1-Rn.
8. The halftone secret extraction method based on optimized data distribution according to claim 6, characterized in that: Extracting the shared image number and check code from the final halftone secret shared images H1-Hn specifically includes: Obtain the last row of data in the final halftone secret sharing image H1-Hn; According to the last row of data, the code i of the shared image and the check code CRC corresponding to the shared image are extracted.
9. The halftone secret extraction method based on optimized data distribution according to claim 6, characterized in that: According to the encrypted secret image D and the erroneous sharing, based on the m sets of sharing data, an updated correct sharing Riec and a correct halftone secret sharing image Hic are generated, specifically including: Divide the encrypted secret image D into g parts to obtain g secret data, where g = (W×H) / 4, W and H are the width and height of the secret image respectively, and g is a positive integer greater than 1; Treat each secret data as a constant coefficient value and obtain m shared data subsets; Extracting correct sharing data from the current position of each correct sharing Ric, and determining a unique sharing data set based on the correct sharing data and the m sharing data sets; Removing the correct sharing that has been used from the unique sharing data set to obtain a remaining sharing data set; According to the remaining shared data set, the optimal data allocation algorithm is used to obtain the completely correctly hidden shared data; The completely correctly hidden shared data is stored in the corresponding position of the correct share to obtain the updated correct share Riec; Hiding the updated correct shared image in the halftone secret shared image using a halftone self-hiding algorithm to obtain an updated first halftone secret shared image; Extracting the 2H+1th row of data from the original halftone secret sharing image Hi corresponding to the incorrectly shared image Rie, where the row of data is used to record the location and shared data of the shared data that cannot be correctly shared, and recording the row of data in the corresponding updated first halftone secret sharing image to obtain an updated second halftone secret sharing image; The updated number and check code of the correct shared image Riec are recorded in the corresponding updated second halftone secret shared image to obtain the correct halftone secret shared image Hic.
Citation Information
Patent Citations
Novel high-security image secret sharing method
CN112235481A
Distributed secret image sharing method with public reconstruction based on block chain authentication
CN113312604A