Secret sharing method and device based on matrix coding
Through a secret sharing method based on matrix coding, the original image is divided into blocks and matrix coding operations are performed to generate a more complex shared image, which solves the problem of insufficient security of shared images in the existing technology.
Patent Information
- Application Number
- CN202210121393.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-09
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-02-09
AI Technical Summary
In the prior art, secretly shared shared images are usually meaningless photos, with low complexity and are easily noticed by attackers, resulting in insufficient security.
A secret sharing method based on matrix coding is used to divide the original image into continuous but non-overlapping blocks. The matrix coding operation is performed through the parity check matrix to generate the first and second marked blocks to form the first and second shared images. Password sharing.
The complexity of shared images for secret sharing is improved, making them no longer meaningless photos, enhancing security and preventing attackers from easily identifying them.
Smart Images

Figure CN114499852B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer information security, and in particular to a secret sharing method and device based on matrix coding. Background Art
[0002] With the popularization of the Internet, information security has become increasingly important, especially when transmitting data on public channels. Compared with traditional data protection technologies, information hiding technology is more secure. Data encryption technology may cause some security issues during transmission, because encrypted data is unreadable and more likely to attract the attention of attackers; while information hiding technology is to hide secret information on common digital media, such as text, images, or audio and video, and the difference before and after hiding is almost indistinguishable to the naked eye, which makes it less likely to be noticed by attackers, thereby increasing the security of its transmission on insecure channels.
[0003] There are many existing information hiding technologies. The most common one is to use digital images as carriers and embed secret data into images to effectively reduce the risk of data leakage. For example, the least significant bit replacement method is a widely used data hiding method. It directly replaces the least significant bit of the image pixel with secret data, and the number of bits replaced can be adjusted according to the amount of data. However, when it is necessary to replace higher bits, it will cause obvious distortion of the image, so it has certain limitations in use. Therefore, some scholars later proposed improved methods, such as EMD method and matrix coding method. In 1998, Crandall first proposed the matrix coding method. First, 7 pixels are selected in the image in sequence, and then one of the pixels is selected according to the 3-bit secret data to be embedded, so that it is added or subtracted by 1 or remains unchanged to achieve information hiding. Because this method is simple to operate and can achieve satisfactory image visual effects, it is now widely used in the field of data hiding. In 2016, Cao et al. proposed a data hiding method based on matrix coding to increase the amount of data embedding. It uses a combination algorithm to embed 3 bits of secret data into a pixel group, thereby increasing the embedding rate to nearly 3bbp. In 2019, Yu et al. improved the above method and proposed a data hiding method based on matrix coding and adaptive bit plane. This method can dynamically adjust the pixel combination involved in embedding according to the amount of embedded data, ensuring a high embedding rate while achieving optimal image quality. However, all of the above methods are irreversible, that is, after extracting the secret data, the carrier image cannot be restored.
[0004] Secret sharing is a visual encryption method proposed by Shamir and Blakley in 1979. It divides secret data into n parts, each of which is saved by different participants. In the future, only t participants can work together to recover the secret data. Inspired by this, many scholars began to study secret sharing. Among them, Naor and Shamir proposed using images for secret sharing in 1995. This method distributes the result obtained by calculating the secret image and the carrier image through a formula as a shared image to n participants. In the future, t participants can decrypt the image. Many secret sharing methods have been proposed in the past two decades. Usually, these methods have two ways to create shared images: using polynomial calculations or using reference matrix lookup tables to obtain shared images. In 2014, Huynh et al. proposed a secret sharing method based on a four-way search algorithm. It uses the Sudoku matrix as a reference matrix, takes a pair of pixels as the starting coordinates, and searches for secret data in its four directions to create and recover shared images. The time complexity of the algorithm is low, but it can ensure the quality of the shared image and the security of the method. Therefore, it is very suitable for scenarios that require real-time applications.
[0005] In the (t,n) threshold mechanism proposed by Shamir, the sharer first constructs n shared information from the secret information S and distributes them to pre-determined participants. When the number of participants is equal to or greater than t, they can work together to recover the secret information; when the number of participants is less than t, the secret information cannot be recovered. In order to generate n shared information, the sharer selects a large prime number p and generates a t-1 degree polynomial, as shown in formula (1):
[0006] F(x)=s0+a1x+…+a t-1 x t-1 (mod p) (1)
[0007] Among them, the constant term s0 is the secret information S, and the polynomial coefficients (a1, a2, ..., a t-1 ) is a set of random number sequences in the range of [0, p-1]. Then the sharer obtains the shared information from formula (2), as shown in formula (2):
[0008] y1=F(1),y2=F(2),…,y n =F(n) (2)
[0009] Then he distributes the shared information to n participants, where as long as any t participants work together, they can reconstruct the polynomial F(x) through the Lagrange interpolation polynomial as shown in formula (3), and thus obtain the secret information S.
[0010]
[0011] The following example explains that in Shamir's (2,3) secret sharing scheme, assuming that the secret information S = 83, the polynomial F(x) = 83 + 7x (mod 251), then according to formula (2), we can get: F(1) = 90, F(2) = 97 and F(3) = 104 respectively. These results are distributed to specific participants, thus obtaining three sets of data (1, 90), (2, 97) and (3, 104). In the future, any two of the three participants can work together to calculate the polynomial F(x) using the interpolation polynomial and obtain the secret information.
[0012] like Figure 3 As shown in the figure, after the secret image I is calculated by the above polynomial, three shared images are obtained. The pixels on these shared images have changed relative to the original image pixel values, so they are all meaningless images. Even if the attacker obtains them, he cannot know what the original content is. However, as long as any two receivers work together, the original secret image can be obtained through the decoding formula calculation. But as discussed before, meaningless images transmitted on an insecure channel are likely to attract the attention of attackers. Therefore, a secret sharing method and device based on matrix coding is needed, which can embed the shared image into the carrier image using information hiding technology, so that the shared image of the secret sharing is not a meaningless photo, and the constructed shared image is more complex, which improves the security of secret sharing. Summary of the invention
[0013] 1. Technical issues to be resolved
[0014] In order to solve the above problems in the prior art, the present invention provides a secret sharing method and device based on matrix coding, so that the shared image of secret sharing is not a meaningless photo, the constructed shared image has higher complexity, and the security of secret sharing is improved.
[0015] (II) Technical solution
[0016] In order to achieve the above object, a technical solution adopted by the present invention is:
[0017] The secret sharing method based on matrix coding comprises the following steps:
[0018] S1, dividing the original image into a number of continuous but non-overlapping blocks, and extracting each block to obtain a corresponding first codeword;
[0019] S2. Obtain a first marking codeword and a first identification bit by performing a matrix coding operation on a parity check matrix according to the first codeword and the corresponding secret information, and generate a corresponding first marking block according to the first marking codeword and the corresponding block;
[0020] S3, obtaining a corresponding second marking codeword through a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit, and generating a corresponding second marking block according to the second marking codeword and the corresponding block;
[0021] S4. All the first marked blocks form a first shared image, and all the second marked blocks form a second shared image. Password sharing is performed according to the first shared image and the second shared image.
[0022] In order to achieve the above object, another technical solution adopted by the present invention is:
[0023] A secret sharing device based on matrix coding comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the program:
[0024] S1, dividing the original image into a number of continuous but non-overlapping blocks, and extracting each block to obtain a corresponding first codeword;
[0025] S2. Obtain a first marking codeword and a first identification bit by performing a matrix coding operation on a parity check matrix according to the first codeword and the corresponding secret information, and generate a corresponding first marking block according to the first marking codeword and the corresponding block;
[0026] S3, obtaining a corresponding second marking codeword through a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit, and generating a corresponding second marking block according to the second marking codeword and the corresponding block;
[0027] S4. All the first marked blocks form a first shared image, and all the second marked blocks form a second shared image. Password sharing is performed according to the first shared image and the second shared image.
[0028] (III) Beneficial effects
[0029] The beneficial effects of the present invention are as follows: an original image is divided into a number of continuous but non-overlapping blocks, and each block is extracted to obtain a corresponding first codeword; a first marking codeword and a first identification bit are obtained by a parity check matrix through a matrix coding operation according to the first codeword and the corresponding secret information, and a corresponding first marking block is generated according to the first marking codeword and the corresponding block; a corresponding second marking codeword is obtained by a parity check matrix through a matrix coding operation according to the first codeword and the corresponding first identification bit, and a corresponding second marking block is generated according to the second marking codeword and the corresponding block; all the first marking blocks form a first shared image, and all the second marking blocks form a second shared image, and cryptographic sharing is performed according to the first shared image and the second shared image, so that the shared image of the secret sharing is not a meaningless photo, the constructed shared image has higher complexity, and the security of the secret sharing is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Flow chart of a secret sharing method based on matrix coding according to an embodiment of the present invention;
[0031] Figure 2 Schematic diagram of the overall structure of a secret sharing device based on matrix coding according to an embodiment of the present invention;
[0032] Figure 3 It is a secret sharing method in the prior art;
[0033] Figure 4 To generate examples of shared information;
[0034] Figure 5 Schematic diagram for secret image extraction and payload image recovery;
[0035] Figure 6 For the test image;
[0036] Figure 7 It is the pixel distribution map of the shared image;
[0037] Figure 8 to embed, extract, and refactor performance tests;
[0038] Fig. 9 PSNR comparison of different methods under the same storage capacity on test images (a) Lena, (b) Barbara, (c) Peppers and (d) Tiffany.
[0039] [Description of Reference Numerals]
[0040] 1: Secret sharing device based on matrix coding;
[0041] 2: Memory;
[0042] 3: Processing. DETAILED DESCRIPTION
[0043] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0044] Embodiment 1
[0045] Please refer to Figure 1 , a secret sharing method based on matrix coding, comprising the steps of:
[0046] S1, dividing the original image into a number of continuous but non-overlapping blocks, and extracting each block to obtain a corresponding first codeword;
[0047] Step S1 specifically includes:
[0048] S11, dividing the original image into a plurality of continuous but non-overlapping blocks according to the order of raster scanning;
[0049] S12. Extract the least significant bit of each pixel from each block in turn to form a binary one-dimensional array, and obtain a corresponding first codeword.
[0050] S2. Obtain a first marking codeword and a first identification bit by performing a matrix coding operation on a parity check matrix according to the first codeword and the corresponding secret information, and generate a corresponding first marking block according to the first marking codeword and the corresponding block;
[0051] Step S2 specifically includes:
[0052] S21, obtaining a first marking codeword and a first identification bit by performing a matrix coding operation using a parity check matrix according to the first codeword and the corresponding secret information;
[0053] S22. Replace the least significant bit of each pixel in the corresponding block with the first marking codeword to obtain a corresponding first marked block.
[0054] S3, obtaining a corresponding second marking codeword through a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit, and generating a corresponding second marking block according to the second marking codeword and the corresponding block;
[0055] Step S3 specifically includes:
[0056] S31, obtaining a corresponding second marking codeword by performing a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit;
[0057] S32: Replace the least significant bit of each pixel in the corresponding block with the second marking codeword to obtain a corresponding second marked block.
[0058] S4. All the first marked blocks form a first shared image, and all the second marked blocks form a second shared image. Password sharing is performed according to the first shared image and the second shared image.
[0059] Embodiment 2
[0060] The difference between this embodiment and the first embodiment is that this embodiment will further illustrate how the above-mentioned secret sharing method based on matrix coding of the present invention is implemented in combination with a specific application scenario:
[0061] The method of the present invention can be divided into two parts: shared information construction and secret information extraction and original image restoration.
[0062] 1. Shared information construction
[0063] a. Input: Secret information {S i |i=1,2,...,n} and {S i ∈[0,7]}, original image I and parity check matrix H;
[0064] b. Output: the first shared image I1 and the second shared image I2.
[0065] Step 1: Divide the original image into 1×7 consecutive but non-overlapping blocks in the order of raster scanning (from left to right and from top to bottom)
[0066] Step 2: Take the least significant bit of each pixel from each block in turn to form a binary one-dimensional array, that is, the first codeword
[0067] Step 3: According to the first code word CW i and the corresponding secret information S i The first mark code word MCW is obtained by matrix coding operation of the parity check matrix 1i and the first marker z 1i ;
[0068] Step 4: Use the first marking codeword MCW 1i Replace the corresponding block C i The least significant bit of each pixel in the first label block C is obtained. 1i ;
[0069] Step 5: Repeat the operations of steps 3 and 4, and finally obtain the first shared image I1;
[0070] Step 6: According to the first code word CW i and the corresponding first flag z i The corresponding second mark code word MCW is obtained by matrix coding operation of the parity check matrix2i and the second flag bit z 2i ;
[0071] Step 7: Use the second marking codeword MCW 2i Replace the corresponding block C i The least significant bit of each pixel in the corresponding second labeled block C 2i ;
[0072] Step 8: Repeat the operations of steps 6 and 7 to finally obtain the second shared image I2.
[0073] To further explain, Figure 4 As an example of generating shared information, take the i-th block C of the original image i As an example, assume that the secret information S i =5, image block C i =[7,10,9,6,3,5,17], first take C i The least significant bit of each element constitutes the code word CW i =[1,0,1,0,1,1,1]; then CW i and S i Perform matrix coding operation to obtain the marking codeword CW 1i =[1,0,0,0,1,1,1] and flag bit z 1i =3; then replace C with the marked codeword i The least significant bit of the labeled image block C 1i =[7,10,8,6,3,5,17]; then the codeword and the flag bit are matrix-coded together to obtain the marking codeword CW 21i =[1,0,1,0,0,1,1] and flag bit z 2i =5, replace the least significant bit of the original image and get the marked image block C 2i =[7,10,9,6,2,5,17].
[0074] 2. Secret image extraction and payload image recovery
[0075] In order to obtain the secret information, the receivers must work together, put their shared images together, and then use the secret information extraction and original image recovery algorithm to decode them, so as to obtain the secret information and restore the original image. The detailed extraction and recovery algorithm is shown below.
[0076] a. Input: first shared image I1, second shared image I2 and parity check matrix H;
[0077] b. Output: Secret information {S i |i=1,2,...,n} and {S i∈[0,7]}, original image I.
[0078] Step 1: Divide the first shared image I1 and the second shared image I2 into 1×7 continuous but non-overlapping blocks in the order of raster scanning (from left to right and from top to bottom).
[0079] Step 2: Take the least significant bit of each pixel from each block in turn to form a binary one-dimensional array, i.e., the codeword
[0080] Step 3: Codeword CW 1i The check matrix H is obtained by the formula mod(H×CW 1i T ,2), the secret information S can be calculated i ;
[0081] Step 4: Repeat step 3 and obtain the secret information S i After the connection is made, the secret information S is obtained;
[0082] Step 5: Change the codeword CW 2i The check matrix H is obtained by the formula mod(H×CW 2i T ,2), the flag bit z can be calculated 1i
[0083] Step 6: If the flag is z 1i =0, then the code word CW 1i Keep unchanged, z 1i ≠0, then the codeword CW 1i The corresponding position is flipped to obtain the updated codeword CW i ;
[0084] Step 7: Use codeword CW i Replace B 1i The least significant bit of
[0085] Step 8: Repeat steps 6 and 7 to finally obtain the original image I.
[0086] To further explain, Figure 5 As an example of secret information extraction and image recovery, first take the example of the receiver collecting the information of the i-th block of the shared image, that is, B 1i =[7,10,8,6,3,5,17] and B 2i =[7,10,9,6,2,5,17], extract the least significant bit to get the mark codeword CW 1i =[1,0,0,0,1,1,1] and CW 2i=[1,0,1,0,0,1,1]; then the two code words are decoded with the parity matrix to obtain the secret information S i =101 and modify the flag bit Syndrome = 011; then use the flag bit to mark the codeword CW 1i The third bit is flipped to get the original codeword CW i =[1,0,1,0,1,1,1]; finally replace B with the original codeword 1i The least significant bit of the original image block B is obtained i =[7,10,9,6,3,5,17].
[0087] 3. Result comparison
[0088] In order to present and analyze the experimental results of the secret sharing scheme based on the coding matrix, the experimental software and hardware platforms are MATLAB R2017a and a computer with a dual-core CPU and 8GB RAM. The experimental images are nine grayscale images with a size of pixels as carrier images. The test images are as follows Figure 6 The following will be divided into 4 sections to present the four aspects of security, image quality, time complexity and pixel expansion, and compare and analyze the experimental results with other similar methods.
[0089] 3.1 Security
[0090] In order to ensure the security and robustness of this method, the shared image obtained after embedding the secret image cannot leak any information about the secret image, and the shared images obtained are meaningful images, which look no different from ordinary images, which can largely avoid suspicion from people with ulterior motives and further improve security. Figure 7 As shown in , by comparing the histograms of the original image and the shared image, it can be found that the pixel distribution of the image before and after embedding is very similar, with only some slight differences, so pixel analysis is not valid for this solution. Figure 8 As shown in the figure, the two shared images embedded with secret information have almost no visual difference from the original images, so this scheme has good visual quality.
[0091] On the other hand, the experiment also uses RS steganalysis technology to verify the security of this method. This analysis method is often used to detect whether the least significant bit is embedded with hidden information. M , R -M , S M and S -M The four results are used to determine whether the detected image contains hidden information. If the above results meet: R M ≈R -M >SM ≈S -M , then the image does not contain hidden information; otherwise, the image contains hidden information. The experiment tested nine test images and recorded the test results in Table 1. It can be found that R M and R -M The results are very similar, the average differences between the first shared image I1 and the second shared image I2 are 0.0168 and 0.0176 respectively; M and S -M The results are also very similar, with the average differences between the first shared image I1 and the second shared image I2 being 0.0093 and 0.0115 respectively.
[0092] In summary, the experiment tested the security of this scheme from two perspectives: visual and steganalysis. The experimental results show that the overall security of the method is relatively high.
[0093] Table 1 Results of RS steganalysis on shared images
[0094]
[0095] 3.2 Image Quality
[0096] Image quality can be expressed by mean square error (MSE) and peak signal-to-noise ratio (PSNR). In fact, when the PSNR value of the marked image is above 30, it will have a relatively good quality. The specific calculation formula is as follows:
[0097]
[0098]
[0099] Here W×H represents the width and height of the image, I 1,i,j and I 2,i,j The pixel values corresponding to the original image and the labeled image in the i-th row and j-th column respectively. The larger the calculated PSNR value is, the better the quality of the labeled image is, and vice versa.
[0100] Table 2 Comparison of shared image quality obtained by Lin et al., Huynh et al. and this solution
[0101]
[0102] In the experiment of testing image quality, the average PSNR values of shared images obtained by Lin et al., Huynh et al. and this scheme, which also use secret sharing, are compared under the same storage conditions. When the secret information is 112347 bits, the specific experimental results are shown in Table 2. The average PSNR value of the scheme of Lin et al. is 43.23, the average PSNR value of the scheme of Huynh et al. is 39.24, and the average PSNR value of this scheme is 57.16. The average PSNR value of the shared image obtained is the highest, which is 13.93 and 17.92 higher than the PSNR values of the Lin and Huynh schemes, respectively. On the other hand, it can be calculated that the mean square error of the PSNR values of the schemes of Lin, Huynh et al. and this scheme in the nine test images is 0.368, 0.155 and 0.007, respectively. From the above analysis, it can be seen that the quality of the shared image obtained by the secret sharing method is mainly closely related to the algorithm itself, and has nothing to do with the test images used.
[0103] like Figure 8 As shown in the figure, in the performance test experiment of this scheme, Airplane and Lena are selected as the secret image and the load image for testing respectively. First, the secret image is embedded into the load image using the shared image construction algorithm and two shared images are obtained, namely Figure 8 (c) and (d), these two images look very similar, and the naked eye cannot distinguish the difference between them, and their PSNR values are 57.1609 and 57.1670 respectively; secondly, the secret image can be correctly extracted from the two shared images using the extraction and recovery algorithm; finally, the shared image can be restored to the original payload image using the flag information, with an accuracy of 100%, that is, PSNR = ∞. Therefore, the experimental results of this scheme are of high quality in terms of both the visual effect of the image and the size of the PSNR, and the extracted secret information is exactly the same as when it was embedded, and the embedded and restored images are also completely reversible.
[0104] like Fig. 9 As shown in the figure, in the fixed storage experiment, four test images were selected, including two images with complex textures, Barbara and Peppers, and two images with smooth textures, Lena and Tiffany. Then the PSNR values of the shared images obtained when the storage of these images was 18720, 37520, 64800, 74752 and 112347 bits were tested and represented by a graph. It can be seen that the peak signal-to-noise ratio of this scheme is better than that of Yu and B.Jana et al., and the PSNR value decreases more slowly with the increase of fixed storage, and still remains above 57.17dB, which is much larger than the standard of 30dB, reflecting the advantage of this scheme in the quality of output images.
[0105] 3.3 Computational complexity
[0106] In the secret sharing scheme, it is very important to maintain low computational complexity while constructing a shared image and extracting secret information from the shared image, which will affect the practical application value of the scheme. The algorithm of this scheme in the stage of creating a shared image and extracting secret information is demonstrated in Sections 3.1 and 3.2. The time complexity of the algorithm mainly depends on the matrix coding operation, and the time complexity is O(n), that is, the effect of secret sharing can be achieved at a very low cost. Table 3 shows the comparison results of the computational complexity of the secret sharing scheme proposed in recent years with the sharing scheme based on matrix coding. It can be seen that the computational complexity of this scheme is lower than that of other schemes.
[0107] Table 3 Computational time complexity of different methods
[0108]
[0109] 4.4 Pixel Expansion
[0110] In the previously mentioned secret sharing scheme, the problem of pixel expansion usually occurs in the process of generating the shared image. In this scheme, the lowest bit of 7 consecutive pixels on the payload image is embedded with 3 bits of secret information through matrix coding, and finally 2 shared images are generated, which have the same size as the payload image. Of course, the overall embedding rate can be improved by using more bits, although it will cause the image quality of the obtained labeled image to deteriorate, but it will not cause the problem of pixel expansion.
[0111] Embodiment 3
[0112] Please refer to Figure 2 A secret sharing device 1 based on matrix coding includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the program, each step in the first embodiment is implemented.
[0113] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A secret sharing method based on matrix coding, characterized in that: Includes steps: S1, dividing the original image into a number of continuous but non-overlapping blocks, and extracting each block to obtain a corresponding first codeword; S2. Obtain a first marking codeword and a first identification bit by performing a matrix coding operation on a parity check matrix according to the first codeword and the corresponding secret information, and generate a corresponding first marking block according to the first marking codeword and the corresponding block; S3, obtaining a corresponding second marking codeword through a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit, and generating a corresponding second marking block according to the second marking codeword and the corresponding block; S4. All the first marked blocks form a first shared image, all the second marked blocks form a second shared image, and password sharing is performed according to the first shared image and the second shared image; Step S2 specifically includes: S21, obtaining a first marking codeword and a first identification bit by performing a matrix coding operation using a parity check matrix according to the first codeword and the corresponding secret information; S22. Replace the least significant bit of each pixel in the corresponding block with the first marking codeword to obtain a corresponding first marked block.
2. The secret sharing method based on matrix coding according to claim 1, characterized in that: Step S1 specifically includes: S11, dividing the original image into a plurality of continuous but non-overlapping blocks according to the order of raster scanning; S12. Extract the least significant bit of each pixel from each block in turn to form a binary one-dimensional array, and obtain a corresponding first codeword.
3. The secret sharing method based on matrix coding according to claim 1, characterized in that: Step S3 specifically includes: S31, obtaining a corresponding second marking codeword by performing a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit; S32: Replace the least significant bit of each pixel in the corresponding block with the second marking codeword to obtain a corresponding second marked block.
4. A secret sharing device based on matrix coding, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the following steps are implemented: S1, dividing the original image into a number of continuous but non-overlapping blocks, and extracting each block to obtain a corresponding first codeword; S2. Obtain a first marking codeword and a first identification bit by performing a matrix coding operation on a parity check matrix according to the first codeword and the corresponding secret information, and generate a corresponding first marking block according to the first marking codeword and the corresponding block; S3, obtaining a corresponding second marking codeword through a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit, and generating a corresponding second marking block according to the second marking codeword and the corresponding block; S4. All the first marked blocks form a first shared image, all the second marked blocks form a second shared image, and password sharing is performed according to the first shared image and the second shared image; Step S2 specifically includes: S21, obtaining a first marking codeword and a first identification bit by performing a matrix coding operation using a parity check matrix according to the first codeword and the corresponding secret information; S22. Replace the least significant bit of each pixel in the corresponding block with the first marking codeword to obtain a corresponding first marked block.
5. The secret sharing device based on matrix coding according to claim 4, characterized in that: Step S1 specifically includes: S11. Divide the original image into a number of continuous but non-overlapping blocks in the order of raster scanning; S12. Extract the least significant bit of each pixel from each block in turn to form a binary one-dimensional array, and obtain the corresponding first codeword.
6. The secret sharing device based on matrix coding according to claim 4, characterized in that: Step S3 specifically includes: S31, obtaining a corresponding second marking codeword by performing a matrix coding operation using a parity check matrix according to the first codeword and the corresponding first identification bit; S32: Replace the least significant bit of each pixel in the corresponding block with the second marking codeword to obtain a corresponding second marked block.
Citation Information
Patent Citations
Improved LSB (Least Significant Bit) image steganography method combining cryptology
CN109547663A