CN113177193A - Watermark adding method, watermark verifying method and terminal equipment - Google Patents

Watermark adding method, watermark verifying method and terminal equipment Download PDF

Info

Publication number
CN113177193A
CN113177193A CN202110442671.3A CN202110442671A CN113177193A CN 113177193 A CN113177193 A CN 113177193A CN 202110442671 A CN202110442671 A CN 202110442671A CN 113177193 A CN113177193 A CN 113177193A
Authority
CN
China
Prior art keywords
file
watermark
information
embedding
watermark information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110442671.3A
Other languages
Chinese (zh)
Inventor
薛帅
谈扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yishi Huolala Technology Co Ltd
Original Assignee
Shenzhen Yishi Huolala Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yishi Huolala Technology Co Ltd filed Critical Shenzhen Yishi Huolala Technology Co Ltd
Priority to CN202110442671.3A priority Critical patent/CN113177193A/en
Publication of CN113177193A publication Critical patent/CN113177193A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]

Abstract

The application is applicable to the technical field of information security, and provides a watermark adding method, a watermark verifying method and terminal equipment, wherein the watermark adding method comprises the following steps: obtaining an Excel file; creating an XML file for embedding watermark information in a folder obtained by decompressing the Excel file; embedding watermark information in the XML file for embedding the watermark information; and compressing the folder obtained by decompressing the Excel file after embedding the watermark information to generate a compressed file in a zip format, and converting the compressed file into a new Excel file. By the method, the Excel file can be effectively protected.

Description

Watermark adding method, watermark verifying method and terminal equipment
Technical Field
The present application belongs to the technical field of information security, and in particular, relates to a watermark adding method, a watermark verifying method, a terminal device, and a computer-readable storage medium.
Background
The current data is generally circulated in the form of electronic version, and in consideration of the fact that the electronic version data is very easy to copy, distribute and share through the internet, it is necessary to trace the source of important files to protect the important files.
In order to implement tracing of a file, the existing method generally adds a digital watermark to the file needing tracing. A common form of watermark is a transparent watermark displayed in a picture or PDF document (document with a suffix of PDF), but because there are many document formats distributed over the internet, it is difficult to protect documents in other formats by only adding a watermark to a picture or PDF document. Furthermore, this type of watermark does not provide sufficient protection, and this form of watermark is easily removed, and there are some tools available on the web to remove this type of watermark.
Disclosure of Invention
The embodiment of the application provides a watermark adding method, which can solve the problem that an Excel file is difficult to effectively protect.
In a first aspect, an embodiment of the present application provides a watermarking method, including:
obtaining an Excel file;
creating an XML file for embedding watermark information in a folder obtained by decompressing the Excel file;
embedding watermark information in the XML file for embedding the watermark information;
and compressing the folder obtained by decompressing the Excel file after embedding the watermark information to generate a compressed file in a zip format, and converting the compressed file into a new Excel file.
In a second aspect, an embodiment of the present application provides a watermark checking method, including:
decompressing the new Excel file to obtain an XML file embedded with the watermark information, wherein the new Excel file is obtained by converting a zip-format compressed file;
extracting the watermark information from the Excel file embedded with the watermark information;
and checking whether the watermark information is correct watermark information.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to the first aspect.
In a fifth aspect, the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the method of the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that:
in the embodiment of the application, the watermark information is embedded into the XML file created by the folder obtained by decompressing the Excel file, namely, is not directly embedded into the Excel file, so that the Excel file added with the watermark has imperceptibility and can resist format attack, and the created XML file has enough capacity to be embedded with the watermark information, so that the embedding of various watermark information can be effectively realized, and the Excel file can be effectively protected.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the embodiments or the description of the prior art will be briefly described below.
Fig. 1 is a flowchart of a watermarking method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a created XML file provided in an embodiment of the present application;
fig. 3 is a schematic diagram of watermarking provided in an embodiment of the present application;
fig. 4 is a flowchart of a watermark verification method provided in the second embodiment of the present application;
fig. 5 is a block diagram of a structure of a watermarking apparatus according to a third embodiment of the present application;
fig. 6 is a block diagram of a watermark verifying apparatus according to a fourth embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal device according to a fifth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise.
The first embodiment is as follows:
at present, transparent watermarks are usually added only in a picture or a PDF document to realize tracing of the picture or the PDF document. However, in practical cases, the files distributed via the internet also include an Excel file (a file suffixed with ". xls" or ". xlsx"), and the Excel file also has a file with important content. In the embodiment of the application, the watermark is added to the Excel file, so that the source tracing of the Excel file can be realized, the watermark is not transparent, the added watermark is difficult to find, and the security of the Excel file is effectively improved.
The following describes a watermarking method provided in an embodiment of the present application with reference to the drawings.
Fig. 1 shows a flowchart of a watermarking method provided in an embodiment of the present application, in the embodiment, an execution subject is a terminal device, which is detailed as follows:
in step S11, an Excel file is acquired.
The Excel file is a file to be added with a watermark, and the Excel file is actually a compressed file.
And step S12, creating an XML file for embedding watermark information in a folder obtained by decompressing the Excel file.
Specifically, compression software such as WinRAR compression software or 360 compression software can be adopted to perform decompression operation on the Excel file to obtain a corresponding folder, and then an XML file is created in the folder. Note that the requirement created here is an XML file, otherwise, the watermark of the Excel file after adding the watermark information will hardly achieve a good hiding effect.
In this embodiment, it is assumed that the Excel file to be watermarked is "test data. xlsx", and after performing an decompression operation on the "test data. xlsx", a plurality of folders are obtained, and usually, a folder named "-rels", a folder named "docpops", a folder named "xl", and the like are obtained. In some embodiments, if multiple folders are obtained after the Excel file is decompressed, only one XML file for embedding watermark information is created in one of the folders, that is, all subsequent watermark information is embedded in the same XML file, so as to improve the embedding speed of the watermark. It should be noted that after the XML file for embedding the watermark information is created, the association relationship between the created XML file and other files is not added, so that a good hiding purpose can be achieved without affecting the normal use of the Excel file.
And step S13, embedding watermark information in the XML file for embedding watermark information.
Here, the watermark information may be fixed information, such as company name, author, downloaded document name, and the like, as the watermark information.
In other embodiments, the watermark information may also be unfixed information, such as one or more of a downloader account number, a downloader Internet Protocol Address (IP), a download time, and the like, as the watermark information.
Of course, one or more of the downloaded document name, the downloader account, the downloader IP address, and the download time may be used as the watermark information, which is not limited herein. For example, the watermark information embedded in an XML file is as follows:
the term < watermark source ═ dsp "> file _ name ═ operation _ report ═ zhanglosader ═ zhangsan ═ time ═ 2020-11-25," ip ═ 192.168.0.1. The element name "watermark source" represents the origin of the watermark, the element name "file _ name" represents the download file name (i.e., the file name of the XML file in which the watermark information is embedded), the element name "downloader" represents the downloader account number, the element name "time" represents the download time, and the element name "IP" represents the downloader IP address. Of course, in practical cases, other characters may be used to represent the element names, and the description is not limited herein.
And step S14, compressing the folder obtained by decompressing the Excel file after embedding the watermark information, generating a compressed file in a zip format, and converting the compressed file into a new Excel file.
In this embodiment, if multiple folders are obtained after the Excel file is decompressed, after watermark information is embedded in the created XML file, the multiple folders are compressed together to obtain a zip-format compressed file (i.e., a file with a suffix name of ". zip"), and the zip-format compressed file is converted into a new Excel file, i.e., the suffix ". zip" of the zip-format compressed file is changed into ". xls" or ". xlsx", thereby completing the addition of the watermark and the repackaging of the source file.
In the embodiment of the application, if a watermark needs to be added to an Excel file, the Excel file is obtained, an XML file used for embedding watermark information is created in a folder obtained by decompressing the Excel file, after the watermark information is embedded in the created XML file, the folder obtained by decompressing the Excel file after the watermark information is embedded is compressed, a compressed file in a zip format is generated, and the compressed file is converted into a new Excel file. The watermark information is embedded into the XML file created by the folder obtained by decompressing the first compressed file, namely, is not directly embedded into the Excel file, so that the added watermark has imperceptibility and can resist format attack, and the created XML file has enough capacity to be embedded into the watermark information, so that the embedding of various watermark information can be effectively realized, and the Excel file can be effectively protected. In addition, when the watermark information is one or more of company name, author, downloaded document name, downloader account, downloader IP address, downloading time and the like, the occupied space is small, so the size of the Excel file is slightly influenced after the watermark information is added.
In some embodiments, after the user performs the downloading operation, the watermark is added to the Excel file, where step S11 includes:
a1, if the downloading operation aiming at the Excel file is detected, identifying whether the Excel file is a file containing sensitive information.
Specifically, when the fact that the user clicks the link address corresponding to the Excel file is detected, or the fact that the user clicks the download key corresponding to the Excel file is detected, it is determined that the download operation for the Excel file is detected.
The identification of whether the Excel file contains sensitive information can be carried out in the following modes:
the method comprises the following steps: generating a list 1 and a list 2 in advance, wherein the list 1 is used for storing a unique identifier of an Excel file containing sensitive information; list 2 is used to store a unique identification of an Excel file that does not contain sensitive information. When it is required to identify whether an Excel file contains sensitive information, comparing the unique identifier corresponding to the Excel file with the unique identifier of the Excel file in the list 1, if the unique identifier which is the same as the unique identifier of the Excel file exists in the list 1, determining that the Excel file is the Excel file containing the sensitive information, otherwise, determining that the Excel file is the Excel file not containing the sensitive information. Of course, if neither list 1 nor list 2 has the same unique identifier as that of the Excel file, the identification is performed by the following method two.
The second method comprises the following steps: and comparing the content information of the Excel file with preset sensitive information, and if the content information of the Excel file has the same information as the preset sensitive information and the number of the same information is greater than or equal to a preset threshold value, judging that the Excel file is the Excel file containing the sensitive information. In some embodiments, sensitivity classification may be performed on an Excel file containing sensitive information according to the existing sensitive information and the number of the existing sensitive information, for example, when the same sensitive information existing in the Excel file is highly sensitive information, or the number of the same sensitive information existing in the Excel file is greater than a preset high sensitivity number threshold, it is determined that the Excel file is a high sensitivity level Excel file.
A2, if the Excel file is a file containing sensitive information, acquiring the Excel file.
In the above-mentioned a1 and a2, after the Excel file is determined to contain the sensitive information, the Excel file is acquired, that is, the subsequent operation of adding the watermark is only performed on the Excel file containing the sensitive information, and when the Excel file does not contain the sensitive information, the operation of adding the watermark is not performed on the Excel file not containing the sensitive information. Since the Excel file containing the sensitive information is the important file, the above-mentioned a1 and a2 can ensure the tracing to the important file and can avoid the resource consumption caused by adding watermark to the non-important file.
It should be noted that after the downloading operation for the Excel file is detected, the corresponding watermark is added to the Excel file containing the sensitive information, and then the obtained new Excel file replaces the original Excel file, that is, the user downloads the Excel file to which the watermark information is added by the downloading operation for the Excel file to which the watermark information is not added.
In some embodiments, the watermark information to be added may be selected according to the sensitivity level corresponding to the Excel file, and at this time, the watermark adding method further includes:
and if the Excel file is a file containing sensitive information, determining corresponding watermark information according to the sensitive information.
In this embodiment, the importance degree of the Excel file is determined according to the sensitive information, specifically, the sensitive level corresponding to the Excel file is determined according to the sensitive information itself and/or the number of the sensitive information included in the Excel file, and the higher the sensitive level is, the more important the Excel file is, at this time, the more watermark information needs to be added, and further, better traceability can be achieved.
In some embodiments, step S12 includes:
b1, determining a target folder in the folders obtained by decompressing the Excel file, wherein the target folder is a folder for storing table information of the existing table of the Excel file.
Specifically, the folder for storing the table information of the existing table of the Excel file is usually a "wooks" folder under the folder name "xl", and the "wooks" folder usually includes several files, such as sheet1.xml, sheet2.xml, and sheet3. xml.
B2, creating an XML file in the target folder for embedding the watermark information.
Specifically, if the folder for storing the table information of the existing table of the Excel file is a "wooks" folder, an XML file for embedding the watermark information is created in the "wooks" folder.
In some embodiments, the XML file used to embed the watermark information is named in the same manner as other files in the target folder (i.e., the folder in which the XML file embedding the watermark information resides). For example, assuming that the folder in which the XML file for embedding watermark information is located is a "wooks" folder, and the other XML files in the "wooks" folder are 3 files such as sheet1.XML, sheet2.XML, and sheet3.XML, that is, the naming modes of the other XML files in the "wooks" folder are all named as "sheet", the created XML file for embedding watermark information is also named as "sheet". For example, the file name of the created XML file may be set to sheet4.XML, as shown in fig. 2. Since the file names are similar, the effect of hiding the watermark information can be further improved.
In some embodiments, in order to improve the security of the embedded watermark information, step S13 includes:
and C1, encrypting the watermark information to obtain watermark ciphertext information.
Specifically, the watermark information is encrypted by using an Encryption Algorithm, where the Encryption Algorithm may include Triple Data Encryption Algorithm (TDEA), International Data Encryption Algorithm (IDEA), Advanced Encryption Standard (AES), stream Encryption Algorithm (such as (Rivest Cipher 4, RC4) and Salsa20), and also may use Encryption algorithms such as Bowfish. Assuming that the selected encryption algorithm is AES, security parameters of the AES algorithm are further determined, and the security parameters include determining key length, encryption mode, and the like. In this embodiment, it is assumed that the selected encryption algorithm is AES, the security parameter is AES-256-GCM, i.e. the key length is 256 bits (i.e. 32 bytes), and GCM refers to the Counter mode of AES encryption. In the same encryption mode, the longer the key length, the higher the corresponding security strength.
The 32-byte key K may be generated by any method, and in some embodiments, in order to improve the security of the key K, the 32-byte random number is generated by using a secure random number generator as the 32-byte key K. And after the secret key K is used for encryption, watermark ciphertext information is obtained. The encoding of the watermark ciphertext information may be any format encoding, such as binary encoding, base64, ASCII encoding, and the like. In some embodiments, the encoding format of the watermark ciphertext information is set to 16-ary encoding, and since office files such as word, excel and the like generally use 16-ary encoding attribute information in XML format files thereof, the encoding format of the watermark ciphertext information is also set to 16-ary encoding, which can enable the inserted watermark to be more concealed.
And C2, embedding the watermark ciphertext information in the XML file for embedding the watermark information.
In the above-mentioned C1 and C2, since the watermark ciphertext information is embedded in the created XML file, the embedded watermark information can be hidden better.
In some embodiments, in order to prevent the watermark information from being tampered, a corresponding hash value is added after the watermark ciphertext information to check the integrity of the watermark ciphertext information, and the step C2 includes:
and embedding the watermark ciphertext information and the hash value of the watermark ciphertext information in an XML file for embedding the watermark information.
In this embodiment, the hash value calculation may be directly performed on the watermark ciphertext information to obtain the hash value corresponding to the watermark ciphertext information. In order to further improve the security of the obtained Hash value, a predefined Hash key and watermark ciphertext information may be combined, and then the Hash value corresponding to the watermark ciphertext information is calculated, that is, a field of a value of a Hash-based Message Authentication Code (HMAC) related to a key of the watermark ciphertext information is added behind the watermark ciphertext information, so that the predefined Hash key must be obtained when the Hash value is subsequently verified, and thus, the security of the obtained Hash value is greatly improved. The display format of the hash value may be 16 systems, or may be an encoding format such as BASE64, BASE58, and the like, and since the office files such as word, excel, and the like usually use 16 systems to encode attribute information in their XML format files, the display format of the hash value is preferably 16 systems, so as to improve the speed of embedding the watermark information.
Fig. 3 shows a schematic diagram of watermarking provided by an embodiment of the present application.
Step 1, carrying out decompression operation on the original Excel file to obtain a decompressed file.
And 2, creating an XML file in the decompressed folder.
And 3, generating watermark information.
It is noted that step 3 may also be performed before step 1.
And 4, performing encryption operation on the watermark information by adopting an AES encryption algorithm and a secret key K to obtain the encrypted watermark information, namely the above watermark ciphertext information.
And 5, embedding the watermark ciphertext information into the XML file created in the step 2 to obtain a decompressed file after the watermark is embedded.
And 6, performing compression operation on the decompressed file after the watermark is embedded to obtain the Excel file with the embedded watermark.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example two:
fig. 4 shows a flowchart of a watermark verification method provided in an embodiment of the present application, which is detailed as follows:
and step S41, decompressing the new Excel file to obtain the XML file embedded with the watermark information, wherein the new Excel file is obtained by converting a zip-format compressed file.
Specifically, WinRAR compression software or 360 compression software and the like are adopted to perform compression operation on a new Excel file, and the new Excel file is an Excel file embedded with watermark information.
In this embodiment, the XML file with the embedded watermark information is determined from the decompressed folder according to the storage path of the XML file with the embedded watermark information in the first embodiment.
And step S42, extracting the watermark information from the Excel file embedded with the watermark information.
Specifically, according to the first embodiment, the embedded information type is selected, and the corresponding watermark information is extracted correspondingly, for example, after an XML file in which the watermark information is embedded is determined from a file whose file name includes sheet, if the embedded information type includes a downloader account, the corresponding watermark information is extracted from an element name corresponding to the downloader account in the XML file.
And step S43, checking whether the watermark information is correct watermark information.
Specifically, whether the watermark information is correct watermark information can be checked by judging whether the number of types of watermark information is the same as the number of types involved in adding the watermark.
In the embodiment of the application, because the XML file in which the watermark information is embedded is known in advance, the corresponding watermark information can be extracted from the XML file, and the accurate verification of the watermark information is completed.
In some embodiments, if the embedded information is watermark ciphertext information, the step S41 is to obtain the XML file after embedding the watermark ciphertext information.
In some embodiments, if the watermark ciphertext information and the hash value of the watermark ciphertext information are embedded in the created XML file for embedding the watermark information, the step S41 is to obtain the XML file after embedding the watermark ciphertext information and the hash value of the watermark ciphertext information, the step S42 is to extract the hash value of the watermark ciphertext information and the watermark ciphertext information, and correspondingly, the step S43 specifically includes: and performing hash value calculation on the watermark ciphertext information, judging whether the hash value obtained after performing the hash value calculation is the same as the hash value of the watermark ciphertext information, if so, judging that the watermark information is correct watermark information, otherwise, judging that the watermark information is wrong watermark information.
Of course, if the hash value of the watermark ciphertext information is obtained by combining the predefined hash key and the watermark ciphertext information, step S43 specifically includes: and performing hash value calculation on the watermark ciphertext information and a predefined hash key, judging whether the hash value obtained after performing the hash value calculation is the same as the hash value of the watermark ciphertext information, if so, judging that the watermark information is correct watermark information, otherwise, judging that the watermark information is wrong watermark information.
Example three:
fig. 5 shows a structural block diagram of a watermarking apparatus provided in the embodiment of the present application, corresponding to the watermarking method described in the first embodiment, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 5, the watermarking apparatus 5 includes: an Excel file acquisition module 51, a file creation module 52, a watermark information embedding module 53 and a new Excel file determination module 54. Wherein:
an Excel file acquisition module 51, configured to acquire an Excel file;
the file creating module 52 is configured to create an XML file for embedding the watermark information in a folder obtained by decompressing the Excel file;
a watermark information embedding module 53, configured to embed watermark information in the XML file for embedding watermark information;
and the new Excel file determining module 54 is configured to compress a folder obtained by decompressing the Excel file after embedding the watermark information, generate a compressed file in a zip format, and convert the compressed file into a new Excel file.
In the embodiment of the application, the watermark information is embedded into the XML file created by the folder obtained by decompressing the first compressed file, namely, is not directly embedded into the Excel file, so that the added watermark has imperceptibility and can resist format attack, and the created XML file has enough capacity to be embedded into the watermark information, so that the embedding of various watermark information can be effectively realized, and the Excel file can be effectively protected. In addition, when the watermark information is one or more of company name, author, downloaded document name, downloader account, downloader IP address, downloading time and the like, the occupied space is small, so the size of the Excel file is slightly influenced after the watermark information is added.
In some embodiments, the Excel file obtaining module 51 is specifically configured to:
if the downloading operation aiming at the Excel file is detected, identifying whether the Excel file is a file containing sensitive information or not; and if the Excel file is a file containing sensitive information, acquiring the Excel file.
In some embodiments, the watermarking means 5 further comprises:
and the watermark information determining module is used for determining corresponding watermark information according to the sensitive information if the Excel file is a file containing the sensitive information.
In some embodiments, file creation module 52 is specifically configured to:
determining a target folder in folders obtained by decompressing the Excel file, wherein the target folder is a folder for storing table information of an existing table of the Excel file; creating an XML file in the target folder for embedding watermark information.
In some embodiments, the XML file for embedding watermark information is named in the same way as other files under the target folder.
In some embodiments, the watermark information embedding module 53 is specifically configured to:
encrypting the watermark information to obtain watermark ciphertext information; and embedding the watermark ciphertext information into the XML file for embedding the watermark information.
In some embodiments, said embedding said watermark ciphertext information in said XML file for embedding watermark information comprises:
and embedding the watermark ciphertext information and the hash value of the watermark ciphertext information in the XML file for embedding the watermark information.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Example four:
fig. 6 shows a structural block diagram of the watermark verification apparatus provided in the embodiment of the present application, which corresponds to the watermark verification method described in the second embodiment above, and for convenience of description, only the parts related to the embodiment of the present application are shown.
The watermark verifying unit 6 includes: a new Excel file decompression module 61, a watermark information extraction module 62 and a watermark information verification module 63. Wherein:
a new Excel file decompression module 61, configured to decompress a new Excel file to obtain an XML file embedded with watermark information, where the new Excel file is obtained by converting a zip-format compressed file;
a watermark information extraction module 62, configured to extract the watermark information from the Excel file in which the watermark information is embedded;
and the watermark information checking module 63 is configured to check whether the watermark information is correct watermark information.
In the embodiment of the application, because the XML file in which the watermark information is embedded is known in advance, the corresponding watermark information can be extracted from the XML file, and the accurate verification of the watermark information is completed.
In some embodiments, if the embedded information is watermark ciphertext information, the new Excel file decompression module 61 obtains an XML file after embedding the watermark ciphertext information.
In some embodiments, if the watermark ciphertext information and the hash value of the watermark ciphertext information are embedded in the created XML file for embedding the watermark information, the new Excel file decompression module 61 obtains the XML file after embedding the watermark ciphertext information and the hash value of the watermark ciphertext information, the watermark information extraction module 62 extracts the watermark ciphertext information and the hash value of the watermark ciphertext information, and correspondingly, the watermark information verification module 63 is specifically configured to: and performing hash value calculation on the watermark ciphertext information, judging whether the hash value obtained after performing the hash value calculation is the same as the hash value of the watermark ciphertext information, if so, judging that the watermark information is correct watermark information, otherwise, judging that the watermark information is wrong watermark information.
Example five:
fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 7, the terminal device 7 of this embodiment includes: at least one processor 70 (only one processor is shown in fig. 7), a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, the processor 70 implementing the steps in any of the various method embodiments described above when executing the computer program 72:
obtaining an Excel file;
creating an XML file for embedding watermark information in a folder obtained by decompressing the Excel file;
embedding watermark information in the XML file for embedding the watermark information;
and compressing the folder obtained by decompressing the Excel file after embedding the watermark information to generate a compressed file in a zip format, and converting the compressed file into a new Excel file.
The terminal device 7 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 70, a memory 71. Those skilled in the art will appreciate that fig. 7 is only an example of the terminal device 7, and does not constitute a limitation to the terminal device 7, and may include more or less components than those shown, or combine some components, or different components, for example, and may further include input/output devices, network access devices, and the like.
The Processor 70 may be a Central Processing Unit (CPU), and the Processor 70 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may in some embodiments be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. In other embodiments, the memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 71 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
An embodiment of the present application further provides a network device, where the network device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A watermarking method, comprising:
obtaining an Excel file;
creating an XML file for embedding watermark information in a folder obtained by decompressing the Excel file;
embedding watermark information in the XML file for embedding the watermark information;
and compressing the folder obtained by decompressing the Excel file after embedding the watermark information to generate a compressed file in a zip format, and converting the compressed file into a new Excel file.
2. The watermarking method according to claim 1, wherein the obtaining of the Excel file comprises:
if the downloading operation aiming at the Excel file is detected, identifying whether the Excel file is a file containing sensitive information or not;
and if the Excel file is a file containing sensitive information, acquiring the Excel file.
3. The watermarking method according to claim 2, wherein the watermarking method further comprises:
and if the Excel file is a file containing sensitive information, determining corresponding watermark information according to the sensitive information.
4. The watermarking method according to claim 1, wherein the creating of the XML file for embedding the watermark information in the folder obtained by decompressing the Excel file comprises:
determining a target folder in folders obtained by decompressing the Excel file, wherein the target folder is a folder for storing table information of an existing table of the Excel file;
creating an XML file in the target folder for embedding watermark information.
5. The watermarking method according to claim 4, wherein the XML file for embedding watermark information is named in the same manner as other files under the target folder.
6. The watermarking method according to claim 1, wherein the embedding of the watermark information in the XML file for embedding watermark information includes:
encrypting the watermark information to obtain watermark ciphertext information;
and embedding the watermark ciphertext information into the XML file for embedding the watermark information.
7. The watermark adding method according to claim 6, wherein the embedding the watermark ciphertext information in the XML file for embedding watermark information includes:
and embedding the watermark ciphertext information and the hash value of the watermark ciphertext information in the XML file for embedding the watermark information.
8. A watermark verification method, comprising:
decompressing the new Excel file to obtain an XML file embedded with the watermark information, wherein the new Excel file is obtained by converting a zip-format compressed file;
extracting the watermark information from the Excel file embedded with the watermark information;
and checking whether the watermark information is correct watermark information.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202110442671.3A 2021-04-23 2021-04-23 Watermark adding method, watermark verifying method and terminal equipment Pending CN113177193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110442671.3A CN113177193A (en) 2021-04-23 2021-04-23 Watermark adding method, watermark verifying method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110442671.3A CN113177193A (en) 2021-04-23 2021-04-23 Watermark adding method, watermark verifying method and terminal equipment

Publications (1)

Publication Number Publication Date
CN113177193A true CN113177193A (en) 2021-07-27

Family

ID=76924529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110442671.3A Pending CN113177193A (en) 2021-04-23 2021-04-23 Watermark adding method, watermark verifying method and terminal equipment

Country Status (1)

Country Link
CN (1) CN113177193A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656825A (en) * 2021-10-21 2021-11-16 北京凯睿数加科技有限公司 Text watermark embedding method, text tampering detection method, text watermark embedding device, text tampering detection device and electronic equipment
CN113806696A (en) * 2021-09-18 2021-12-17 上海观安信息技术股份有限公司 Watermark generation and tracing method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1897522A (en) * 2005-07-15 2007-01-17 国际商业机器公司 Water mark embedded and/or inspecting method, device and system
CN108108632A (en) * 2017-11-30 2018-06-01 中车青岛四方机车车辆股份有限公司 A kind of multifactor file watermark generation extracting method and system
CN108563930A (en) * 2018-04-16 2018-09-21 深圳市联软科技股份有限公司 A kind of method, apparatus, medium and the system of confidential document addition watermark
CN110457873A (en) * 2018-05-08 2019-11-15 中移(苏州)软件技术有限公司 A kind of watermark embedding and detection method and device
CN110674477A (en) * 2019-09-24 2020-01-10 北京溯斐科技有限公司 Document source tracing method and device based on electronic file security identification
CN111488556A (en) * 2020-04-09 2020-08-04 深信服科技股份有限公司 Nested document extraction method and device, electronic equipment and storage medium
CN111970114A (en) * 2020-08-31 2020-11-20 中移(杭州)信息技术有限公司 File encryption method, system, server and storage medium
CN112529759A (en) * 2020-12-22 2021-03-19 北京百度网讯科技有限公司 Document processing method, device, equipment, storage medium and computer program product
CN112650956A (en) * 2021-01-06 2021-04-13 携程旅游信息技术(上海)有限公司 Excel document tracking method and system, electronic device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1897522A (en) * 2005-07-15 2007-01-17 国际商业机器公司 Water mark embedded and/or inspecting method, device and system
CN108108632A (en) * 2017-11-30 2018-06-01 中车青岛四方机车车辆股份有限公司 A kind of multifactor file watermark generation extracting method and system
CN108563930A (en) * 2018-04-16 2018-09-21 深圳市联软科技股份有限公司 A kind of method, apparatus, medium and the system of confidential document addition watermark
CN110457873A (en) * 2018-05-08 2019-11-15 中移(苏州)软件技术有限公司 A kind of watermark embedding and detection method and device
CN110674477A (en) * 2019-09-24 2020-01-10 北京溯斐科技有限公司 Document source tracing method and device based on electronic file security identification
CN111488556A (en) * 2020-04-09 2020-08-04 深信服科技股份有限公司 Nested document extraction method and device, electronic equipment and storage medium
CN111970114A (en) * 2020-08-31 2020-11-20 中移(杭州)信息技术有限公司 File encryption method, system, server and storage medium
CN112529759A (en) * 2020-12-22 2021-03-19 北京百度网讯科技有限公司 Document processing method, device, equipment, storage medium and computer program product
CN112650956A (en) * 2021-01-06 2021-04-13 携程旅游信息技术(上海)有限公司 Excel document tracking method and system, electronic device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DATASEC: "Office 文件追踪方案探索", pages 1 - 4, Retrieved from the Internet <URL:《https://www.freebuf.com/articles/database/246984.html》> *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113806696A (en) * 2021-09-18 2021-12-17 上海观安信息技术股份有限公司 Watermark generation and tracing method, device, equipment and storage medium
CN113656825A (en) * 2021-10-21 2021-11-16 北京凯睿数加科技有限公司 Text watermark embedding method, text tampering detection method, text watermark embedding device, text tampering detection device and electronic equipment
CN113656825B (en) * 2021-10-21 2022-02-22 北京凯睿数加科技有限公司 Text watermark embedding method, text tampering detection method, text watermark embedding device, text tampering detection device and electronic equipment

Similar Documents

Publication Publication Date Title
JP4993674B2 (en) Information processing apparatus, verification processing apparatus, control method thereof, computer program, and storage medium
US20070220260A1 (en) Protecting the integrity of electronically derivative works
CN107911222B (en) Digital signature generating method, digital signature verifying method, digital signature generating apparatus, digital signature verifying apparatus, and storage medium storing digital signature verifying program
KR101744744B1 (en) System for tracking illegal distributeur and preventing distribution of illegal content and method thereof
CN111143869B (en) Application package processing method and device, electronic equipment and storage medium
CN103530535A (en) Shell adding and removing method for Android platform application program protection
CN111756522A (en) Data processing method and system
EP1777651A1 (en) Electronic data delivery method
CN111901337A (en) File uploading method and system and storage medium
CN113177193A (en) Watermark adding method, watermark verifying method and terminal equipment
CN112883361B (en) Function jump method and device of application program, computer equipment and storage medium
CN103971061A (en) Method and device for acquiring text file fingerprint and data management method
CN110968847A (en) File watermark hiding and analyzing method, device, equipment and storage medium
CN112163412A (en) Data verification method and device, electronic equipment and storage medium
CN114785524B (en) Electronic seal generation method, device, equipment and medium
CN109413099B (en) Certificate-based hybrid cloud encrypted communication method and device and electronic equipment
CN110826091B (en) File signature method and device, electronic equipment and readable storage medium
CN112307503A (en) Signature management method and device and electronic equipment
JP5056995B1 (en) Application program distribution execution method that can detect falsification
CN112328975A (en) Product software authorization management method, terminal device and medium
CN111881425A (en) Picture copyright authentication method and device and storage medium
CN114745373A (en) File transmission method, device, equipment and storage medium
CN115361376A (en) Government affair file uploading method and device, electronic equipment and storage medium
CN113177214A (en) Image publishing and auditing method, related device and computer program product
CN112632588A (en) Text encryption method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination