Hidden information processing method, system and medium based on CFB document
By traversing the OLE attribute structure in the CFB document and encoding and embedding hidden information based on the attribute identifier, the problem of small amount of information embedding and complex extraction in the CFB document is solved, and efficient and accurate hidden information processing is achieved, suitable for common offices Document and keep the file format intact.
Patent Information
- Application Number
- CN202411171192.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The prior art has a small amount of hidden information embedded in CFB documents, which affects user editing, is easy to be detected and removed, and it is difficult to adapt after changing the file format, the extraction method is complex and the accuracy is poor, and the hidden content is easily destroyed.
By obtaining the directory structure of the CFB document, traversing the OLE attribute structure, determining the target attribute item based on the attribute identifier, encoding and embedding or extraction of hidden information, using preset prefixes and suffixes for encoding processing, embedding into the attribute value, ensuring information Does not affect the file body and format.
It realizes efficient embedding and extraction of hidden information in CFB documents, avoids user editing influence, keeps the file format complete, improves the amount of information embedding and extraction accuracy, and is suitable for common office documents to prevent hidden content from being corrupted.
Smart Images

Figure CN118690725B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of hidden information processing, and in particular to a hidden information processing method, system and medium based on CFB documents. Background Art
[0002] CFB document (Compound File Binary) is a file format used to organize and store complex data structures. CFB documents organize data into a series of storage blocks, which can contain various types of data, such as document content, objects, metadata, etc. CFB document format is commonly used in Microsoft Office and wps documents (such as .doc, .xls, .ppt, .wps, .et, .dsp, vsd, etc.).
[0003] There are four main ways to embed hidden information in documents: one is to embed unreadable information directly in the file content, such as QR code barcode, etc.; the second is to change the file format, add information to the header or footer, and use technical means to decode it when opening; the third is to embed information by modifying the font and adjusting the text; the fourth is to modify the encoding of homophones, synonyms, and punctuation marks in the document.
[0004] However, the above solutions all have the problem of too little information embedding. In addition, the first type has the problem of affecting user editing and being easily detected and removed by users who are looking for it; the second type requires changing the opening method of the application software after changing the file format, which is difficult to adapt; the third type has a more complicated extraction method and poor extraction accuracy; the third type is not suitable for more official files, and the hidden content is easy to be destroyed. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present application provides a hidden information processing method, system and medium based on CFB documents to solve the problems in the prior art, such as small amount of information embedded, embedded unreadable information affecting user editing, easy to be noticed and removed by users who are viewing, the need to change the opening method of the application software after changing the file format, greater difficulty in adaptation, more complicated extraction method, poor accuracy of extracted data corresponding to the solution for modifying the content, the solution for modifying the content is not applicable to more official files, and the hidden content is easily destroyed.
[0006] In a first aspect, the present application provides a hidden information processing method based on a CFB document, the method comprising: obtaining a CFB document and a hidden information processing instruction; parsing the CFB document to obtain a directory structure in the CFB document; traversing the directory structure to search for a target directory of an OLE attribute structure according to a name; when the hidden information processing instruction is an embedded hidden information instruction, traversing the attribute items of all attribute groups in the target directory, determining the target attribute item based on an attribute identifier in the attribute item, and ending the traversal; updating the content of the attribute value in the target attribute item to the hidden information corresponding to the embedded hidden information instruction; when the hidden information processing instruction is an extracted hidden information instruction, traversing the attribute items of all attribute groups in the target directory to obtain an attribute item containing hidden information; reading and returning the hidden information.
[0007] Further, the directory structure is traversed to search for the target directory of the OLE property structure according to the name, specifically including: traversing the directory structure to obtain the names of each directory under the directory structure; determining the directory with a preset name as the target directory; wherein the preset name includes at least: \005SummaryInformation and \005DocumentSummaryInformation.
[0008] Further, the attribute items of all attribute groups in the target directory are traversed, and the target attribute item is determined based on the attribute identifier in the attribute item, specifically including: traversing the attribute items of all attribute groups in the target directory, and when the attribute identifier in the current attribute item is a preset identifier, determining the current attribute item as the target attribute item; when the attribute identifier in the non-existent attribute item is the preset identifier, adding a new attribute item as the target attribute item, and the attribute identifier in the newly added attribute item is the preset identifier.
[0009] Furthermore, the preset identifiers are PIDSI_TITLE (0x00000002), PIDSI_KEYWORDS (0x00000005), and PIDSI_TEMPLATE (0x00000007).
[0010] Furthermore, before updating the content of the attribute value in the target attribute item to the hidden information corresponding to the embedded hidden information instruction, the method also includes: obtaining initial hidden information; after encoding the initial hidden information, adding a preset specific prefix and / or suffix to the hidden information after the encoding process to obtain the final hidden information.
[0011] Furthermore, the encoding process is BASE64 encoding process, HEX encoding process, SM4 encoding process or SM2 encoding process; the preset specific prefix and suffix are CFBLABEL or ZFLABEL.
[0012] Furthermore, the attribute items of all attribute groups in the target directory are traversed to obtain attribute items containing hidden information, specifically including: traversing the attribute items of all attribute groups in the target directory, obtaining attribute items whose attribute identifiers are preset identifiers, and reading embedded content from the attribute values of the attribute items according to preset specific prefixes and / or suffixes; when there is no embedded content in the attribute value, continuing to read the next attribute item; when there is embedded content in the attribute value, decoding the embedded content; when decoding fails, determining that the current embedded content is not hidden information, and continuing to read the next attribute item; when decoding succeeds, determining that the decoded current embedded content is hidden information, and ending the traversal.
[0013] In a second aspect, the present application provides a hidden information processing system based on a CFB document, the system comprising: a directory acquisition module, used to acquire a CFB document and a hidden information processing instruction; parse the CFB document to obtain a directory structure in the CFB document; traverse the directory structure to search for a target directory of an OLE attribute structure according to a name; an information embedding module, used to traverse the attribute items of all attribute groups in the target directory when the hidden information processing instruction is an embed hidden information instruction, determine the target attribute item based on an attribute identifier in the attribute item, and end the traversal; update the content of the attribute value in the target attribute item to the hidden information corresponding to the embed hidden information instruction; an information extraction module, used to traverse the attribute items of all attribute groups in the target directory when the hidden information processing instruction is an extract hidden information instruction, and obtain the attribute item containing the hidden information; read and return the hidden information.
[0014] Furthermore, the information embedding module includes a hidden information acquisition unit for acquiring initial hidden information; after encoding the initial hidden information, a preset specific prefix and / or suffix is added to the encoded hidden information to obtain the final hidden information.
[0015] In a third aspect, the present application provides a non-volatile computer storage medium on which computer instructions are stored. When the computer instructions are executed, they implement a hidden information processing method based on a CFB document as described above.
[0016] Those skilled in the art can understand that the present application has at least the following beneficial effects:
[0017] The present application proposes a hidden information processing method, system and medium based on CFB documents. The present application can embed coded hidden information in common CFB documents (such as documents with extensions such as wps, et, dsp, doc, xls, and ppt), and the embedded hidden information is embedded in the target directory of the OLE attribute structure, that is, embedded in the binary attribute stream, and the main text will not be modified. When the user modifies the main text, the hidden information will not be modified. In addition, the present application determines the target attribute item based on the attribute identifier in the attribute item. Since there are a series of target attribute items (for example, PIDSI_KEYWORDS (0x00000005), etc.), the target attribute item remains unchanged after the file format is changed, which solves the problem that the existing solution needs to change the opening method of the application software after the file format is changed, and the adaptation is difficult. In addition, the present application uses the OLE attribute structure that can be parsed (such as the directory named \005SummaryInformation and \005DocumentSummaryInformation) carried by common office documents in the CFB document to encode the hidden information and insert it into the attribute value in the OLE attribute structure. This will not destroy the format of the CFB document. The office editing software will parse and read the embedded information as an attribute string, and write it synchronously when saving or editing. The office editing software will not display the attribute to the user who views it (after embedding hidden information, ordinary users cannot view it through ordinary office editing software). This solves the problems of complex extraction methods, poor extraction accuracy, unsuitability for more official files, and easy destruction of hidden content. In addition, hidden information of more than 2000 bytes can be embedded by embedding attribute values, which solves the problem of small amount of information embedded in existing solutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Some embodiments of the present disclosure are described below with reference to the accompanying drawings, in which:
[0019] Figure 1 It is a schematic diagram of the structure of a CFB file provided in an embodiment of the present application;
[0020] Figure 2 It is a flow chart of a hidden information processing method based on CFB documents provided in an embodiment of the present application;
[0021] Figure 3 It is a schematic diagram of the internal structure of a hidden information processing system based on CFB documents provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] It should be understood by those skilled in the art that the embodiments described below are only preferred embodiments of the present disclosure, and do not mean that the present disclosure can only be implemented through the preferred embodiments. The preferred embodiments are only used to explain the technical principles of the present disclosure, and are not used to limit the protection scope of the present disclosure. Based on the preferred embodiments provided by the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work should still fall within the protection scope of the present disclosure.
[0023] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0024] CFB document, full name "Compound File Binary", is a file format used to organize and store complex data structures. CFB files organize data into a series of storage blocks, which can contain various types of data, such as document content, objects, metadata, etc. CFB document format is commonly used in Microsoft Office and wps documents (such as .doc, .xls, .ppt, .wps, .et, .dsp, vsd, etc.).
[0025] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0026] The present application embodiment provides a hidden information processing method based on CFB documents, such as Figure 1 and Figure 2 As shown, the method provided in the embodiment of the present application mainly includes the following steps:
[0027] Step 110, obtaining the CFB document and the hidden information processing instruction; parsing the CFB document to obtain the directory structure in the CFB document; traversing the directory structure to search for the target directory of the OLE attribute structure according to the name.
[0028] It should be noted that if Figure 1As shown in the figure, the structure of CFB document contains many directories, some of which are OLE property structures. The directories of OLE property structure contain many property groups. Each property group contains several property items. Each property item contains property identifier and property value. Some property identifiers are defined for office documents and can also be customized. Encoded hidden information can be placed in the property value.
[0029] In the step, the directory structure is traversed to find the target directory of the OLE attribute structure according to the name, which can be specifically:
[0030] Traverse the directory structure and obtain the names of the directories under the directory structure; determine that the directory with the preset name is the target directory.
[0031] It should be noted that the preset name is the name of the OLE attribute structure. For example, the preset name includes but is not limited to: \005SummaryInformation and \005DocumentSummaryInformation. In addition, those skilled in the art can add preset names according to the name of the actual OLE attribute structure.
[0032] Step 120, when the hidden information processing instruction is an embedded hidden information instruction, traverse the attribute items of all attribute groups in the target directory, determine the target attribute item based on the attribute identifier in the attribute item, and end the traversal; update the content of the attribute value in the target attribute item to the hidden information corresponding to the embedded hidden information instruction.
[0033] In the step, the attribute items of all attribute groups in the target directory are traversed, and the target attribute item is determined based on the attribute identifier in the attribute item, which specifically includes:
[0034] Traverse the attribute items of all attribute groups in the target directory, and when the attribute identifier in the current attribute item is a preset identifier, determine that the current attribute item is the target attribute item; when the attribute identifier in the non-existent attribute item is the preset identifier, add a new attribute item as the target attribute item, and the attribute identifier in the newly added attribute item is the preset identifier.
[0035] It should be noted that the preset identifiers may be PIDSI_TITLE (0x00000002), PIDSI_KEYWORDS (0x00000005), and PIDSI_TEMPLATE (0x00000007). In addition, those skilled in the art may determine the specific content of the preset identifiers according to actual needs. In addition, when the attribute identifier in the existing attribute item is the preset identifier, the hidden information is updated; when a new attribute item is added as the target attribute item, the empty content of the attribute value of the target attribute item is updated as the hidden information in an added manner.
[0036] In addition, the present application can encode the hidden information and mark the prefix and suffix to facilitate locating the specific location of the hidden information. The specific process can be:
[0037] Before updating the content of the attribute value in the target attribute item to the hidden information corresponding to the embedded hidden information instruction, the initial hidden information is obtained; after encoding the initial hidden information, a preset specific prefix and / or suffix is added to the encoded hidden information to obtain the final hidden information.
[0038] It should be noted that the encoding process can be BASE64 (Base64 Encoding Base64 encoding) encoding process, HEX (Hexadecimal hexadecimal) encoding process, SM4 (Symmetric Key Block Cipher4 Commercial Cryptographic Algorithm 4) encoding process or SM2 (Symmetric Key Block Cipher2 Commercial Cryptographic Algorithm 2) encoding process, or any other feasible processing means. The preset specific prefix and suffix can be CFBLABEL or ZFLABEL, or any other feasible identification symbol. When there is only a prefix, the hidden information is all the information after the prefix, and when there is only a suffix, the hidden information is all the information before the suffix. Those skilled in the art can configure the extraction rules of the prefix and suffix in advance according to actual needs, and use them automatically when triggering information extraction or embedding.
[0039] Step 130: When the hidden information processing instruction is an instruction for extracting hidden information, traverse the attribute items of all attribute groups in the target directory to obtain the attribute items containing hidden information; read and return the hidden information.
[0040] In the step, the attribute items of all attribute groups in the target directory are traversed to obtain the attribute items containing hidden information, which can be specifically:
[0041] Traverse the attribute items of all attribute groups in the target directory, obtain the attribute item whose attribute identifier is the preset identifier, and read the embedded content from the attribute value of the attribute item according to the preset specific prefix and / or suffix (if embedded, only the prefix is identified, here the embedded content is read from the attribute value of the attribute item according to the preset specific prefix; if embedded, only the suffix is identified, here the embedded content is read from the attribute value of the attribute item according to the preset specific suffix; if embedded, the preset specific prefix and suffix are identified, here the embedded content is read from the attribute value of the attribute item according to the preset specific prefix and suffix).
[0042] When there is no embedded content in the attribute value, continue to read the next attribute item; when there is embedded content in the attribute value, decode the embedded content; when decoding fails, determine that the current embedded content is not hidden information, and continue to read the next attribute item; when decoding succeeds, determine that the decoded current embedded content is hidden information, and end the traversal.
[0043] It should be noted that the decoding method here is consistent with the encryption method for embedding hidden information.
[0044] besides, Figure 3 A hidden information processing system based on CFB documents is provided in the embodiment of the present application. Figure 3 As shown, the system provided in the embodiment of the present application mainly includes:
[0045] The directory acquisition module 210 is used to acquire the CFB document and the hidden information processing instruction; parse the CFB document to obtain the directory structure in the CFB document; traverse the directory structure and search for the target directory of the OLE attribute structure according to the name.
[0046] It should be noted that the directory acquisition module 210 is a device or apparatus capable of acquiring documents and instructions, and capable of searching for a target directory of an OLE property structure from a CFB document.
[0047] The information embedding module 220 is used to traverse the attribute items of all attribute groups in the target directory when the hidden information processing instruction is an embed hidden information instruction, determine the target attribute item based on the attribute identifier in the attribute item, and end the traversal; update the content of the attribute value in the target attribute item to the hidden information corresponding to the embed hidden information instruction.
[0048] It should be noted that the information embedding module 220 is a device or apparatus capable of updating the content of the attribute value in the target attribute item to the hidden information corresponding to the embedded hidden information instruction.
[0049] In addition, the present application can encode the hidden information and mark the prefix and suffix to facilitate locating the specific location of the hidden information. The specific process can be:
[0050] The initial hidden information is obtained by the hidden information obtaining unit in the information embedding module 220; after the initial hidden information is encoded, a preset specific prefix and / or suffix is added to the encoded hidden information to obtain the final hidden information.
[0051] The information extraction module 230 is used to traverse the attribute items of all attribute groups in the target directory to obtain the attribute items containing the hidden information when the hidden information processing instruction is an instruction to extract the hidden information; and read and return the hidden information.
[0052] It should be noted that the information extraction module 230 is a device or apparatus capable of obtaining attribute items containing hidden information, and reading and returning the hidden information.
[0053] In addition, an embodiment of the present application further provides a non-volatile computer storage medium on which executable instructions are stored. When the executable instructions are executed, a hidden information processing method based on a CFB document as described above is implemented.
[0054] So far, the technical solutions of the present disclosure have been described in combination with the above multiple embodiments, but it is easy for those skilled in the art to understand that the protection scope of the present disclosure is not limited to these specific embodiments. Without departing from the technical principles of the present disclosure, those skilled in the art can split and combine the technical solutions in the above-mentioned various embodiments, and can also make equivalent changes or replacements to the relevant technical features. Any changes, equivalent replacements, improvements, etc. made within the technical concept and / or technical principle of the present disclosure will fall within the protection scope of the present disclosure.
Claims
1. A hidden information processing method based on CFB document, characterized in that: The method comprises: Get CFB documents and hidden information processing instructions; Parse the CFB document and obtain the directory structure in the CFB document; Traverse the directory structure and find the target directory of the OLE attribute structure according to the name; When the hidden information processing instruction is an embedded hidden information instruction, traverse the attribute items of all attribute groups in the target directory, determine the target attribute item based on the attribute identifier in the attribute item, and end the traversal; update the content of the attribute value in the target attribute item to the hidden information corresponding to the embedded hidden information instruction; When the hidden information processing instruction is an instruction for extracting hidden information, the attribute items of all attribute groups in the target directory are traversed to obtain the attribute items containing hidden information; the hidden information is read and returned.
2. The hidden information processing method based on CFB document according to claim 1 is characterized in that: Traverse the directory structure and find the target directory of the OLE property structure by name, including: Traverse the directory structure and obtain the names of each directory under the directory structure; Determine that the directory with the preset name is the target directory; The preset names include at least: \005SummaryInformation and \005DocumentSummaryInformation.
3. The hidden information processing method based on CFB document according to claim 1 is characterized in that: Traverse the attribute items of all attribute groups in the target directory and determine the target attribute item based on the attribute identifier in the attribute item, including: Traversing the attribute items of all attribute groups in the target directory, and when the attribute identifier in the current attribute item is a preset identifier, determining the current attribute item as the target attribute item; When the attribute identifier in the non-existent attribute item is the preset identifier, a new attribute item is added as the target attribute item, and the attribute identifier in the newly added attribute item is the preset identifier.
4. The method for processing hidden information based on CFB documents according to claim 3, characterized in that: The preset identifiers are PIDSI_TITLE (0x00000002), PIDSI_KEYWORDS (0x00000005), and PIDSI_TEMPLATE (0x00000007).
5. The method for processing hidden information based on CFB documents according to claim 1, characterized in that: Before updating the content of the attribute value in the target attribute item to the hidden information corresponding to the embedding hidden information instruction, the method further includes: Get initial hidden information; After the initial hidden information is encoded, a preset specific prefix and / or suffix is added to the encoded hidden information to obtain the final hidden information.
6. The method for processing hidden information based on CFB documents according to claim 5, characterized in that: The encoding process is BASE64 encoding process, HEX encoding process, SM4 encoding process or SM2 encoding process; The default specific prefix and suffix are CFBLABEL or ZFLABEL.
7. The method for processing hidden information based on CFB documents according to claim 5, characterized in that: Traverse the attribute items of all attribute groups in the target directory to obtain the attribute items containing hidden information, including: Traversing the attribute items of all attribute groups in the target directory, obtaining the attribute item whose attribute identifier is the preset identifier, and reading the embedded content from the attribute value of the attribute item according to the preset specific prefix and / or suffix; When there is no embedded content in the attribute value, continue reading the next attribute item; When there is embedded content in the attribute value, the embedded content is decoded; When decoding fails, it is determined that the current embedded content is not hidden information, and the next attribute item is read; When the decoding is successful, the decoded current embedded content is determined to be hidden information, and the traversal ends.
8. A hidden information processing system based on CFB documents, characterized in that: The system comprises: The acquisition module is used to obtain CFB documents and hidden information processing instructions; Get module, used to parse CFB document and get the directory structure in CFB document; The search module is used to traverse the directory structure and find the target directory of the OLE attribute structure according to the name; The embedding module is used for traversing the attribute items of all attribute groups in the target directory when the hidden information processing instruction is an embed hidden information instruction, determining the target attribute item based on the attribute identifier in the attribute item, and ending the traversal; updating the content of the attribute value in the target attribute item to the hidden information corresponding to the embed hidden information instruction; The extraction module is used for traversing the attribute items of all attribute groups in the target directory to obtain the attribute items containing the hidden information when the hidden information processing instruction is an instruction to extract the hidden information; and reading and returning the hidden information.
9. The hidden information processing system based on CFB documents according to claim 8, characterized in that: The embedding module includes a hidden information acquisition unit, Used to obtain initial hidden information; after encoding the initial hidden information, a preset specific prefix and / or suffix is added to the encoded hidden information to obtain the final hidden information.
10. A non-volatile computer storage medium, characterized in that: Computer instructions are stored thereon, and when the computer instructions are executed, the method for processing hidden information based on a CFB document as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
File encryption method
CN101819618A
File hiding method and device
CN111913915A
Document management and operation method and system
CN112667563A
Secret information hiding method, secret information extraction method and transmission system
CN114386103A
Hidden information embedding and extracting method based on OOXML document
CN114741717A
