A cipher domain reversible information hiding method of all 0 row and all 0 column coding

By using a method of encoding all rows and all columns of zeros, the difference image is compressed in blocks and Huffman encoded, which solves the problem of permanent distortion of the carrier image and realizes a reversible information hiding technology that embeds large-capacity secret information and restores it without loss.

CN116437019BActive Publication Date: 2026-07-21GUANGXI NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGXI NORMAL UNIV
Filing Date
2023-04-18
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing reversible information hiding technologies are prone to permanent distortion of the carrier image when embedding secret information, making it difficult to achieve lossless recovery while protecting both image security and secret information security.

Method used

The difference image is compressed in blocks by using a method of encoding with all rows and columns of zeros. The compression is carried out by using the characteristics of all rows and columns of zeros in the bit plane block through type encoding and position encoding. Combined with Huffman coding, reversible information hiding is achieved. After embedding secret information, the original image can be completely restored.

Benefits of technology

It achieves large-capacity embedding of secret information while ensuring lossless image restoration and high security, thus improving the efficiency and security of information hiding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116437019B_ABST
    Figure CN116437019B_ABST
Patent Text Reader

Abstract

The application discloses a ciphertext domain reversible information hiding method of all-0 row and all-0 column coding, and is characterized by comprising the following steps: 1) coding of all-0 row and all-0 column of a bit plane block; 2) compression space calculation of the all-0 row and all-0 column coded bit plane block; and 3) reversible information hiding of the all-0 row and all-0 column coded bit plane block. The method has the advantages of large embedding capacity and high security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to image processing and information security technologies, specifically a method for reversible information hiding in a ciphertext field encoded with all rows and columns of zeros. Background Technology

[0002] With the rapid development of information technology, data security issues have become increasingly prominent. The Internet of Things (IoT) connects every household, bringing convenience but also raising concerns about the leakage of personal information; the widespread adoption of mobile internet also exposes everyone to online fraud. With the promulgation of the Data Security Law and the Personal Information Protection Law, data security issues have received even greater attention.

[0003] Technologies for protecting data security include encryption and information hiding techniques. Information hiding refers to concealing critical information within other normal media (such as images, audio, video, or general documents), or distributing or transmitting it over a network. Information hiding techniques can be categorized as steganography, digital watermarking, reversible information hiding, and so on. In the early stages of information hiding technology research, the process of hiding secret information often caused permanent distortion of the media, which is unacceptable in fields such as medical image processing and copyright protection where the accuracy of the media content is paramount.

[0004] Reversible information hiding technology can extract secret information while restoring the original image without loss. Depending on the image used as the carrier, reversible information hiding technology is further divided into plaintext-domain reversible information hiding and ciphertext-domain reversible information hiding. Ciphertext-domain reversible information hiding technology effectively combines image encryption and reversible information hiding techniques. Encryption protects the security of the image itself, while reversible information hiding effectively protects the security of the embedded secret information, while simultaneously restoring the original image without loss. With the increasing demand for information security and privacy protection, ciphertext-domain reversible information hiding technology will be applied and promoted in more fields. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing a reversible information hiding method for ciphertext fields encoded with all rows and columns of zeros. This method has the advantages of large embedding capacity and high security.

[0006] The technical solution to achieve the objective of this invention is:

[0007] A method for reversible information hiding in a ciphertext field encoded with all rows and columns of zeros, wherein the method compresses the image space based on the encoding of all rows and columns of zeros and embeds secret information in the encrypted image, and can completely recover the original image after extracting the information, comprising the following steps:

[0008] 1) Encoding of all-zero rows and columns in a bit-plane block: The original image is predicted pixel-by-pixel using median edge detection to obtain a predicted image. The difference image is obtained by subtracting the original image from the predicted image. The difference image contains a large number of bit-plane blocks with all zeros or mostly zeros. Based on this characteristic, the difference image is divided into blocks. Let the block size be s×s, with each block having 8 bit-planes, and each bit-plane block also having a size of s×s. First, the type of the bit-plane block is determined based on the number of all-zero rows and columns, resulting in a type code. Then, the position code is determined based on the distribution of all-zero rows and columns. The encoding of all-zero rows and columns in a bit-plane block is as follows:

[0009] Bit-plane block type encoding [position encoding of all-zero rows and all-zero columns]

[0010] The parts enclosed in square brackets [] may be omitted. For example, a bit-plane block containing all zeros does not require position encoding. Specifically:

[0011] 1-1) Bit-plane block types and encoding: For a bit-plane block of size s×s, it is classified according to the number of rows and columns of all zeros in the block. There are a total of s×s+1 types. Let V be the set of all zero rows and columns of compressible blocks, and let the elements in V be (m,n), where m represents the number of all zero rows and n is the number of all zero columns. If (m,n)∈V, then all m rows and all n columns of all zeros are compressible. Obviously, all n rows and all m columns of all zeros are also compressible, thus having the following symmetric characteristics:

[0012] Feature 1: If (m,n)∈V, then (n,m)∈V. Let V be an empty set initially. When m = s, the block is a block of all zeros. Obviously, (s,s)∈V, therefore:

[0013] V = V∪{(s,s)}

[0014] In a planar block of size s×s, if there are m rows of all zeros and n columns of all zeros, the number of zeros in these rows and columns is m×s + n×sm×n. The m rows of all zeros are distributed across s rows. In this case, if fixed-length encoding is used, In this case, the encoding length needs to be [length]. n columns of all zeros need to Therefore, disregarding the bit-plane block type, let the compressed space of a bit-plane block with m rows of all zeros and n columns of all zeros be S(m,n), then we have:

[0015]

[0016] When n = 0, since the block size is s × s, for non-all-zero blocks, the maximum value of m is s - 1, and the minimum value is 0. Since m = 0, compression is not possible. Therefore, we only limit the case where the minimum value of m is 1. For the bit-plane block compression space S(m,0), we have:

[0017] Feature 2: If s ≥ 2, then S(m+1,0) > S(m,0).

[0018] prove:

[0019]

[0020]

[0021] Since s≥2, we have: S(m+1,0)-S(m,0)>0. Clearly, a bit-plane block of type (m+1,0) must be a bit-plane block of type (m,0), but the converse is not true. According to feature 2, S(m+1,0)>S(m,0). Therefore, (m+1,0) and (m,0) are two bit-plane blocks of different types. Hence:

[0022] V=V∪{(m,0)|m=1,2,3,...,s-1},

[0023] Let n2 > n1 ≥ 0. Clearly, a bitplane block of type (m, n2) must belong to (m, n1). If the space obtained by compressing type (m, n2) is less than or equal to the space obtained by compressing type (m, n1), then type (m, n2) is merged into (m, n1). This reduces the number of types and improves compression efficiency, thus:

[0024] Feature 3: Let n2>n1≥0, (m,n1)∈V. If S(m,n2)>S(m,n1), then:

[0025] V = V∪{(m,n2)}, otherwise

[0026] Starting from (m,0), based on feature 3, we obtain all types of m rows of all zeros. For a bit-plane block of size s×s, it is clear that the all-zero block is compressed, therefore (s,s)∈V. Then, based on features 1, 2, and 3, we construct set V as follows:

[0027] 1-1-1): V = {(s,s)};

[0028] 1-1-2): According to characteristic 2, we have V=V∪{(m,0)|m=1,2,3,...,s-1};

[0029] 1-1-3): m = s-1, k = 0;

[0030] 1-1-4): n = 1;

[0031] 1-1-5): If S(m,n) > S(m,k), according to Feature 3, then V = V ∪ {(m,n)}, k = n;

[0032] 1-1-6): If n < m, then n = n + 1, go to step 1-1-5);

[0033] 1-1-7): If m > 1, then m = m - 1, k = 0, go to step 1-1-4);

[0034] [[ID=,9]]1-1-8): m = 0;

[0035] 1-1-9): n = m + 1;

[0036] 1-1-10): If (n,m) ∈ V, according to Feature 1, then V = V ∪ {(m,n)};

[0037] 1-1-11): If n < s - 1, then n = n + 1, go to step 1-1-10);

[0038] 1-1-12): If m < s - 1, then m = m + 1, go to step 1-1-9); if m = s - 1, then end the construction and obtain the set V of block types;

[0039] 1-2) Position encoding of all-zero rows and all-zero columns: If fixed-length encoding is adopted, the cases where m all-zero rows are distributed among s rows require an encoding length of n all-zero columns require To reduce the encoding length and further improve the compression efficiency, a complete binary tree with all node degrees of 0 or 2 is used to encode the row and column positions. For the cases where m all-zero rows are distributed, let the number of leaf nodes of the complete binary tree be Traverse the complete binary tree in breadth-first order from top to bottom and from left to right, and number the leaf nodes starting from 1 in the traversal order. The result is 1, 2, 3, …, The i-th leaf node corresponds to the i-th case where m all-zero rows are distributed among s rows. Let the encoding of the left subtree of the complete binary tree be 0 and the encoding of the right subtree be 1. Traverse the leaf nodes in depth-first order starting from the root node to obtain the leaf node encoding, that is, the encoding of m all-zero rows distributed among s rows. The total number is Similarly, obtain the encoding of n all-zero columns distributed among s rows. The total number is The height of the complete binary tree When , all leaf nodes are on the h-th layer of the binary tree, and the corresponding encoding lengths are all h - 1; when <, , there are The first leaf node is at level h-1, with a corresponding encoding length of h-2. The remaining leaf nodes are at level h, with an encoding length of h-1. Let m rows of all zeros be distributed in rows s. In this case, the encoding length is l m,i ,but:

[0040]

[0041] Similarly, the n columns of all zeros are distributed in column s. Encoding length l in this case n,j Thus, we obtain the position codes of m rows of all zeros and n columns of all zeros and their corresponding code lengths;

[0042] 2) Bit-plane block compression space calculation for all-zero rows and all-zero columns: To achieve bit-plane compression, the type of bit-plane must first be determined to maximize the compression capacity. Since the type in V is based on the compression capacity S(m v ,n v Sort from largest to smallest. Only the first type that satisfies the condition needs to be found sequentially. Count the number of rows m and columns n of all zeros in the bit-plane block. If type (m) exists in V... v ,n v )make The type of the bit plane is (m v ,n v ), where v takes the minimum value, if there is no v such that Then the bit plane block is incompressible, and the type of the bit plane (m) is obtained. v ,n v After encoding its type, based on the first m bits from top to bottom in the bit plane... v The position code of the all-zero rows is obtained by analyzing the distribution of the first n rows from left to right. v The distribution of all-zero columns is used to obtain the position code of the all-zero columns. The remaining rows and columns are treated as uncompressed portions and recorded according to the raster scan order. v n rows of all zeros v Let the length of the uncompressed portion excluding the columns of all zeros be L, and let the number of rows and columns of all zeros be m. v and n v ,when At that time, there is only one 1 in the block, and its position has been determined by the position encoding of the all-zero row and all-zero column. Therefore:

[0043]

[0044] Based on the data obtained in steps 1-1) and 1-2), the bit plane block is compressed. The compressed bit plane block data includes three parts:

[0045] (2-1) Bit-plane block type encoding, with a length of t(m)v ,n v );

[0046] (2-2)m v The positional encoding of the i-th case of all zero rows, with a length of . and n v The position code for the j-th case of a column of all zeros, with a length of .

[0047] (2-3) The uncompressed portion has a length of L. The compressed bit-plane block data length p is as follows:

[0048]

[0049] Size s×s (m v ,n v The space C(m) that can be compressed from a type bit-plane block v ,n v )as follows:

[0050] C(m v ,n v ) = s × sp,

[0051] If C(m) v ,n v If C(m) > 0, then the planar block can be compressed. v ,n v If )≤0, then the bit plane block is incompressible. If all blocks of a certain bit plane block type are incompressible, then the type is removed from V, thus completing the bit plane block compression based on all-zero rows and all-zero columns encoding.

[0052] 3) Reversible information hiding using all-zero row and all-zero column encoding: The highest bit plane of the difference image is used as the sign bit plane and is not compressed. The remaining 7 bit planes are compressed to achieve reversible information hiding. The specific steps are as follows:

[0053] 3-1) Divide the difference image into non-overlapping blocks of size s×s, and obtain the type set V based on features 1, features 2 and features 3 in step 1);

[0054] 3-2) For each difference image block, starting from the 7th bit plane B7, count the number of rows with all zeros m and the number of columns with all zeros n in the bit plane from high to low. Combined with the corresponding type determined in set V, if the bit plane does not belong to the type in V, then no compression is performed from the bit plane to the lowest bit plane B1.

[0055] 3-3) Count the frequency of all bit plane types and perform Huffman coding. Calculate the compression space C(m) of the bit plane based on the type. v ,n vIf all bit planes of a certain type cannot be compressed, then the type is removed from V, resulting in the final V and its corresponding type code table D1.

[0056] 3-4) Based on V and its corresponding type code table D1, starting from B7, calculate the number of continuously compressible bit planes h and the compression capacity of each difference image block, count the distribution of all blocks h, perform Huffman coding to obtain code table D2, record the encoding of all blocks h according to the raster scan order, and obtain seq;

[0057] 3-5) Compress the continuous compressible bit planes of each difference image block to obtain a compression space. These spaces can be used to embed secret information. Record the location of the compressed data and the compression space according to step 2).

[0058] 3-6) To encrypt the difference image, a pseudo-random image of the same size as the difference image is generated using the image encryption key. The difference image and the pseudo-random image are then XORed bitwise to complete the encryption.

[0059] 3-7) The sender and receiver agree on the values ​​of k1, k2, and k3 in advance, and record the lengths of D1, D2, and seq using binary sequences L1, L2, and L3 of length k1, k2, and k3 respectively. Starting from the upper left corner of the highest bit plane of the encrypted image, L1, L2, L3, D1, D2, and seq are replaced according to the raster scan order. The replaced sequence is recorded as aux, with a length of k1+k2+k3+L1+L2+L3.

[0060] 3-7) Embed the aux and the secret information to be embedded into the compressed space recorded in step 3-5) in sequence;

[0061] 3-8) The process of extracting secret information and restoring the image is as follows: At the top left corner of the highest bit plane of the image, read the sequence L1, L2, L3 of length k1, k2, k3 in raster scan order to obtain the lengths of D1, D2, and seq. Then, continue reading the sequence D1, D2 of length L1, L2 in raster scan order to obtain the code table of the type encoding and the code table of the compressible bit plane height h. Continue reading the sequence seq of length L3 to obtain the compressible bit plane height h of each block. After obtaining the above information, decrypt the image by bitwise XORing the pseudo-random image generated according to the image encryption key with the original image. For each block, starting from the top left corner of the 7th bit plane, first read the type encoding of the original 7th bit plane according to D1 to obtain its type (m... v ,n v Then, according to the pre-agreed code table, the position codes of the original 7th bit plane's all-zero row and all-zero column are read, thereby enabling the calculation of the length of the uncompressed portion of the original 7th bit plane, and then the calculation of the compressed space C(m). v ,n vIf the length of the end of the bit plane is C(m), then the length of the end of the bit plane is C(m). v ,n v ) is the embedded secret information. Similarly, after combining the h bit planes within the block, the embedded secret information of each block is obtained. The secret information extracted from all blocks is combined according to the raster scan order. The sequence with the length of the beginning part being k1+k2+k3+L1+L2+L3 is the original sequence aux of the highest bit plane that was replaced. It is restored to the highest bit plane. The remaining information is first decrypted with the image encryption key and then decrypted with the information hiding key to obtain the original secret information.

[0062] This method has the advantages of large embedding capacity and high security. Attached Figure Description

[0063] Figure 1 The image shows a bit plane block of type (4,4) in the embodiment and its compressed result.

[0064] Figure 2 The image shows a bit plane block of type (3,3) in the embodiment and its compressed result.

[0065] Figure 3 The image shows a bit plane block of type (3,0) in the embodiment and its compressed result.

[0066] Figure 4 The image shows a bit plane block of type (0,3) in the embodiment and its compressed result.

[0067] Figure 5 The image shows a bit plane block of type (2,2) in the embodiment and its compressed result.

[0068] Figure 6 The image shows a bit plane block of type (2,0) in the embodiment and its compressed result.

[0069] Figure 7 The image shows a bit plane block of type (0,2) in the embodiment and its compressed result. Detailed Implementation

[0070] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this is not intended to limit the scope of the invention.

[0071] Example:

[0072] A method for reversibly hiding ciphertext field encoded with all rows and all columns of zeros includes the following steps:

[0073] 1) Encoding of all-zero rows and columns in a bit-plane block: The original image is predicted pixel-by-pixel using median edge detection to obtain a predicted image. The difference image is obtained by subtracting the original image from the predicted image. The difference image contains a large number of bit-plane blocks with all zeros or mostly zeros. Based on this characteristic, the difference image is divided into blocks. Let the block size be s×s, with each block having 8 bit-planes, and each bit-plane block also having a size of s×s. First, the type of the bit-plane block is determined based on the number of all-zero rows and columns, resulting in a type code. Then, the position code is determined based on the distribution of all-zero rows and columns. The encoding of all-zero rows and columns in a bit-plane block is as follows:

[0074] Bit-plane block type encoding [position encoding of all-zero rows and all-zero columns]

[0075] The part in [] indicates that it may be omitted, specifically:

[0076] 1-1) Bit-plane block types and encoding: For a bit-plane block of size s×s, it is classified according to the number of rows and columns of all zeros in the block. There are a total of s×s+1 types. Let V be the set of all zero rows and columns of compressible blocks, and let the elements in V be (m,n), where m represents the number of all zero rows and n is the number of all zero columns. If (m,n)∈V, then all m rows and all n columns of all zeros are compressible. Obviously, all n rows and all m columns of all zeros are also compressible, thus having the following symmetric characteristics:

[0077] Feature 1: If (m,n)∈V, then (n,m)∈V. Let V be an empty set initially. When m = s, the block is a block of all zeros. Obviously, (s,s)∈V, therefore:

[0078] V = V∪{(s,s)}

[0079] In a planar block of size s×s, if there are m rows of all zeros and n columns of all zeros, the number of zeros in these rows and columns is m×s + n×sm×n. The m rows of all zeros are distributed across s rows. In this case, if fixed-length encoding is used, In this case, the encoding length needs to be [length]. n columns of all zeros need to Therefore, disregarding the bit-plane block type, let the compressed space of a bit-plane block with m rows of all zeros and n columns of all zeros be S(m,n), then we have:

[0080]

[0081] When n = 0, since the block size is s × s, for non-all-zero blocks, the maximum value of m is s - 1, and the minimum value is 0. Since m = 0, compression is not possible. Therefore, we only limit the case where the minimum value of m is 1. For the bit-plane block compression space S(m,0), we have:

[0082] Feature 2: If s ≥ 2, then S(m+1,0) > S(m,0).

[0083] prove:

[0084]

[0085] Since s≥2, we have: S(m+1,0)-S(m,0)>0. Clearly, a bit-plane block of type (m+1,0) must be a bit-plane block of type (m,0), but the converse is not true. According to feature 2, S(m+1,0)>S(m,0). Therefore, (m+1,0) and (m,0) are two bit-plane blocks of different types. Hence:

[0086] V=V∪{(m,0)|m=1,2,3,...,s-1},

[0087] Let n2 > n1 ≥ 0. Clearly, a bitplane block of type (m, n2) must belong to (m, n1). If the space obtained by compressing type (m, n2) is less than or equal to the space obtained by compressing type (m, n1), then type (m, n2) is merged into (m, n1). This reduces the number of types and improves compression efficiency, thus:

[0088] Feature 3: Let n2>n1≥0, (m,n1)∈V. If S(m,n2)>S(m,n1), then:

[0089] V = V∪{(m,n2)}, otherwise

[0090] Starting from (m,0), based on feature 3, we obtain all types of m rows of all zeros. For a bit-plane block of size s×s, it is clear that the all-zero block is compressed, therefore (s,s)∈V. Then, based on features 1, 2, and 3, we construct set V as follows:

[0091] 1-1-1): V = {(s,s)};

[0092] 1-1-2): According to characteristic 2, we have V=V∪{(m,0)|m=1,2,3,...,s-1};

[0093] 1-1-3): m = s-1, k = 0;

[0094] 1-1-4): n = 1;

[0095] 1-1-5): If S(m,n)>S(m,k), according to characteristic 3, then V=V∪{(m,n)},k=n;

[0096] 1-1-6): If n < m, then n = n + 1, and go to step 1-1-5);

[0097] 1-1-7): If m > 1, then m = m - 1, k = 0, and go to step 1-1-4);

[0098] 1-1-8): m = 0;

[0099] 1-1-9): n = m + 1;

[0100] 1-1-10): If (n, m) ∈ V, according to Feature 1, then V = V ∪ {(m, n)};

[0101] 1-1-11): If n < s - 1, then n = n + 1, and go to step 1-1-10);

[0102] 1-1-12): If m < s - 1, then m = m + 1, and go to step 1-1-9); if m = s - 1, then end the construction, and obtain the set V of block types;

[0103] 1-2) Position encoding of all-zero rows and all-zero columns: If fixed-length encoding is adopted, the cases where m all-zero rows are distributed in s rows require an encoding length of n all-zero columns require To reduce the encoding length and further improve the compression efficiency, a complete binary tree with all node degrees being 0 or 2 is used to encode the row and column positions. For the cases where m all-zero rows are distributed, let the number of leaf nodes of the complete binary tree be Traverse the complete binary tree in breadth-first order from top to bottom and from left to right, and number the leaf nodes starting from 1 in the traversal order. The result is 1, 2, 3, …, The i-th leaf node corresponds to the i-th case where m all-zero rows are distributed in s rows. Let the encoding of the left subtree of the complete binary tree be 0 and the encoding of the right subtree be 1. Traverse the leaf nodes in depth-first order starting from the root node to obtain the leaf node encoding, that is, the encoding of m all-zero rows distributed in s rows. The total number is Similarly, obtain the encoding of n all-zero columns distributed in s rows. The total number is Height of the complete binary tree When At this time, all leaf nodes are on the h-th layer of the binary tree, and the corresponding encoding lengths are all h - 1; when At this time, there are leaf nodes on the (h - 1)-th layer, the corresponding encoding length is h - 2, and the remaining leaf nodes are on the h-th layer, and the encoding length is h - 1. Let the encoding length of the th case where m all-zero rows are distributed in s rows be lm,i ,but:

[0104]

[0105] Similarly, the n columns of all zeros are distributed in column s. Encoding length l in this case n,j Thus, we obtain the position codes of m rows of all zeros and n columns of all zeros and their corresponding code lengths;

[0106] 2) Bit-plane block compression space calculation for all-zero rows and all-zero columns: To achieve bit-plane compression, the type of bit-plane must first be determined to maximize the compression capacity. Since the type in V is based on the compression capacity S(m v ,n v Sort from largest to smallest. Only the first type that satisfies the condition needs to be found sequentially. Count the number of rows m and columns n of all zeros in the bit-plane block. If type (m) exists in V... v ,n v )make The type of the bit plane is (m v ,n v ), where v takes the minimum value, if there is no v such that Then the bit plane block is incompressible, and the type of the bit plane (m) is obtained. v ,n v After encoding its type, based on the first m bits from top to bottom in the bit plane... v The position code of the all-zero rows is obtained by analyzing the distribution of the first n rows from left to right. v The distribution of all-zero columns is used to obtain the position code of the all-zero columns. The remaining rows and columns are treated as uncompressed portions and recorded according to the raster scan order. v n rows of all zeros v Let the length of the uncompressed portion excluding the columns of all zeros be L, and let the number of rows and columns of all zeros be m. v and n v ,when At that time, there is only one 1 in the block, and its position has been determined by the position encoding of the all-zero row and all-zero column. Therefore:

[0107]

[0108] Based on the data obtained in steps 1-1) and 1-2), the bit plane block is compressed. The compressed bit plane block data includes three parts:

[0109] (2-1) Bit-plane block type encoding, with a length of t(m) v ,n v );

[0110] (2-2)m vThe positional encoding of the i-th case of all zero rows, with a length of . and n v The position code for the j-th case of a column of all zeros, with a length of .

[0111] (2-3) The uncompressed portion has a length of L. The compressed bit-plane block data length p is as follows:

[0112]

[0113] Size s×s (m v ,n v The space C(m) that can be compressed from a type bit-plane block v ,n v )as follows:

[0114] C(m v ,n v ) = s × sp,

[0115] If C(m) v ,n v If C(m) > 0, then the planar block can be compressed. v ,n v If )≤0, then the bit plane block is incompressible. If all blocks of a certain bit plane block type are incompressible, then the type is removed from V, thus completing the bit plane block compression based on all-zero rows and all-zero columns encoding.

[0116] 3) Reversible information hiding using all-zero row and all-zero column encoding: The highest bit plane of the difference image is used as the sign bit plane and is not compressed. The remaining 7 bit planes are compressed to achieve reversible information hiding. The specific steps are as follows:

[0117] 3-1) Divide the difference image into non-overlapping blocks of size s×s, and obtain the type set V based on features 1, features 2 and features 3 in step 1);

[0118] 3-2) For each difference image block, starting from the 7th bit plane B7, count the number of rows with all zeros m and the number of columns with all zeros n in the bit plane from high to low. Combined with the corresponding type determined in set V, if the bit plane does not belong to the type in V, then no compression is performed from the bit plane to the lowest bit plane B1.

[0119] 3-3) Count the frequency of all bit plane types and perform Huffman coding. Calculate the compression space C(m) of the bit plane based on the type. v ,n v If all bit planes of a certain type cannot be compressed, then the type is removed from V, resulting in the final V and its corresponding type code table D1.

[0120] 3-4) Based on V and its corresponding type code table D1, starting from B7, calculate the number of continuously compressible bit planes h and the compression capacity of each difference image block, count the distribution of all blocks h, perform Huffman coding to obtain code table D2, record the encoding of all blocks h according to the raster scan order, and obtain seq;

[0121] 3-5) Compress the continuous compressible bit planes of each difference image block to obtain a compression space. These spaces can be used to embed secret information. Record the location of the compressed data and the compression space according to step 2).

[0122] 3-6) To encrypt the difference image, a pseudo-random image of the same size as the difference image is generated using the image encryption key. The difference image and the pseudo-random image are then XORed bitwise to complete the encryption.

[0123] 3-7) The sender and receiver agree on the values ​​of k1, k2, and k3 in advance, and record the lengths of D1, D2, and seq using binary sequences L1, L2, and L3 of length k1, k2, and k3 respectively. Starting from the upper left corner of the highest bit plane of the encrypted image, L1, L2, L3, D1, D2, and seq are replaced according to the raster scan order. The replaced sequence is recorded as aux, with a length of k1+k2+k3+L1+L2+L3.

[0124] 3-7) Embed the aux and the secret information to be embedded into the compressed space recorded in step 3-5) in sequence;

[0125] 3-8) The process of extracting secret information and restoring the image is as follows: At the top left corner of the highest bit plane of the image, read the sequence L1, L2, L3 of length k1, k2, k3 in raster scan order to obtain the lengths of D1, D2, and seq. Then, continue reading the sequence D1, D2 of length L1, L2 in raster scan order to obtain the code table of the type encoding and the code table of the compressible bit plane height h. Continue reading the sequence seq of length L3 to obtain the compressible bit plane height h of each block. After obtaining the above information, decrypt the image by bitwise XORing the pseudo-random image generated according to the image encryption key with the original image. For each block, starting from the top left corner of the 7th bit plane, first read the type encoding of the original 7th bit plane according to D1 to obtain its type (m... v ,n v Then, according to the pre-agreed code table, the position codes of the original 7th bit plane's all-zero row and all-zero column are read, thereby enabling the calculation of the length of the uncompressed portion of the original 7th bit plane, and then the calculation of the compressed space C(m). v ,n v If the length of the end of the bit plane is C(m), then the length of the end of the bit plane is C(m). v ,n v) is the embedded secret information. Similarly, after combining the h bit planes within the block, the embedded secret information of each block is obtained. The secret information extracted from all blocks is combined according to the raster scan order. The sequence with the length of the beginning part being k1+k2+k3+L1+L2+L3 is the original sequence aux of the highest bit plane that was replaced. It is restored to the highest bit plane. The remaining information is first decrypted with the image encryption key and then decrypted with the information hiding key to obtain the original secret information.

[0126] Experimental example:

[0127] This example uses a compressible bitplane block of size 4×4 in the Lena diagram:

[0128] Bit Plane Block Figure 1 The left image contains four rows and four columns of all zeros, with a bit-plane block type of (4,4). The corresponding Huffman code is

[00111] . The encoded and compressed result is as follows. Figure 1 As shown in the middle right figure, the 11 zeros other than the compressed data can be used to embed secret information;

[0129] Bit Plane Block Figure 2 The left image shows three rows and three columns of all zeros, with a bit-plane block type of (3,3) and a corresponding Huffman code of

[10] . The rows of all zeros are rows 1, 2, and 4, and the columns of all zeros are columns 1, 2, and 4, with corresponding position codes of

[10] and

[10] , respectively. The result after encoding and compression is as follows. Figure 2 As shown in the middle right figure, the 10 zeros outside of the compressed data can be used to embed secret information;

[0130] Bit Plane Block Figure 3 The left image contains three rows and one column of all zeros, with a bit-plane block type of (3,0) and a corresponding Huffman code of

[00110] . The rows of all zeros are rows 1, 3, and 4, with a corresponding positional code of

[01] . The parts outside the rows of all zeros maintain their original order. The result after encoding and compression is as follows. Figure 3 As shown in the middle right figure, the five zeros other than the compressed data can be used to embed secret information;

[0131] Bit Plane Block Figure 4 The left image contains two rows and three columns of all zeros, with a bit-plane block type of (0,3) and a corresponding Huffman code of

[0010] . The columns of all zeros are columns 1, 2, and 3, with a corresponding positional code of

[11] . The parts outside the columns of all zeros maintain their original order. The result after encoding and compression is as follows. Figure 4 As shown in the middle right figure, the six zeros other than the compressed data can be used to embed secret information;

[0132] Bit Plane Block Figure 5The left image contains two rows and two columns of all zeros, with a bit-plane block type of (2,2) and a corresponding type code of

[01] . The rows of all zeros are the 3rd and 4th rows, and the columns of all zeros are the 2nd and 3rd columns, with corresponding position codes of

[011] and

[001] , respectively. The parts outside the rows and columns of all zeros maintain their original order. The result after encoding compression is as follows. Figure 5 As shown in the middle right figure, the four zeros other than the compressed data can be used to embed secret information;

[0133] Bit Plane Block Figure 6 The left image shows two rows and one column of all zeros, with a bit-plane block type of (2,0) and a corresponding Huffman code of

[000] . The rows of all zeros are the 3rd and 4th rows, with a corresponding positional code of

[011] . The parts outside the rows of all zeros maintain their original order. The result after encoding and compression is as follows. Figure 6 As shown in the middle right figure, the two zeros outside of the compressed data can be used to embed secret information;

[0134] Bit Plane Block Figure 7 The left figure contains 0 rows of all zeros and 2 columns of all zeros, with a bit plane block type of (0,2) and a corresponding Huffman code of

[11] . The columns of all zeros are the 2nd and 3rd columns, with a corresponding position code of

[001] . The parts outside the columns of all zeros maintain their order. The result after encoding and compression is as follows. Figure 7 As shown in the middle right figure, the three zeros other than the compressed data can be used to embed secret information.

Claims

1. A method for reversibly hiding ciphertext field information using all-zero rows and all-zero columns encoding, characterized in that, Includes the following steps: 1) Encoding of all zero rows and columns in a bit-plane block: The original image is predicted pixel-by-pixel using median edge detection to obtain a predicted image. The original image and the predicted image are subtracted to obtain a difference image. The difference image is then divided into blocks, with each block having a size of s×s and 8 bit-planes. Each bit-plane block also has a size of s×s. First, the type of the bit-plane block is determined based on the number of all zero rows and columns, resulting in a type code. Then, the position code is determined based on the distribution of all zero rows and columns. The encoding of all zero rows and columns in a bit-plane block is as follows: Bit-plane block type encoding [position encoding of all-zero rows and all-zero columns] The part in [] indicates that it may be omitted, specifically: 1-1) Bit-plane block types and encoding: For a bit-plane block of size s×s, it is classified according to the number of rows and columns of all zeros in the block. There are a total of s×s+1 types. Let V be the set of all zero rows and columns of compressible blocks, and let the elements in V be (m,n), where m represents the number of all zero rows and n is the number of all zero columns. If (m,n)∈V, then all m rows and all n columns of all zeros are compressible. Obviously, all n rows and all m columns of all zeros are also compressible, thus having the following symmetric characteristics: Feature 1: If (m,n)∈V, then (n,m)∈V. Let V be an empty set initially. When m = s, the block is a block of all zeros, and (s,s)∈V. Therefore: V = V∪{(s,s)} In a planar block of size s×s, if there are m rows of all zeros and n columns of all zeros, the number of zeros in these rows and columns is m×s + n×sm×n. The m rows of all zeros distributed in s rows have a total of C. s m In this case, if fixed-length encoding is used, C s m In this case, the encoding length needs to be [length]. n columns of all zeros need to Let S(m,n) be the space to be compressed by a bit-plane block consisting of m rows of all zeros and n columns of all zeros. Then we have: When n = 0, since the block size is s × s, for non-all-zero blocks, the maximum value of m is s - 1, and the minimum value is 0. Since m = 0, compression is not possible. Therefore, we only limit the case where the minimum value of m is 1. For the bit-plane block compression space S(m,0), we have: Feature 2: If s ≥ 2, then S(m+1,0) > S(m,0). prove: Since s≥2, we have: S(m+1,0)-S(m,0)>0. Clearly, a bit-plane block of type (m+1,0) must be a bit-plane block of type (m,0), but the converse is not true. According to feature 2, S(m+1,0)>S(m,0). Therefore, (m+1,0) and (m,0) are two bit-plane blocks of different types. Hence: V=V∪{(m,0)|m=1,2,3,...,s-1}, Let n2 > n1 ≥ 0. Clearly, a bit-plane block of type (m, n2) must belong to (m, n1). If the space obtained by compressing type (m, n2) is less than or equal to the space obtained by compressing type (m, n1), then type (m, n2) is merged into (m, n1), thus: Feature 3: Let n2>n1≥0, (m,n1)∈V. If S(m,n2)>S(m,n1), then: V = V∪{(m,n2)}, otherwise Starting from (m,0), based on feature 3, we obtain all types of m rows of all zeros. For a bit-plane block of size s×s, the all-zero block is compressed, therefore (s,s)∈V. Then, based on features 1, 2, and 3, we construct set V as follows: 1-1-1): V = {(s,s)}; 1-1-2): According to Feature 2, we have \(V = V\cup\{(m, 0)|m = 1, 2, 3,\cdots, s - 1\}\); 1-1-3): \(m = s - 1\), \(k = 0\); 1-1-4):n=1; 1-1-5): If \(S(m,n)>S(m,k)\), according to Feature 3, then \(V = V\cup\{(m,n)\}\), \(k = n\); 1-1-6): If \(n < m\), then \(n=n + 1\), go to step 1-1-5); 1-1-7): If \(m>1\), then \(m = m - 1\), \(k = 0\), go to step 1-1-4); 1-1-8):m=0; 1-1-9): \(n = m + 1\); 1-1-10): If \((n,m)\in V\), according to Feature 1, then \(V = V\cup\{(m,n)\}\); 1-1-11): If \(n < s - 1\), then \(n=n + 1\), go to step 1-1-10); 1-1-12): If \(m < s - 1\), then \(m = m + 1\), go to step 1-1-9); If \(m = s - 1\), then end the construction and obtain the set \(V\) of block types; 1-2) Position encoding of rows and columns of all zeros: If fixed-length encoding is used, m rows of all zeros are distributed in s rows. In this case, the encoding length needs to be [length]. n columns of all zeros need to The row and column positions are encoded using a complete binary tree where all nodes have a degree of 0 or 2. This is applied to m rows of all zeros. In this case, let the number of leaf nodes in the complete binary tree be... Traverse the complete binary tree from top to bottom and left to right using breadth-first search. Number the leaf nodes starting from 1 according to the traversal order, resulting in 1, 2, 3, ... The i-th leaf node corresponds to the i-th case of m rows of all zeros distributed in rows s. Let the left subtree of the complete binary tree be encoded as 0 and the right subtree as 1. Starting from the root node, traverse the leaf nodes in a depth-first manner to obtain the leaf node codes, which are the codes for the m rows of all zeros distributed in rows s. The total number of codes is... Similarly, the total number of codes with n columns of all zeros distributed in s rows is . Height of a complete binary tree when hour, If all leaf nodes are at level h of the binary tree, then the corresponding encoding length is h-1; when Sometimes, The first leaf node is at level h-1, with a corresponding encoding length of h-2. The remaining leaf nodes are at level h, with an encoding length of h-1. Let m rows of all zeros be distributed in rows s. In this case, the encoding length is l m,i ,but: Similarly, we can obtain the n columns of all zeros distributed in column s. Encoding length l in this case n,j Thus, we obtain the position codes of m rows of all zeros and n columns of all zeros and their corresponding code lengths; 2) Bit-plane block compression space calculation for all-zero rows and all-zero columns: To achieve bit-plane compression, the type of bit-plane must first be determined. Since the type in V is based on the compression capacity S(m v ,n v Sort the data from largest to smallest, and find the first type that meets the conditions in order. Count the number of rows m and columns n of all zeros in the bit-plane block. If type (m) exists in V... v ,n v )make The type of the bit plane is (m v ,n v ), where v takes the minimum value, if there is no v such that Then the bit plane block is incompressible, and the type of the bit plane (m) is obtained. v ,n v After encoding its type, based on the first m bits from top to bottom in the bit plane... v The position code of the all-zero rows is obtained by analyzing the distribution of the first n rows from left to right. v The distribution of all-zero columns is used to obtain the position code of the all-zero columns. The remaining rows and columns are treated as uncompressed portions and recorded according to the raster scan order. v n rows of all zeros v Let the length of the uncompressed portion excluding the columns of all zeros be L, and let the number of rows and columns of all zeros be m. v and n v ,when At that time, there is only one 1 in the block, and its position has been determined by the position encoding of the all-zero row and all-zero column. Therefore: Compress the bit-plane block according to the data obtained in step 1-1) and step 1-2). The compressed bit-plane block data includes three parts: (2-1) Bit-plane block type encoding, with a length of t(m) v ,n v ); (2-2)m v The positional encoding of the i-th case of all zero rows, with a length of . and n v The position code for the j-th case of a column of all zeros, with a length of . (2-3) Uncompressed part, with length \(L\). The length \(p\) of the compressed bit-plane block data is as follows: Size s×s (m v ,n v The space C(m) that can be compressed from a type bit-plane block v ,n v )as follows: C(m v ,n v )=s×s-p, If C(m) v ,n v If C(m) > 0, then the planar block can be compressed. v ,n v If )≤0, then the bit plane block is incompressible. If all blocks of a certain bit plane block type are incompressible, then the type is removed from V, thus completing the bit plane block compression based on all-zero rows and all-zero columns encoding. 3) Reversible information hiding for encoding of all-zero rows and all-zero columns: The highest bit-plane of the difference image is used as the sign bit-plane and is not compressed. The remaining 7 bit-planes are compressed to achieve reversible information hiding. The specific steps are as follows: 3-1) Divide the difference image into non-overlapping blocks of size \(s\times s\), and obtain the set \(V\) of types according to Feature 1, Feature 2, and Feature 3 in step 1); 3-2) For each difference image block, starting from the 7th bit-plane \(B_7\), count the number \(m\) of all-zero rows and the number \(n\) of all-zero columns in the bit-plane from high to low. Combine the corresponding types determined in the set \(V\). If the bit-plane does not belong to the types in \(V\), then no compression is performed from this bit-plane to the lowest bit-plane \(B_1\); 3-3) Count the frequency of all bit plane types and perform Huffman coding. Calculate the compression space C(m) of the bit plane based on the type. v ,n v If all bit planes of a certain type cannot be compressed, then the type is removed from V, resulting in the final V and its corresponding type code table D1. 3-4) According to \(V\) and its corresponding type code table \(D_1\), calculate the number \(h\) of continuously compressible bit-planes and the compression capacity for each difference image block starting from \(B_7\). Statistically analyze the distribution of \(h\) for all blocks, perform Huffman coding to obtain the code table \(D_2\), and record the encoding of \(h\) for all blocks in raster scan order to obtain \(seq\); 3-5) Compress the continuously compressible bit-planes of each difference image block to obtain compression spaces, which are used to embed secret information. Record the positions of the compressed data and the compression spaces according to step 2); 3-6) Encrypt the difference image, that is, generate a pseudo-random image with the same size as the difference image using the image encryption key, and complete the encryption by performing bitwise XOR on the pixels corresponding to all positions of the difference image and the pseudo-random image; 3-7) The sender and the receiver pre-arrange the values of \(k_1\), \(k_2\), \(k_3\), that is, record the lengths of \(D_1\), \(D_2\), and \(seq\) using binary sequences \(L_1\), \(L_2\), \(L_3\) with lengths \(k_1\), \(k_2\), \(k_3\) respectively. Starting from the upper left corner of the highest bit-plane of the encrypted image, replace with \(L_1\), \(L_2\), \(L_3\), \(D_1\), \(D_2\), \(seq\) in raster scan order. The replaced sequence is recorded as \(aux\), with a length of \(k_1 + k_2 + k_3+L_1 + L_2 + L_3\); 3-7) Embed the aux and the secret information to be embedded into the compressed space recorded in step 3-5) in sequence; 3-8) The process of extracting secret information and restoring the image is as follows: At the top left corner of the highest bit plane of the image, read the sequence L1, L2, L3 of length k1, k2, k3 in raster scan order to obtain the lengths of D1, D2, and seq. Then, continue reading the sequence D1, D2 of length L1, L2 in raster scan order to obtain the code table of the type encoding and the code table of the compressible bit plane height h. Continue reading the sequence seq of length L3 to obtain the compressible bit plane height h of each block. After obtaining the above information, decrypt the image by bitwise XORing the pseudo-random image generated according to the image encryption key with the original image. For each block, starting from the top left corner of the 7th bit plane, first read the type encoding of the original 7th bit plane according to D1 to obtain its type (m... v ,n v Then, according to the pre-agreed code table, the position codes of the original 7th bit plane's all-zero row and all-zero column are read to calculate the length of the uncompressed portion of the original 7th bit plane, and then the compressed space C(m) is calculated. v ,n v If the length of the end of the bit plane is C(m), then the length of the end of the bit plane is C(m). v ,n v ) is the embedded secret information. Similarly, after combining the h bit planes within the block, the embedded secret information of each block is obtained. The secret information extracted from all blocks is combined according to the raster scan order. The sequence with the length of the beginning part being k1+k2+k3+L1+L2+L3 is the original sequence aux of the highest bit plane that was replaced. It is restored to the highest bit plane. The remaining information is first decrypted with the image encryption key and then decrypted with the information hiding key to obtain the original secret information.