Digital text dark watermark embedding and extracting method and device, equipment and medium
By converting text into a set of dotted lines of the Morse password and inserting zero-width characters, the problem of poor robustness of existing text watermarks during copy-paste and conversion is solved, and efficient memory usage and embedding efficiency is achieved.
Patent Information
- Application Number
- CN202411554481.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-25
AI Technical Summary
Existing text dark watermarks are poorly robust during copy-paste and text conversion, and occupy a lot of memory space, affecting embedding efficiency.
By converting the bytes to be embedded into the dotted and line set of the Morse password and converting it into zero-width characters according to the zero-width mapping relationship, a zero-width character string is formed and inserted into the target carrier text.
The text conversion process does not occupy a lot of memory space, which improves the robustness and embedding efficiency of dark watermarks, ensuring that dark watermarks are not easily damaged during text editing and formatting.
Smart Images

Figure CN119513837A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical fields of text watermark and information hiding, and in particular to a method, device, equipment and medium for embedding and extracting a dark watermark of a digital text. Background Art
[0002] Digital watermarking is a technology that embeds hidden information in digital media files. It embeds some identification information directly into digital carriers such as multimedia, documents, and software, but it does not affect the use value of the original carrier and is not easily noticed by people's visual or auditory systems.
[0003] Digital watermarks can be divided into visible watermarks and dark watermarks from a perceptual point of view. Common visible watermarks include: the producer's logo on a video, the name of the person printed on the background of the application software, etc.; examples of dark watermarks include: the owner information stored in the pixels of the picture, the copyright information stored in the video through discrete cosine transform, etc. Text is the main carrier of sensitive assets and data in the Internet scenario, so text watermarks are the most widely used.
[0004] Existing text dark watermarks include inserting specific identifiers or identification codes into the original text, using uncommon Unicode characters in the text, or setting specific words or phrases to italics, bold or underline. These technologies result in the embedded watermark being damaged after copying and pasting the embedded text, and the embedded watermark has poor robustness and occupies a large amount of memory space during the text conversion process. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, equipment and medium for embedding and extracting a dark watermark of a digital text, which can achieve the effect of not occupying a large amount of memory space during the conversion process of the dark watermark content and improving the efficiency of embedding the dark watermark.
[0006] In a first aspect, an embodiment of the present invention provides a method for embedding a dark watermark of a digital text, comprising:
[0007] Convert the bytes of the text to be embedded into a set of dots and lines in Morse code;
[0008] Converting the points and lines in the point and line set into zero-width characters respectively according to the zero-width mapping relationship;
[0009] Inserting a set zero-width character corresponding to the space character after one or more zero-width characters according to a preset rule to form a zero-width character string;
[0010] The zero-width string is inserted into the target carrier text.
[0011] In a second aspect, an embodiment of the present invention provides a method for extracting a dark watermark of a digital text, comprising:
[0012] Traverse the characters of the target carrier text to read zero-width characters;
[0013] Remove the set zero-width characters corresponding to the space characters from the read zero-width characters, and form a zero-width string;
[0014] Convert each zero-width character of the zero-width character string into a point and a line according to a zero-width mapping relationship to form a point and line set;
[0015] The point and line set is converted into a byte stream representing the embedded text.
[0016] In a third aspect, an embodiment of the present invention provides a device for embedding a dark watermark of a digital text, comprising:
[0017] A first point-line conversion module, used for converting bytes of the text to be embedded into a set of points and lines of Morse code;
[0018] A zero-width character conversion module, used for converting the points and lines in the point and line set into zero-width characters according to the zero-width mapping relationship;
[0019] A character string forming module, used for inserting a set zero-width character corresponding to a spacer character after one or more zero-width characters according to a preset rule to form a zero-width character string;
[0020] The string insertion module is used to insert the zero-width string into the target carrier text.
[0021] In a fourth aspect, an embodiment of the present invention provides a device for extracting a dark watermark of a digital text, comprising:
[0022] A zero-width character reading module, used for traversing characters of the target carrier text to read zero-width characters;
[0023] A string composition module is used to remove the set zero-width characters corresponding to the spacer characters from the read zero-width characters and compose a zero-width string;
[0024] A second point and line conversion module is used to convert each zero-width character of the zero-width character string into a point and a line according to a zero-width mapping relationship to form a point and line set;
[0025] The text conversion module is used to convert the point and line set into a byte stream representing the embedded text.
[0026] In a fifth aspect, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements a method for embedding or extracting a digital text dark watermark as described in any one of the embodiments of the present invention.
[0027] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for embedding or extracting a digital text dark watermark as described in any one of the embodiments of the present invention.
[0028] The embodiment of the present invention establishes a correspondence between text and zero-width characters based on Morse code, so as to achieve the purpose of not occupying a large amount of memory space during the conversion process and improving the efficiency of dark watermark embedding. Compared with the dark watermark technology of modifying the text format of the carrier text, by inserting corresponding zero-width characters into the text, the dark watermark is not easily damaged when the carrier text is frequently edited and formatted. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 The figure is a flowchart of a method for embedding a dark watermark of a digital text provided according to an embodiment of the present invention.
[0030] Figure 2 The figure is a flow chart of a method for extracting a dark watermark of a digital text provided according to an embodiment of the present invention.
[0031] Figure 3 The present invention is a flowchart of a device for embedding a dark watermark of a digital text provided in accordance with an embodiment of the present invention.
[0032] Figure 4 It is a flow chart of a device for extracting dark watermark of digital text provided according to an embodiment of the present invention.
[0033] Figure 5 It is a structural block diagram of an electronic device provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0035] Figure 1 This is a flowchart of embedding a digital text dark watermark provided in the first embodiment of the present invention. The method can be applied to embedding hidden information into a text carrier. The dark watermark content can be embedded by the method of the embodiment of the present invention. After the embedded text carrier is processed, the dark watermark content remains intact. The method can be executed by the digital text dark watermark embedding device provided in the embodiment of the present invention. The device can be implemented in software and / or hardware. The device can be completed by an electronic device with data processing function. The method specifically includes the following steps:
[0036] Step 110: Convert the bytes of the text to be embedded into a set of dots and lines of Morse code.
[0037] The text to be embedded is the text content inserted into the original text, and is used to mark the source or ownership of the original text.
[0038] In an optional implementation of the embodiment of the present invention, determining the bytes of the text to be embedded may include: obtaining the text to be embedded, and converting the text to be embedded into bytes through a programming language. It should be noted that the conversion method between text and bytes may include: in Java, a getBytes() method may be used to implement similar functions; in C++, a c_str() method of the std::string class may be used to obtain a pointer to a C-style string, and then a standard library function such as strtol() or strtoul() may be used to perform the conversion; this is not limited in the embodiment of the present invention.
[0039] Exemplarily, the text to be embedded includes the character "a", and the byte corresponding to the binary character in the ASCII (American Standard Code for Information Interchange) encoding is 01100001.
[0040] Among them, the point and line set of Morse code is to convert bytes into points and lines in Morse code according to the corresponding relationship, and the points and lines after all the bytes of the embedded text are converted form a point and line set; the Morse code corresponding to a single byte value is one or more, and the correspondence between Morse code and symbols is shown in Table 1.
[0041] Table 1
[0042]
[0043]
[0044] Preferably, in order to reduce the memory space occupied by byte conversion, the binary bytes of the text to be embedded can be further converted into other numerical representations, such as hexadecimal, octal, etc. For example: the text to be embedded includes the character "a", and the binary corresponding byte in the ASCII code is 01100001; converted to octal, it is 141. Based on the corresponding relationship of the Morse code in Table 1, it can be known that the set of points and lines corresponding to the text to be embedded is {.――――....―.――――}.
[0045] Step 120: Convert the points and lines in the point and line set into zero-width characters respectively according to the zero-width mapping relationship.
[0046] The zero-width mapping relationship is the correspondence between zero-width characters and Morse code, and each point and line in the point and line set is converted into a corresponding zero-width character according to the correspondence.
[0047] It is understandable that zero-width characters are a special type of Unicode characters, there are about 13 zero-width characters, they are visually invisible, due to the invisibility of zero-width characters, they can be used to hide information in text, but they will take up a lot of space when obtaining the length of the string. It should be noted that the zero-width characters selected in the zero-width mapping relationship only represent the corresponding relationship with the dotted line in the Morse code, and the required zero-width characters can be selected according to the actual business scenario and effect, and are not limited in the embodiments of the present invention.
[0048] The zero-width mapping relationship is shown in Table 2.
[0049] Table 2
[0050]
[0051] Exemplarily, the dot and line set of the character "a" is {.――――....―.――――}, which is converted to {U+200B U+200C U+200C U+200C U+200 C U+200B U+200B U+200B U+200B U+200B U+200B U+200C U+200C U+200C U+200C} according to the zero-width mapping relationship in Table 2. In the dot and line set, the zero-width character corresponding to "." in the Morse code is U+200B, and the zero-width character corresponding to "- " in the Morse code is U+200C.
[0052] The embodiment of the present invention combines zero-width characters with Morse code to reduce the memory usage of zero-width characters, selects fewer zero-width characters to represent text byte streams, and further improves text conversion efficiency.
[0053] Step 130: insert a set zero-width character corresponding to the space character after one or more zero-width characters according to a preset rule to form a zero-width character string.
[0054] In response to the Huffman coding principle, a zero-width character corresponding to the spacer character is set to ensure that there will be no confusion during subsequent decoding, and the encoding of each character can be accurately identified. As shown in Table 3:
[0055] Table 3
[0056]
[0057] It can be understood that the preset rule is to set the zero-width characters corresponding to a single value into a group based on the representation of the base value, and insert a zero-width character corresponding to the spacer character at the end of each group until all the zero-width characters corresponding to all byte values are converted and merged into a zero-width string.
[0058] The separator character is used to separate numerical values, and the zero-width character used as the separator character is arbitrarily selected from zero-width characters. Other zero-width characters can be set as separator characters as needed, and the embodiment of the present invention does not specifically limit this.
[0059] For example, the character "a" has an octal value of "141". According to the preset rule, the zero-width character "U+200D" corresponding to the space character is inserted after each numerical value, and the results are merged into a zero-width character string, which is "U+200BU+200C U+200C U+200C U+200C U+200C U+200D U+200B U+200B U+200B U+200B U+200CU+200D U+200B U+200C U+200C U+200C U+200C U+200C U+200D".
[0060] Step 140: Insert the zero-width character string into the target carrier text.
[0061] Among them, the target carrier text is the protected text, which can be pdf, doc.x, xls.x, ppt.x and other file texts.
[0062] Optionally, inserting the zero-width string into the target carrier text specifically includes: determining an insertion point from the target carrier text according to an insertion strategy; wherein the insertion point includes at least one of the following: a space, an end of a paragraph, before or after a punctuation mark; and inserting the zero-width string into each insertion point of the target carrier file.
[0063] Exemplarily, by analyzing the characteristics of the target carrier text, including spaces, paragraph ends, and before or after punctuation marks, a zero-width string is inserted into each insertion point of the target carrier text based on an insertion strategy. The insertion strategy is an embedding strategy based on business requirements, that is, the insertion point type of the dark watermark, which is not specifically limited in the embodiment of the present invention.
[0064] Optionally, before inserting the zero-width string into each insertion point of the target carrier file, the method further includes: segmenting the zero-width string to form a plurality of zero-width substrings.
[0065] It is understandable that, in view of the large capacity of the content to be embedded, the zero-width character string is segmented to form multiple zero-width substrings for subsequent insertion. It should be noted that the specific segmentation method is determined according to the insertion strategy, and the number of zero-width substrings after segmentation can be the same as the number of insertion points in the insertion strategy, and the number of zero-width characters in each zero-width substring is not specifically limited.
[0066] Exemplarily, the target carrier text is analyzed based on the insertion strategy to determine the insertion points of the target carrier text, including: spaces, end of paragraphs, before or after punctuation marks, etc. The zero-width character string is segmented based on the insertion strategy so that the number of zero-width substrings after segmentation is the same as the number of insertion points, and each zero-width substring is inserted into each insertion point of the target carrier in sequence according to the order of the zero-width character string.
[0067] The technical solution of the embodiment of the present invention is to convert the bytes of the text to be embedded into a set of points and lines of Morse code; and convert the points and lines in the set of points and lines into zero-width characters according to the zero-width mapping relationship; insert the set zero-width characters of the corresponding spacing characters between each zero-width character to form a zero-width string; and insert the zero-width string into the target carrier text. The correspondence between the hexadecimal value of the text and the zero-width character is established based on the Morse code, so as to achieve the purpose of not occupying a large amount of memory space during the conversion process, improve the efficiency of dark watermark embedding, and achieve the effect that the dark watermark is not easily damaged when the protected text is processed.
[0068] On the basis of the above technical solution, the bytes of the text to be embedded are converted into a set of points and lines of Morse code, which also includes:
[0069] Convert the bytes of the text to be embedded into hexadecimal values;
[0070] The high and low bits of the hexadecimal value are converted into points and lines of Morse code respectively according to the point-line mapping relationship to serve as a point-line set.
[0071] In one example, binary to hexadecimal conversion can be performed as follows:
[0072] 1. Grouping: Start from the lowest bit (rightmost) of the binary number and group every four bits. If the highest bit (leftmost) is less than four bits, you can add 0 in front.
[0073] 2. Conversion: Convert each group of four-bit binary numbers into the corresponding hexadecimal numbers according to the conversion relationship. For example, the binary number corresponding to each hexadecimal number is: 0 corresponds to 0000, 1 corresponds to 0001, 2 corresponds to 0010, 3 corresponds to 0011, 4 corresponds to 0100, 5 corresponds to 0101, 6 corresponds to 0110, 7 corresponds to 0111, 8 corresponds to 1000, 9 corresponds to 1001, A corresponds to 1010, B corresponds to 1011, C corresponds to 1100, D corresponds to 1101, E corresponds to 1110, and F corresponds to 1111. Therefore, each hexadecimal number can easily correspond to a 4-bit binary number.
[0074] 3. Combine and combine all converted hexadecimal numbers in order to get the final hexadecimal number.
[0075] For example, the byte corresponding to the character a in the text to be embedded is 01100001, and we convert it into a hexadecimal value. First, divide 01100001 into two groups: 0110 and 0001. According to the conversion relationship, the hexadecimal number corresponding to 0110 is 6, and the hexadecimal number corresponding to 0001 is 1; according to the high and low bit order, the final hexadecimal value is 61.
[0076] It should be noted that the binary and hexadecimal conversion method involved in the embodiments of the present invention can also be any conversion method provided in the prior art; for example, through the built-in hex() function in Python, online binary to hexadecimal tool conversion, etc., which is not limited in the embodiments of the present invention.
[0077] Among them, the mapping relationship between points and lines is the corresponding relationship between hexadecimal values and Morse codes. Since this scheme only needs 16 symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f), it is only necessary to determine the Morse codes of the points and lines corresponding to the 16 symbols, as described in Table 4:
[0078] Table 4
[0079]
[0080] For example, the character "a" in the text to be embedded has a corresponding hexadecimal value of 61. The high bit 6 of the hexadecimal value is converted to...; the low bit 1 is converted to -.-, then the dot and line set corresponding to the character "a" is {...-.-}.
[0081] The embodiment of the present invention converts bytes into hexadecimal values and constructs a mapping relationship between hexadecimal values and Morse code points and lines. Compared with binary and octal point and line sets, the amount of calculation during conversion is reduced, the capacity of subsequent dark watermark embedding is reduced, and the point and line conversion efficiency of the dark watermark embedding process is further improved.
[0082] Figure 2 This is a flowchart of a digital text dark watermark extraction method provided in the first embodiment of the present invention. The method can be applied to the verification process of the text carrier, and the dark watermark content embedded in the text can be extracted by the method of the embodiment of the present invention to complete the acquisition of hidden information. The method can be executed by the digital text dark watermark extraction device provided in the embodiment of the present invention. The device can be implemented in software and / or hardware, and the device can be completed by an electronic device with data processing function. Specifically, it includes the following steps:
[0083] Step 210: traverse the characters of the target carrier text to read zero-width characters.
[0084] The target carrier text is the carrier text embedded with the dark watermark; it can be understood that the target carrier text is traversed to read the zero-width characters at each insertion point.
[0085] Step 220: Remove the set zero-width characters corresponding to the space characters from the read zero-width characters, and form a zero-width character string.
[0086] According to the order of reading zero-width characters in the target carrier text, the zero-width characters are read in order, and when the set zero-width character corresponding to the spacing character is read, the zero-width characters before the set zero-width character are combined into a zero-width character string.
[0087] Exemplarily, the zero-width characters read are "U+200B U+200C U+200C U+200C U+200C U+200C U+200D U+200B U+200B U+200B U+200B U+200C U+200D U+200B U+200C U+200CU+200C U+200C U+200C U+200D", and the set zero-width characters corresponding to the space characters are removed, and the obtained zero-width character strings are "U+200BU+200C U+200C U+200C U+200C", "U+200B U+200BU+200B U+200B U+200C" and "U+200B U+200C U+200C U+200C U+200C".
[0088] Step 230: Convert each zero-width character of the zero-width character string into a point and a line according to a zero-width mapping relationship to form a point and line set.
[0089] The zero-width characters in each zero-width character string are converted into points and lines in the Morse code according to the zero-width mapping relationship to form a point and line set.
[0090] Illustratively, the zero-width character strings are "U+200B U+200C U+200C U+200C U+200C", "U+200BU+200B U+200B U+200B U+200C", and "U+200B U+200C U+200C U+200C U+200C U+200C", which are converted into dots and lines of Morse code according to the zero-width mapping relationship, forming dot and line sets of ".―――", "....-", and ".―――".
[0091] Step 240: Convert the point and line set into a byte stream representing the embedded text.
[0092] The byte stream is represented as binary bytes. In this step, the point and line set is converted into corresponding numerical values according to the relationship between points and lines in the Morse code.
[0093] For example, the dot-line set is ".―――", "....-" and ".―――", and the converted value is "141". It can be known that it is an octal value, and the corresponding binary byte is determined to be "01100001" according to the ASCII code.
[0094] Based on the above technical solution, the step of converting the point and line set into a byte stream representing the embedded text further includes:
[0095] Convert the points and lines in the point-line set into hexadecimal values according to the point-line mapping relationship;
[0096] Each two hexadecimal values are sequentially combined into a binary byte as the high bit and the low bit, respectively, to obtain a byte stream of the embedded text.
[0097] In this step, after obtaining the points and lines in each point and line set, they are converted into corresponding hexadecimal values according to the mapping relationship. For example, if the point and line set is "..." and "-.-.", then according to the mapping relationship, they are "6" and "1" respectively.
[0098] The above-obtained "6" and "1" can be combined into one byte according to the high and low bits of the two hexadecimal values to obtain the corresponding byte "61". According to the existing conversion relationship between hexadecimal and binary, the binary byte stream "01100001" embedded in the text is obtained.
[0099] The technical solution of the embodiment of the present invention is to traverse the characters of the target carrier text to read zero-width characters; remove the set zero-width characters corresponding to the spacer characters from the read zero-width characters to form a zero-width character string; convert the zero-width characters of the zero-width character string into points and lines according to the zero-width mapping relationship to form a point-line set; convert the point-line set into a byte stream representing the embedded text. The corresponding relationship between the hexadecimal value of the text and the zero-width character is established based on the Morse code to improve the confidentiality of the dark watermark content; and there is no need to process the protected text, ensuring that the dark watermark is not easily damaged when the protected text is copied and pasted.
[0100] Figure 3 is a structural diagram of a digital text dark watermark embedding device in an embodiment of the present invention. The device is implemented by software and / or hardware and is specifically configured in an electronic device with certain data computing capabilities. Figure 3 The digital text dark watermark embedding device 300 shown includes a first point and line conversion module 310 , a zero-width character conversion module 320 , a character string formation module 330 , and a character string insertion module 340 .
[0101] The first point-line conversion module 310 is used to convert the bytes of the text to be embedded into a set of points and lines of Morse code;
[0102] A zero-width character conversion module 320 is used to convert the points and lines in the point and line set into zero-width characters according to the zero-width mapping relationship;
[0103] The character string forming module 330 is used to insert a set zero-width character corresponding to the spacer character after one or more zero-width characters according to a preset rule to form a zero-width character string;
[0104] The string insertion module 340 is used to insert the zero-width string into the target carrier text.
[0105] On the basis of the above-mentioned technical solutions, the first point-line conversion module 310 is also used to convert the binary bytes corresponding to the text to be embedded into hexadecimal values; convert the high and low bits of the hexadecimal values into points and lines of Morse code according to the point-line mapping relationship, as a point-line set.
[0106] On the basis of the above-mentioned technical solutions, the zero-width character conversion module 320 is also used to determine the insertion point from the target carrier text according to the insertion strategy; insert the zero-width character string into each insertion point of the target carrier file; wherein the insertion point includes at least one of the following: a space, an end of a paragraph, before or after a punctuation mark.
[0107] On the basis of the above technical solutions, before inserting the zero-width character string into each insertion point of the target carrier file, it further includes: a zero-width character string segmentation unit.
[0108] The zero-width string segmentation unit is used to segment the zero-width string to form a plurality of zero-width substrings.
[0109] The method converts the bytes of the text to be embedded into a set of points and lines of Morse code; converts the points and lines in the set of points and lines into zero-width characters according to the zero-width mapping relationship; inserts the set zero-width characters of the corresponding spacing characters between the zero-width characters to form a zero-width character string; and inserts the zero-width character string into the target carrier text. The corresponding relationship between the hexadecimal value of the text and the zero-width character is established based on the Morse code, so as to achieve the purpose of not occupying a large amount of memory space during the conversion process, improving the efficiency of dark watermark embedding, and achieving the effect that the dark watermark is not easily damaged when the protected text is processed.
[0110] According to an embodiment of the present invention, Figure 4 is a structural diagram of a digital text dark watermark extraction device in an embodiment of the present invention. The device is implemented by software and / or hardware and is specifically configured in an electronic device with certain data computing capabilities. Figure 4 The digital text dark watermark embedding device 400 shown includes a zero-width character reading module 410 , a character string composition module 420 , a second point and line conversion module 430 , and a text conversion module 440 .
[0111] A zero-width character reading module 410 is used to traverse the characters of the target carrier text to read zero-width characters;
[0112] The character string forming module 420 is used to remove the set zero-width characters corresponding to the spacer characters from the read zero-width characters and form a zero-width character string;
[0113] A second point and line conversion module 430 is used to convert each zero-width character of the zero-width character string into a point and a line according to a zero-width mapping relationship to form a point and line set;
[0114] The text conversion module 440 is used to convert the point and line set into a byte stream representing the embedded text.
[0115] Based on the above technical solutions, the text conversion module is also used to convert the points and lines in the point and line set into hexadecimal values according to the point-line mapping relationship; and merge every two hexadecimal values into a binary byte in sequence as the high bit and the low bit, so as to obtain the byte stream of the embedded text.
[0116] The characters of the target carrier text are traversed to read zero-width characters; the set zero-width characters corresponding to the spacer characters are removed from the read zero-width characters to form a zero-width character string; the zero-width characters of the zero-width character string are converted into points and lines according to the zero-width mapping relationship to form a point-line set; the point-line set is converted into a byte stream representing the embedded text. The corresponding relationship between the hexadecimal value of the text and the zero-width character is established based on Morse code to improve the confidentiality of the dark watermark content; and there is no need to process the protected text, ensuring that the dark watermark is not easily damaged when the protected text is copied and pasted.
[0117] Figure 5 It is a structural diagram of an electronic device provided by an embodiment of the present invention. Figure 5 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0118] like Figure 5 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0119] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0120] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0121] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0122] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0123] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0124] The processing unit 16 executes various functional applications and data processing by running at least one of the other programs among the multiple programs stored in the system memory 28, such as implementing a method for embedding and extracting a dark watermark of a digital text provided in an embodiment of the present invention.
[0125] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, a method for embedding and extracting a digital text dark watermark provided by any embodiment of the present invention is implemented.
[0126] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for embedding a dark watermark of a digital text, the method comprising: Convert the bytes of the text to be embedded into a set of dots and lines in Morse code; Converting the points and lines in the point and line set into zero-width characters respectively according to the zero-width mapping relationship; Inserting a set zero-width character corresponding to the space character after one or more zero-width characters according to a preset rule to form a zero-width character string; The zero-width string is inserted into the target carrier text.
2. The method according to claim 1, characterized in that The step of converting the bytes of the text to be embedded into a set of dots and lines of Morse code includes: Convert the binary bytes corresponding to the text to be embedded into hexadecimal values; The high and low bits of the hexadecimal value are converted into points and lines of Morse code respectively according to the point-line mapping relationship to serve as a point-line set.
3. The method according to claim 1, characterized in that The step of inserting the zero-width character string into the target carrier text comprises: Determine an insertion point from the target carrier text according to the insertion strategy; wherein the insertion point includes at least one of the following: a space, an end of a paragraph, before or after a punctuation mark; The zero-width character string is inserted into each insertion point of the target carrier file.
4. The method according to claim 3, wherein the step of inserting the zero-width string before each insertion point of the target carrier file further comprises: The zero-width character string is segmented to form a plurality of zero-width sub-character strings.
5. A method for extracting a dark watermark of a digital text, the method comprising: Traverse the characters of the target carrier text to read zero-width characters; Remove the set zero-width characters corresponding to the space characters from the read zero-width characters, and form a zero-width string; Convert each zero-width character of the zero-width character string into a point and a line according to a zero-width mapping relationship to form a point and line set; The point and line set is converted into a byte stream representing the embedded text.
6. The method according to claim 5, characterized in that The step of converting the point and line set into a byte stream representing the embedded text comprises: Convert the points and lines in the point-line set into hexadecimal values according to the point-line mapping relationship; Each two hexadecimal values are sequentially combined into a binary byte as the high bit and the low bit, respectively, to obtain a byte stream of the embedded text.
7. A device for embedding a dark watermark of a digital text, the method comprising: A first point-line conversion module, used for converting bytes of the text to be embedded into a set of points and lines of Morse code; A zero-width character conversion module, used for converting the points and lines in the point and line set into zero-width characters according to the zero-width mapping relationship; A character string forming module, used for inserting a set zero-width character corresponding to a spacer character after one or more zero-width characters according to a preset rule to form a zero-width character string; The string insertion module is used to insert the zero-width string into the target carrier text.
8. A device for extracting a dark watermark of a digital text, the method comprising: A zero-width character reading module, used for traversing characters of the target carrier text to read zero-width characters; A string composition module is used to remove the set zero-width characters corresponding to the spacer characters from the read zero-width characters and compose a zero-width string; A second point and line conversion module is used to convert each zero-width character of the zero-width character string into a point and a line according to a zero-width mapping relationship to form a point and line set; The text conversion module is used to convert the point and line set into a byte stream representing the embedded text.
9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the digital text dark watermark embedding method as described in any one of claims 1-4 or the digital text dark watermark extraction method as described in any one of claims 5 or 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for embedding a digital text dark watermark as described in any one of claims 1 to 4 or the method for extracting a digital text dark watermark as described in any one of claims 5 or 6 is implemented.