Information hiding method and device based on excel file, equipment and storage medium
By parsing and modifying the OOXML structure of Excel files, watermark information is hidden in cells and file attributes. The watermark code is generated using the MD5 encryption algorithm, which solves the problem that watermark information in Excel files is easily identified and cracked, and achieves stronger robustness and protection.
Patent Information
- Application Number
- CN202210749023.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-06-28
AI Technical Summary
In existing technologies, watermark information in Excel files is highly perceptible, easily identified and optimized, but lacks robustness and is easily cracked.
By parsing the OOXML structure of the Excel file, the watermark information is hidden in the table cells and file attributes. The MD5 encryption algorithm is used to generate the watermark code, and the watermark image is added to the cell. The watermark code is injected into specific tags in the attribute file.
It achieves watermark information that is difficult to detect, optimize, and crack, has stronger robustness, and can effectively protect Excel files from being leaked.
Smart Images

Figure CN115048665B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to an information hiding method and device based on an Excel file, equipment and a storage medium. BACKGROUND
[0002] At present, there are many protection schemes for Excel files. The protection of Excel files can be achieved by adding visible text watermark or background picture watermark in the Excel file. As a novel information hiding technology, digital watermarking provides a solution to a series of problems such as copyright protection, source authentication, file leakage, user tracking and identity authentication on an open network.
[0003] In the prior art, the following two ways are mainly used to protect Excel files. The first way is to add visible text watermark or background picture watermark in the Excel file to achieve the protection effect. However, this way can be cracked by destroying the file, and the visible watermark will bring strong perceptibility and be more easily identified. The second way is to modify the XML tag attribute in the Excel file structure to achieve file protection. However, this way will be optimized when saved by using other software (such as WPS), so that the watermark information is lost.
[0004] Therefore, the existing way of protecting Excel files by adding information in the Excel file has the problems of high perceptibility of watermark information, easy identification and optimization of information, easy cracking of information and poor robustness. SUMMARY
[0005] Therefore, the present disclosure provides an information hiding method and device based on an Excel file, equipment and a storage medium to solve the problems of high perceptibility of watermark information, easy identification and optimization of information, easy cracking of information and poor robustness in the prior art.
[0006] In a first aspect, the present disclosure provides an information hiding method based on an Excel file, comprising: reading a to-be-processed Excel file into a binary stream file, and parsing the binary stream file based on a predetermined composite document structure to obtain a composite document containing a plurality of HyperText Markup Language (HTML) texts; obtaining original information to be hidden, performing an encryption operation on the original information to obtain watermark encoding corresponding to the original information, processing the watermark encoding based on an encoding rule of a picture file in a predetermined format to obtain a watermark picture; modifying the plurality of HTML texts in the composite document based on the watermark picture and picture information corresponding to the watermark picture, so as to add the watermark picture to a cell in the Excel file; modifying an attribute file of the composite document based on the watermark encoding, so as to inject the watermark encoding into at least one label in the attribute file of the composite document, to obtain an Excel file to which the watermark picture is added and the watermark encoding is injected.
[0007] In a second aspect, the present disclosure provides an information hiding device based on an Excel file, comprising: a reading module configured to read a to-be-processed Excel file into a binary stream file, and parse the binary stream file based on a predetermined composite document structure to obtain a composite document containing a plurality of HyperText Markup Language (HTML) texts; an encoding module configured to obtain original information to be hidden, perform an encryption operation on the original information to obtain watermark encoding corresponding to the original information, and process the watermark encoding based on an encoding rule of a picture file in a predetermined format to obtain a watermark picture; an adding module configured to modify the plurality of HTML texts in the composite document based on the watermark picture and picture information corresponding to the watermark picture, so as to add the watermark picture to a cell in the Excel file; and an injecting module configured to modify an attribute file of the composite document based on the watermark encoding, so as to inject the watermark encoding into at least one label in the attribute file of the composite document, to obtain an Excel file to which the watermark picture is added and the watermark encoding is injected.
[0008] In a third aspect, the present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0009] In a fourth aspect, the present disclosure provides a computer-readable storage medium, which stores a computer program executable by a processor to implement the steps of the above method.
[0010] The above at least one technical solution adopted by the present disclosure can achieve the following beneficial effects:
[0011] The method comprises the following steps: reading an Excel file to be processed as a binary stream file, and parsing the binary stream file based on a predetermined composite document structure to obtain a composite document containing multiple hypertext markup language texts; obtaining hidden original information, performing an encryption operation on the original information to obtain watermark encoding corresponding to the original information, processing the watermark encoding based on an encoding rule of a picture file in a predetermined format to obtain a watermark picture; modifying the multiple hypertext markup language texts in the composite document based on the watermark picture and picture information corresponding to the watermark picture, so as to add the watermark picture to a cell in the Excel file; modifying an attribute file of the composite document based on the watermark encoding, so as to inject the watermark encoding into at least one label in the attribute file of the composite document, to obtain an Excel file to which the watermark picture and the watermark encoding are added. The hidden information added by the method is not easy to perceive, not easy to optimize, not easy to crack, and has stronger robustness. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.
[0013] Figure 1 is a flow diagram of the information hiding method based on the Excel file provided by the embodiments of the present disclosure;
[0014] Figure 2 is a structural diagram of the information hiding device based on the Excel file provided by the embodiments of the present disclosure;
[0015] Figure 3 is a structural diagram of the electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION
[0016] In the following description, specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure, but the present disclosure can be practiced without these specific details. In other instances, well-known systems, devices, circuits, and methods have not been described in detail so as not to obscure the present disclosure.
[0017] As described in the background, the existing protection scheme for Excel files can achieve protection effect by adding visible text watermark or background picture watermark in the Excel file, or by adding watermark code to the XML tag attribute of the Excel file structure. However, the method of adding visible text watermark or background picture watermark in the Excel file not only brings strong perceptibility and is easy to be identified, but also the watermark can be cracked by destroying the file. The method of modifying the XML tag attribute in the Excel file structure will be optimized when saved by WPS software, so that the watermark information is lost and the purpose of hiding information in the Excel file cannot be achieved.
[0018] In view of the problems existing in the prior art, the present disclosure finds that the OOXML structure of the Excel document can add a picture carrying user watermark information to the cell of the Excel document by modifying the OOXML structure to insert a cell picture, and set the visible width and height of the watermark picture to 0, thereby achieving the purpose of imperceptibility. Since the function of inserting a horizontal picture in the cell of the Excel document is completely realized, the Excel document with the added horizontal picture will be recognized as a normal structure and will not be optimized. In addition, by studying the OOXML structure, a specific XML file can be modified to achieve the purpose of modifying the file attribute.
[0019] In view of the problems of high perceptibility, low watermark robustness and easy loss of watermark information existing in the prior art, the present disclosure provides an information hiding method based on the OOXML structure of the Excel file. The information hiding method of the present disclosure hides the watermark information in the table cells and file attributes by analyzing the OOXML structure of the Excel file. The Excel file processed by the technical solution of the present disclosure hides information that is not easy to be perceived and is not easy to be optimized and cracked, and has stronger robustness.
[0020] The technical solutions of the table data processing method provided by the embodiments of the present disclosure will be described in detail below in combination with the drawings and specific embodiments.
[0021] Figure 1 is a flowchart of the information hiding method based on the Excel file provided by the embodiments of the present disclosure. Figure 1 The information hiding method based on the Excel file can be executed by a system server. As shown in Figure 1 , the information hiding method based on the Excel file can specifically include:
[0022] S101, read the Excel file to be processed into a binary stream file, and parse the binary stream file based on a predetermined composite document structure to obtain a composite document containing multiple generic markup language texts;
[0023] S102, obtain the original information to be hidden, perform encryption operation on the original information to obtain the watermark code corresponding to the original information, and process the watermark code based on the encoding rules of the image file in the predefined format to obtain the watermark image;
[0024] S103, Based on the watermark image and the image information corresponding to the watermark image, modify multiple generic markup language texts in the composite document so as to add the watermark image to the cells in the Excel file;
[0025] S104, Modify the property file of the composite document based on the watermark encoding so as to inject the watermark encoding into at least one tag in the property file of the composite document, thereby obtaining an Excel file with added watermark image and injected watermark encoding.
[0026] Specifically, the Excel file in this embodiment is a spreadsheet file containing a number of cells. The predetermined composite document structure refers to the OOXML structure corresponding to the Excel file. OOXML stands for Office Open XML, also known as OpenXML. OOXML is an XML-based office document format that includes word processing documents, spreadsheets, presentations, and charts, graphs, shapes, and other graphic materials. Developed by Microsoft for Office 2007, this technical specification has become an international document format standard, compatible with the former international standard ODF (Open Document Format) and the Chinese document standard UOF (Unified Office document Format).
[0027] Furthermore, Generalized Markup Language (GML) text refers to the XML files that constitute the OOXML structure. XML is an abbreviation for Extensible Markup Language, a markup language used to mark up electronic documents to give them structure. It can be used to mark up data and define data types, and is a source language that allows users to define their own markup languages. A compound document is an OOXML structure document, which contains multiple XML files, each of which stores different information.
[0028] According to the technical scheme provided by the embodiment of the present disclosure, the Excel file is read and parsed by using the OOXML structure to obtain an OOXML structure document containing multiple XML files, the original information (i.e. the account identifier of the user, the access time and the like) used for hiding is obtained, the MD5 encryption algorithm is used to obtain a 32-bit length hexadecimal code, the hexadecimal code is used as a complete watermark code, the watermark code is used as the color and transparency information of the watermark picture based on the coding rule of the picture file of the predetermined format, the watermark code is processed to obtain the watermark picture, finally, the OOXML structure of the Excel file is modified to add the watermark picture in the cells of the Excel file, and the attribute file in the OOXML structure is modified to inject the watermark code into the specific tag of the attribute file, so that the modification of the attribute of the Excel file is realized. The modified Excel file contains the cells after the insertion of the watermark picture, and the watermark code information is contained in the file attribute of the modified Excel file. The hidden information in the Excel file of the present disclosure is not easy to be noticed by the user, is not easy to be optimized and cracked, and has strong robustness.
[0029] In some embodiments, before the Excel file to be processed is read as a binary stream file, the method further comprises: obtaining the Excel file downloaded by the user from the system, taking the downloaded Excel file as the Excel file to be processed, and obtaining the account identifier of the user and the access time of the user when the user downloads the Excel file.
[0030] Specifically, the Excel file downloaded by the user in the enterprise internal platform system needs to be embedded with personal information, which can not only effectively avoid the leakage of the enterprise internal file by the user, but also can obtain the watermark information carried in the file through the watermark tracing method after the file is leaked, and can obtain the user information corresponding to the watermark information by querying the database with the watermark information, so as to trace to the user who leaks the file information.
[0031] Further, the Excel file downloaded by the user is taken as the Excel file to be processed, the unique account identifier (i.e. the account ID) of the user and the access time of the user are obtained when the user downloads the file through the enterprise internal platform, i.e. the time when the user accesses the enterprise internal platform is recorded, and these information is taken as the basic information when the watermark code is generated.
[0032] In some embodiments, the composite document structure adopts an OOXML structure; an Excel file to be processed is read as a binary stream file, and the binary stream file is parsed based on a predetermined composite document structure to obtain a composite document containing multiple hypertext markup language texts, including: reading the Excel file to be processed to read it as a binary stream file, parsing the binary stream file based on the OOXML structure of the Excel file to obtain an OOXML document corresponding to the Excel file, wherein the OOXML document contains multiple hypertext markup language texts, and the hypertext markup language texts are XML files.
[0033] Specifically, when reading the Excel file, the Excel file is read as a binary stream file, and then the read binary stream file is parsed based on the OOXML structure of the Excel file to obtain an OOXML document corresponding to the Excel file, and the OOXML document contains multiple XML files. In actual application, each XML file corresponds to a different component structure of the OOXML document, such as an xl / media structure.
[0034] In some embodiments, the original information for hiding is obtained, and an encryption operation is performed on the original information to obtain a watermark code corresponding to the original information, including: obtaining an account identifier, a user access time, and a pre-generated random value, combining the account identifier, the user access time, and the random value into a string, and calculating the string using an encryption algorithm to obtain a watermark code; wherein the encryption algorithm uses an MD5 encryption algorithm, and the watermark code is a 32-bit length hexadecimal code.
[0035] Specifically, before generating the watermark information, first, the account identifier (i.e., the unique account ID) of the user, the user access time, and the pre-generated random value are obtained, and the MD5 encryption algorithm and the encoding rule of the PNG picture are used to further generate the watermark picture based on the obtained basic information for generating the watermark. In actual application, the predetermined format of the picture file includes but is not limited to PNG, JPG, and other picture formats supported by the Excel file.
[0036] Further, according to the account identifier, the user access time, and the pre-generated random value, a string of characters with rules of 0-9 and a-z is formed; and the MD5 algorithm is used to calculate the string to obtain a 32-bit length hexadecimal code, which is used as the complete code of the watermark, such as the complete code of the watermark is denoted as M. It should be noted that the present embodiment is not limited to the way of using the MD5 algorithm to obtain a 32-bit hexadecimal code when generating the watermark code, other generation rules are also applicable, for example, other asymmetric encryption algorithms are used, and the length of the watermark code can also be selected as any length (such as a 16-bit code).
[0037] In some embodiments, based on the encoding rule of the picture file in the predetermined format, the watermark encoding is processed to obtain the watermark picture, including: analyzing the binary file structure of the picture file in the predetermined format to obtain the encoding rule of the picture file in the predetermined format; taking the watermark encoding as the color and transparency information of the picture file in the predetermined format, and processing the watermark encoding by using the encoding rule to obtain the watermark picture; wherein the picture file in the predetermined format is a picture file in PNG format.
[0038] Specifically, after generating the watermark encoding, by analyzing the binary file structure of the PNG picture, the encoding rule of the PNG picture file is obtained, the watermark encoding M is taken as the color and transparency information of the watermark picture, the watermark encoding M is processed by using the encoding rule of the PNG picture file, a PNG picture of 2px*2px is generated, the generated PNG picture is taken as the watermark picture, and the watermark picture is recorded as P.
[0039] Further, after generating the watermark encoding and the watermark picture, the user-related information and the watermark information are transmitted to the server by the Hyper Text Transfer Protocol (HTTP) or Hyper Text Transfer Protocol over Secure Socket Layer (HTTPS) and saved in the database; in actual application, the user-related information not only contains the unique account identification of the user, but also contains the basic information of the Excel file, the related information generated by the user accessing the Excel file, etc.
[0040] After generating the watermark encoding and the watermark picture, the OOXML structure of the Excel file is modified, so that the watermark encoding and the watermark picture are added to the cells and the file attributes respectively, so as to reduce the perceptibility of the user and achieve the purpose of hiding information. The adding methods of the two kinds of information will be described in detail below in combination with specific embodiments.
[0041] In some embodiments, based on the watermark picture and the picture information corresponding to the watermark picture, the multiple hypertext markup language texts in the composite document are modified, including: based on the watermark picture and the picture information of the watermark picture, the multiple hypertext markup language texts in the OOXML document are modified, the watermark picture is inserted into the first hypertext markup language text, the label of the watermark picture is inserted into the second hypertext markup language text, the position and size information of the watermark picture is inserted into the third hypertext markup language text, the association label of the watermark picture is inserted into the fourth hypertext markup language text and the fifth hypertext markup language text, and the Default label and the Override label are inserted into the sixth hypertext markup language text.
[0042] Specifically, the picture information of the watermark picture includes information such as a label, a position, a size, and an associated label of the watermark picture. The PNG picture carrying the watermark encoding information is inserted into a cell of the Excel file by modifying the OOXML structure of the Excel file, so as to hide the watermark picture in the cell of the Excel file. The cell for adding the watermark picture can be a pre-set cell or a randomly selected cell.
[0043] Further, the multiple hyper-text markup language texts in the OOXML document are modified. First, the PNG picture (i.e., the watermark picture) is inserted in xl / media. The watermark picture label is inserted in xl / worksheets / sheet1.XML. The position information and the size information of the watermark picture are inserted in xl / drawings / drawing1.XML. The associated label of the file is inserted in xl / worksheets / _rels / sheet1.XML.rels and xl / drawings / _rels / drawing1.XML.rels. The Default and Override labels are inserted in [Content_Types].XML. The multiple added XML files and types need to be declared in this file.
[0044] Further, xl / media corresponds to a first hyper-text markup language text, and xl / media is used to store the picture of the Excel table. xl / worksheets / sheet1.XML corresponds to a second hyper-text markup language text. xl / drawings / drawing1.XML corresponds to a third hyper-text markup language text. xl / worksheets / _rels / sheet1.XML.rels and xl / drawings / _rels / drawing1.XML.rels correspond to a fourth hyper-text markup language text and a fifth hyper-text markup language text, respectively. [Content_Types].XML corresponds to a sixth hyper-text markup language text.
[0045] Further, by modifying the OOXML structure of the Excel file, a PNG picture (i.e., a watermark picture) is inserted into a cell of the Excel file. The visible size of the picture can be set to 0, and the position of the picture can be at any cell position.
[0046] In some embodiments, modifying the property file of the composite document based on the watermark encoding so as to inject the watermark encoding into at least one tag in the property file of the composite document comprises: obtaining the property file of the OOXML document, injecting the watermark encoding into a first tag of the property file so as to modify the preserver in the property file, and injecting the watermark encoding into a second tag of the property file so as to modify the description in the property file.
[0047] Specifically, in addition to adding the watermark picture in the cell of the Excel file, in order to ensure the robustness in the watermark information injection process, it is also necessary to inject the watermark encoding into the property information of the Excel file. The injection of the watermark encoding still needs to be realized by modifying the OOXML structure, for example, by modifying a specific XML file in the OOXML structure to achieve the purpose of modifying the file property.
[0048] Further, by injecting the watermark encoding into the cp:lastModifiedBy tag of the docProps / core.XML of the OOXML structure, the modification of the preserver in the file property is realized, and in addition, by injecting the watermark encoding into the dc:description tag of the docProps / core.XML of the OOXML structure, the modification of the description in the file property is realized. In actual application, the preserver only retains the watermark encoding of the latest operation user, and the description is retained by the watermark encoding of multiple operation users in a superimposed manner.
[0049] Further, in the injection of the watermark encoding, only the preserver and the remark in the file property are added with the watermark encoding information, and it should be understood that in actual application, other property information of the file can also be modified.
[0050] It should be noted that the embodiments of the present disclosure modify the OOXML structure of the Excel file, so as to add the watermark picture to the cell of the Excel file and inject the watermark encoding into the property file of the Excel, thereby realizing the hiding of the watermark information and achieving the purpose of protecting the Excel file from being leaked. However, it should be understood that when any one of the two kinds of watermark information injection provided in the above embodiments is successful, the watermark information of the Excel file is added successfully, so as long as any one of the watermark information is added successfully, the Excel file can be protected from being leaked, and the traceability of the watermark information of the Excel file can be realized. In actual application, the Excel file after adding the watermark information can be recorded as file E.
[0051] The above embodiments make a detailed description of the generation of watermark information and the adding process of watermark information. The traceability method of the Excel file after adding the watermark information will be introduced in combination with specific embodiments.
[0052] The technical scheme of watermark traceability of the Excel file is also provided in the embodiments of the present disclosure. The watermark traceability mainly includes extraction and query of the watermark information. Corresponding to the two adding methods of the watermark information provided in the above embodiments, the watermark traceability of the embodiments of the present disclosure also includes two extraction methods of the watermark information.
[0053] Firstly, when the PNG picture (i.e. the watermark picture) in the Excel file is extracted, all the PNG pictures stored in xl / media in the OOXML structure of the Excel file are extracted, and the extracted PNG pictures are screened to screen out the PNG pictures with a size of 2px*2px. By analyzing the binary file structure of the PNG picture, the PNG picture is decoded, and the color and transparency information of the picture are analyzed, so that the watermark code M is analyzed.
[0054] Secondly, when the watermark code in the Excel file is extracted, the encoding information acquisition method of the file attribute can be directly adopted, and Microsoft Excel or WPS is used to open the corresponding file, and then the file attribute details are found. Through the information displayed by the file attribute details, the watermark code M can be obtained. Then, according to the obtained watermark code and the watermark code and user information in the database uploaded to the background system server, they are compared and found, so that the user who leaks the file information can be traced.
[0055] According to the technical scheme provided in the embodiments of the present disclosure, the present disclosure hides the watermark information in the table cells and file attributes of the Excel file by analyzing and modifying the OOXML structure of the Excel file. The unique identification information of the user is encoded, and the encoded information is hidden in the cells and file attributes of the Excel file. The purpose of adding cell pictures and modifying file attributes is achieved through OOXML operation. The enterprise internal system can record a series of user information chain of operating the Excel document, and store the data in the cells and file attributes of the Excel file.
[0056] The following is an apparatus embodiment of the present disclosure, which can be used to execute the method embodiments of the present disclosure. For details not disclosed in the apparatus embodiments of the present disclosure, please refer to the method embodiments of the present disclosure.
[0057] Figure 2 is a structural schematic diagram of the information hiding device based on the Excel file provided in the embodiments of the present disclosure. As shown in Figure 2As shown, the information hiding device based on the Excel file comprises:
[0058] The parsing module 201 is configured to read the Excel file to be processed into a binary stream file, and parse the binary stream file based on a predetermined composite document structure to obtain a composite document containing a plurality of universal markup language texts.
[0059] The encoding module 202 is configured to obtain original information for hiding, perform encryption operation on the original information to obtain watermark encoding corresponding to the original information, and process the watermark encoding based on the encoding rule of the picture file of the predetermined format to obtain a watermark picture.
[0060] The modification module 203 is configured to modify the plurality of universal markup language texts in the composite document based on the watermark picture and the picture information corresponding to the watermark picture, so as to add the watermark picture into a cell in the Excel file.
[0061] The injection module 204 is configured to modify the attribute file of the composite document based on the watermark encoding, so as to inject the watermark encoding into at least one label in the attribute file of the composite document, and obtain the Excel file after adding the watermark picture and injecting the watermark encoding.
[0062] In some embodiments, Figure 2 The parsing module 201 of the information hiding device obtains the Excel file downloaded by the user from the system before reading the Excel file to be processed into a binary stream file, takes the downloaded Excel file as the Excel file to be processed, and obtains the account identifier of the user and the user access time when the user downloads the Excel file.
[0063] In some embodiments, the composite document structure adopts an OOXML structure. Figure 2 The parsing module 201 of the information hiding device reads the Excel file to be processed into a binary stream file, and parses the binary stream file based on the OOXML structure of the Excel file to obtain an OOXML document corresponding to the Excel file, wherein the OOXML document contains a plurality of universal markup language texts, and the universal markup language text is an XML file.
[0064] In some embodiments, Figure 2 The encoding module 202 of the information hiding device obtains the account identifier, the user access time, and the pre-generated random value, combines the account identifier, the user access time, and the random value into a string, and calculates the string by using an encryption algorithm to obtain watermark encoding; wherein the encryption algorithm adopts an MD5 encryption algorithm, and the watermark encoding is a 16-bit hexadecimal encoding with a length of 32 bits.
[0065] In some embodiments, Figure 2 The encoding module 202 analyzes the binary file structure of the picture file in the predetermined format to obtain the encoding rule of the picture file in the predetermined format, and encodes the watermark as color and transparency information of the picture file in the predetermined format to obtain the watermark picture by using the encoding rule. The picture file in the predetermined format is a picture file in PNG format.
[0066] In some embodiments, Figure 2 The modifying module 203 modifies the multiple markup language texts in the OOXML document based on the watermark picture and the picture information of the watermark picture, inserts the watermark picture in the first markup language text, inserts the label of the watermark picture in the second markup language text, inserts the position and size information of the watermark picture in the third markup language text, inserts the associated label of the watermark picture in the fourth markup language text and the fifth markup language text, and inserts the Default label and the Override label in the sixth markup language text.
[0067] In some embodiments, Figure 2 The injecting module 204 obtains the property file of the OOXML document, injects the watermark code into the first label of the property file to modify the preserver in the property file, and injects the watermark code into the second label of the property file to modify the description in the property file.
[0068] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
[0069] Figure 3 is a structural schematic diagram of the electronic device 3 provided by the embodiments of the present disclosure. As shown in Figure 3 The electronic device 3 of the embodiment includes a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. The processor 301 implements the steps in each of the above method embodiments when executing the computer program 303. Alternatively, the processor 301 implements the functions of each module / unit in each of the above device embodiments when executing the computer program 303.
[0070] Exemplarily, the computer program 303 can be divided into one or more modules / units, which are stored in the memory 302 and executed by the processor 301 to complete the present disclosure. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 303 in the electronic device 3.
[0071] The electronic device 3 can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The electronic device 3 can include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art can understand that the electronic device 3 can include more or less components than those shown, or combine certain components, or include different components, for example, the electronic device can also include an input / output device, a network access device, a bus, and the like. Figure 3 The electronic device 3 is merely an example and does not constitute a limitation on the electronic device 3, and can include more or less components than those shown, or combine certain components, or include different components, for example, the electronic device can also include an input / output device, a network access device, a bus, and the like.
[0072] The processor 301 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0073] The memory 302 can be an internal storage unit of the electronic device 3, for example, a hard disk or a memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Further, the memory 302 can include both an internal storage unit and an external storage device of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device. The memory 302 can also be used to temporarily store data that has been output or will be output.
[0074] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0075] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0076] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present disclosure.
[0077] In the embodiments provided in the present disclosure, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0078] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0079] In addition, each functional unit in each of the embodiments of the present disclosure can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0080] If the integrated module / unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can be executed by a processor to implement the steps of each method embodiment. The computer program can include computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0081] The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure.
Claims
1. An information hiding method based on an Excel file, characterized in that, The method comprises the following steps: reading an Excel file to be processed as a binary stream file, and parsing the binary stream file based on a predetermined composite document structure to obtain a composite document containing multiple hypertext markup language texts; obtaining original information for hiding, performing an encryption operation on the original information to obtain watermark encoding corresponding to the original information, and processing the watermark encoding based on an encoding rule of a picture file in a predetermined format to obtain a watermark picture; modifying the multiple hypertext markup language texts in the composite document based on the watermark picture and picture information corresponding to the watermark picture, so as to add the watermark picture to a cell in the Excel file; modifying an attribute file of the composite document based on the watermark encoding, so as to inject the watermark encoding into at least one label in the attribute file of the composite document to obtain an Excel file after adding the watermark picture and injecting the watermark encoding; wherein the modification of the multiple hypertext markup language texts in the composite document based on the watermark picture and the picture information corresponding to the watermark picture comprises: modifying multiple hypertext markup language texts in an OOXML document based on the watermark picture and picture information of the watermark picture, inserting the watermark picture in a first hypertext markup language text, inserting a label of the watermark picture in a second hypertext markup language text, inserting position and size information of the watermark picture in a third hypertext markup language text, inserting an associated label of the watermark picture in a fourth hypertext markup language text and a fifth hypertext markup language text, and inserting a Default label and an Override label in a sixth hypertext markup language text; wherein xl / media corresponds to the first hypertext markup language text, and xl / media is used to store a picture of an Excel table; xl / worksheets / sheet1.XML corresponds to the second hypertext markup language text, xl / drawings / drawing1.XML corresponds to the third hypertext markup language text, xl / worksheets / _rels / sheet1.XML.rels and xl / drawings / _rels / drawing1.XML.rels correspond to the fourth hypertext markup language text and the fifth hypertext markup language text respectively, and [Content_Types].XML corresponds to the sixth hypertext markup language text; the modification of the attribute file of the composite document based on the watermark encoding, so as to inject the watermark encoding into at least one label in the attribute file of the composite document, comprises: obtaining an attribute file of an OOXML document, injecting the watermark encoding into a first label of the attribute file to modify a preserver in the attribute file, and injecting the watermark encoding into a second label of the attribute file to modify a description in the attribute file. The first tag of the attribute file is a cp:lastModifiedBy tag of a docProps / core.XML of an OOXML structure, and the second tag of the attribute file is a dc:description tag of the docProps / core.XML of the OOXML structure. The modification of the description in the attribute file is in a manner of superposition one by one, and the watermark codes of multiple operation users are reserved.
2. The method of claim 1, wherein, Before the Excel file to be processed is read as a binary stream file, the method further comprises: An account identifier and a user access time of a user are acquired when the user downloads an Excel file from the system, and the downloaded Excel file is taken as the Excel file to be processed.
3. The method of claim 1, wherein, The composite document structure adopts an OOXML structure; the Excel file to be processed is read as a binary stream file, and the binary stream file is parsed based on a predetermined composite document structure to obtain a composite document containing multiple general markup language texts, which comprises: The Excel file to be processed is read to be read as a binary stream file, and the binary stream file is parsed based on an OOXML structure of the Excel file to obtain an OOXML document corresponding to the Excel file, wherein the OOXML document contains multiple general markup language texts, and the general markup language texts are XML files.
4. The method of claim 2, wherein, The account identifier, the user access time and a random value generated in advance are taken to form a string, and the string is calculated by using an encryption algorithm to obtain the watermark code; wherein the encryption algorithm adopts an MD5 encryption algorithm, and the watermark code is a 16 hexadecimal code with a length of 32 bits. The account identifier, the user access time and a random value generated in advance are taken to form a string, and the string is calculated by using an encryption algorithm to obtain the watermark code; wherein the encryption algorithm adopts an MD5 encryption algorithm, and the watermark code is a 16 hexadecimal code with a length of 32 bits.
5. The method of claim 1, wherein, The binary file structure of the picture file in the predetermined format is analyzed to obtain the encoding rule of the picture file in the predetermined format; the watermark code is taken as color and transparency information of the picture file in the predetermined format, and the watermark code is processed by using the encoding rule to obtain a watermark picture; wherein the picture file in the predetermined format adopts a PNG format picture file. The account identifier, the user access time and a random value generated in advance are taken to form a string, and the string is calculated by using an encryption algorithm to obtain the watermark code; wherein the encryption algorithm adopts an MD5 encryption algorithm, and the watermark code is a 16 hexadecimal code with a length of 32 bits.
6. An information hiding apparatus based on an Excel file, characterized by The parsing module is configured to read the Excel file to be processed as a binary stream file, and parse the binary stream file based on a predetermined composite document structure to obtain a composite document containing multiple general markup language texts; The encoding module is configured to acquire original information for hiding, perform encryption operation on the original information to obtain a watermark code corresponding to the original information, and process the watermark code based on an encoding rule of a picture file in a predetermined format to obtain a watermark picture. The modifying module is configured to modify the multiple general markup language texts in the composite document based on the watermark picture and picture information corresponding to the watermark picture, so as to add the watermark picture into a cell in the Excel file. The injecting module is configured to modify an attribute file of the composite document based on the watermark code, so as to inject the watermark code into at least one label in the attribute file of the composite document, and obtain the Excel file after adding the watermark picture and injecting the watermark code. The modifying module is configured to modify multiple general markup language texts in the OOXML document based on the watermark picture and picture information of the watermark picture, insert the watermark picture in a first general markup language text, insert a label of the watermark picture in a second general markup language text, insert position and size information of the watermark picture in a third general markup language text, insert an associated label of the watermark picture in a fourth general markup language text and a fifth general markup language text, and insert a Default label and an Override label in a sixth general markup language text; the xl / media corresponds to the first general markup language text and is used to store pictures of the Excel table; the xl / worksheets / sheet1.XML corresponds to the second general markup language text, the xl / drawings / drawing1.XML corresponds to the third general markup language text, the xl / worksheets / _rels / sheet1.XML.rels and the xl / drawings / _rels / drawing1.XML.rels correspond to the fourth general markup language text and the fifth general markup language text respectively, and the [Content_Types].XML corresponds to the sixth general markup language text. The injecting module is configured to obtain an attribute file of the OOXML document, inject the watermark code into a first label of the attribute file to modify a preserver in the attribute file, and inject the watermark code into a second label of the attribute file to modify a description in the attribute file; the first label of the attribute file is a cp:lastModifiedBy label of an OOXML structure of docProps / core.XML, the second label of the attribute file is a dc:description label of the OOXML structure of docProps / core.XML, and the modification of the description in the attribute file is performed by means of stacking one by one to reserve watermark codes of multiple operation users. 7.An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor implements the method of any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 7. The computer program, which when executed by the processor, implements the method as claimed in any one of claims 1 to 5.
Citation Information
Patent Citations
OOX (Object-Oriented Xml) document digital watermarking method based on attribute sequence transformation
CN102930187A
Method for embedding hidden tracing watermark in Word document
CN107358073A