CN110322386A - A kind of insertion of digital text watermarking and detection method and device - Google Patents

A kind of insertion of digital text watermarking and detection method and device Download PDF

Info

Publication number
CN110322386A
CN110322386A CN201810276720.9A CN201810276720A CN110322386A CN 110322386 A CN110322386 A CN 110322386A CN 201810276720 A CN201810276720 A CN 201810276720A CN 110322386 A CN110322386 A CN 110322386A
Authority
CN
China
Prior art keywords
character
watermark
embedded
digital text
substring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810276720.9A
Other languages
Chinese (zh)
Inventor
董军
李莉
王宝晗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongchang (suzhou) Software Technology Co Ltd
China Mobile Communications Group Co Ltd
Original Assignee
Zhongchang (suzhou) Software Technology Co Ltd
China Mobile Communications Group 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 Zhongchang (suzhou) Software Technology Co Ltd, China Mobile Communications Group Co Ltd filed Critical Zhongchang (suzhou) Software Technology Co Ltd
Priority to CN201810276720.9A priority Critical patent/CN110322386A/en
Publication of CN110322386A publication Critical patent/CN110322386A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking
    • G06T2201/0062Embedding of the watermark in text images, e.g. watermarking text documents using letter skew, letter distance or row distance

Landscapes

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

Abstract

The invention discloses a kind of insertion of digital text watermarking and detection method and device, solves the problems, such as that existing digital text insertion water mark method watermark information is easily tampered, improve the validity of digital copyright protection.The digital text watermarking embedding grammar includes: to encode the copyright information of the digital text of request insertion watermark, wherein the copyright information is used to characterize the transmitting terminal attribute information of the digital text;The character string obtained after coding is split as several substrings;And judge whether each character of the digital text needs to be embedded in watermark according to chaos algorithm;To judge to need to be embedded in the character selection substring of watermark and be embedded into corresponding character.

Description

A kind of insertion of digital text watermarking and detection method and device
Technical field
The present invention relates to technical field of digital copyright protection more particularly to a kind of insertion of digital text watermarking and detection methods And device.
Background technique
Digital watermark technology is that some identification informations are embedded in the digital carriers such as multimedia, document or software, passes through this A little identification informations hidden in the carrier can achieve confirmation creator of content, buyer, transmission secret information or judgement and carry The purpose of whether body is tampered.Digital watermarking is to protect information security, realize anti-fake trace to the source and digital copyright protection has an efficacious prescriptions Method.
The existing digital watermark technology for digital text has some limitations, such as: variant is carried out to text Operation generates deformed character, the digital watermarking being added to after encoding to the deformed character of generation as digital watermarking in digital text Method needs to install on the subscriber terminal corresponding to allow the text for carrying hiding information correctly to show on the subscriber terminal Font is deformed, this document can not be checked if being fitted without the font on the computer of document viewing person.For another example: to invisible Symbol such as space, carriage return, symbol appearance of tabulating sequence encoded after be embedded into digital text for indicating digital water The method of official seal breath, since watermark information concentrates on invisible symbol, a large amount of visicode is not loaded in digital text Watermark information, watermark information are unevenly distributed, and the watermark information loaded in this way is easily distorted and removed by attacker, To reduce the validity of digital copyright protection.
Summary of the invention
In order to solve the problems, such as that existing digital text insertion water mark method watermark information is easily tampered, the embodiment of the present invention Provide a kind of insertion of digital text watermarking and detection method and device.
In a first aspect, the embodiment of the invention provides a kind of digital text watermarking embedding grammars, comprising:
The copyright information of the digital text of request insertion watermark is encoded, wherein the copyright information is for characterizing The transmitting terminal attribute information of the digital text;
The character string obtained after coding is split as several substrings;And
Judge whether each character of the digital text needs to be embedded in watermark according to chaos algorithm;
To judge to need to be embedded in the character selection substring of watermark and be embedded into corresponding character.
In digital text watermarking embedding grammar provided in an embodiment of the present invention, server is literary by the number of request insertion watermark This copyright information is encoded, wherein copyright information is used to characterize the transmitting terminal attribute information of the digital text, after coding Obtained character string is split as several substrings, according to chaos algorithm judge the digital text each character whether need it is embedding Enter watermark, that is, calculate the position that the digital text needs to be embedded in the character of watermark, to judge to need to be embedded in the character of watermark Selection substring is simultaneously embedded into corresponding character, digital text watermarking embedding grammar provided in an embodiment of the present invention, different In water mark method general at present, watermark is such as embedded in each character of digital text, or in every section of section head, Duan Mo It is embedded in watermark, since the position of these watermarks insertion is usually fixed, is easily found rule, causes to be easy to be tampered destruction, and originally Invention makes the embedded location pair of watermark using the characteristic of chaos algorithm using the position that chaos algorithm calculating needs to be embedded in watermark Randomness is shown outside, can not be predicted, so that the crypticity of insertion watermark location is significantly reinforced, prevents from being tampered, mention The high validity of safety and digital copyright protection.
Preferably, the character string obtained after coding is split as several substrings, specifically include:
The character string obtained after the coding is split into the substring of several preset lengths according to preset order.
Preferably, judge whether each character of the digital text needs to be embedded in watermark according to chaos algorithm, it is specific to wrap It includes:
The corresponding iterative value of each character is obtained according to the iterative equation of hybrid optical flip-flop model;
Determine whether the character needs to be embedded in watermark according to the corresponding iterative value of the character.
Preferably, determining whether the character needs to be embedded in watermark according to the corresponding iterative value of the character, specifically include:
When the corresponding iterative value of the character is less than preset threshold, it is determined that the character does not need insertion watermark;
When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that the character needs to be embedded in water Print.
Preferably, obtaining the corresponding iterative value of each character, tool according to the iterative equation of hybrid optical flip-flop model Body includes:
The corresponding iterative value of each character is obtained according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text, N indicate the digital text The character sum for including;
XnIndicate the corresponding iterative value of n-th of character in the digital text;
A, B indicates constant.
Optionally, the method also includes:
After the character string obtained after by the coding splits into several substrings, to several sons after fractionation Character string carries out label in order.
Preferably, selecting substring for the character that judgement needs to be embedded in watermark and being embedded into corresponding character, specifically Include:
For each character for needing to be embedded in watermark, a random number is obtained according to default random number algorithm, it is described random Number is any one label among the label;And
The random number is converted into the first character string;
Choose the substring marked as the random number;
R, G, B value of the character color are obtained, and R, G, B value is converted into the second character string, third word respectively Symbol string and the 4th character string;
The substring marked as the random number is split into the first substring and the second substring;
The low order character of the corresponding digit of second character string is replaced with first character string;
The low order character of the corresponding digit of the third character string is replaced with first substring;And
The low order character of the corresponding digit of the 4th character string is replaced with second substring.
Using digital text watermarking embedding grammar provided in an embodiment of the present invention, according to the small model of the not noticeable color of human eye It encloses and changes this feature, hiding copyright information will be needed to be embedded in the color attribute of digital text character, and be able to maintain that number The size of word text is constant, while increasing the crypticity of watermark information.Also, it is formed using encryption algorithm to by copyright information Watermark content encoded, convert thereof into after character string and be embedded in digital text, rather than directly by plaintext embedment, into One step improves the identification difficulty of watermark, enhances crypticity.
Optionally, the method also includes:
Replaced each character string is converted into corresponding decimal number respectively;And
Decimal number after conversion is replaced into R, G, B value, the color attribute new as the character respectively.
Second aspect, the embodiment of the invention provides a kind of digital text watermarking flush mountings, comprising:
Coding unit, for encoding the copyright information of the digital text of request insertion watermark, wherein the copyright Information is used to characterize the transmitting terminal attribute information of the digital text;
Split cells, for the character string obtained after coding to be split as several substrings;
Judging unit, for judging whether each character of the digital text needs to be embedded in watermark according to chaos algorithm;
Embedded unit, the character for needing to be embedded in watermark for judgement select substring and are embedded into corresponding character In.
Preferably, the split cells, specifically for the character string obtained after the coding is split according to preset order At the substring of several preset lengths.
Request is embedded in the digital text of watermark by digital text watermarking flush mounting provided in an embodiment of the present invention, server Copyright information encoded, wherein copyright information is used to characterize the transmitting terminal attribute information of the digital text, will be after coding To character string be split as several substrings, judge whether each character of the digital text needs to be embedded according to chaos algorithm Watermark, that is, the position that the digital text needs to be embedded in the character of watermark is calculated, to judge to need to be embedded in the character choosing of watermark It selects substring and is embedded into corresponding character, digital text watermarking embedding grammar provided in an embodiment of the present invention is different from Water mark method general at present is such as embedded in watermark in each character of digital text, or in every section of section head, Duan Moqian Enter watermark, since the position of these watermarks insertion is usually fixed, be easily found rule, leads to be easy to be tampered destruction, and this hair The bright position for needing to be embedded in watermark using chaos algorithm calculating keeps the embedded location of watermark external using the characteristic of chaos algorithm Randomness is shown, can not be predicted, so that the crypticity of insertion watermark location is significantly reinforced, prevents from being tampered, improve The validity of safety and digital copyright protection.
Preferably, the judging unit, described every specifically for being obtained according to the iterative equation of hybrid optical flip-flop model The corresponding iterative value of a character;Determine whether the character needs to be embedded in watermark according to the corresponding iterative value of the character.
Preferably, the judging unit, is specifically used for when the corresponding iterative value of the character is less than preset threshold, then really The fixed character does not need insertion watermark;When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that The character needs to be embedded in watermark.
Preferably, the judging unit, is specifically used for obtaining the corresponding iterative value of each character according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text, N indicate the digital text The character sum for including;
XnIndicate the corresponding iterative value of n-th of character in the digital text;
A, B indicates constant.
Optionally, described device further include:
Processing unit, after the character string for obtaining after by the coding splits into several substrings, to fractionation Several substrings afterwards carry out label in order.
Preferably, the embedded unit, specifically for for each character for needing to be embedded in watermark, according to default random number Algorithm obtains a random number, and the random number is any one label among the label;And the random number is converted At the first character string;Choose the substring marked as the random number;Obtain R, G, B value of the character color, and by institute It states R, G, B value and is converted into the second character string, third character string and the 4th character string respectively;By described marked as the random number Substring splits into the first substring and the second substring;The second character string phase is replaced with first character string Answer the low order character of digit;The low order character of the corresponding digit of the third character string is replaced with first substring;And The low order character of the corresponding digit of the 4th character string is replaced with second substring.
Optionally, described device further include:
Converting unit, for replaced each character string to be converted to corresponding decimal number respectively;
Replacement unit, for the decimal number after conversion to be replaced R, G, B value, the face new as the character respectively Color attribute.
The technical effect of digital text watermarking flush mounting provided by the invention may refer to above-mentioned first aspect or first The technical effect of each implementation of aspect, details are not described herein again.
The third aspect the embodiment of the invention provides a kind of server, including memory, processor and is stored in described deposit On reservoir and the computer program that can run on the processor, the processor realize institute of the present invention when executing described program The digital text watermarking embedding grammar stated.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer journey Sequence, the program realize the step in digital text watermarking embedding grammar of the present invention when being executed by processor.
5th aspect, the embodiment of the invention provides a kind of digital text watermarking detection methods, comprising:
Judge whether each character of digital text to be detected is embedded in watermark, the number to be detected according to chaos algorithm Text is the digital text that watermark is embedded in using data waterprint embedded method provided in an embodiment of the present invention;
For each character for being embedded in watermark judged, the substring of insertion is extracted, and by each of the extraction Substring is recombinated, and a new character string is obtained;
The character string is decoded, the copyright information of the digital text to be detected is obtained;
The copyright information is compared with the copyright information of insertion, obtains comparison result.
Digital text watermarking detection method provided in an embodiment of the present invention is for the number provided using above-mentioned first aspect Word Text Watermarking embedding grammar is embedded in the digital text of watermark, digital text watermarking detection method provided in an embodiment of the present invention In, server judges whether each character of digital text to be detected is embedded in watermark according to chaos algorithm, for what is judged It is embedded in each character of watermark, the substring of insertion is extracted, and each substring of extraction is recombinated, obtains one Character string after recombination is decoded by new character string, obtains the copyright information of digital text to be detected, then the copyright is believed Breath is compared with the copyright information of insertion, obtains comparison result, and whether the watermark that is initially embedded in of detection is tampered, and can be with Prove the copyright ownership of the digital text to be detected.
Preferably, the chaos algorithm is hybrid optical flip-flop model;
Judge whether each character of digital text to be detected is embedded in watermark according to chaos algorithm, specifically include:
The corresponding iterative value of each character is obtained according to the iterative equation of hybrid optical flip-flop model;
Determine whether the character is embedded in watermark according to the corresponding iterative value of the character.
Preferably, determining whether the character is embedded in watermark according to the corresponding iterative value of the character, specifically include:
When the corresponding iterative value of the character is less than preset threshold, it is determined that the character is not embedded in watermark;
When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that the character is embedded in water Print.
Preferably, obtaining the corresponding iterative value of each character, tool according to the iterative equation of hybrid optical flip-flop model Body includes:
The corresponding iterative value of each character is obtained according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates n-th of character in the digital text to be detected, N indicate it is described to The character sum that detection digital text includes;
XnIndicate the corresponding iterative value of n-th of character in the digital text to be detected;
A, B indicates constant.
Preferably, extracting the substring of insertion for each character for being embedded in watermark judged, specifically including:
For each character for being embedded in watermark judged, R, G, B value of the character color are obtained;
R, G, B value is converted into corresponding character string respectively;
The low order character of corresponding presetting digit capacity is extracted from the corresponding character string of R, G, B value respectively;
The low order character extracted from the corresponding character string of G, B value is combined into a character string;
Character string after determining the combination is the substring of character insertion.
Preferably, each substring of the extraction is recombinated, a new character string is obtained, is specifically included:
It is default by what is extracted from the corresponding character string of the R value for each character for being embedded in watermark judged The character string of the low order character composition of digit is converted into decimal number;
The substring that the character is embedded in is stored to the array being marked with the decimal number pre-established In;
Statistics is for storing of identical each substring from each array for the substring that each character extracts Number;And
The largest number of substrings of identical each substring are determined as marking the decimal number of each array Corresponding substring;
It is recombinated, is obtained according to preset order according to the substring of the decimal number and the determination that mark each array One new character string.
Digital text watermarking detection method provided by the invention is embedded in using above-mentioned digital text watermarking embedding grammar Watermark in the digital text of watermark is detected, and is the inverse process of above-mentioned digital text watermarking embedding grammar, technology effect Fruit may refer to the technical effect of each implementation of above-mentioned first aspect or first aspect, and details are not described herein again.
6th aspect, the embodiment of the invention provides a kind of digital text watermarking detection devices, comprising:
Judging unit, for judging whether each character of digital text to be detected is embedded in watermark according to chaos algorithm, The digital text to be detected is the number text that watermark is embedded in using data waterprint embedded method provided in an embodiment of the present invention This;
Extraction unit, for extracting the substring of insertion for each character for being embedded in watermark judged, and will Each substring of the extraction is recombinated, and a new character string is obtained;
Decoding unit obtains the copyright information of the digital text to be detected for the character string to be decoded;
Comparing unit obtains comparison result for the copyright information to be compared with the copyright information of insertion.
Preferably, the chaos algorithm is hybrid optical flip-flop model;
The judging unit, specifically for obtaining each character pair according to the iterative equation of hybrid optical flip-flop model The iterative value answered;Determine whether the character is embedded in watermark according to the corresponding iterative value of the character.
Preferably, the judging unit, is specifically used for when the corresponding iterative value of the character is less than preset threshold, then really The fixed character is not embedded in watermark;When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that institute It states character and is embedded in watermark.
Preferably, the judging unit, is specifically used for obtaining the corresponding iterative value of each character according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates n-th of character in the digital text to be detected, N indicate it is described to The character sum that detection digital text includes;
XnIndicate the corresponding iterative value of n-th of character in the digital text to be detected;
A, B indicates constant.
Preferably, the extraction unit, specifically for for each character for being embedded in watermark judged, described in acquisition R, G, B value of character color;R, G, B value is converted into corresponding character string respectively;It is corresponding from R, G, B value respectively The low order character of corresponding presetting digit capacity is extracted in character string;The low order character that will be extracted from the corresponding character string of G, B value It is combined into a character string;Character string after determining the combination is the substring of character insertion.
It, will be from described specifically for for each character for being embedded in watermark judged preferably, the extraction unit The character string of the low order character composition for the presetting digit capacity extracted in the corresponding character string of R value is converted into decimal number;By the word The substring of symbol insertion is stored into the array being marked with the decimal number pre-established;Statistics for store from The number of identical each substring in each array for the substring that each character extracts;And by identical each sub- word The largest number of substrings of symbol string are determined as marking the corresponding substring of the decimal number of each array;According to each number of label The decimal number of group and the substring of the determination are recombinated according to preset order, obtain a new character string.
7th aspect the embodiment of the invention provides a kind of server, including memory, processor and is stored in described deposit On reservoir and the computer program that can run on the processor, the processor realize institute of the present invention when executing described program The digital text watermarking detection method stated.
Eighth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer journey Sequence, the program realize the step in digital text watermarking detection method of the present invention when being executed by processor.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by written explanation Specifically noted structure is achieved and obtained in book, claims and attached drawing.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes a part of the invention, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the application scenarios schematic diagram of digital text watermarking embedding grammar provided in an embodiment of the present invention;
Fig. 2 is the implementation process diagram of digital text watermarking embedding grammar provided in an embodiment of the present invention;
Fig. 3 is in digital text watermarking embedding grammar provided in an embodiment of the present invention, for judging to need to be embedded in watermark Each character insertion watermark implementation process diagram;
Fig. 4 is the structural schematic diagram of digital text watermarking flush mounting provided in an embodiment of the present invention;
Fig. 5 is the implementation process diagram of digital text watermarking detection method provided in an embodiment of the present invention;
Fig. 6 is in digital text watermarking detection method provided in an embodiment of the present invention, for judging to be embedded in watermark Each character extracts the implementation process diagram of the substring of insertion;
Fig. 7 be digital text watermarking detection method provided in an embodiment of the present invention in, will be embedding from digital text to be detected The implementation process diagram that each substring of each character extraction of watermark is recombinated is entered;
Fig. 8 is the structural schematic diagram of digital text watermarking detection device provided in an embodiment of the present invention.
Specific embodiment
In order to solve the problems, such as that existing digital text insertion water mark method watermark information is easily tampered, the invention proposes A kind of insertion of digital text watermarking and detection method and device.
The implementation principle of digital text watermarking embedding grammar provided in an embodiment of the present invention is: provided in an embodiment of the present invention Digital text watermarking embedding grammar, server encode the copyright information of the digital text of request insertion watermark, wherein version Power information is used to characterize the transmitting terminal attribute information of the digital text, and the character string obtained after coding is split as several sub- characters String, judges whether each character of the digital text needs to be embedded in watermark according to chaos algorithm, that is, calculate the digital text Need to be embedded in the position of the character of watermark, to judge to need to be embedded in the character selection substring of watermark and be embedded into corresponding In character, digital text watermarking embedding grammar provided in an embodiment of the present invention, different from water mark method general at present, such as in number Watermark, or the section head at every section, the insertion watermark of section end are embedded in each character of word text, due to these watermarks insertion Position is usually fixed, is easily found rule, causes to be easy to be tampered destruction, and the present invention needs to be embedded in using chaos algorithm calculating The position of watermark makes the embedded location of watermark externally show randomness using the characteristic of chaos algorithm, can not be predicted, from And the crypticity for being embedded in watermark location is significantly reinforced, it prevents from being tampered, improve safety and digital copyright protection has Effect property.
Below in conjunction with Figure of description, preferred embodiment of the present invention will be described, it should be understood that described herein Preferred embodiment only for the purpose of illustrating and explaining the present invention and is not intended to limit the present invention, and in the absence of conflict, this hair The feature in embodiment and embodiment in bright can be combined with each other.
When the present invention refers to ordinal numbers such as " first ", " second " or " third ", unless based on context it is expressed really One of sequence, it is appreciated that being only to distinguish to be used.
It is that the application scenarios of digital text watermarking embedding grammar provided in an embodiment of the present invention are illustrated referring initially to Fig. 1 Figure.User 10 is embedded in the digital text of watermark to server 12 by the client upload request installed in terminal 11, wherein visitor Family end can be the browser of webpage, or the client being installed in mobile terminal, such as mobile phone, tablet computer.This Digital text involved in inventive embodiments is rich text, and rich text format (Rich Text Format, RTF) means mostly literary again This format, it can be arranged relative to plain text with format abundant, keep the readability of text stronger.When it is implemented, User 10 passes through the client installed in registration terminal 11, and upload request is embedded in the digital text of watermark and needs the hiding number The copyright information of word text, copyright information are used to characterize the transmitting terminal attribute information of the digital text, can include but is not limited to: The information such as Unit code, sender's information, sender's IP address and timestamp.Server 12 receives the number of request insertion watermark After the copyright information of text and the digital text, the copyright information is encoded according to pre-arranged code algorithm, is converted thereof into Character string, the character string can be string of binary characters, then can be arbitrarily can be by text, number, mark for pre-arranged code algorithm The characters such as point symbol are converted to the encryption algorithm of the string of binary characters, and the embodiment of the present invention is not construed as limiting this, for example, can be with It is BASE64 encryption algorithm.The character string obtained after coding is split into several substrings by server 12, substring Length can according to need sets itself, and the embodiment of the present invention is not construed as limiting this.Judge that the request is embedding further according to chaos algorithm Whether each character for entering the digital text of watermark needs to be embedded in watermark, to judge that the character for needing to be embedded in watermark selects sub- character It goes here and there and is embedded into corresponding character, to complete the watermark telescopiny of digital text.Chaos is used in the embodiment of the present invention Algorithm calculates the position that digital text needs to be embedded in the character of watermark, chaos refer to occur in determining system it is a kind of seemingly without Rule, similar random phenomenon, are to be present in the more universal phenomenon of one of nonlinear system, and the randomness of chaos is tool Have it is deterministic, can be completely reproduced up.Existing watermark embedding method is such as embedded in watermark in each character, or every The section of section is first, section end is embedded in watermark, and the position of these watermarks insertion is typically more fixed, is easily found rule and distorts, and this Inventive embodiments are calculated the embedded location of watermark using chaos algorithm, judge whether each character needs to be embedded in watermark, are utilized The characteristic of chaos algorithm can make the embedded location of watermark externally show as randomness, can not be predicted, so that watermark embedded location Crypticity significantly reinforce, prevent distorting and destroying to watermark, it is highly-safe, improve the validity of digital copyright protection. Also, the present invention changes this feature according to the small range of the not noticeable color of human eye, and hiding copyright information will be needed to be embedded in It in the color attribute of digital text character, and is able to maintain that the size of digital text is constant, while further increasing watermark letter The crypticity of breath.
It should be noted that chaos algorithm involved in the embodiment of the present invention is said by taking hybrid optical flip-flop model as an example It is bright, but not limited to this, the embodiment of the present invention is not construed as limiting this.
It is communicatively coupled between terminal 11 and server 12 by network, which can be local area network, wide area network etc.. Terminal 11 can be portable equipment (such as: mobile phone, tablet computer, laptop etc.), or PC (PC, Personal Computer), server 12 can be any equipment for being capable of providing Internet service.
Below with reference to the application scenarios of Fig. 1, it is described with reference to Figure 2 the digital text of illustrative embodiments according to the present invention Watermark embedding method.It should be noted that above-mentioned application scenarios are merely for convenience of understanding spirit and principles of the present invention and showing Out, embodiments of the present invention are unrestricted herein.On the contrary, embodiments of the present invention can be applied to it is applicable any Scene.
As shown in Fig. 2, it is the implementation process diagram of digital text watermarking embedding grammar provided in an embodiment of the present invention, It may comprise steps of:
S21, the copyright information of the digital text of request insertion watermark is encoded.
When it is implemented, server receives the number for the request insertion watermark that user is uploaded by the client installed in terminal The copyright information of word text and the digital text, wherein the copyright information is used to characterize the transmitting terminal category of the digital text Property information, can include but is not limited to: the information such as Unit code, sender's information, sender's IP address and timestamp.Server The copyright information of the digital text of request insertion watermark is encoded, a character string is obtained.
Specifically, server encodes the copyright information according to pre-arranged code algorithm, convert thereof into one two into Character string processed, wherein pre-arranged code algorithm can be BASE64 encryption algorithm.
For example, copyright information is carried out BASE64 code conversion, the string of binary characters that length is 128 is obtained.
S22, the character string obtained after coding is split as several substrings.
When it is implemented, the character string obtained after coding is split into several preset lengths according to preset order by server Substring, and label is carried out in order to several substrings after fractionation.
Specifically, the string of binary characters obtained after coding is split into binary system of several preset lengths by server Character string, and label is carried out in order to the binary system substring of several preset lengths after fractionation.
Specifically, when the length for determining the string of binary characters is the integral multiple of the preset length, by described two System character string splits into the binary system substring of several preset lengths according to the sequence of little-endian;Work as determination When the length of the string of binary characters is not the integral multiple of the preset length, then in the highest order of the string of binary characters The 0 of the corresponding digit of preceding supplement obtains a new string of binary characters, so that the length of the new string of binary characters is described The integral multiple of preset length, then the new string of binary characters split into according to the sequence of little-endian several described pre- If the binary system substring of length.
For example, in step S21 by the length that copyright information progress BASE64 code conversion obtains is 128 two into Character string processed, it is assumed that preset length is 8, since 128 be 8 integral multiple, then can be pressed 128 strings of binary characters Split into 128/8=16 8 binary system substrings according to the sequence of little-endian, and can be according to from low to high Sequence carries out label to this 16 binary system substrings, is denoted as 0~15.If the length of the string of binary characters obtained after coding When degree is not the integral multiple of preset length 8, for example string of binary characters is 124, then supplements 40 before its highest order, obtain To 128 strings of binary characters, which is being split into 16 8 according to the sequence of little-endian Binary system substring, and label is carried out to this 16 binary system substrings according to sequence from low to high, it is denoted as 0~15.
S23, judge whether each character of the digital text needs to be embedded in watermark according to chaos algorithm.
When it is implemented, chaos algorithm can be hybrid optical flip-flop model, server reads the request of acquisition in order It is embedded in each character of the digital text of watermark, it is corresponding repeatedly to obtain each character according to the iterative equation of hybrid optical flip-flop model Generation value, determines whether the character needs to be embedded in watermark according to the corresponding iterative value of the character.Specifically, when character is corresponding When iterative value is less than preset threshold, it is determined that the character does not need insertion watermark, is somebody's turn to do when the corresponding iterative value of character is more than or equal to When preset threshold, it is determined that the character needs to be embedded in watermark.
Specifically, the iterative equation of hybrid optical flip-flop model are as follows:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text, N indicate the digital text The character sum for including;
XnIndicate the corresponding iterative value of n-th of character in the digital text;
A, B indicates constant.
When it is implemented, inputting initial value A, B, X of above-mentioned iterative equation first1, X1The as digital text first character Corresponding iterative value is accorded with, initial value A, B, X can be arranged in server based on experience value1, calculated according to above-mentioned iterative equation each After the corresponding iterative value of character, then two-value judgement is carried out to the corresponding iterative value of each character, to determine whether the character needs It is embedded in watermark, specifically, when the corresponding iterative value of the character is less than preset threshold, it is determined that the character does not need insertion water Print, when determining that the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that the character needs to be embedded in watermark.Specifically When implementation, preset threshold can beWhenWhen, it is determined that n-th of character does not need insertion watermark, whenWhen, it is determined that n-th of character needs to be embedded in watermark.
It should be noted that preset threshold can be set according to actual needs, the embodiment of the present invention is not construed as limiting this.
S24, the character for needing to be embedded in watermark for judgement select substring and are embedded into corresponding character.
When it is implemented, for each character for needing to be embedded in watermark judged, it can be according to process as shown in Figure 3 It chooses substring to be embedded into corresponding character, may include:
S201, for each character for needing to be embedded in watermark, a random number is obtained according to default random number algorithm, it is described Random number is any one label among the label.
When it is implemented, server is directed to each character for needing to be embedded in watermark judged, figured at random according to default Method obtains a random number, which is any one label in step S22 among the label of binary system substring.On In example, which is any one in 0~15.Wherein, the embodiment of the present invention is not construed as limiting default random number algorithm.
S202, the random number is converted into the first character string.
When it is implemented, the random number is converted into string of binary characters by server, in order to other strings of binary characters It distinguishes, is denoted as the first character string.Wherein, the length of the character string can be set according to actual needs, the embodiment of the present invention It is not construed as limiting.
For example, it is assumed that need to be embedded in the character of watermark for some, the random number obtained according to default random number algorithm It is 4, then can be converted into 4 strings of binary characters: 0100, the string of binary characters of position 3 can also be converted: 100.
S203, choose marked as the random number substring.
When it is implemented, server chooses label binary system substring identical with the random number.
For example, random number is 4, then the binary system substring marked as 4 in selecting step S22.
S204, R, G, B value for obtaining the character color, and R, G, B value is converted into the second character string, the respectively Three character strings and the 4th character string.
When it is implemented, server obtains R, G, B value of the character color of needs insertion watermark, by the binary system of selection Substring is inserted into the color attribute of the character, wherein R, G, B value are to be not inserted into from the decimal number between 0~255 Before watermark, R, G, B value of each character of digital text are defaulted are as follows: 0,0,0.R, G, B value are converted into binary word respectively Symbol string, is denoted as the second character string, third character string and the 4th character string respectively, and length can according to need sets itself, this Inventive embodiments are not construed as limiting this.
In this example, for R, G, B value are converted into 8 strings of binary characters respectively, it is assumed that R, G, B value are default value 0,0,0, then the second character string, third character string and the 4th character string after converting are 00000000.
S205, the substring marked as the random number is split into the first substring and the second sub- character String.
When it is implemented, the binary system substring for assuming that random number is 4 in upper example is 10010011, then can by this two System substring splits into two four substrings 1001 and 0011 according to the sequence of big-endian, is denoted as first The digit of substring and the second substring, the first substring and the second substring can also be different, for example, the first son Character string be it is 5 high, the second character string be low 3, the embodiment of the present invention is not construed as limiting this.
S206, the low order character that the corresponding digit of second character string is replaced with first character string.
When it is implemented, assuming that random number is 4,4 strings of binary characters, i.e. the first character string 0100 are converted to, then By latter four of 0100 the second character string 00000000 of replacement, string of binary characters 00000100 is obtained.
S207, the low order character that the corresponding digit of the third character string is replaced with first substring;And use institute State the low order character that the second substring replaces the corresponding digit of the 4th character string.
When it is implemented, in upper example, after low 4 of the first substring 1001 replacement third character string 00000000, Obtain string of binary characters 00001001.After low 4 that second substring 0011 is replaced to the 4th character string 00000000, obtain To string of binary characters 00000011.
S208, replaced each character string is converted into corresponding decimal number respectively.
Specifically, server turns replaced string of binary characters 00000100,00001001 and 00000011 respectively It is changed to corresponding decimal number are as follows: 4,9,3.
S209, the decimal number after conversion is replaced to R, G, B value, the color attribute new as the character respectively.
Specifically, the decimal number after conversion is replaced R, G, B value by server respectively, the color category new as the character Property.In upper example, i.e., by 4,9,3 new R, G, B value as the character.So far, the watermark to the character is completed to be embedded in.Server To request insertion watermark digital text in it is all judge each character for needing to be embedded in watermark be performed both by step S201~ S209, and then the digital text handled is exported, and to each parameter used in this method such as pre-arranged code algorithm, default Initial value setting of length, chaos algorithm equation and equation etc. is recorded, and digital text pass corresponding with each parameter is established System, for making when being detected to the digital text for being embedded in watermark using digital text watermarking embedding grammar provided by the invention With.
Request is embedded in the digital text of watermark by digital text watermarking embedding grammar provided in an embodiment of the present invention, server Copyright information encoded, the character string obtained after coding is split as several substrings, according to chaos algorithm judgement should Whether each character of digital text needs to be embedded in watermark, that is, calculates the position that the digital text needs to be embedded in the character of watermark It sets, to judge to need to be embedded in the character selection substring of watermark and be embedded into corresponding character, the embodiment of the present invention is provided Digital text watermarking embedding grammar watermark is such as embedded in each character different from general water mark method at present, or It is embedded in watermark at every section of section head, section end, since the position of these watermarks insertion is usually fixed, rule is easily found, causes to hold It is easily tampered destruction, and the present invention is made using the position that chaos algorithm calculating needs to be embedded in watermark using the characteristic of chaos algorithm The embedded location of watermark externally shows randomness, can not be predicted, so that the crypticity of insertion watermark location significantly adds By force, it prevents from being tampered, also, the present invention changes this feature according to the small range of the not noticeable color of human eye, will need to hide Copyright information insertion digital text character color attribute in, and be able to maintain that the size of digital text is constant, increase simultaneously The crypticity of watermark information, improves the validity of safety and digital copyright protection.Also, using encryption algorithm to by version The watermark content of power information composition is encoded, and is embedded in digital text after converting thereof into character string, rather than directly will Plaintext embedment further improves the identification difficulty of watermark, enhances crypticity.
Based on the same inventive concept, the embodiment of the invention also provides a kind of digital text watermarking flush mountings, due to upper State that the principle that digital text watermarking flush mounting solves the problems, such as is similar to digital text watermarking embedding grammar, therefore above-mentioned apparatus Implementation may refer to the implementation of method, and overlaps will not be repeated.
As shown in figure 4, it is structural schematic diagram of digital text watermarking flush mounting provided in an embodiment of the present invention, it can be with Include:
Coding unit 31, for encoding the copyright information of the digital text of request insertion watermark, wherein the version Power information is used to characterize the transmitting terminal attribute information of the digital text;
Split cells 32, for the character string obtained after coding to be split as several substrings;
Judging unit 33, for judging whether each character of the digital text needs to be embedded in water according to chaos algorithm Print;
Embedded unit 34, the character for needing to be embedded in watermark for judgement select substring and are embedded into corresponding word Fu Zhong.
Preferably, the split cells 32, specifically for the character string obtained after the coding is torn open according to preset order It is divided into the substring of several preset lengths.
Preferably, the judging unit 33, specifically for according to the acquisition of the iterative equation of hybrid optical flip-flop model The corresponding iterative value of each character;Determine whether the character needs to be embedded in watermark according to the corresponding iterative value of the character.
Preferably, the judging unit 33, is specifically used for when the corresponding iterative value of the character is less than preset threshold, then Determine that the character does not need insertion watermark;When the corresponding iterative value of the character is more than or equal to the preset threshold, then really The fixed character needs to be embedded in watermark.
Preferably, the judging unit 33, is specifically used for obtaining the corresponding iteration of each character according to following formula Value:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text, N indicate the digital text The character sum for including;
XnIndicate the corresponding iterative value of n-th of character in the digital text;
A, B indicates constant.
Optionally, described device can also include:
Processing unit 35, after the character string for obtaining after by the coding splits into several substrings, to tearing open Several substrings after point carry out label in order.
Preferably, the embedded unit 34, specifically for for each character for needing to be embedded in watermark, according to default random It figures method and obtains a random number, the random number is any one label among the label;And the random number is turned Change the first character string into;Choose the substring marked as the random number;R, G, B value of the character color are obtained, and will R, G, B value is converted into the second character string, third character string and the 4th character string respectively;It will be described marked as the random number Substring split into the first substring and the second substring;Second character string is replaced with first character string The low order character of corresponding digit;The low order character of the corresponding digit of the third character string is replaced with first substring;With And the low order character of the corresponding digit of the 4th character string is replaced with second substring.
Optionally, described device can also include:
Converting unit 36, for replaced each character string to be converted to corresponding decimal number respectively;
Replacement unit 37, for the decimal number after conversion to be replaced R, G, B value respectively, new as the character Color attribute.
The embodiment of the invention provides a kind of server, including memory, processor and it is stored on the memory simultaneously The computer program that can be run on the processor, the processor are realized described in the embodiment of the present invention when executing described program Digital text watermarking embedding grammar.
The embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer program, the program The step in digital text watermarking embedding grammar described in the embodiment of the present invention is realized when being executed by processor.
For the number text for being embedded in watermark using above-mentioned digital text watermarking embedding grammar provided in an embodiment of the present invention This, the embodiment of the invention also provides a kind of digital text watermarking detection methods, wherein with digital text watermarking embedding grammar phase The implementation of same step, may refer to the implementation of above-mentioned digital text watermarking embedding grammar, overlaps will not be repeated.
As shown in figure 5, it is the implementation process diagram of digital text watermarking detection method provided in an embodiment of the present invention, It may comprise steps of:
S41, judge whether each character of digital text to be detected is embedded in watermark according to chaos algorithm.
When it is implemented, server obtains the digital text to be detected that terminal is sent, digital text to be detected is to use this The digital text watermarking embedding grammar that inventive embodiments provide is embedded in the digital text of watermark.Server obtains number to be detected The mode of text is identical with the mode of the digital text of acquisition request insertion watermark in above-mentioned digital text watermarking embedding grammar, this Place repeats no more.
When it is implemented, chaos algorithm uses the same algorithm in above-mentioned digital text watermarking embedding grammar.Specifically, needle It is corresponding to obtain each character according to the iterative equation of hybrid optical flip-flop model for each character for treating detection digital text Iterative value;Determine whether the character is embedded in watermark according to the corresponding iterative value of the character.Specifically, when character is corresponding Iterative value be less than preset threshold when, it is determined that the character is not embedded in watermark;When the corresponding iterative value of character is more than or equal to When the preset threshold, it is determined that the character is embedded in watermark.
Specifically, the iterative equation of hybrid optical flip-flop model are as follows:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates n-th of character in the digital text to be detected, N indicate it is described to The character sum that detection digital text includes;
XnIndicate the corresponding iterative value of n-th of character in the digital text to be detected;
A, B indicates constant.
The implementation process of this step referring to step S23 implementation, wherein the iterative equation of hybrid optical flip-flop model just Initial value A, B, X1Setting and preset threshold value and above-mentioned hybrid optical in above-mentioned digital text watermarking embedding grammar it is double The initial value of iterative equation setting and the value of preset threshold of steady model correspond to identical.
S42, for each character for being embedded in watermark judged, extract the substring of insertion, and by the extraction Each substring recombinated, obtain a new character string.
When it is implemented, can be mentioned according to process as shown in FIG. 6 for each character for being embedded in watermark judged The substring for taking it to be embedded in, comprising the following steps:
S401, R, G, B value for obtaining the character color.
When it is implemented, server reads R, G, B value of the character color.
S402, R, G, B value is converted into corresponding character string respectively.
When it is implemented, R, G, B value for the character color that server will acquire are converted into corresponding character string respectively, this It is illustrated by taking string of binary characters as an example in inventive embodiments.Wherein, the corresponding character string of R, G, B value in the embodiment of the present invention Length and digital text watermarking embedding grammar step S204 provided in an embodiment of the present invention in the second character string, third character The length of string and the 4th character string is equal to each other.
S403, the low order character for extracting corresponding presetting digit capacity from the corresponding character string of R, G, B value respectively.
When it is implemented, server extracts the low level two of the corresponding presetting digit capacity in the corresponding character string of R, G, B value respectively The string of binary characters of system character composition.Wherein, it is formed from the low level binary-coded character of the extraction in the corresponding character string of R value String of binary characters length and digital text watermarking embedding grammar provided in an embodiment of the present invention in, the in step S202 The length of one character string corresponds to identical, to form from the low level binary-coded character of the extraction in the corresponding character string of G value binary system The length of character string and the length of the first substring in step S205 are corresponding identical, from mentioning in the corresponding character string of B value The length of the string of binary characters of the low level binary-coded character composition taken and the length pair of the second substring in step S205 It answers identical.
For example, it is assumed that the corresponding presetting digit capacity of R value is 4, then 4 low order character compositions in the corresponding character string of R value are extracted Character string, it is assumed that the corresponding string of binary characters of R value be 00000110, then extract 0110 composition string of binary characters.Together It manages, the extracting mode of the low order character in the corresponding character string of G, B value repeats no more.
S404, the low order character extracted from the corresponding character string of G, B value is combined into a character string.
When it is implemented, server is by the low order character extracted from the corresponding character string of G, B value according to from a high position to low The sequence of position is combined into a string of binary characters.
S405, determine that the character string after the combination is the substring of character insertion.
The sub- word that each character insertion of watermark is embedded in digital text to be detected is obtained by step S401~S405 Symbol string, that is, form each substring of watermark.
Further, each substring extracted from each character is recombinated, obtains a new character string, I.e. complete watermark.
Specifically, each substring extracted from each character is recombinated by flow chart as shown in Figure 7, A new character string is obtained, may comprise steps of:
S501, for each character for being embedded in watermark judged, by what is extracted from the corresponding character string of the R value The character string of the low order character composition of presetting digit capacity is converted into decimal number.
S502, the substring that the character is embedded in is stored to being marked with the decimal number of pre-establishing In array.
When it is implemented, server pre-establishes several arrays, line label of going forward side by side is corresponding with from the R value for storing Character string in the corresponding sub- character of decimal number that is converted into of character string of the low order character composition of presetting digit capacity that extracts String, that is, it is embedded in the character of the low order character composition for the presetting digit capacity extracted in the corresponding character string of R value of the character of watermark The decimal number being converted into go here and there for label, marks the default position extracted from the G value, the corresponding character string of B value of the character It is obtained after the watermark information that the character string of several low order character compositions is embedded in initially insertion watermark i.e. copyright information coding Position in character string.
Specifically, server by the substring that the character is embedded in store to pre-establish with the decimal number into In the array of line flag.
S503, statistics are for storing identical each substring from each array for the substring that each character extracts Number.
When it is implemented, what each character that server statistics are used to be embedded in watermark from digital text to be detected extracted The number of identical each substring in each array of substring.
S504, the largest number of substrings of identical each substring are determined as marking the ten of each array into The corresponding substring of number processed.
In this manner it is ensured that still can accurately be extracted initially embedding even if the substring of some insertion is tampered The watermark information entered.
S505, weight is carried out according to preset order according to the substring of the decimal number and the determination that mark each array Group obtains a new character string.
When it is implemented, the preset order in this step should keep in step S22 to several preset lengths after fractionation Substring carry out label sequence consensus.Such as the example in step S22, according to sequence from low to high to 16 of fractionation Binary system substring carries out label, is denoted as 0~15, then in digital text watermarking detection method provided in an embodiment of the present invention, Accordingly establish array number be 16, and be labeled as 0~15, by array 0~15 determine substring according to by as low as High sequence combination, obtains a new character string.
S43, the character string is decoded, obtains the copyright information of the digital text to be detected.
In this step, the corresponding decoding algorithm of pre-arranged code algorithm in server by utilizing step S21, to being obtained after recombination New character string be decoded, obtain the copyright information of digital text to be detected.
S44, the copyright information is compared with the copyright information of insertion, obtains comparison result.
When it is implemented, by copyright information obtained in step S44 and digital text watermarking provided in an embodiment of the present invention Copyright information in the step S21 of embedding grammar is compared, if in copyright information obtained in this step and step S21 Copyright information is identical, then it represents that the watermark information in digital text to be detected is not tampered with, and in turn, can prove that this is to be detected The copyright ownership of digital text.
Digital text watermarking detection method provided in an embodiment of the present invention is embedded in for using above-mentioned digital text watermarking Method is embedded in the digital text of watermark, in digital text watermarking detection method provided in an embodiment of the present invention, server according to Chaos algorithm judges whether each character of digital text to be detected is embedded in watermark, is embedded in the every of watermark for what is judged One character extracts the substring of insertion, and each substring of extraction is recombinated, and obtains a new character string, will Character string after recombination is decoded, and obtains the copyright information of digital text to be detected, then by the version of the copyright information and insertion Power information is compared, and obtains comparison result, detects whether the watermark being initially embedded in is tampered, and can prove that this is to be detected The copyright ownership of digital text.
Based on the same inventive concept, the embodiment of the invention also provides a kind of digital text watermarking detection devices, due to upper State that the principle that digital text watermarking detection device solves the problems, such as is similar to digital text watermarking detection method, therefore above-mentioned apparatus Implementation may refer to the implementation of method, and overlaps will not be repeated.
As shown in figure 8, it is structural schematic diagram of digital text watermarking detection device provided in an embodiment of the present invention, it can be with Include:
Judging unit 61, for judging whether each character of digital text to be detected is embedded in water according to chaos algorithm Print, the digital text to be detected is the number that watermark is embedded in using data waterprint embedded method provided in an embodiment of the present invention Text;
Extraction unit 62, for extracting the substring of insertion for each character for being embedded in watermark judged, and Each substring of the extraction is recombinated, a new character string is obtained;
Decoding unit 63 obtains the copyright information of the digital text to be detected for the character string to be decoded;
Comparing unit 64 obtains comparison result for the copyright information to be compared with the copyright information of insertion.
Preferably, the chaos algorithm is hybrid optical flip-flop model;
The judging unit 61, specifically for obtaining each character according to the iterative equation of hybrid optical flip-flop model Corresponding iterative value;Determine whether the character is embedded in watermark according to the corresponding iterative value of the character.
Preferably, the judging unit 61, is specifically used for when the corresponding iterative value of the character is less than preset threshold, then Determine that the character is not embedded in watermark;When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that The character is embedded in watermark.
Preferably, the judging unit 61, is specifically used for obtaining the corresponding iteration of each character according to following formula Value:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates n-th of character in the digital text to be detected, N indicate it is described to The character sum that detection digital text includes;
XnIndicate the corresponding iterative value of n-th of character in the digital text to be detected;
A, B indicates constant.
Preferably, the extraction unit 62, specifically for obtaining institute for each character for being embedded in watermark judged State R, G, B value of character color;R, G, B value is converted into corresponding character string respectively;It is corresponding from R, G, B value respectively Character string in extract the low order character of corresponding presetting digit capacity;The low word that will be extracted from the corresponding character string of G, B value Symbol is combined into a character string;Character string after determining the combination is the substring of character insertion.
Preferably, the extraction unit 62 will be from institute specifically for being directed to each character for being embedded in watermark judged The character string for stating the low order character composition for the presetting digit capacity extracted in the corresponding character string of R value is converted into decimal number;It will be described The substring of character insertion is stored into the array being marked with the decimal number pre-established;Statistics is for storing The number of identical each substring in each array of the substring extracted from each character;And by identical each son The largest number of substrings of character string are determined as marking the corresponding substring of the decimal number of each array;It is each according to label The decimal number of array and the substring of the determination are recombinated according to preset order, obtain a new character string.
The embodiment of the invention provides a kind of server, including memory, processor and it is stored on the memory simultaneously The computer program that can be run on the processor, the processor are realized described in the embodiment of the present invention when executing described program Digital text watermarking detection method.
The embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer program, the program The step in digital text watermarking detection method described in the embodiment of the present invention is realized when being executed by processor.
For convenience of description, above each section is divided by function describes respectively for each module (or unit).Certainly, exist Implement to realize the function of each module (or unit) in same or multiple softwares or hardware when the present invention.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, apparatus or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (device) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications can be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (32)

1. a kind of digital text watermarking embedding grammar characterized by comprising
The copyright information of the digital text of request insertion watermark is encoded, wherein the copyright information is described for characterizing The transmitting terminal attribute information of digital text;
The character string obtained after coding is split as several substrings;And
Judge whether each character of the digital text needs to be embedded in watermark according to chaos algorithm;
To judge to need to be embedded in the character selection substring of watermark and be embedded into corresponding character.
2. the method as described in claim 1, which is characterized in that the character string obtained after coding is split as several sub- characters String, specifically includes:
The character string obtained after the coding is split into the substring of several preset lengths according to preset order.
3. the method as described in claim 1, which is characterized in that judge each character of the digital text according to chaos algorithm Whether need to be embedded in watermark, specifically include:
The corresponding iterative value of each character is obtained according to the iterative equation of hybrid optical flip-flop model;
Determine whether the character needs to be embedded in watermark according to the corresponding iterative value of the character.
4. method as claimed in claim 3, which is characterized in that determine that the character is according to the corresponding iterative value of the character It is no to need to be embedded in watermark, it specifically includes:
When the corresponding iterative value of the character is less than preset threshold, it is determined that the character does not need insertion watermark;
When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that the character needs to be embedded in watermark.
5. method as claimed in claim 3, which is characterized in that according to the acquisition of the iterative equation of hybrid optical flip-flop model The corresponding iterative value of each character, specifically includes:
The corresponding iterative value of each character is obtained according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text, N indicate that the digital text includes Character sum;
XnIndicate the corresponding iterative value of n-th of character in the digital text;
A, B indicates constant.
6. method according to claim 1 or 2, which is characterized in that if the character string obtained after by the coding is split into After dry substring, further includes:
Label is carried out in order to several substrings after fractionation.
7. method as claimed in claim 6, which is characterized in that for judgement need to be embedded in watermark character select substring, And be embedded into corresponding character, it specifically includes:
For each character for needing to be embedded in watermark, a random number is obtained according to default random number algorithm, the random number is Any one label among the label;And
The random number is converted into the first character string;
Choose the substring marked as the random number;
R, G, B value of the character color are obtained, and R, G, B value is converted into the second character string, third character string respectively With the 4th character string;
The substring marked as the random number is split into the first substring and the second substring;
The low order character of the corresponding digit of second character string is replaced with first character string;
The low order character of the corresponding digit of the third character string is replaced with first substring;And
The low order character of the corresponding digit of the 4th character string is replaced with second substring.
8. the method for claim 7, which is characterized in that further include:
Replaced each character string is converted into corresponding decimal number respectively;And
Decimal number after conversion is replaced into R, G, B value, the color attribute new as the character respectively.
9. a kind of digital text watermarking flush mounting characterized by comprising
Coding unit, for encoding the copyright information of the digital text of request insertion watermark, wherein the copyright information For characterizing the transmitting terminal attribute information of the digital text;
Split cells, for the character string obtained after coding to be split as several substrings;
Judging unit, for judging whether each character of the digital text needs to be embedded in watermark according to chaos algorithm;
Embedded unit, the character for needing to be embedded in watermark for judgement select substring and are embedded into corresponding character.
10. device as claimed in claim 9, which is characterized in that
The split cells, specifically for the character string obtained after the coding is split into several default length according to preset order The substring of degree.
11. device as claimed in claim 9, which is characterized in that
The judging unit, it is corresponding specifically for obtaining each character according to the iterative equation of hybrid optical flip-flop model Iterative value;Determine whether the character needs to be embedded in watermark according to the corresponding iterative value of the character.
12. device as claimed in claim 11, which is characterized in that
The judging unit is specifically used for when the corresponding iterative value of the character is less than preset threshold, it is determined that the character Insertion watermark is not needed;When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that the character needs It is embedded in watermark.
13. device as claimed in claim 11, which is characterized in that
The judging unit is specifically used for obtaining the corresponding iterative value of each character according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text, N indicate that the digital text includes Character sum;
XnIndicate the corresponding iterative value of n-th of character in the digital text;
A, B indicates constant.
14. the device as described in claim 9 or 10, which is characterized in that further include:
Processing unit, after the character string for obtaining after by the coding splits into several substrings, after fractionation Several substrings carry out label in order.
15. device as claimed in claim 14, which is characterized in that
The embedded unit, specifically for obtaining one according to default random number algorithm for each character for needing to be embedded in watermark A random number, the random number are any one labels among the label;And the random number is converted into the first character String;Choose the substring marked as the random number;R, G, B value of the character color are obtained, and R, G, B value is divided It is not converted into the second character string, third character string and the 4th character string;The substring marked as the random number is torn open It is divided into the first substring and the second substring;The low of the corresponding digit of second character string is replaced with first character string Position character;The low order character of the corresponding digit of the third character string is replaced with first substring;And with described second Substring replaces the low order character of the corresponding digit of the 4th character string.
16. device as claimed in claim 15, which is characterized in that further include:
Converting unit, for replaced each character string to be converted to corresponding decimal number respectively;
Replacement unit, for the decimal number after conversion to be replaced R, G, B value respectively, the color category new as the character Property.
17. a kind of server, including memory, processor and it is stored on the memory and can runs on the processor Computer program, which is characterized in that the processor is realized as described in any one of claim 1~8 when executing described program Digital text watermarking embedding grammar.
18. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The step in digital text watermarking embedding grammar as described in any one of claims 1 to 8 is realized when execution.
19. a kind of digital text watermarking detection method characterized by comprising
Judge whether each character of digital text to be detected is embedded in watermark, the digital text to be detected according to chaos algorithm To use claim 1~8 the method to be embedded in the digital text of watermark;
For each character for being embedded in watermark judged, the substring of insertion is extracted, and by each sub- word of the extraction Symbol string is recombinated, and a new character string is obtained;
The character string is decoded, the copyright information of the digital text to be detected is obtained;
The copyright information is compared with the copyright information of insertion, obtains comparison result.
20. method as claimed in claim 19, which is characterized in that the chaos algorithm is hybrid optical flip-flop model;
Judge whether each character of digital text to be detected is embedded in watermark according to chaos algorithm, specifically include:
The corresponding iterative value of each character is obtained according to the iterative equation of hybrid optical flip-flop model;
Determine whether the character is embedded in watermark according to the corresponding iterative value of the character.
21. method as claimed in claim 20, which is characterized in that determine the character according to the corresponding iterative value of the character Whether it is embedded in watermark, specifically included:
When the corresponding iterative value of the character is less than preset threshold, it is determined that the character is not embedded in watermark;
When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that the character is embedded in watermark.
22. method as claimed in claim 20, which is characterized in that obtain institute according to the iterative equation of hybrid optical flip-flop model The corresponding iterative value of each character is stated, is specifically included:
The corresponding iterative value of each character is obtained according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text to be detected, N indicate described to be detected The character sum that digital text includes;
XnIndicate the corresponding iterative value of n-th of character in the digital text to be detected;
A, B indicates constant.
23. method as claimed in claim 19, which is characterized in that for each character for being embedded in watermark judged, mention The substring for taking insertion, specifically includes:
For each character for being embedded in watermark judged, R, G, B value of the character color are obtained;
R, G, B value is converted into corresponding character string respectively;
The low order character of corresponding presetting digit capacity is extracted from the corresponding character string of R, G, B value respectively;
The low order character extracted from the corresponding character string of G, B value is combined into a character string;
Character string after determining the combination is the substring of character insertion.
24. method as claimed in claim 23, which is characterized in that recombinate each substring of the extraction, obtain One new character string, specifically includes:
For each character for being embedded in watermark judged, the presetting digit capacity that will be extracted from the corresponding character string of the R value Low order character composition character string be converted into decimal number;
The substring that the character is embedded in is stored into the array being marked with the decimal number pre-established;
Statistics is for storing the number of identical each substring from each array for the substring that each character extracts;And
It is determined as marking the decimal number of each array corresponding the largest number of substrings of identical each substring Substring;
It is recombinated according to the substring of the decimal number and the determination that mark each array according to preset order, obtains one New character string.
25. a kind of digital text watermarking detection device characterized by comprising
Judging unit, it is described for judging whether each character of digital text to be detected is embedded in watermark according to chaos algorithm Digital text to be detected is the digital text that watermark is embedded in using claim 1~8 the method;
Extraction unit, for extracting the substring of insertion for each character for being embedded in watermark judged, and will be described Each substring extracted is recombinated, and a new character string is obtained;
Decoding unit obtains the copyright information of the digital text to be detected for the character string to be decoded;
Comparing unit obtains comparison result for the copyright information to be compared with the copyright information of insertion.
26. device as claimed in claim 25, which is characterized in that the chaos algorithm is hybrid optical flip-flop model;
The judging unit, it is corresponding specifically for obtaining each character according to the iterative equation of hybrid optical flip-flop model Iterative value;Determine whether the character is embedded in watermark according to the corresponding iterative value of the character.
27. device as claimed in claim 26, which is characterized in that
The judging unit is specifically used for when the corresponding iterative value of the character is less than preset threshold, it is determined that the character It is not embedded in watermark;When the corresponding iterative value of the character is more than or equal to the preset threshold, it is determined that the character insertion Watermark.
28. device as claimed in claim 26, which is characterized in that
The judging unit is specifically used for obtaining the corresponding iterative value of each character according to following formula:
Xn+1=Asin2(Xn-B)
Wherein, n=1,2 ..., N indicates that n-th of character in the digital text to be detected, N indicate described to be detected The character sum that digital text includes;
XnIndicate the corresponding iterative value of n-th of character in the digital text to be detected;
A, B indicates constant.
29. device as claimed in claim 25, which is characterized in that
The extraction unit, specifically for obtaining the character color for each character for being embedded in watermark judged R, G, B value;R, G, B value is converted into corresponding character string respectively;It is mentioned from the corresponding character string of R, G, B value respectively Take the low order character of corresponding presetting digit capacity;The low order character extracted from the corresponding character string of G, B value is combined into one Character string;Character string after determining the combination is the substring of character insertion.
30. device as claimed in claim 29, which is characterized in that
The extraction unit will be from the corresponding word of the R value specifically for being directed to each character for being embedded in watermark judged The character string of the low order character composition for the presetting digit capacity extracted in symbol string is converted into decimal number;The sub- word that the character is embedded in Symbol string is stored into the array being marked with the decimal number pre-established;Statistics is extracted for storing from each character Substring each array in identical each substring number;And most by the number of identical each substring More substrings is determined as marking the corresponding substring of the decimal number of each array;According to the decimal number for marking each array It is recombinated with the substring of the determination according to preset order, obtains a new character string.
31. a kind of server, including memory, processor and it is stored on the memory and can runs on the processor Computer program, which is characterized in that the processor is realized when executing described program such as any one of claim 19~24 institute The digital text watermarking detection method stated.
32. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor It realizes when execution such as the step in the described in any item digital text watermarking detection methods of claim 19~24.
CN201810276720.9A 2018-03-30 2018-03-30 A kind of insertion of digital text watermarking and detection method and device Pending CN110322386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810276720.9A CN110322386A (en) 2018-03-30 2018-03-30 A kind of insertion of digital text watermarking and detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810276720.9A CN110322386A (en) 2018-03-30 2018-03-30 A kind of insertion of digital text watermarking and detection method and device

Publications (1)

Publication Number Publication Date
CN110322386A true CN110322386A (en) 2019-10-11

Family

ID=68111486

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810276720.9A Pending CN110322386A (en) 2018-03-30 2018-03-30 A kind of insertion of digital text watermarking and detection method and device

Country Status (1)

Country Link
CN (1) CN110322386A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400670A (en) * 2020-03-06 2020-07-10 全球能源互联网研究院有限公司 Watermark adding method, device, equipment and storage medium
CN112948895A (en) * 2019-12-10 2021-06-11 航天信息股份有限公司 Data watermark embedding method, watermark tracing method and device
CN112948776A (en) * 2021-02-03 2021-06-11 海信集团控股股份有限公司 Digital watermark adding method and device, electronic equipment and storage medium
CN114780924A (en) * 2022-06-20 2022-07-22 北京和人广智科技有限公司 Electronic text tracing method and device
CN115292731A (en) * 2022-08-02 2022-11-04 深圳市乐凡信息科技有限公司 Encryption storage method of text reading and amending information and related equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517855A (en) * 2003-01-16 2004-08-04 成都市宇飞信息工程有限公司 Image digital watermark method
CN1924925A (en) * 2006-09-28 2007-03-07 北京理工大学 Document data waterprint embedded method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1517855A (en) * 2003-01-16 2004-08-04 成都市宇飞信息工程有限公司 Image digital watermark method
CN1924925A (en) * 2006-09-28 2007-03-07 北京理工大学 Document data waterprint embedded method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
彭宇: "一种基于数字水印技术的文本文档版权保护方案", 《中国教育信息化》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948895A (en) * 2019-12-10 2021-06-11 航天信息股份有限公司 Data watermark embedding method, watermark tracing method and device
CN111400670A (en) * 2020-03-06 2020-07-10 全球能源互联网研究院有限公司 Watermark adding method, device, equipment and storage medium
CN111400670B (en) * 2020-03-06 2023-12-15 全球能源互联网研究院有限公司 Watermark adding method, device, equipment and storage medium
CN112948776A (en) * 2021-02-03 2021-06-11 海信集团控股股份有限公司 Digital watermark adding method and device, electronic equipment and storage medium
CN114780924A (en) * 2022-06-20 2022-07-22 北京和人广智科技有限公司 Electronic text tracing method and device
CN115292731A (en) * 2022-08-02 2022-11-04 深圳市乐凡信息科技有限公司 Encryption storage method of text reading and amending information and related equipment

Similar Documents

Publication Publication Date Title
CN110322386A (en) A kind of insertion of digital text watermarking and detection method and device
Gutub et al. A novel Arabic text steganography method using letter points and extensions
Roy et al. A novel approach to format based text steganography
CN103049682B (en) Character pitch encoding-based dual-watermark embedded text watermarking method
Tayyeh et al. Novel steganography scheme using Arabic text features in Holy Quran
CN102194081B (en) Method for hiding natural language information
CN105303075B (en) Adaptive Text Watermarking method based on PDF format
CN112016061A (en) Excel document data protection method based on robust watermarking technology
CN115604401B (en) Traceable electronic seal encryption method
Mandal et al. A new approach of text Steganography based on mathematical model of number system
Rafat et al. Secure digital steganography for ASCII text documents
Fei et al. A reversible watermark scheme for 2D vector map based on reversible contrast mapping
CN104715442B (en) A kind of quantum image watermark method based on Hamming code
Choche et al. A methodology to conceal QR codes for security applications
Sharma et al. A study of steganography based data hiding techniques
CN103731654A (en) Information embedding system and information extracting system using 2D/3D videos
CN104424619A (en) Information processing apparatus and information processing method
Liu et al. Text steganography based on online chat
CN109840574B (en) Two-dimensional code information hiding method and device, electronic equipment and storage medium
CN110008663B (en) Method for quickly embedding and extracting information for PDF document protection and distribution tracking
Saber et al. Steganography in MS excel document using unicode system characteristics
Qin et al. Artificial Intelligence Oriented Information Hiding and Multimedia Forensics
Bajaj et al. RSA Secured Web Based Steganography Employing HTML Space Codes And Compression Technique
Chaudhary et al. A capital shape alphabet encoding (CASE) based text steganography
Jie Algorithm of XML document information hiding based on equal element

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191011