[go: up one dir, main page]

WO2018098879A1 - 数字水印加密方法及装置 - Google Patents

数字水印加密方法及装置 Download PDF

Info

Publication number
WO2018098879A1
WO2018098879A1 PCT/CN2016/112858 CN2016112858W WO2018098879A1 WO 2018098879 A1 WO2018098879 A1 WO 2018098879A1 CN 2016112858 W CN2016112858 W CN 2016112858W WO 2018098879 A1 WO2018098879 A1 WO 2018098879A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
digital watermark
file
string
encrypted
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.)
Ceased
Application number
PCT/CN2016/112858
Other languages
English (en)
French (fr)
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 TCL Digital Technology Co Ltd
Original Assignee
Shenzhen TCL Digital 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 TCL Digital Technology Co Ltd filed Critical Shenzhen TCL Digital Technology Co Ltd
Publication of WO2018098879A1 publication Critical patent/WO2018098879A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking

Definitions

  • the present invention relates to the field of digital watermarking technologies, and in particular, to a digital watermark encryption method and apparatus.
  • Digital watermarking technology is a technology that embeds some identification information (ie, digital watermark) into a digital carrier (including multimedia, documents, software, etc.), and is often used to protect information security or information hiding, and thus is widely used.
  • digital watermark encryption is performed on a digital carrier, the digital watermark is generally embedded directly into the digital carrier, which occupies a certain storage space of the digital carrier, and when the available storage space of the digital carrier is insufficient, the embedded digital watermark affects the digital carrier. Normal use, therefore, the reliability of digital watermark encryption is not very high.
  • the main object of the present invention is to provide a digital watermark encryption method and apparatus, aiming at solving the technical problem that the reliability of the existing digital watermark encryption is not high.
  • the present invention provides a digital watermark encryption method, and the digital watermark encryption method includes the following steps:
  • the step of searching for the identifier character included in the third character string and acquiring the digital watermark according to the identifier character comprises:
  • the present invention also provides a digital watermark encryption method, and the digital watermark encryption method includes the following steps:
  • the step of adding the digital watermark to the preset identification character comprises:
  • the identification character is added at a head position and a tail position of the digital watermark.
  • the binary format is a binary format
  • the characters in the first character string are sequentially extracted in a preset order, and the files are extracted and extracted according to the characters extracted each time.
  • the steps of the node corresponding to the character performing the corresponding processing include:
  • the node corresponding to the currently extracted character in the file to be encrypted is maintained unchanged
  • the currently extracted character is a binary character 1
  • a space character is added to the tail position of the node corresponding to the currently extracted character in the file to be encrypted.
  • the method further includes:
  • the step of searching for the identifier character included in the third character string and acquiring the digital watermark according to the identifier character comprises:
  • the present invention further provides a digital watermark encrypting apparatus, where the digital watermark encrypting apparatus includes:
  • An identifier module configured to add a digital watermark to a preset identifier character, to perform identifier processing on the digital watermark, wherein the digital watermark is in a first binary format
  • a conversion module configured to perform the second binary format conversion on the digital watermark after the identifier processing, to generate a first character string in a binary format corresponding to the digital watermark
  • a processing module configured to sequentially extract each character in the first character string according to a preset order, and perform corresponding processing on the node corresponding to the extracted character in the encrypted file according to each extracted character. And generating an encrypted file corresponding to the file to be encrypted, where the file to be encrypted includes multiple nodes.
  • the identification module is used to:
  • the identification character is added at a head position and a tail position of the digital watermark.
  • the processing module includes:
  • An extracting unit configured to sequentially extract each character in the first character string in a binary format according to a preset order
  • a processing unit configured to: if the currently extracted character is a binary character 0, maintaining a node corresponding to the currently extracted character in the file to be encrypted is unchanged; if the currently extracted character is a binary character 1, And adding a space character to the tail position of the node corresponding to the currently extracted character in the file to be encrypted.
  • the processing module is further configured to sequentially extract each node of the encrypted file, and determine a character in a binary format corresponding to each extracted node, and form the determined character into a second character in a binary format. string;
  • the conversion module is further configured to perform a first-ary format conversion on the second character string to generate a third character string in a first-ary format, where the third string includes the identifier character digital water mark;
  • the digital watermark encryption device further includes:
  • an obtaining module configured to search for the identifier character included in the third string, and obtain the digital watermark according to the identifier character.
  • the obtaining module comprises:
  • a searching unit configured to search for the two identifier characters included in the third string
  • an obtaining unit configured to extract character information between the two identifier characters, where the character information is the digital watermark.
  • the digital watermark encryption method and device proposed by the invention when digital watermark encryption is to be performed on the encrypted file, firstly adds a digital watermark in the first binary format to the preset identification character, and then performs a binary format conversion on the digital watermark to generate The first character string in the binary format corresponding to the digital watermark, and then each character in the first character string is sequentially extracted according to a preset order, and the characters corresponding to the extracted characters are sequentially processed according to the characters extracted each time.
  • the node performs corresponding processing, and the encrypted file corresponding to the file to be encrypted is generated after the processing is completed. Therefore, the encryption process only processes the node to be encrypted, and does not directly embed the digital watermark into the file to be encrypted, thereby avoiding embedding.
  • the digital watermark occupies the storage space and affects the use of the file to be encrypted, thereby improving the reliability of the digital watermark encryption.
  • FIG. 1 is a schematic flow chart of a first embodiment of a digital watermark encryption method according to the present invention
  • FIG. 2 is a schematic flow chart of a second embodiment of a digital watermark encryption method according to the present invention.
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a digital watermark encryption apparatus according to the present invention.
  • FIG. 4 is a schematic diagram of a refinement function module of a processing module in a first embodiment of a digital watermark encryption apparatus according to the present invention
  • FIG. 5 is a schematic diagram of functional modules of a second embodiment of a digital watermark encryption apparatus according to the present invention.
  • FIG. 6 is a schematic diagram of a refinement function module of an acquisition module in a second embodiment of the digital watermark encryption apparatus of the present invention.
  • FIG. 1 is a schematic flowchart of a first embodiment of a digital watermark encryption method according to the present invention.
  • the digital watermark encryption method comprises the following steps:
  • step S10 the digital watermark is added with a preset identification character to perform identification processing on the digital watermark, wherein the digital watermark is in a first binary format;
  • the digital watermarking technology embeds some identification information (ie, digital watermark) into a digital carrier (including multimedia, documents, software, etc.) or indirectly (modifies the structure of a specific area) without affecting the use value of the original carrier, and is not easy. Techniques that are detected and modified again, but can be identified and identified by the producer, are often used to protect information security or information hiding.
  • the encrypted file is encrypted by using a digital watermark, wherein the file to be encrypted includes multimedia, a document, software, and the like.
  • the digital watermark is subjected to identification processing, and the digital watermark is added with a preset identification character.
  • the identifier character corresponding to the digital watermark is preset to be “#”.
  • the identification character can also be set to other Characters are not limited here.
  • the digital watermark is in a first-ary format, for example, the digital watermark is in a decimal format.
  • step S10 includes:
  • the identification character is added at a head position and a tail position of the digital watermark.
  • a preset identification character is added to the head position and the tail position of the digital watermark. For example, a character "#" is added to the head position and the tail position of the digital watermark to perform the digital watermark. Identification processing.
  • Step S20 performing the second binary format conversion on the digital watermark after the identification process to generate a first character string in a binary format corresponding to the digital watermark;
  • the digital watermark after the identification process is converted into a binary format to generate a first character string in a binary format corresponding to the digital watermark.
  • the binary format is a binary format
  • the processed digital watermark is converted into a binary format to generate a first character string in a binary format corresponding to the digital watermark, that is, a binary 01 character string is generated.
  • Step S30 sequentially extracting each character in the first character string according to a preset order, and sequentially performing corresponding processing on the node corresponding to the extracted character in the file to be encrypted according to each extracted character. And generating an encrypted file corresponding to the file to be encrypted, where the file to be encrypted includes multiple nodes.
  • each character in the first character string is sequentially extracted in a preset order, for example, the first character string is sequentially extracted in order from a high order to a low order.
  • each character of the first character string can also be sequentially extracted in order from low to high. Since the file to be encrypted includes a plurality of nodes, the nodes corresponding to the extracted characters in the encrypted file are sequentially processed according to the characters extracted each time.
  • the first node in the encrypted file is processed correspondingly
  • the second node in the encrypted file is processed correspondingly
  • the extraction Each character of the encrypted file is processed correspondingly to the node corresponding to the character.
  • the step S30 includes:
  • Step a sequentially extracting each character in the first character string in a binary format according to a preset order
  • step b if the currently extracted character is a binary character 0, the node corresponding to the currently extracted character in the file to be encrypted is maintained unchanged;
  • step c if the currently extracted character is a binary character 1, a space character is added to the tail position of the node corresponding to the currently extracted character in the file to be encrypted.
  • the binary format is a binary format
  • performing binary format conversion on the digital watermark processed by the identifier generating a first character string in a binary format corresponding to the digital watermark, and then sequentially extracting the first character string in a binary format according to a preset order.
  • Each character that is, extracts binary characters 0 and binary characters 1. If the currently extracted character is a binary character 0, the node corresponding to the currently extracted character in the file to be encrypted is maintained unchanged; if the currently extracted character is a binary character 1, the file to be encrypted corresponds to the currently extracted character. Add a space character to the end of the node. According to this method, the node corresponding to the character in the encrypted file is processed correspondingly according to each character in the extracted first character string.
  • the digital watermark encryption method of the present invention will be described in detail below by taking the apk (AndroidPackage, Android installation package) file of the Android application as an example.
  • the user When the user needs to perform digital watermark encryption on the apk file of a certain Android application, the user first performs identification processing on the digital watermark, for example, adding the character "#" in the head position and the tail position of the digital watermark respectively. Then, the digital watermark with the identification character added is converted into a binary format, for example, a binary format conversion is performed on the digital watermark to which the identification character is added, and the first character string in the binary format, that is, the binary 01 string is generated.
  • identification processing for example, adding the character "#" in the head position and the tail position of the digital watermark respectively.
  • the digital watermark with the identification character added is converted into a binary format, for example, a binary format conversion is performed on the digital watermark to which the identification character is added, and the first character string in the binary format, that is, the binary 01 string is generated.
  • the unpacked apk file includes the AndroidManifest.xml file, the META-INF directory file, the res directory file, the lib directory file, the assets directory file, and the classes. Dex file, resources.arsc file.
  • the AndroidManifest.xml file must be defined and included in each Android application, it describes the name, version, permissions, referenced library files and so on information of the Android application; the signature information is stored under the META-INF directory file. Used to ensure the integrity of the apk package and system security; res directory file to store resource files, layout files, etc., where drawable storage resource files, layout, xml storage layout files; subdirectory armeabi under the lib directory file is stored So file; assets directory file stores some configuration files; classes.dex file is the compiled source code file of Java source code; resources.arsc file is the compiled resource file, in most cases, most of the words and statements that need to be finished In this file, we must first look at this file when we are finished.
  • the xml file Since the xml file has a huge redundant space, it is convenient to embed information such as a digital watermark. Therefore, after decompressing the apk file, the xml file under the res directory file is obtained.
  • the obtained xml file is a compiled binary file, that is, the xml file is in a binary format. Therefore, after obtaining the xml file, the xml file is first converted in decimal format to obtain the formatted decimal format. Xml file.
  • each character in the first character string is sequentially extracted in a preset order, that is, binary character 0 and binary character 1 are extracted. If the currently extracted character is a binary character 0, the item node corresponding to the currently extracted character in the decimal format xml file is maintained unchanged; if the currently extracted character is a binary character 1, the currently extracted character is in the decimal format xml file. Add a space character to the tail position of the item node corresponding to the character. According to this method, according to the extraction of each character in the first character string, the item node corresponding to each character in the decimal format xml file is processed correspondingly to generate an encrypted xml file.
  • the first character extracted is a binary character 1
  • a space character is added at the tail position of the first item node of the decimal format xml file; if the extracted second character is a binary character 0, the decimal is maintained.
  • the second item node of the format xml file is unchanged. According to this method, the item nodes corresponding to each character in the decimal format xml file are processed correspondingly according to each character extracted.
  • the encrypted xml file is converted into a binary format, and then the xml file converted by the binary format is compressed and packaged together with other AndroidManifest.xml files, META-INF directory files, resources.arsc files, etc. to generate encryption.
  • the apk file is signed.
  • the digital watermark in the first binary format is first added with a preset identification character, and then the digital watermark is converted into a binary format to generate a digital watermark corresponding to the digital watermark.
  • the first character string in the binary format, and then each character in the first character string is sequentially extracted according to a preset order, and according to the character extracted each time, the node corresponding to the extracted character in the encrypted file is sequentially executed.
  • the encrypted file corresponding to the file to be encrypted is generated. Therefore, the encryption process only processes the node to be encrypted, and the digital watermark is not directly embedded in the file to be encrypted, thereby avoiding the storage due to the embedded digital watermark. Space affects the use of files to be encrypted, thereby improving the reliability of digital watermark encryption.
  • a second embodiment of the digital watermark encryption method of the present invention is proposed based on the first embodiment.
  • the method further includes:
  • Step S40 sequentially extracting each node of the encrypted file, and determining a character in a binary format corresponding to each extracted node, and forming the determined character into a second character string in a binary format;
  • Step S50 performing a first-ary format conversion on the second character string to generate a third character string in a first-ary format, where the third character string includes a digital watermark carrying the identifier character;
  • Step S60 Search for the identifier character included in the third character string, and acquire the digital watermark according to the identifier character.
  • each node of the encrypted file is first extracted in turn, because the node in the encrypted file is the first character according to the binary format.
  • Each character in the string is processed accordingly, and therefore, based on the extracted node, the character in the binary format corresponding to the extracted node can be determined.
  • the determined characters in the binary format are composed of the second character string in the binary format, and the second character string includes the second binary format. a string.
  • the second character string in the binary format is converted into a first-order format to generate a third character string in the first-ary format.
  • the first character string is generated after the first-ary format conversion
  • the digital watermark carrying the identification character that is, the third character string contains the digital watermark carrying the identification character.
  • the identification character is found from the third character string. When the identification character is found, the digital watermark is obtained according to the identification character.
  • the generated third character string includes two identifier characters.
  • the step S60 includes:
  • Step d searching for two identifier characters included in the third string
  • Step e extract character information between two identifier characters, where the character information is the digital watermark.
  • the two identifier characters included in the third string are found, and then the character information between the two identifier characters is extracted, and the character information is the digital watermark for the file to be encrypted.
  • the digital watermark used in encryption that is, the digital watermark is extracted from the encrypted file.
  • the digital watermark encryption method in this embodiment will be described in detail below by taking the encrypted apk file as an example.
  • the user wants to extract the digital watermark from the encrypted apk file, first decompress the encrypted apk file to obtain the xml file under the decompressed res directory file. Since the xml file is in binary format, the xml file is converted in decimal format to generate a formatted converted decimal format xml file. Then, the item node in the decimal format xml file is sequentially extracted, and the binary character corresponding to the item node is determined according to the extracted item node. For example, it is determined whether there is a space character in the tail position of each item node extracted.
  • the determined character is composed into the second character string in the binary format.
  • the second character string is converted into a decimal format to generate a third character string in decimal
  • the third character character contains a digital watermark carrying the identification character.
  • the identification character is found from the third character string, and the digital watermark is obtained according to the identification character. For example, if a logo character is added to the head position and the tail position of the digital watermark in the process of digital watermark encryption on the apk file, two identifier characters are found in the third string, and the two identifiers are extracted.
  • the character information between the characters, which is the digital watermark used in the digital watermark encryption of the apk file, that is, the digital watermark is extracted from the encrypted apk file.
  • the solution provided by this embodiment when extracting the digital watermark corresponding to the encrypted file, firstly extract each node of the encrypted file, and determine the characters in the binary format corresponding to each extracted node, and form the determined characters. a second character string in a binary format, and then performing a first-ary format conversion on the second character string to generate a third character string in a first-ary format, where the third character string includes a number carrying the identifier character After the watermark is searched for from the third character string, the digital watermark is obtained according to the identifier character. Therefore, the solution of the embodiment not only realizes digital watermark encryption, but also implements digital watermark extraction of the encrypted file.
  • the invention provides a digital watermark encryption device.
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a digital watermark encryption apparatus according to the present invention.
  • the functional block diagram shown in FIG. 4 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art will surround the functional modules of the digital watermark encrypting apparatus shown in FIG.
  • the new functional modules can be easily supplemented; the names of the functional modules are custom names, which are only used to assist in understanding the various program functional blocks of the digital watermark encrypting device, and are not used to limit the technical solutions of the present invention.
  • the core is the function that each functional module of the defined name has to achieve.
  • the digital watermark encryption device includes:
  • the identifier module 10 is configured to add a digital watermark to the preset identifier character to perform identifier processing on the digital watermark, wherein the digital watermark is in a first binary format;
  • the digital watermarking technology embeds some identification information (ie, digital watermark) into a digital carrier (including multimedia, documents, software, etc.) or indirectly (modifies the structure of a specific area) without affecting the use value of the original carrier, and is not easy. Techniques that are detected and modified again, but can be identified and identified by the producer, are often used to protect information security or information hiding.
  • the encrypted file is encrypted by using a digital watermark, wherein the file to be encrypted includes multimedia, a document, software, and the like.
  • the identification module 10 performs the identification processing on the digital watermark, and adds the digital watermark to the preset identification character.
  • the identification character corresponding to the digital watermark is set to “#” in advance, and those skilled in the art can understand that the identifier can also be set. Characters are other characters and are not limited here.
  • the digital watermark is in a first-ary format, for example, the digital watermark is in a decimal format.
  • the identifier module 10 is specifically configured to:
  • the identification character is added at a head position and a tail position of the digital watermark.
  • the identification module 10 adds a preset identification character to the head position and the tail position of the digital watermark. For example, the identification module 10 adds the character "#" to the head position and the tail position of the digital watermark respectively. To identify the digital watermark.
  • the conversion module 20 is configured to perform the second binary format conversion on the digital watermark after the identifier processing, to generate a first character string in a binary format corresponding to the digital watermark;
  • the conversion module 20 After the identification module 10 performs the identification processing on the digital watermark, the conversion module 20 performs the binary conversion on the digital watermark after the identification process to generate the first character string in the binary format corresponding to the digital watermark. For example, if the binary format is a binary format, the conversion module 20 converts the processed digital watermark into a binary format to generate a first character string in a binary format corresponding to the digital watermark, that is, generates a binary 01 character string.
  • the processing module 30 is configured to sequentially extract each bit in the first character string according to a preset order, and sequentially perform corresponding processing on the node corresponding to the extracted character in the encrypted file according to each extracted character. And generating an encrypted file corresponding to the file to be encrypted, where the file to be encrypted includes multiple nodes.
  • the processing module 30 sequentially extracts each bit character in the first character string according to a preset order, for example, sequentially extracting the first character from the highest order to the low order. For each character of a string, it can be understood that each character of the first character string can also be sequentially extracted in order from low to high. Since the file to be encrypted includes a plurality of nodes, the processing module 30 sequentially performs corresponding processing on the nodes corresponding to the extracted characters in the encrypted file according to the characters extracted each time.
  • the processing module 30 performs corresponding processing on the first node in the encrypted file according to the extracted first character, and performs corresponding processing on the second node in the encrypted file according to the extracted second character, and the processing module 30 According to this method, the nodes corresponding to the characters in the encrypted file are processed correspondingly according to each character extracted. After the corresponding processing is performed on the node corresponding to each character in the encrypted file according to each character in the first character string, the encryption processing of the file to be encrypted is completed, and the encrypted file corresponding to the file to be encrypted is generated.
  • the processing module 30 includes:
  • the extracting unit 31 is configured to sequentially extract each bit in the first character string in a binary format according to a preset order
  • the processing unit 32 is configured to: if the currently extracted character is a binary character 0, maintain the node corresponding to the currently extracted character in the file to be encrypted unchanged; if the currently extracted character is a binary character 1 And adding a space character to the tail position of the node corresponding to the currently extracted character in the file to be encrypted.
  • the conversion module 20 performs binary format conversion on the digital watermark after the identification process, generates a first character string in a binary format corresponding to the digital watermark, and then the extracting unit 31 sequentially extracts the binary format according to a preset order.
  • Each character in the first string that is, extracts binary character 0 and binary character 1. If the currently extracted character is a binary character 0, the processing unit 32 maintains the node corresponding to the currently extracted character in the file to be encrypted unchanged; if the currently extracted character is the binary character 1, the processing unit 32 is in the file to be encrypted. A space character is added to the tail position of the node corresponding to the currently extracted character. In this manner, the processing unit 32 sequentially processes the node corresponding to the character in the file to be encrypted according to each bit character in the extracted first character string.
  • the identifier module 10 when digital watermark encryption is to be performed on the encrypted file, the identifier module 10 first adds the digital watermark in the first format to the preset identifier character, and then the conversion module 20 performs the binary format conversion on the digital watermark. And generating a first character string in a binary format corresponding to the digital watermark, and then the processing module 30 sequentially extracts each bit character in the first character string according to a preset order, and sequentially processes the encrypted file according to each extracted character.
  • the node corresponding to the extracted character performs corresponding processing, and the encrypted file corresponding to the file to be encrypted is generated after the processing is completed. Therefore, the encryption process only processes the node to be encrypted, and does not directly embed the digital watermark into the file to be encrypted.
  • the problem that the embedded digital watermark occupies the storage space and affects the use of the file to be encrypted is avoided, thereby improving the reliability of the digital watermark encryption.
  • the processing module 30 is further configured to:
  • the conversion module 20 is further configured to:
  • the digital watermark encryption device further includes:
  • the obtaining module 40 is configured to search for the identifier character included in the third character string, and obtain the digital watermark according to the identifier character.
  • the processing module 30 first extracts each node of the encrypted file, because the node in the encrypted file is according to the binary format.
  • Each character in the first character string is processed accordingly, and therefore, based on the extracted node, the character in the binary format corresponding to the extracted node can be determined.
  • the determined characters in the binary format are composed of the second character string in the binary format, and the second character string includes the second binary format. a string.
  • the conversion module 20 performs a first-ary format conversion on the second character string in the binary format to generate a third character string in the first-ary format.
  • the first character string is generated after the first-ary format conversion
  • the digital watermark carrying the identification character that is, the third character string contains the digital watermark carrying the identification character.
  • the obtaining module 40 searches for the identifier character from the third character string. When the identifier character is found, the digital watermark is obtained according to the identifier character.
  • the generated third character string includes two identification characters.
  • the obtaining module 40 includes:
  • the searching unit 41 is configured to search for the two identifier characters included in the third character string;
  • the obtaining unit 42 is configured to extract character information between two identifier characters, where the character information is the digital watermark.
  • the search unit 41 searches for the two identifier characters included in the third character string, and then the obtaining unit 42 extracts the character information between the two identifier characters, and the character information is to be
  • the digital watermark used by the encrypted file in the digital watermark encryption, that is, the digital watermark is extracted from the encrypted file.
  • the processing module 30 when extracting the digital watermark corresponding to the encrypted file, the processing module 30 first extracts each node of the encrypted file, and determines the character in the binary format corresponding to each extracted node, and determines The character is composed of the second character string in the binary format, and then the conversion module 20 performs the first-ary format conversion on the second character string to generate a third character string in the first binary format, and the third character string includes The digital watermark carrying the identifier character, the obtaining module 40 obtains the identifier character from the third character string, and obtains the digital watermark according to the identifier character. Therefore, the solution of the embodiment not only realizes the digital watermark encryption, but also implements the encryption. Digital watermark extraction of files.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)
  • Storage Device Security (AREA)

Abstract

一种数字水印加密方法,所述数字水印加密方法包括以下步骤:将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式(S10);将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串(S20);按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点(S30)。还公开了一种数字水印加密装置,提高了数字水印加密的可靠性。

Description

数字水印加密方法及装置
技术领域
本发明涉及数字水印技术领域,尤其涉及一种数字水印加密方法及装置。
背景技术
数字水印技术是将一些标识信息(即数字水印)嵌入数字载体(包括多媒体、文档、软件等)当中的技术,常用于保护信息安全或者信息隐藏,因此得到广泛应用。在对数字载体进行数字水印加密时,一般是将数字水印直接嵌入到数字载体当中,这会占用数字载体的一定存储空间,而当数字载体的可用存储空间不足时,嵌入数字水印会影响数字载体的正常使用,因此,数字水印加密的可靠性并非很高。
发明内容
本发明的主要目的在于提出一种数字水印加密方法及装置,旨在解决现有数字水印加密的可靠性不高的技术问题。
为实现上述目的,本发明提供的一种数字水印加密方法,所述数字水印加密方法包括以下步骤:
将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点;
依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
优选地,所述查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印的步骤包括:
查找所述第三字符串中包含的两个所述标识字符;
提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
此外,为实现上述目的,本发明还提出一种数字水印加密方法,所述数字水印加密方法包括以下步骤:
将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点。
优选地,所述将数字水印添加预设的标识字符的步骤包括:
在所述数字水印的头部位置和尾部位置添加所述标识字符。
优选地,当所述第二进制格式为二进制格式时,所述按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理的步骤包括:
按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;
若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
优选地,所述依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件的步骤之后,还包括:
依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
优选地,所述查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印的步骤包括:
查找所述第三字符串中包含的两个所述标识字符;
提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
此外,为实现上述目的,本发明还提出一种数字水印加密装置,所述数字水印加密装置包括:
标识模块,用于将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
转换模块,用于将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
处理模块,用于按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点。
优选地,所述标识模块用于:
在所述数字水印的头部位置和尾部位置添加所述标识字符。
优选地,当所述第二进制格式为二进制格式时,所述处理模块包括:
提取单元,用于按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
处理单元,用于若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
优选地,所述处理模块,还用于依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
所述转换模块,还用于对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
所述数字水印加密装置还包括:
获取模块,用于查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
优选地,所述获取模块包括:
查找单元,用于查找所述第三字符串中包含的两个所述标识字符;
获取单元,用于提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
本发明提出的数字水印加密方法和装置,当要对待加密文件进行数字水印加密时,首先将第一进制格式的数字水印添加预设的标识字符,然后对数字水印进行第二进制格式转换,生成数字水印对应的第二进制格式的第一字符串,之后按照预设顺序依次提取第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的字符所对应的节点执行相应处理,处理完成后生成该待加密文件对应的加密文件,因此,加密过程只是对待加密文件的节点进行处理,而并没有将数字水印直接嵌入到待加密文件中,避免了由于嵌入数字水印占用存储空间而影响待加密文件使用的问题,从而提高了数字水印加密的可靠性。
附图说明
图1为本发明数字水印加密方法第一实施例的流程示意图;
图2为本发明数字水印加密方法第二实施例的流程示意图;
图3为本发明数字水印加密装置第一实施例的功能模块示意图;
图4为本发明数字水印加密装置第一实施例中处理模块的细化功能模块示意图
图5为本发明数字水印加密装置第二实施例的功能模块示意图;
图6为本发明数字水印加密装置第二实施例中获取模块的细化功能模块示意图。
本发明目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明提供一种数字水印加密方法,参照图1,图1为本发明数字水印加密方法第一实施例的流程示意图。
在该实施例中,所述数字水印加密方法包括以下步骤:
步骤S10,将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
数字水印技术是将一些标识信息(即数字水印)嵌入数字载体当中(包括多媒体、文档、软件等)或是间接表示(修改特定区域的结构),且不影响原载体的使用价值,也不容易被探知和再次修改,但可以被生产方识别和辨认的技术,常用于保护信息安全或者信息隐藏。本实施例中,采用数字水印对待加密文件进行加密处理,其中,该待加密文件包括多媒体、文档、软件等等。
首先,对数字水印进行标识处理,将数字水印添加预设的标识字符,比如,预先设置数字水印对应的标识字符为“#”,本领域技术人员可以理解的是,也可以设置标识字符为其他字符,在此不作限制。其中,数字水印为第一进制格式,比如,数字水印为十进制格式。
可选地,所述步骤S10包括:
在所述数字水印的头部位置和尾部位置添加所述标识字符。
当对数字水印进行标识处理时,在数字水印的头部位置和尾部位置添加预设的标识字符,比如,在数字水印的头部位置和尾部位置分别添加字符“#”,以对数字水印进行标识处理。
步骤S20,将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
当对数字水印进行标识处理之后,将标识处理后的数字水印进行第二进制格式转换,生成该数字水印对应的第二进制格式的第一字符串。比如,若第二进制格式为二进制格式,则将标识处理后的数字水印进行二进制格式转换,生成该数字水印对应的二进制格式的第一字符串,也即生成二进制01字符串。
步骤S30,按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对所述待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点。
本实施例中,当生成第二进制格式的第一字符串之后,按照预设顺序依次提取该第一字符串中的每一位字符,比如按照从高位到低位的顺序依次提取该第一字符串的每一位字符,可以理解的是,也可以按照从低位到高位的顺序依次提取该第一字符串的每一位字符。由于待加密文件包含多个节点,根据每次提取的字符,依次对待加密文件中与提取的字符对应的节点执行相应处理。比如,根据提取的第一位字符,对待加密文件中的第一个节点进行相应处理,根据提取的第二位字符,对待加密文件中的第二个节点进行相应处理,按照此方式依次根据提取的每一位字符,对待加密文件中与该字符对应的节点进行相应处理。当根据第一字符串中的每位字符对待加密文件中与每位字符对应的节点进行相应处理完成之后,也即完成对待加密文件的加密处理,生成该待加密文件对应的加密文件。
可选地,在第二进制格式为二进制格式时,所述步骤S30包括:
步骤a,按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
步骤b,若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;
步骤c,若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
在第二进制格式为二进制格式时,对标识处理后的数字水印进行二进制格式转换,生成该数字水印对应的二进制格式的第一字符串,然后按照预设顺序依次提取二进制格式的第一字符串中的每一位字符,也即提取二进制字符0和二进制字符1。若当前提取的字符为二进制字符0,则维持待加密文件中与当前提取的字符对应的节点不变;若当前提取的字符为二进制字符1,则在待加密文件中与当前提取的字符对应的节点的尾部位置添加一位空格字符。按照此方式依次根据提取的第一字符串中的每一位字符,对待加密文件中与该字符对应的节点进行相应处理。
下面以安卓应用的apk(AndroidPackage,安卓安装包)文件为例,对本发明数字水印加密方法进行详细说明。
当用户需要对某一款安卓应用的apk文件进行数字水印加密时,用户首先对数字水印进行标识处理,比如在数字水印的头部位置和尾部位置分别添加字符“#”。然后对添加了标识字符的数字水印进行进制格式转换,比如对添加了标识字符的数字水印进行二进制格式转换,生成二进制格式的第一字符串,也即二进制01字符串。
由于apk文件是一个zip压缩包,因此,要对该apk文件进行解压,解压后的apk文件包括AndroidManifest.xml文件、META-INF目录文件、res目录文件、lib目录文件、assets目录文件、classes.dex文件、resources.arsc文件。
其中,AndroidManifest.xml文件是每个安卓应用都必须定义和包含的,它描述了安卓应用的名字、版本、权限、引用的库文件等等信息;META-INF目录文件下存放的是签名信息,用来保证apk包的完整性和系统的安全;res目录文件存放资源文件、布局文件等,其中,drawable存放资源文件,layout、xml存放布局文件;lib目录文件下的子目录armeabi存放的是一些so文件;assets目录文件存放一些配置文件;classes.dex文件是Java源码编译后的代码文件;resources.arsc文件是编译后的资源文件,大多数情况下,需要汉化的单词、语句绝大多数都在这个文件里,汉化的时候首先就要看这个文件。
由于xml文件有巨大的冗余空间,便于嵌入数字水印等信息,因此,在对apk文件解压后,获取res目录文件下的xml文件。获取的该xml文件是经过编译生成的二进制文件,也即该xml文件为二进制格式,因此,在获取到该xml文件后,先对该xml文件进行十进制格式转换,获取到格式转换后的十进制格式xml文件。
之后,按照预设顺序依次提取第一字符串中的每一位字符,也即提取二进制字符0和二进制字符1。若当前提取的字符为二进制字符0,则维持十进制格式xml文件中与当前提取的字符对应的item节点不变;若当前提取的字符为二进制字符1,则在十进制格式xml文件中与当前提取的字符对应的item节点的尾部位置添加一位空格字符。按照此方式依次根据提取第一字符串中的每一位字符,对十进制格式xml文件中与每一位字符对应的item节点进行相应处理,生成加密后的xml文件。
例如,若提取的第一位字符为二进制字符1,则在十进制格式xml文件的第一个item节点的尾部位置添加一位空格字符;若提取的第二位字符为二进制字符0,则维持十进制格式xml文件的第二个item节点不变。按照此方式依次根据提取的每一位字符,对十进制格式xml文件中与每一位字符对应的item节点进行相应处理。
加密完成之后,将加密后的xml文件进行二进制格式转换,然后将二进制格式转换后的xml文件与其他AndroidManifest.xml文件、META-INF目录文件、resources.arsc文件等各个文件一起压缩打包,生成加密后的apk文件。进一步地,由于有些apk文件需要通过签名进行校验,因此,在生成加密apk文件之后,对该加密apk文件进行签名处理。
本实施例提供的方案,当要对待加密文件进行数字水印加密时,首先将第一进制格式的数字水印添加预设的标识字符,然后对数字水印进行第二进制格式转换,生成数字水印对应的第二进制格式的第一字符串,之后按照预设顺序依次提取第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的字符所对应的节点执行相应处理,处理完成后生成该待加密文件对应的加密文件,因此,加密过程只是对待加密文件的节点进行处理,而并没有将数字水印直接嵌入到待加密文件中,避免了由于嵌入数字水印占用存储空间而影响待加密文件使用的问题,从而提高了数字水印加密的可靠性。
进一步地,如图2所示,基于第一实施例提出本发明数字水印加密方法第二实施例,在本实施例中,所述步骤S30之后,还包括:
步骤S40,依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
步骤S50,对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
步骤S60,查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
在本实施例中,要提取第一实施例中生成的加密文件所对应的数字水印时,首先依次提取该加密文件的每一个节点,由于加密文件中的节点是根据第二进制格式的第一字符串中的每一位字符进行相应处理过的,因此,根据提取的节点,可确定与提取的该节点对应的第二进制格式的字符。在依次确定出与提取的每一个节点对应的第二进制格式的字符之后,将确定的第二进制格式的字符组成第二进制格式的第二字符串,该第二字符串中包含了第二进制格式的第一字符串。
之后,对第二进制格式的该第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串。在对第二字符串进行第一进制格式转换时,也即对第二进制格式的第一字符串进行了第一进制格式转换,而第一字符串进行第一进制格式转换之后会生成携带有标识字符的数字水印,也即第三字符串中包含了携带有标识字符的数字水印。从该第三字符串中查找出该标识字符,当查找到该标识字符时,根据该标识字符,获取到数字水印。
可选地,若在对待加密文件进行数字水印加密的过程中,在数字水印的头部位置和尾部位置添加了标识字符,则生成的第三字符串中包含有两个标识字符。此时,所述步骤S60包括:
步骤d,查找所述第三字符串中包含的两个所述标识字符;
步骤e,提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
当生成第三字符串后,从第三字符串中查找出其包含的两个标识字符,然后提取出该两个标识字符之间的字符信息,该字符信息即为待加密文件在进行数字水印加密时所采用的数字水印,也即实现了从加密文件中提取出数字水印。
下面以加密apk文件为例,对本实施例中的数字水印加密方法进行详细说明。
当用户要从加密apk文件中提取出数字水印时,首先对该加密apk文件进行解压,获取解压后的res目录文件下的xml文件。由于该xml文件是二进制格式的,因此,对该xml文件进行十进制格式转换,生成格式转换后的十进制格式xml文件。然后依次提取十进制格式xml文件中的item节点,并根据提取的item节点,确定与该item节点对应的二进制字符。例如,判断提取的每一个item节点的尾部位置是否有一位空格字符,当item节点的尾部位置有一位空格字符时,确定该item节点对应二进制字符1;当item节点的尾部位置没有空格字符时,确定该item节点对应二进制字符0。在确定每一个item节点对应的二进制字符之后,将确定的字符组成第二进制格式的第二字符串。
然后,将该第二字符串进行十进制格式转换,生成十进制的第三字符串,该第三字符中包含了携带标识字符的数字水印。从该第三字符串中查找出标识字符,并根据标识字符获取数字水印。比如,若在对apk文件进行数字水印加密的过程中,在数字水印的头部位置和尾部位置添加了标识字符,则在第三字符串中查找出两个标识字符,提取出该两个标识字符之间的字符信息,该字符信息就是在对apk文件进行数字水印加密时所采用的数字水印,也即完成了从加密apk文件中提取出数字水印。
本实施例提供的方案,要提取加密文件所对应的数字水印时,首先依次提取该加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串,然后对该第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,该第三字符串中就包含携带有标识字符的数字水印,从第三字符串中查找出标识字符后,根据标识字符获取到数字水印,因此,本实施例的方案不仅实现了数字水印加密,而且还实现了加密文件的数字水印提取。
本发明提供一种数字水印加密装置。
参照图3,图3为本发明数字水印加密装置第一实施例的功能模块示意图。
需要强调的是,对本领域的技术人员来说,图4所示功能模块图仅仅是一个较佳实施例的示例图,本领域的技术人员围绕图4所示的数字水印加密装置的功能模块,可轻易进行新的功能模块的补充;各功能模块的名称是自定义名称,仅用于辅助理解该数字水印加密装置的各个程序功能块,不用于限定本发明的技术方案,本发明技术方案的核心是,各自定义名称的功能模块所要达成的功能。
在本实施例中,所述数字水印加密装置包括:
标识模块10,用于将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
数字水印技术是将一些标识信息(即数字水印)嵌入数字载体当中(包括多媒体、文档、软件等)或是间接表示(修改特定区域的结构),且不影响原载体的使用价值,也不容易被探知和再次修改,但可以被生产方识别和辨认的技术,常用于保护信息安全或者信息隐藏。本实施例中,采用数字水印对待加密文件进行加密处理,其中,该待加密文件包括多媒体、文档、软件等等。
首先,标识模块10对数字水印进行标识处理,将数字水印添加预设的标识字符,比如,预先设置数字水印对应的标识字符为“#”,本领域技术人员可以理解的是,也可以设置标识字符为其他字符,在此不作限制。其中,数字水印为第一进制格式,比如,数字水印为十进制格式。
可选地,所述标识模块10具体用于:
在所述数字水印的头部位置和尾部位置添加所述标识字符。
当对数字水印进行标识处理时,标识模块10在数字水印的头部位置和尾部位置添加预设的标识字符,比如,标识模块10在数字水印的头部位置和尾部位置分别添加字符“#”,以对数字水印进行标识处理。
转换模块20,用于将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
当标识模块10对数字水印进行标识处理之后,转换模块20将标识处理后的数字水印进行第二进制格式转换,生成该数字水印对应的第二进制格式的第一字符串。比如,若第二进制格式为二进制格式,则转换模块20将标识处理后的数字水印进行二进制格式转换,生成该数字水印对应的二进制格式的第一字符串,也即生成二进制01字符串。
处理模块30,用于按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点。
本实施例中,当生成第二进制格式的第一字符串之后,处理模块30按照预设顺序依次提取该第一字符串中的每一位字符,比如按照从高位到低位的顺序依次提取该第一字符串的每一位字符,可以理解的是,也可以按照从低位到高位的顺序依次提取该第一字符串的每一位字符。由于待加密文件包含多个节点,根据每次提取的字符,处理模块30依次对待加密文件中与提取的字符对应的节点执行相应处理。比如,处理模块30根据提取的第一位字符,对待加密文件中的第一个节点进行相应处理,根据提取的第二位字符,对待加密文件中的第二个节点进行相应处理,处理模块30按照此方式依次根据提取的每一位字符,对待加密文件中与该字符对应的节点进行相应处理。当根据第一字符串中的每位字符对待加密文件中与每位字符对应的节点进行相应处理完成之后,也即完成对待加密文件的加密处理,生成该待加密文件对应的加密文件。
可选地,如图4所示,在第二进制格式为二进制格式时,所述处理模块30包括:
提取单元31,用于按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
处理单元32,用于若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
在第二进制格式为二进制格式时,转换模块20对标识处理后的数字水印进行二进制格式转换,生成该数字水印对应的二进制格式的第一字符串,然后提取单元31按照预设顺序依次提取二进制格式的第一字符串中的每一位字符,也即提取二进制字符0和二进制字符1。若当前提取的字符为二进制字符0,则处理单元32维持待加密文件中与当前提取的字符对应的节点不变;若当前提取的字符为二进制字符1,则处理单元32在待加密文件中与当前提取的字符对应的节点的尾部位置添加一位空格字符。处理单元32按照此方式依次根据提取的第一字符串中的每一位字符,对待加密文件中与该字符对应的节点进行相应处理。
本实施例提供的方案,当要对待加密文件进行数字水印加密时,首先标识模块10将第一进制格式的数字水印添加预设的标识字符,然后转换模块20对数字水印进行第二进制格式转换,生成数字水印对应的第二进制格式的第一字符串,之后处理模块30按照预设顺序依次提取第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的字符所对应的节点执行相应处理,处理完成后生成该待加密文件对应的加密文件,因此,加密过程只是对待加密文件的节点进行处理,而并没有将数字水印直接嵌入到待加密文件中,避免了由于嵌入数字水印占用存储空间而影响待加密文件使用的问题,从而提高了数字水印加密的可靠性。
进一步地,如图5所示,基于第一实施例提出本发明数字水印加密装置第二实施例,在本实施例中,所述处理模块30还用于:
依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
所述转换模块20还用于:
对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
所述数字水印加密装置还包括:
获取模块40,用于查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
在本实施例中,要提取第一实施例中生成的加密文件所对应的数字水印时,首先处理模块30依次提取该加密文件的每一个节点,由于加密文件中的节点是根据第二进制格式的第一字符串中的每一位字符进行相应处理过的,因此,根据提取的节点,可确定与提取的该节点对应的第二进制格式的字符。在依次确定出与提取的每一个节点对应的第二进制格式的字符之后,将确定的第二进制格式的字符组成第二进制格式的第二字符串,该第二字符串中包含了第二进制格式的第一字符串。
之后,转换模块20对第二进制格式的该第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串。在对第二字符串进行第一进制格式转换时,也即对第二进制格式的第一字符串进行了第一进制格式转换,而第一字符串进行第一进制格式转换之后会生成携带有标识字符的数字水印,也即第三字符串中包含了携带有标识字符的数字水印。获取模块40从该第三字符串中查找出该标识字符,当查找到该标识字符时,根据该标识字符,获取到数字水印。
可选地,若在对待加密文件进行数字水印加密的过程中,标识模块10在数字水印的头部位置和尾部位置添加了标识字符,则生成的第三字符串中包含有两个标识字符。此时,如图6所示,所述获取模块40包括:
查找单元41,用于查找所述第三字符串中包含的两个所述标识字符;
获取单元42,用于提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
当生成第三字符串后,查找单元41从第三字符串中查找出其包含的两个标识字符,然后获取单元42提取出该两个标识字符之间的字符信息,该字符信息即为待加密文件在进行数字水印加密时所采用的数字水印,也即实现了从加密文件中提取出数字水印。
本实施例提供的方案,要提取加密文件所对应的数字水印时,首先处理模块30依次提取该加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串,然后转换模块20对该第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,该第三字符串中就包含携带有标识字符的数字水印,获取模块40从第三字符串中查找出标识字符后,根据标识字符获取到数字水印,因此,本实施例的方案不仅实现了数字水印加密,而且还实现了加密文件的数字水印提取。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (18)

  1. 一种数字水印加密方法,其特征在于,所述数字水印加密方法包括步骤:
    将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
    将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
    按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点;
    依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
    对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
    查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
  2. 如权利要求1所述的数字水印加密方法,其特征在于,所述查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印的步骤包括:
    查找所述第三字符串中包含的两个所述标识字符;
    提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
  3. 一种数字水印加密方法,其特征在于,所述数字水印加密方法包括步骤:
    将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
    将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
    按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点。
  4. 如权利要求3所述的数字水印加密方法,其特征在于,当所述第二进制格式为二进制格式时,所述按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理的步骤包括:
    按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
    若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;
    若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
  5. 如权利要求4所述的数字水印加密方法,其特征在于,所述依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件的步骤之后,还包括:
    依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
    对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
    查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
  6. 如权利要求3所述的数字水印加密方法,其特征在于,所述将数字水印添加预设的标识字符的步骤包括:
    在所述数字水印的头部位置和尾部位置添加所述标识字符。
  7. 如权利要求6所述的数字水印加密方法,其特征在于,所述依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件的步骤之后,还包括:
    依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
    对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
    查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
  8. 如权利要求6所述的数字水印加密方法,其特征在于,当所述第二进制格式为二进制格式时,所述按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理的步骤包括:
    按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
    若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;
    若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
  9. 如权利要求8所述的数字水印加密方法,其特征在于,所述依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件的步骤之后,还包括:
    依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
    对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
    查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
  10. 如权利要求9所述的数字水印加密方法,其特征在于,所述查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印的步骤包括:
    查找所述第三字符串中包含的两个所述标识字符;
    提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
  11. 一种数字水印加密装置,其特征在于,所述数字水印加密装置包括:
    标识模块,用于将数字水印添加预设的标识字符,以对所述数字水印进行标识处理,其中,所述数字水印为第一进制格式;
    转换模块,用于将标识处理后的所述数字水印进行第二进制格式转换,生成所述数字水印对应的第二进制格式的第一字符串;
    处理模块,用于按照预设顺序依次提取所述第一字符串中的每一位字符,并根据每次提取的字符,依次对待加密文件中与提取的所述字符对应的节点执行相应处理,生成所述待加密文件对应的加密文件,其中,所述待加密文件包括多个节点。
  12. 如权利要求11所述的数字水印加密装置,其特征在于,当所述第二进制格式为二进制格式时,所述处理模块包括:
    提取单元,用于按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
    处理单元,用于若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
  13. 如权利要求12所述的数字水印加密装置,其特征在于,所述处理模块,还用于依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
    所述转换模块,还用于对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
    所述数字水印加密装置还包括:
    获取模块,用于查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
  14. 如权利要求11所述的数字水印加密装置,其特征在于,所述标识模块用于:
    在所述数字水印的头部位置和尾部位置添加所述标识字符。
  15. 如权利要求14所述的数字水印加密装置,其特征在于,所述处理模块,还用于依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
    所述转换模块,还用于对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
    所述数字水印加密装置还包括:
    获取模块,用于查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
  16. 如权利要求14所述的数字水印加密装置,其特征在于,当所述第二进制格式为二进制格式时,所述处理模块包括:
    提取单元,用于按照预设顺序依次提取二进制格式的所述第一字符串中的每一位字符;
    处理单元,用于若当前提取的所述字符为二进制字符0,则维持所述待加密文件中与当前提取的所述字符对应的节点不变;若当前提取的所述字符为二进制字符1,则在所述待加密文件中与当前提取的所述字符对应的节点的尾部位置添加一位空格字符。
  17. 如权利要求16所述的数字水印加密装置,其特征在于,所述处理模块,还用于依次提取所述加密文件的每一个节点,并确定与提取的每一个节点对应的第二进制格式的字符,将确定的字符组成第二进制格式的第二字符串;
    所述转换模块,还用于对所述第二字符串进行第一进制格式转换,生成第一进制格式的第三字符串,所述第三字符串中包含携带有所述标识字符的数字水印;
    所述数字水印加密装置还包括:
    获取模块,用于查找所述第三字符串中包含的所述标识字符,并根据所述标识字符获取所述数字水印。
  18. 如权利要求17所述的数字水印加密装置,其特征在于,所述获取模块包括:
    查找单元,用于查找所述第三字符串中包含的两个所述标识字符;
    获取单元,用于提取两个所述标识字符之间的字符信息,所述字符信息为所述数字水印。
PCT/CN2016/112858 2016-11-30 2016-12-29 数字水印加密方法及装置 Ceased WO2018098879A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611095829.X 2016-11-30
CN201611095829.XA CN106780280B (zh) 2016-11-30 2016-11-30 数字水印加密方法及装置

Publications (1)

Publication Number Publication Date
WO2018098879A1 true WO2018098879A1 (zh) 2018-06-07

Family

ID=58884131

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/112858 Ceased WO2018098879A1 (zh) 2016-11-30 2016-12-29 数字水印加密方法及装置

Country Status (2)

Country Link
CN (1) CN106780280B (zh)
WO (1) WO2018098879A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559497A (zh) * 2020-12-25 2021-03-26 北京百度网讯科技有限公司 一种数据处理方法、一种信息传输方法、装置及电子设备
CN114637972A (zh) * 2022-03-31 2022-06-17 合肥高维数据技术有限公司 基于docx格式文档的水印嵌入和提取方法
CN118094608A (zh) * 2024-04-29 2024-05-28 山东水文印务有限公司 水文数据管理方法
CN119089413A (zh) * 2024-08-09 2024-12-06 福建天晴在线互动科技有限公司 一种区块连接库的引用水印设置方法及系统

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400670B (zh) * 2020-03-06 2023-12-15 全球能源互联网研究院有限公司 一种水印添加方法、装置、设备及存储介质
CN117034220B (zh) * 2023-10-10 2024-01-05 北京安华金和科技有限公司 一种数字水印处理方法和系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751656A (zh) * 2008-12-22 2010-06-23 北京大学 一种水印嵌入和提取方法及装置
US20110243374A1 (en) * 2010-04-02 2011-10-06 Ying-Jieh Huang Method of embedding information in input image, method of extracting information from input image, and related apparatus
CN103873954A (zh) * 2012-12-13 2014-06-18 航天信息股份有限公司 将不见数字水印嵌入到流媒体的方法、装置和系统
CN104134023A (zh) * 2014-08-15 2014-11-05 北京邮电大学 一种水印处理方法和水印处理系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751656A (zh) * 2008-12-22 2010-06-23 北京大学 一种水印嵌入和提取方法及装置
US20110243374A1 (en) * 2010-04-02 2011-10-06 Ying-Jieh Huang Method of embedding information in input image, method of extracting information from input image, and related apparatus
CN103873954A (zh) * 2012-12-13 2014-06-18 航天信息股份有限公司 将不见数字水印嵌入到流媒体的方法、装置和系统
CN104134023A (zh) * 2014-08-15 2014-11-05 北京邮电大学 一种水印处理方法和水印处理系统

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559497A (zh) * 2020-12-25 2021-03-26 北京百度网讯科技有限公司 一种数据处理方法、一种信息传输方法、装置及电子设备
CN112559497B (zh) * 2020-12-25 2023-06-23 北京百度网讯科技有限公司 一种数据处理方法、一种信息传输方法、装置及电子设备
CN114637972A (zh) * 2022-03-31 2022-06-17 合肥高维数据技术有限公司 基于docx格式文档的水印嵌入和提取方法
CN118094608A (zh) * 2024-04-29 2024-05-28 山东水文印务有限公司 水文数据管理方法
CN119089413A (zh) * 2024-08-09 2024-12-06 福建天晴在线互动科技有限公司 一种区块连接库的引用水印设置方法及系统

Also Published As

Publication number Publication date
CN106780280A (zh) 2017-05-31
CN106780280B (zh) 2019-02-01

Similar Documents

Publication Publication Date Title
WO2018098879A1 (zh) 数字水印加密方法及装置
WO2019104876A1 (zh) 保险产品的推送方法、系统、终端、客户终端及存储介质
WO2019165691A1 (zh) 自动生成测试案例的方法、装置、设备及可读存储介质
WO2015172684A1 (en) Ap connection method, terminal, and server
WO2019100638A1 (zh) 数据同步方法、装置、设备及存储介质
WO2019169814A1 (zh) 自动生成中文注释的方法、装置、设备及存储介质
WO2019024219A1 (zh) 文档自动生成方法、装置、文档自动生成器及介质
WO2018107610A1 (zh) 业务数据处理方法、系统、设备及计算机可读存储介质
WO2019037396A1 (zh) 账户清结算方法、装置、设备及存储介质
WO2016192270A1 (zh) 媒体文件的快速启播方法及装置
WO2018120429A1 (zh) 一种资源更新的方法、终端、计算机可读存储介质及资源更新设备
WO2018006489A1 (zh) 终端的语音交互方法及装置
WO2017148112A1 (zh) 一种指纹录入方法及终端
WO2018188196A1 (zh) 一种数据版本控制方法、数据版本控制器、设备及计算机可读存储介质
WO2015196960A1 (en) Method and system for checking security of url for mobile terminal
WO2019033904A1 (zh) 登录验证方法、系统及计算机可读存储介质
WO2019075973A1 (zh) 应用程序的测试方法及装置
WO2016000560A1 (en) File transmission method, file transmission apparatus, and file transmission system
WO2016032021A1 (ko) 음성 명령 인식을 위한 장치 및 방법
WO2018188342A1 (zh) 脚本文件生成方法、装置、设备和计算机可读存储介质
WO2017041538A1 (zh) 终端用户界面的受控显示方法及装置
WO2015144089A1 (en) Application recommending method and apparatus
WO2019041832A1 (zh) 修改源数据库表结构的方法、服务器、系统及存储介质
WO2017036208A1 (zh) 显示界面中的信息提取方法及系统
WO2017071352A1 (zh) 密码的推送方法、推送系统及终端设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16922851

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18.10.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16922851

Country of ref document: EP

Kind code of ref document: A1