A Reversible Information Hiding Method for Encrypted Images with Bit-Plane Compression and Block Rearrangement
Through bit plane compression and block rearrangement, the security and capacity problems of encrypted image embedding secret information in cloud environments are solved, efficient data embedding and extraction are achieved, and image security is enhanced.
Patent Information
- Application Number
- CN202310632297.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2043-05-31
AI Technical Summary
In the prior art, in the reversible information hiding method of encrypting images in a cloud environment, it is difficult to simultaneously improve the ability to embed secret information and maintain the security of the embedded image.
The prediction error image is block-compressed and rearranged using bit plane compression and block rearrangement. The auxiliary information length is reduced by using Huffman encoding, and the encrypted secret information is embedded in the encrypted image, and image recovery and data extraction are performed through the encryption key and hidden key.
It achieves higher embedded capacity and sufficient security, can withstand existing attack methods and meet the security and efficient needs of practical applications.
Smart Images

Figure CN116582344B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image content security in information security, and particularly relates to a reversible information hiding method for encrypted images with bit-plane compression and block rearrangement. Background Art
[0002] In recent years, with the development of technology, the lifestyle of human beings has undergone earth-shaking changes. In particular, the communication method has changed from the original telephone and text messages to WeChat and QQ today, the communication medium has changed from the previous PHS and pagers to smartphones now, and the communication group has changed from the original specific population to almost everyone in the world today. While people are enjoying the convenience brought by the high-tech information revolution, the accompanying problem of information leakage has become increasingly serious. Viruses, trojans, and phishing information flooding the network pose a serious threat to information security. Therefore, how to effectively ensure the security of information during transmission has become the focus of attention.
[0003] Information hiding is an effective technology for protecting privacy security. It embeds secret information into multimedia files (such as digital images) for transmission. Since it is difficult for a third party to detect the content distortion on the multimedia, it can effectively ensure that the embedded data is not leaked. Reversible information hiding can achieve lossless recovery of the embedded carrier on this basis, thus playing an important role in fields such as military medical image processing and multimedia copyright protection. With the emergence of cloud technology, when the sender transmits an image to the receiver, it needs to go through the processing of the cloud server. After obtaining the receiver's image, the cloud server needs to embed user information such as watermarks and timestamps. To prevent the privacy of the sender from being leaked at this stage, the sender needs to encrypt the image before sending, and the cloud server performs reversible information hiding on the encrypted image. Finally, the receiver performs image restoration or embedded information extraction according to different encryption keys. The whole process is called reversible information hiding of encrypted images. This technology solves the problem that the original image is easily exposed and further improves the ability to protect user privacy in the cloud environment. Summary of the Invention
[0004] In order to improve the ability of embedding secret information into encrypted images as much as possible while maintaining the security of the image after embedding, the present invention proposes a reversible information hiding method for encrypted images based on bit-plane compression and block rearrangement. For the image owner, first, a prediction algorithm (such as median edge detection) is applied to the original image to obtain a prediction error value image; second, the prediction error image is divided into blocks, the high-order all-zero bit-planes of each separated block are compressed, and the remaining low-order embeddable bit-planes are compressed to create embedding space, and then the characteristic data for restoring the carrier image is statistically analyzed; then, according to the statistically analyzed characteristic data, the low-order bit-planes of each block are swapped, and the blocks in the image are rearranged, and the characteristic data of the rearranged blocks is statistically analyzed again; finally, Huffman coding is used to reduce the length of the auxiliary information, the auxiliary information is classified and encrypted, and all the auxiliary information is embedded into the encrypted image and sent to the information hider. For the information hider, the information to be embedded is encrypted with the hiding key first, and then the encrypted secret information is embedded into the redundant space vacated by the encrypted image to obtain a secret-containing image. For the receiver, if it has the hiding key, it can extract and decrypt the data to obtain the embedded secret information; if it has the encryption key, it can decrypt the auxiliary information to restore the original image; if it has both the hiding key and the encryption key, the original data can not only be correctly extracted, but the original image can also be losslessly restored. Compared with other related works, the proposed scheme of the present invention not only has a great improvement in the embedding capacity, but also can maintain sufficient security of the secret-containing image, and has relatively superior performance.
[0005] The technical solution of the present invention is as follows;
[0006] S1: The image owner applies a prediction algorithm to the original carrier image to be information-hidden to obtain a corresponding prediction error image.
[0007] S2: The prediction error image is divided into blocks, the high-order all-zero bit-planes of each block are compressed, and the remaining low-order embeddable bit-planes are compressed to create embedding space, and then the characteristic data for restoring the carrier image is statistically analyzed.
[0008] S3: According to the statistically analyzed characteristic data, the low-order bit-planes of each block are swapped, and the blocks in the prediction error image are rearranged, and the characteristic data of the rearranged blocks is statistically analyzed again.
[0009] S4: The rearranged prediction error image is encrypted with the encryption key to obtain a preliminary encrypted image.
[0010] S5: Huffman coding is used to re-encode the number of high-order all-zero bit-planes of the blocks before rearrangement, and then the re-encoded data and the characteristic data of the blocks before rearrangement are encrypted together to form ciphertext information. The ciphertext information and the characteristic data of the blocks after rearrangement together form all the auxiliary information. Finally, the auxiliary information is embedded into the preliminary encrypted image to form the final encrypted image and sent to the information hider.
[0011] S6: The information hider first encrypts the secret information using the hidden key, then embeds the encrypted secret information into the received encrypted image to form a secret image, and sends it to the receiver.
[0012] S7: The receiver performs image recovery and data extraction operations on the received secret image according to the encryption key and the hidden key.
[0013] Furthermore, the specific process of step S1 is:
[0014] S1-1. Get the original carrier image. Assume that the size of the image is m×n and the pixel value of the image is x(i,j), where 1≤i≤m, 1≤j≤n. For the first row and first column pixel of the image, its predicted value p(1,1) is its own value; for the first row (i=1,1 <j≤n)或第一列(1<i≤m,j=1)像素,其预测值p(1,j)或p(i,1)分别为其前一列同行或前一行同列的像素值;对于剩余的其他像素(1<i≤n,1<j≤n),其预测值p(i,j)则根据中值边缘检测预测来得到。
[0015] S1-2. Calculate the prediction error e(i,j) of each pixel using the following formula:
[0016] e(i,j)=x(i,j)-p(i,j)
[0017] Finally, we can get the prediction error matrix of the same size as the image, using L sign To record the sign of e(i,j), and take |e(i,j)| to construct the prediction error image.
[0018] Furthermore, the specific process of step S2 is:
[0019] S2-1, according to the formula:
[0020]
[0021] The pixels of the prediction error image are converted from decimal to binary 8 bits to represent, where k represents the ordinal number of the binary sequence from low to high. Indicates rounding down.
[0022] S2-2. Divide the prediction error image into blocks, where the size of each block is t×t.
[0023] S2-3. For each block, first count all the bits in the highest-order plane. If all the bits in the current plane are 0, continue to compare the next lower plane; if not all the bits in the current plane are 0, stop the comparison. Use the symbol LR m to record and represent that all elements in the block before the LR m -MSB layer planes are 0. The value of LR m has 9 cases, which are 0 to 8 respectively.
[0024] S2-4. After obtaining the LR m of each block, then continue to traverse the remaining (8 - LR m ) bit planes of each block. If the number of 0s or 1s in the current bit plane is less than the number of 1s or 0s, extra embedding space can be freed by recording the information of the small number of bits in the current bit plane LR f . The information to be recorded LR f includes the values of the small number of bits in this bit plane, the number of these small bits, and the positions of these small bits in the current bit plane. At the same time, it is also necessary to use LR v to represent which of the remaining bit planes of the current block can be used to embed data. If the current bit plane can embed data, the corresponding value in LR v is 1, otherwise it is 0. The length of the LR v value of each block should be (8 - LR m ) bits.
[0025] Furthermore, the specific process of step S3 is as follows:
[0026] S3-1. According to the LR v value of each block, swap the corresponding bit planes so that among the remaining (8 - LR m ) bit planes, the bit planes that can embed data are at higher significant bits, and the bit planes that cannot embed are at lower significant bits. After the above operations, according to the formula:
[0027] LR′ m = LR m + l T (LR v = 1)
[0028] it can be obtained that all the first LR′ m -MSB bit planes of this block can embed data, where l T (LR v = 1) represents the number of 1s in LR v .
[0029] S3-2. Perform bit plane exchange on each block to obtain LR′ mAfter that, all blocks in the image are rearranged in the image in descending order according to the obtained LR′ m value, so that when traversing the image from left to right and from top to bottom, the block with the largest LR′ m value will be traversed first, while the block with the smallest LR′ m value will be at the end of the image; after the rearrangement operation of the blocks in the image, a newly rearranged image I r is obtained. Use LC(k) to record the number of blocks with LR′ m =d, where the value of d is 0 to 8.
[0030] Furthermore, the specific method of step S4 is as follows:
[0031] S4-1: Use the encryption key K e to generate a random matrix R of size m×n, where the values R(i,j) in the matrix R ∈ [0, 255].
[0032] S4-2: Convert the pixel value I r in the image I r (i,j) and the value R(i,j) in the matrix R into 8-bit binary sequences and R k (i,j) respectively, where 1 ≤ k ≤ 8.
[0033] S4-3: According to the formula:
[0034]
[0035] where represents the exclusive OR operation, to obtain the encrypted binary sequence Then, the binary sequence is passed through the formula:
[0036]
[0037] to obtain the finally encrypted image pixel I e (i,j), and the initially encrypted image generated is I e .
[0038] Furthermore, the specific method of step S5 is as follows:
[0039] S5-1: The LR of all blocks m needs to be embedded as part of the auxiliary information into the initially encrypted image I e . Since the distribution of the LR values of the blocks m is not uniform, Huffman coding {00, 01, 100, 101, 1100, 1101, 1110, 11110, 11111} is used to shorten the length of the auxiliary information, and shorter codes are used to represent the more frequently occurring LRm Finally, LR represented by Huffman coding is obtained. m Set LR s ; In order to correctly extract each LR from LR s , the auxiliary information to be embedded should also include the Huffman coding rule LR m . r .
[0040] S5-2. To facilitate the embedding of the secret message, LC(k) needs to be first embedded into the preliminary encrypted image as auxiliary information. Through LC(k), all embeddable regions in the image can be known.
[0041] S5-3. To be able to restore the original image, auxiliary information LR for image restoration also needs to be embedded. The content of LR includes the Huffman coding rule LR r , LR after Huffman coding s , LR of all blocks v , LR of all blocks f , the sign marker L of the prediction error sign and the first pixel x(1,1) of the original carrier image.
[0042] S5-4. To achieve sufficient security, the auxiliary information LR needs to be encrypted with the encryption key K e before embedding to form LR e . To facilitate the extraction of LR e , the length l of LR e should also be added b (LR e ) as auxiliary information.
[0043] S5-5. All the final auxiliary information LA to be embedded includes LC, l b (LR e ) and LR e ; According to the value of LC(k), all the auxiliary information LA is embedded into the embeddable bit planes of the image from high to low in the order of block traversal to form the final encrypted image I with auxiliary information a .
[0044] Furthermore, the specific process of encrypting the secret information with the hiding key in step S6 is as follows:
[0045] S6-1. First, LC(8) needs to be extracted from the encrypted image I a , and the remaining LC(k) is continuously extracted through the value of LC(8); if the value of LC(8) is 0, then LC(7) is continuously extracted until all LC(k) are completely extracted.
[0046] S6-2. Continue to traverse the embeddable parts in the image through the value of LC(k). After traversing all the auxiliary information LA, the remaining space is used to embed the secret data. Before embedding, for security reasons, the secret data should also be encrypted by the hiding key K d .
[0047] Furthermore, the specific method of step S7 is as follows:
[0048] S7-1. First, it is necessary to extract LC(8) from the image I a , and continuously extract the remaining LC(k) through the value of LC(8). If the value of LC(8) is 0, continue to extract LC(7) until all LC(k) are extracted.
[0049] S7-2. Continue to extract l b (LR e ) through the value of LC(k). According to the length l b (LR e ), extract the encrypted LR e , and then extract all the data in the remaining embeddable space, which is the encrypted secret data.
[0050] S7-3. If the receiver only has the hiding key K d but does not have the encryption key K e , then the encrypted data can be decrypted into the original secret information through K d .
[0051] S7-4. If the receiver only has the encryption key K e but does not have the hiding key K d , then through K e , the original carrier image can be restored losslessly.
[0052] S7-5. If the receiver has both the hiding key K d and the encryption key K e , then not only can the embedded data be correctly extracted, but also the original carrier image can be restored losslessly.
[0053] Furthermore, the specific process of restoring the original carrier image in step S7-4 is as follows:
[0054] S7-4-1. Decrypt the encrypted image I a and the extracted auxiliary information LR e into I′ and LR respectively using the encryption key K e . The first 32 bits of LR are the Huffman coding rule LR r . Then, with the help of the coding rule LR r , continue to traverse the remaining part of LR. When traversing to After the group encoding, the LR of all blocks can be obtained m .
[0055] S7-4-2. Through LR m , LR v The length l T (LR v ) is determined by the formula:
[0056]
[0057] where LR v (a, b) represents the LR of the block located at the a-th row and b-th column in the predicted error image of the block v value; through the length l T (LR v ), LR v can be extracted from LR
[0058] S7-4-3. The total number N of remaining bit planes of all blocks in the original predicted error image except for the high-order all-0 bit plane v can be obtained through the formula:
[0059]
[0060] where l T (LR v (a, b) = 1) represents the number of 1s in LR v (a, b), continue to traverse LR and accumulate the number of bit planes represented by each LR f until the accumulated value is equal to N v , then the LR of each block f can be completely determined
[0061] S7-4-4. The symbol information L sign and the distribution of the first pixel x(1, 1) of the original carrier image I are determined by their lengths respectively
[0062] S7-4-5. In order to restore the image before rearrangement, the LR' of each block in the predicted error image m can be obtained through LR m and LR v . Through the obtained LR' m , each block in the image I' is restored to the original order; then the bit plane of each block can be restored to the original value through LR m , LR v and LR f . Through the above operations, the original predicted error image is finally obtained, and then through L sign and x(1, 1), the original carrier image I is losslessly restored
[0063] The beneficial effects of the present invention are as follows:
[0064] 1. The present invention proposes a new bit-plane compression method. Based on the characteristics between prediction error values, the prediction error image is divided into blocks, and the high-order all-zero bit-planes and the remaining embeddable data bit-planes of each block are fully compressed. Then, Huffman coding is used to minimize the length of auxiliary information as much as possible, so as to achieve a higher embedding capacity.
[0065] 2. The present invention proposes a method of bit-plane swapping and block rearrangement. By merging the embedding space and dividing the auxiliary information into three parts, it is possible to embed and extract data with only a small part of the auxiliary information, while the vast majority of the auxiliary information is encrypted to enhance security.
[0066] In summary, while improving the embeddable data capacity, the present invention also has sufficient security to resist some existing attack methods, thus better meeting the actual needs and being more secure and efficient in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 is a flow chart of the present invention;
[0068] Figure 2 are the effect diagrams of the Lena image at different stages;
[0069] Figure 3 are the effect diagrams of the Lena image analyzed under brute-force attack;
[0070] Figure 4 are the effect diagrams of the Tiffany image under cropping attack;
[0071] Figure 5 is a comparison chart of the embedding capacity of the present invention and the reference algorithm on test images;
[0072] Figure 6 is a comparison chart of the average embedding capacity of the present invention and the reference algorithm on the test database image set. DETAILED DESCRIPTION OF THE INVENTION
[0073] In order to better understand the technical solution of the present invention, the following describes in detail the specific implementation manners of the present invention with reference to the drawings, so as to facilitate those skilled in the art to understand the present invention. It should be clear that all other implementation manners obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0074] As Figure 1 shown, the reversible information hiding method for encrypted images with bit-plane compression and block rearrangement includes the following steps:
[0075] S1: The image owner uses a prediction algorithm on the original carrier image to be information - hidden to obtain the corresponding prediction error image.
[0076] S2: Divide the prediction error image into blocks, compress the high - order all - 0 bit - planes and the remaining low - order embeddable bit - planes of each block to create embedding space, and then count the feature data used to restore the carrier image.
[0077] S3: According to the feature - statistical data, swap the low - order bit - planes in each block and rearrange the blocks in the prediction error image, and then count the feature data of the rearranged blocks again.
[0078] S4: Encrypt the rearranged prediction error image with an encryption key to obtain a preliminary encrypted image.
[0079] S5: Use Huffman coding to re - encode the number of high - order all - 0 bit - planes of the blocks before rearrangement, then encrypt the re - encoded data together with the feature data of the blocks before rearrangement to form ciphertext information. Combine this ciphertext information with the feature data of the blocks after rearrangement to form all the auxiliary information. Finally, embed the auxiliary information into the preliminary encrypted image to form the final encrypted image and send it to the information hider.
[0080] S6: The information hider first encrypts the secret information with a hiding key, then embeds the encrypted secret information into the received encrypted image to form a stego - image, and sends it to the receiver.
[0081] S7: The receiver performs image restoration and data extraction operations on the received image according to the encryption key and the hiding key respectively.
[0082] The specific process of step S1 is as follows:
[0083] S1 - 1: Obtain the original carrier image. Assume the size of the image is m×n, and the pixel value of the image is x(i,j), where 1≤i≤m, 1≤j≤n. For the pixel in the first row and first column of the image, its predicted value p(1,1) is its own value; for the pixels in the first row (i = 1, 1 < j≤n) or the first column (1 < i≤m, j = 1) of the image, their predicted values p(1,j) or p(i,1) are the pixel values of the same row in the previous column or the same column in the previous row respectively; for the remaining other pixels (1 < i≤n, 1 < j≤n), their predicted values p(i,j) are obtained according to median - edge detection prediction.
[0084] S1 - 2: Calculate the prediction error e(i,j) of each pixel through the following formula:
[0085] e(i,j)=x(i,j)-p(i,j)
[0086] Finally, a prediction error matrix of the same size as the image can be obtained. The prediction error value e(i, j) in this matrix belongs to [-255, 255]. If this value is used as the pixel of the image, an underflow problem will occur. Therefore, use L sign to record the sign of e(i, j), and construct a prediction error image by taking |e(i, j)|.
[0087] The specific process of step S2 is as follows:
[0088] S2-1: According to the formula:
[0089]
[0090] Convert the pixels of the prediction error image from decimal to 8 bits represented in binary, where k represents the ordinal number of the binary sequence from the low bit to the high bit, indicating rounding down.
[0091] S2-2: Divide the prediction error image into blocks, where the size of each block is t×t.
[0092] S2-3: For each block, the most significant bit plane is the bit plane formed by the most significant bits (MSB) of each pixel in the block. Similarly, the least significant bit plane is the bit plane formed by the least significant bits (LSB) of each pixel in the block. First, start counting all the bits in the most significant bit plane. If all the bits in the current bit plane are 0, continue to compare the next lower bit plane; if the bits in the current layer are not all 0, stop comparing; use the symbol LR m to record and represent that all elements in the block before the LR m -MSB layer bit planes are 0. The value of LR m has 9 cases, which are 0 to 8 respectively.
[0093] S2-4: After obtaining the LR m of each block, then continue to traverse the remaining (8 - LR m ) bit planes of each block; if the number of bits with a value of 0 or 1 in the current bit plane is much smaller than the number of bits with a value of 1 or 0, then the extra embedding space can be freed by recording the information LR f of a small number of bits in the current bit plane. The information LR f to be recorded includes the values of a small number of bits in this bit plane, the number of these small bits, and the positions of these small bits in the current bit plane; at the same time, it is also necessary to use LR v to represent which of the remaining bit planes of the current block can be used to embed data. If the current bit plane can embed data, the corresponding value in LR v is 1, otherwise it is 0. The LR vThe length of the value should be (8 - LR m ) bits.
[0094] The specific process of step S3 is as follows:
[0095] S3-1. According to the LR v value of each block, the corresponding bit planes are swapped so that among the remaining (8 - LR m ) bit planes, the bit planes where data can be embedded are located at higher significant bits, while the bit planes where data cannot be embedded are at lower significant bits. After the above operations, according to the formula:
[0096] LR′ m = LR m + l T (LR v = 1)
[0097] it can be obtained that all the first LR′ m -MSB bit planes of the block can be embedded with data, where l T (LR v = 1) represents the number of 1s in LR v .
[0098] S3-2. After performing bit plane swapping on each block to obtain LR′ m , all the blocks in the image are rearranged in descending order according to the obtained LR′ m value in the image, so that when traversing the image from left to right and top to bottom, the block with the largest LR′ m value will be traversed first, while the block with the smallest LR′ m value will be at the end of the image; after the rearrangement operation of the blocks in the image, a newly rearranged image I r is obtained, and LC(k) is used to record the number of blocks with LR′ m = d, where the value of d is 0 to 8.
[0099] The specific method of step S4 is as follows:
[0100] S4-1. Use the encryption key K e to generate a random matrix R of size m×n, and the values R(i,j) in the matrix R ∈ [0,255].
[0101] S4-2. Convert the pixel value I r in the image I r (i,j) and the value R(i,j) in the matrix R into 8-bit binary sequences and R k (i,j) respectively, where 1 ≤ k ≤ 8.
[0102] S4-3. According to the formula:
[0103]
[0104] where represents the exclusive-or operation to obtain the encrypted binary sequence Then, the binary sequence is passed through the formula:
[0105]
[0106] to obtain the finally encrypted image pixel I e (i, j), and the generated encrypted image is I e .
[0107] The specific method of step S5 is as follows:
[0108] S5-1. The LR of all blocks m needs to be embedded as part of the auxiliary information into the preliminary encrypted image I e . Since the value distribution of the block LR m is not uniform, Huffman coding {00, 01, 100, 101, 1100, 1101, 1110, 11110, 11111} is used to shorten the length of the auxiliary information, and shorter codes are used to represent the more frequently occurring LR m , and finally the LR represented by Huffman coding is obtained m set LR s ; In order to correctly extract each LR from LR s , the auxiliary information to be embedded should also include the Huffman coding rule LR m . r
[0109] S5-2. To facilitate the embedding of the secret message, LC(k) needs to be embedded as auxiliary information into the preliminary encrypted image first. Through LC(k), all embeddable regions in the image can be known.
[0110] S5-3. To be able to restore the original image, auxiliary information LR for image restoration also needs to be embedded. The content of LR includes the Huffman coding rule LR r , the Huffman-coded LR s , the LR of all blocks v , the LR of all blocks f , the sign marker L of the prediction error sign and the first pixel x(1, 1) of the original carrier image.
[0111] S5-4. To achieve sufficient security, the auxiliary information LR needs to be encrypted with the encryption key K e before embedding to form LRe , for the convenience of extracting LR e , the length l of LR e should also be added b (LR e ) is auxiliary information
[0112] S5-5. All the auxiliary information LA to be finally embedded includes LC, l b (LR e ) and LR e ; all the auxiliary information LA is embedded into the embeddable bit planes of the image from high to low in the order of block traversal according to the value of LC(k), forming the final encrypted image I with auxiliary information a .
[0113] The specific process of encrypting the secret information with the hidden key in step S6 is as follows
[0114] S6-1. First, LC(8) needs to be extracted from the encrypted image I a , and the remaining LC(k) is continuously extracted through the value of LC(8); if the value of LC(8) is 0, then LC(7) is continuously extracted until all LC(k) are completely extracted
[0115] S6-2. Continuing to traverse the embeddable part of the image through the value of LC(k), when all the auxiliary information LA is traversed, the remaining space is used to embed the secret data; before embedding, to ensure security, the secret data should also be encrypted with the hidden key K d .
[0116] The specific method of step S7 is as follows
[0117] S7-1. First, LC(8) needs to be extracted from the image I a , and the remaining LC(k) is continuously extracted through the value of LC(8); if the value of LC(8) is 0, then LC(7) is continuously extracted until all LC(k) are completely extracted
[0118] S7-2. Continuing to extract l b (LR e ) through the value of LC(k), and extracting the encrypted LR b (LR e ) according to the length l e , and then extracting all the data in the remaining embeddable space, which is the encrypted secret data
[0119] S7-3. If the receiver only has the hidden key K d but does not have the encryption key K e , then the encrypted data can be decrypted through K dDecrypted into the original secret information.
[0120] S7-4. If the recipient only has the encryption key K e but does not have the hiding key K d , then through K e , the original carrier image can be restored losslessly.
[0121] S7-5. If the recipient has both the hiding key K d and the encryption key K e , then not only can the embedded data be correctly extracted, but also the original carrier image can be restored losslessly.
[0122] The specific process of restoring the original carrier image in step S7-4 is as follows:
[0123] S7-4-1. Decrypt the encrypted image I a and the extracted auxiliary information LR e using the encryption key K e into I' and LR respectively. The first 32 bits of LR are the Huffman coding rule LR r . Then, with the help of the coding rule LR r , continue to traverse the remaining part of LR. When traversing to groups of codes, all blocks of LR can be obtained m .
[0124] S7-4-2. Through LR m , the length l v of LR T (LR v ) is determined by the formula:
[0125]
[0126] . Where LR v (a, b) represents the LR value of the block located in the a-th row and b-th column in the predicted error image of the block; through the length l v (LR T ), LR v can be extracted from LR. v
[0127] S7-4-3. The total number N v of the remaining bit planes except the high-order all-0 bit plane in all blocks of the original predicted error image can be obtained by the formula:
[0128] [[ID=7l]]
[0129] . Where l T (LR v (a, b) = 1) represents LRv The number of 1s in (a, b), continue to traverse LR and accumulate each LR f Indicates the number of bit planes, until the accumulated value is equal to N v , then the LR of each block f Can be completely determined
[0130] S7-4-4, Symbol information L sign And the distribution of the first pixel x(1, 1) of the original carrier image I are determined by their lengths respectively
[0131] S7-4-5, In order to restore the image before rearrangement, the LR' of each block in the predicted error image m Can be obtained through LR m And LR v Get, through the obtained LR' m , restore each block in the image I' to the original order; then the bit planes of each block can be obtained through LR m , LR v And LR f Restore to the original value, through the above operations, finally obtain the original predicted error image, and then through L sign And x(1, 1), the original image I is losslessly restored
[0132] Such as Figure 2 Shown, taking the most commonly used Lena image in the field of image processing as an example Figure 2 From left to right, it represents the original carrier image I, the encrypted image I e , the encrypted image I after embedding auxiliary information a , the encrypted image I after embedding secret information m And the finally restored image
[0133] To verify the performance of the present invention, different experiments are carried out, and the specific results are shown as follows
[0134] Security analysis
[0135] Prove the security of the present invention through some security parameters and different attack methods. The main security parameters to be counted are the correlation coefficient (horizontal and vertical), Shannon entropy, mean absolute error (MAE), chi-square test (χ 2 test), number of pixel change rate (NPCR) and normalized average change intensity (UACI)
[0136] Taking Lena and Baboon as examples, Table 1 shows the statistical results of the security parameters of the original image I, the encrypted image I a And the encrypted image I with secret information m . It can be seen from Table 1 that the encrypted images I generated by the two test imagesa and the correlation coefficients with the encrypted image I m both approach 0, the Shannon entropy approaches 8, the NPCR approaches 100%, the MAE and UACI are both large enough, and the chi-square test is also small enough compared to the original image I, indicating that the encrypted image I a or the encrypted image I m has a large enough difference from the original image I, which further verifies that the present invention has very high security.
[0137] Table 1 shows the statistical results of the security parameters of different images
[0138]
[0139] As Figure 3 shown, taking the Lena image as an example, a brute-force attack is performed on the image. Figure 3 From left to right, the original Lena image, the encrypted image I after encryption with the encryption key K e , the encrypted image I' after encryption with the encryption key K' a , and the difference between I e and I' a are respectively shown. Among them, K a and K' a differ by only one bit, but the finally generated encrypted images are completely different, indicating that it is very difficult for an attacker to obtain the content of the original image by analyzing the encryption key. Therefore, the present invention can resist brute-force attacks. e and e K'
[0140] As Figure 4 shown, taking the Tiffany image as an example, a cropping attack is performed on the image. The figure shows the original Tiffany image, the encrypted image I a , the encrypted image after 60×60 cropping, and the image recovered from the cropped image from left to right. It can be seen from the figure that when the encrypted image is subjected to such an attack, most of the information on the original image can be recovered.
[0141] Embedding capacity comparison:
[0142] To evaluate the embedding capacity of this method, the average net embedding capacity of this method and other related methods [1-6] was compared on five typical grayscale images and the images provided by two image databases. From Figure 5 it can be seen that the method proposed by the present invention is all superior to other methods. In addition, as Figure 6 shown, the present invention also performs best on the databases BOSSbase and BOWS-2, and can achieve embedding capacities of 3.753 bpp and 3.705 bpp respectively.
[0143] For the specific implementation of the above comparison method, please refer to the following reference pixels:
[0144] [1] Chen, Kaimeng, and Chin-Chen Chang. "High-capacity reversible data hiding in encrypted images based on extended run-length coding and block-based MSB plane rearrangement." Journal of Visual Communication and Image Representation 58 (2019): 334-344.
[0145] [2] Wu, Youqing, et al. "An improved reversible data hiding in encrypted images using parametric binary tree labeling." IEEE Transactions on Multimedia 22.8 (2020): 1929-1938.
[0146] [3] Yin, Zhaoxia, Youzhi Xiang, and Xinpeng Zhang. "Reversible data hiding in encrypted images based on multi-MSB prediction and Huffman coding." IEEE Transactions on Multimedia 22.4 (2020): 874-884.
[0147] [4] Yin, Zhaoxia, Yinyin Peng, and Youzhi Xiang. "Reversible data hiding in encrypted images based on pixel prediction and bit-plane compression." IEEE Transactions on Dependable and Secure Computing 19.2 (2020): 992-1002.
[0148] [5]Gao, Guangyong, et al. "High-performance reversible data hiding in encrypted images with adaptive Huffman code." Digital Signal Processing 133 (2023): 103870.
[0149] [6]Yu, Chunqiang, et al. "Reversible data hiding with adaptive difference recovery for encrypted images." Information Sciences 584 (2022): 89 - 110.
[0150] The present invention proposes a new bit-plane compression method. Based on the characteristics between prediction error values, the prediction error image is divided into blocks, and the high-order all-zero bit-planes and the remaining embeddable data bit-planes of each block are fully compressed. Then, Huffman coding is used to minimize the length of the auxiliary information as much as possible, so as to achieve a higher embedding capacity.
[0151] The present invention proposes a method of bit-plane swapping and block rearrangement. By merging the embedding space and dividing the auxiliary information into three parts, it is possible to perform data embedding and extraction with only a small part of the auxiliary information, while the vast majority of the auxiliary information is encrypted to enhance security.
[0152] In summary, while improving the embeddable data capacity, the present invention also has sufficient security to resist some existing attack methods, thus better meeting the actual needs and being more secure and efficient in practical applications.
[0153] The above-described embodiments are only a preferred solution of the present invention, but they are not intended to limit the present invention. Those of ordinary skill in the relevant technical fields can still make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all technical solutions obtained by means of equivalent replacement or equivalent transformation fall within the protection scope of the present invention.
Claims
1. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement, characterized in that, It includes the following steps: S1: The image owner applies a prediction algorithm to the original carrier image to be information - hidden to obtain the corresponding prediction error image; S2: The prediction error image is segmented, the high - order all - 0 bit - planes and the remaining low - order embeddable bit - planes of each segment are compressed, and then the characteristic data for restoring the carrier image is statistically analyzed; S3: According to the statistically analyzed characteristic data, the low - order bit - planes of each segment are swapped and the segments in the prediction error image are rearranged, and then the characteristic data of the rearranged segments is statistically analyzed again; S4: The rearranged prediction error image is encrypted with an encryption key to obtain a preliminary encrypted image; S5: Huffman coding is used to re - encode the number of high - order all - 0 bit - planes of the segments before rearrangement, and then the re - encoded data and the characteristic data before block rearrangement are encrypted together to form ciphertext information. The ciphertext information and the characteristic data after block rearrangement together form all the auxiliary information. Finally, the auxiliary information is embedded into the preliminary encrypted image to form the final encrypted image, which is sent to the information hider; The specific process of forming the final encrypted image is as follows: S5-1, LR of all blocks m is embedded into the preliminary encrypted image I as part of the auxiliary information e , and the Huffman coding is used to reduce the length of the auxiliary information, and finally the LR represented by the Huffman coding is obtained m set LR s ; the embedded auxiliary information also includes the Huffman coding rule LR r , and the symbol LR m records and represents that the first LR m -MSB bit planes of all elements in the block are 0, and the value of LR m has 9 cases, which are 0 to 8 respectively; S5 - 2: LC(k) is first embedded into the preliminary encrypted image as auxiliary information, and all embeddable regions in the image can be known through LC(k); S5-3. Embed the auxiliary information LR for image restoration, where the content of LR includes the Huffman coding rule LR r , the LR after Huffman coding s , the LR of all blocks v , the LR of all blocks f , the sign flag L of the prediction error sign and the first pixel x(1,1) of the original carrier image; Before embedding, S5-4 and LR are encrypted with the encryption key K e to form LR e , and the length of LR e is added b (LR e ) as auxiliary information; S5-5. All the auxiliary information LA finally embedded includes LC, l b (LR e ) and LR e ; all the auxiliary information LA is embedded into the embeddable bit planes of the image from the high bit to the low bit in the order of block traversal according to the value of LC(k), forming the final encrypted image I with auxiliary information a ; S6: The information hider first encrypts the secret information with a hiding key, and then embeds the encrypted secret information into the received encrypted image to form a secret - containing image, and sends it to the receiver; S7: The receiver performs image restoration and data extraction operations on the received secret - containing image according to the encryption key and the hiding key.
2. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 1, characterized in that, The specific process of step S1 is as follows: S1 - 1: Obtain the original carrier image. Assume the size of the image is m×n, and the pixel value of the image is x(i,j), where 1≤i≤m, 1≤j≤n; for the pixel in the first row and first column of the image, its predicted value p(1,1) is its own value; for the pixels in the first row or the first column of the image, its predicted values p(1,j) or p(i,1) are the pixel values of the same row in the previous column or the same column in the previous row respectively; for the remaining other pixels, its predicted value p(i,j) is predicted according to median edge detection; S1 - 2: Calculate the prediction error e(i,j) of each pixel through the following formula: e(i,j)=x(i,j)-p(i,j) Obtain a prediction error matrix of the same size as the image, and use L sign Record the sign of e(i,j), and take |e(i,j)| to construct a prediction error image.
3. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 2, characterized in that, The specific process of step S2 is as follows: S2 - 1: Convert the pixel of the prediction error image from decimal to an 8 - bit binary representation according to the following formula: where k represents the ordinal number of the binary sequence from the low bit to the high bit, represents rounding down; S2 - 2: Segment the prediction error image, where the size of each block is t×t; S2 - 3: For each block, first count all the bits of the current bit - plane starting from the highest - order bit - plane. If all the bits of the current bit - plane are 0, continue to compare the next - layer bit - plane; if the bits of the current layer are not all 0, stop comparing; S2-4. After obtaining the LR of each block m continue to traverse the remaining (8 - LR m ) bit planes of each block; if the number of bit values 0 or 1 in the current bit plane is less than the number of bit 1 or 0, record the information of the small number of bits in the current bit plane as LR f to free up extra embedding space; at the same time, use LR v to indicate which of the remaining bit planes of the current block are used to embed data. If data is embedded in the current bit plane, the corresponding value in LR v is 1, otherwise it is 0. The length of the LR v value of each block should be (8 - LR m ) bits.
4. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 3, characterized in that, The information LR described in S2-4 f includes the values of a small number of bits in this bit plane, the number of these small bits, and the positions of these small bits in the current bit plane.
5. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 4, characterized in that, The specific process of step S3 is as follows: S3-1. Swap the corresponding bit planes according to the LR v value of each block, so that in the remaining (8 - LR m ) bit planes, the bit planes for embedding data are located at higher significant bits, while the bit planes that cannot be embedded are at lower significant bits. After the above operations, according to the formula: LR′ m = LR m + l T (LR v = 1) The front LR' of the block m - All the MSB bit planes are embedded with data, l T (LR v = 1) indicates the number of 1s in LR v ; the number of 1s in S3-2. Perform bit-plane swapping on each block to obtain LR'. m After that, all the blocks in the image are rearranged in the image according to their obtained LR' m values in descending order, so that when traversing the image from left to right and top to bottom, the block with the largest LR' m value will be traversed first, while the block with the smallest LR' m value will be at the end of the image; after the rearrangement operation of the blocks in the image, a newly rearranged image I r is obtained. Use LC(k) to record the number of blocks with LR' m = d, where the value of d is from 0 to 8.
6. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 5, characterized in that, The specific process of step S4 is as follows: S4-1. Use the encryption key K e Generate a random matrix R of size m×n, where the values R(i,j) in the matrix R ∈ [0, 255]; S4-2. Convert the pixel value I r in the image I r (i,j) and the value R(i,j) in the matrix R into 8-bit binary sequences and R k (i,j); S4 - 3: Encrypt according to the following formula: Among them represents an exclusive OR operation to obtain the encrypted binary sequence Then, through the formula: Obtain the finally encrypted image pixel I e (i, j), and the initially generated encrypted image is I e .
7. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 6, characterized in that, The specific process of encrypting the secret information with the hiding key described in step S6 is as follows: S6-1. Extract LC(8) from the encrypted image I a and continuously extract the remaining LC(k) based on the value of LC(8); if the value of LC(8) is 0, then continue to extract LC(7) until all LC(k) are completely extracted; S6-2. Continue to traverse the embeddable parts in the image through the value of LC(k). After traversing all the auxiliary information LA, the remaining space is used to embed the secret data. Before embedding, the secret data is encrypted by the hiding key K d for encryption.
8. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 7, characterized in that, The specific process of step S7 is as follows: S7-1. Extract LC(8) from image I a and continuously extract the remaining LC(k) based on the value of LC(8); if the value of LC(8) is 0, then continue to extract LC(7) until all LC(k) are extracted; S7-2. Continue to extract l through the value of LC(k) b (LR e ), according to the length l b (LR e ) to extract the encrypted LR e , and then extract all the data in the remaining embeddable space, which is the encrypted secret data; S7-3. If the receiver only has the hidden key K d but does not have the encryption key K e , then the encrypted data is decrypted by K d into the original secret information; S7-4. If the recipient only has the encryption key K e but does not have the hiding key K d , then through K e , the original carrier image is restored losslessly; S7-5. If the receiver has both the hidden key K d and the encryption key K e , then it can not only correctly extract the embedded data, but also losslessly restore the original carrier image.
9. A reversible information hiding method for encrypted images with bit-plane compression and block rearrangement according to claim 8, characterized in that, The specific process of restoring the original carrier image described in step S7 - 4 is: S7-4-1. Decrypt the encrypted image I a and the extracted auxiliary information LR e using the encryption key K e into I' and LR respectively. The first 32 bits of LR are the Huffman coding rule LR r . Then, with the help of the coding rule LR r , continue to traverse the remaining part of LR. When traversing to groups of codes, obtain the LR of all blocks m ; S7-4-2, through LR m , LR v The length l T (LR v ) is determined by the following formula: LR v (a, b) represents the LR of the block located at the a-th row and b-th column in the block-based prediction error image v value; through the length l T (LR v ), LR v is extracted from LR; S7-4-3, the total number N of remaining bit planes of all blocks in the original prediction error image except for the high-order all-0 bit plane v Obtained by the following formula: where l T (LR v (a,b) = 1) represents LR v (a,b), continue to traverse LR and accumulate each LR f represents the number of bit planes, until the accumulated value is equal to N v , then the LR of each block f is completely determined; S7-4-4, Symbol Information L sign The distribution of the first pixel x(1,1) of the original carrier image I and the symbol information L is determined respectively by their lengths; S7-4-5. To restore the image before rearrangement, for each block in the prediction error image, LR′ m is obtained through LR m and LR v . By the obtained LR′ m , each block in the image I′ is restored to the original order; then the bit planes of each block are restored to the original values through LR m , LR v and LR f . Through the above operations, the original prediction error image is finally obtained, and then through L sign and x(1,1), the original carrier image I is losslessly restored.