Information hiding method and analysis method for webpage watermark
By converting user information into digital encoding and hiding it in long text fields, text watermarks in the form of clear watermarks are solved, and the existing watermark technology is effectively hidden and securely protected.
Patent Information
- Application Number
- CN202411970452.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
AI Technical Summary
The existing watermark information hiding technology has shortcomings in information security protection. It is difficult for open watermarks to hide user information, while the hidden watermark technology is complex and costly, making it difficult to widely use.
Generate text watermarks in the form of clear watermarks by converting user information into digital encodings and hiding them in long text fields using encoding strategies. The method includes obtaining user information, converting it to digital encoding, filling a positioning identifier and a random empty identifier, and adjusting the text shape to generate a watermark.
The information hiding of Ming Watermark is realized, solving the problem that traditional Ming Watermarks are difficult to hide user identity, and at the same time, it reduces technical complexity and implementation costs, and enhances the security and anti-counterfeiting capabilities of information.
Smart Images

Figure CN119885121A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of watermark generation, and in particular to an information hiding method and a parsing method for a webpage watermark. Background Art
[0002] The watermark information hiding method is a comprehensive technology involving multiple aspects such as information hiding, algorithms and implementation methods. It currently has a wide range of application scenarios. For example, watermark information hiding technology is currently used in copyright protection, internal enterprise information protection, e-commerce platforms, prevention of information leakage and many other fields.
[0003] At present, there are two types of watermark information hiding methods: clear watermark and dark watermark. Clear watermark is difficult to effectively hide user information due to its intuitive and visible characteristics. Its original design intention is more for copyright statement and brand display rather than information security protection. Therefore, most of them adopt the dark watermark method. Although dark watermark can better hide user information, it requires a higher level of technology and computing power, has high technical complexity, and the corresponding implementation cost is significantly increased, which requires more resource investment and technical support in its application. Summary of the invention
[0004] In view of this, the problem to be solved by the present invention is to provide an information hiding method and a parsing method for a webpage watermark.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A webpage watermark information hiding method includes obtaining user information and converting it into a digital code consisting of values 0-9;
[0007] Obtain a long text field, and hide the digital code in the long text field according to the encoding strategy to generate a text watermark containing user information;
[0008] The encoding strategy includes obtaining a positioning identifier, determining the correspondence between a numerical value and a deformation pattern according to the positioning identifier, filling the positioning identifier at the front end of a digital code, filling a random number of empty identifiers at random positions in the digital code and the positioning identifier to form a watermark string with a length consistent with the length of a long text field, and adjusting the text shape according to the correspondence between characters in the watermark string and the deformation pattern to generate a text watermark.
[0009] Furthermore, the style combination includes several deformation styles, each of which includes a type A deformation style, a type B deformation style and a type C deformation style, and the type C deformation style is used to generate a positioning mark.
[0010] Furthermore, the deformation style is composed of a random combination of font offset, font size, and font rotation.
[0011] Furthermore, the user information includes user name and user ID.
[0012] Furthermore, the number of characters in the long text field is greater than the numerical value of the digital code.
[0013] Furthermore, the empty mark corresponds to multiple type A deformation styles.
[0014] A webpage watermark generation system includes a user information encoding module for converting user information into a digital code consisting of numerical values, a text library module for providing text required for watermarks, a style processing module for generating a plurality of style combinations consisting of deformed styles, a mapping module for determining the corresponding relationship between deformed styles and numerical values, and a generation module for generating text watermarks.
[0015] A webpage watermark recognition method includes obtaining a watermark image, recognizing a text style on the watermark image to generate a text feature column;
[0016] Eliminate the a-type text style in the text feature column, determine the positioning identifier, determine the mapping relationship between the text style and the numerical value based on the positioning identifier, and parse the subsequent text style to generate a digital code.
[0017] Furthermore, based on the comparison between the type a text features and the text features in the text feature column, the type a text features in the text feature column are eliminated.
[0018] A webpage watermark recognition system includes a watermark image acquisition module for collecting watermark images, an image preprocessing module for improving image clarity, a style feature extraction module for identifying text styles, a text information decoding module for parsing text feature columns, and a verification and comparison module for determining whether a watermark is correct.
[0019] The advantages and positive effects of the present invention are:
[0020] The user information is encrypted and converted into a digital code in numerical form. According to the mapping relationship between the digital code and the text deformation style, the text shape is adjusted to generate a text watermark in the form of a clear watermark, thereby achieving the technical effect of hiding information in a clear watermark, and solving the problem that traditional clear watermarks are difficult to effectively hide user identities and are easily tampered with. This allows the information to maintain a high degree of readability and traceability while protecting user privacy and enhancing the security and anti-counterfeiting capabilities of the information. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0022] Figure 1 It is an overall flow chart of a method for hiding information of a webpage watermark of the present invention;
[0023] Figure 2 It is a structural diagram of an information hiding system for a webpage watermark of the present invention;
[0024] Figure 3 It is a flow chart of a method for parsing a webpage watermark of the present invention;
[0025] Figure 4 It is a structural diagram of a web page watermark analysis system of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0028] The present invention provides a method for hiding information of a webpage watermark. Figure 1 As shown, it includes obtaining user information and converting it into a digital code consisting of values 0-9.
[0029] User information includes user name and user ID. Since user ID is unique, the generated watermark is also unique. For example: {username:"test",email:"test@163.com"}. Use JSON.stringify() method to convert user information into JSON string. Generate a unique digital identifier through user information encoding algorithm. The generated digital code is as follows: 534040907.
[0030] One embodiment of the present application is: converting user information into a digital code formed by 0-9 through the DJB2 hash algorithm to hide the original user information, and each user's digital code is unique and has no length limit. And: a long user name or a long ID name does not affect the generation of the watermark. The principle of the DJB2 algorithm is to treat the input string as a byte array, then traverse each byte and multiply it with a constant (usually 33 or 5381) (or perform shift and addition operations to achieve a similar effect), add the current hash value (or updated hash value), and finally return a hash value.
[0031] The long text field is obtained, and the digital code is hidden in the long text field according to the encoding strategy to generate a text watermark containing user information.
[0032] The encoding strategy includes obtaining a positioning identifier, determining the correspondence between a numerical value and a deformation style based on the positioning identifier, filling the positioning identifier at the front end of a digital code, filling a random number of empty identifiers at random positions within the digital code and the positioning identifier to form a watermark string whose length is consistent with the length of a long text field, and adjusting the text shape based on the correspondence between characters in the watermark string and the deformation style to generate a text watermark.
[0033] The long text field can randomly select a meaningful sentence or it can be determined by the user. In order to improve the efficiency of hiding information by the text watermark, the number of characters in the long text field is greater than the numerical value of the digital code, which is convenient for filling empty marks and improving concealment.
[0034] The encoding strategy includes several style combinations, and different style combinations have different deformation modes. The style combination can be selected according to personal preferences to generate watermark text arranged in the order of text. The style combination includes several deformation styles, and the deformation style is composed of a random combination of font offset, font size, and font rotation. An embodiment of the present application is: the font offset includes three types: no vertical offset, vertical upward offset, and vertical downward offset; the font size includes two types: unchanged and smaller; the font rotation includes three types: no rotation, left rotation, and right rotation, which together constitute 2*3*3=18 deformation styles.
[0035] The deformation styles include a deformation style, b deformation style and c deformation style. A does not contain any information, and a class corresponds to an empty identifier, and an empty identifier maps multiple a classes; b contains numerical information and is mapped one-to-one with the numerical value; c is used to generate positioning identifiers and calibrate the mapping relationship between b and numerical values. When generating a watermark, different positioning identifiers are used, and the deformation styles corresponding to the numerical values are also different, which can effectively improve the information hiding efficiency of the watermark.
[0036] An embodiment of the present application is: each of the 18 deformation styles is represented by A to R, wherein the 10 letters A to J represent the B-type deformation style, the 4 letters K to N represent the C-type deformation style, and the 4 letters O to R represent the A-type deformation style.
[0037] The four letters K to N are randomly arranged in pairs to form 16 positioning identifiers, and each positioning identifier has a different mapping relationship between the corresponding A class and the value, which can effectively improve the information hiding efficiency of the watermark.
[0038] An embodiment of the present application is: the selected digital code is 534040907, the characters of the positioning mark are S, X, Y, and Z, each character corresponds to a deformation style, the character of the empty mark is T, the selected long text field contains 20 characters, XS is selected as the style combination, and the generated watermark string is TXTTST340TT409TT0TT7. When generating the watermark string, T corresponds to the A-type deformation style. When generating the watermark, the deformation style corresponding to each empty mark is randomly selected, and the selection weight of each deformation style is the same. According to the mapping relationship between the characters and values in the watermark string and the deformation style, the deformation style of each word in the long text field can be obtained. Through HTML+CSS technology, the corresponding text is set to the corresponding text style, and the set single watermark text is combined together to form a text watermark. The text in the text watermark is arranged in a fixed format.
[0039] A webpage watermark generation system, such as Figure 2 As shown, the watermark information hiding system includes a user information encoding module, a text library module, a mapping module, a style processing module and a generation module. The user information encoding module is used to convert user information into a digital code consisting of numerical values; the text library module is used to provide the text required for the watermark; the style processing module is used to generate a combination of several styles consisting of deformed styles, the mapping module is used to determine the corresponding relationship between the deformed style and the numerical value, and the generation module is used to generate a text watermark.
[0040] The text library module includes a text library, which records characters of different fonts, styles and languages. It can carry enough hidden information while ensuring the diversity, readability and aesthetics of the watermark text. The generation module uses HTML+CSS technology to generate related DOM elements or image elements based on the processed text and its style, and then uses HTML+CSS technology to spread the DOM elements or image elements across the entire screen. At the same time, it combines front-end technologies such as MutationObserver to monitor changes in page elements to prevent watermarks from being tampered with.
[0041] A webpage watermark recognition method, such as Figure 3 As shown, the process includes obtaining a watermark image and identifying the text style on the watermark image to generate a text feature column.
[0042] In order to improve the accuracy of the text feature column, multiple watermark images were collected and preprocessed by denoising, contrast enhancement, color balance adjustment, etc. to identify their text styles.
[0043] Eliminate the a-type text style in the text feature column, determine the positioning identifier based on the first two text styles, determine the mapping relationship between the text style and the numerical value based on the positioning identifier, and parse the subsequent text styles to generate digital codes.
[0044] Since the a-type text features do not contain information, the a-type text features contained in all style combinations are compared with the text features in the text feature column, and the a-type text features in the text feature column are eliminated. The text style permutations and combinations contained in the positioning identifiers in all style combinations are compared with the first two text styles in the remaining text feature columns, and the mapping relationship between the style combinations and the text styles in the style combinations and the values is determined, and the unique digital code of the value is parsed.
[0045] The digital code is compared with the user digital code recorded in the user database. If the comparison is successful, a watermark valid feedback is given. If the comparison fails, a watermark invalid feedback is given.
[0046] During the verification and comparison, the restored unique digital identifier is compared with the user's unique identifier stored in the database to ensure the confidentiality and integrity of the user information. If the comparison is successful, it means that the watermark information is valid and the user information is authentic; if the comparison fails, further investigation and processing are required.
[0047] A watermark recognition system, such as Figure 4 As shown, it includes a watermark image acquisition module for acquiring watermark images, an image preprocessing module for improving image clarity, a style feature extraction module for identifying text styles, a text information decoding module for parsing text feature columns, and a verification and comparison module for determining that the watermark is correct.
[0048] The acquisition methods of the watermark image acquisition module include directly providing by the user, directly acquiring from a network link, and acquiring the image containing the watermark through a camera device.
[0049] Image preprocessing includes denoising, contrast enhancement, color balance adjustment, etc., which can remove noise and interference factors in the image and make the watermark text clearer and easier to identify.
[0050] The feature extraction module identifies the text style features in the watermark image through manual recognition or image recognition technology (such as OCR), including the text offset, font size, and rotation angle.
[0051] The text information decoding module decodes the text information in the watermark image according to the extracted style features and the preset encoding strategy to restore the original digital sequence or unique data identifier.
[0052] The verification and comparison module compares and verifies the decoded unique data identifier with the user unique identifier stored in the database and gives a comparison result.
[0053] The embodiments of the present invention are described in detail above, but the contents described are only preferred embodiments of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of this patent.
Claims
1. A webpage watermark information hiding method, characterized in that: It includes obtaining user information and converting it into a digital code consisting of values 0-9; Obtain a long text field, and hide the digital code in the long text field according to the encoding strategy to generate a text watermark containing user information; The encoding strategy includes obtaining a positioning identifier, determining the correspondence between a numerical value and a deformation pattern according to the positioning identifier, filling the positioning identifier at the front end of a digital code, filling a random number of empty identifiers at random positions in the digital code and the positioning identifier to form a watermark string with a length consistent with the length of a long text field, and adjusting the text shape according to the correspondence between characters in the watermark string and the deformation pattern to generate a text watermark.
2. The method for hiding information of a webpage watermark according to claim 1, characterized in that: The style combination includes several deformation styles, each of which includes a type A deformation style, a type B deformation style and a type C deformation style, and the type C deformation style is used to generate a positioning mark.
3. The method for hiding information of a webpage watermark according to claim 1, characterized in that: The deformation style is composed of a random combination of font offset, font size, and font rotation.
4. The method for hiding information of a webpage watermark according to claim 1, characterized in that: The user information includes user name and user ID.
5. The method for hiding information of a webpage watermark according to claim 1, characterized in that: The number of characters in the long text field is greater than the numerical value of the digital code.
6. The method for hiding information of a webpage watermark according to claim 1, characterized in that: The empty tag corresponds to multiple type A deformation styles.
7. A webpage watermark generation system, according to the webpage watermark information hiding method and parsing method according to any one of claims 1 to 6, characterized in that: It includes a user information encoding module for converting user information into a digital code consisting of numerical values, a text library module for providing the text required for the watermark, a style processing module for generating a style combination consisting of several deformed styles, a mapping module for determining the corresponding relationship between the deformed style and the numerical value, and a generation module for generating a text watermark.
8. A webpage watermark recognition method, according to the webpage watermark information hiding method and parsing method according to any one of claims 1 to 6, characterized in that: Including obtaining a watermark image, identifying the text style on the watermark image to generate a text feature column; Eliminate the a-type text style in the text feature column, determine the positioning identifier, determine the mapping relationship between the text style and the numerical value based on the positioning identifier, and parse the subsequent text style to generate a digital code.
9. A webpage watermark recognition method according to claim 8, characterized in that: Based on the comparison between the type a text features and the text features in the text feature column, the type a text features in the text feature column are eliminated.
10. A webpage watermark recognition system, according to a webpage watermark recognition method according to any one of claims 8-9, characterized in that: It includes a watermark image acquisition module for collecting watermark images, an image preprocessing module for improving image clarity, a style feature extraction module for identifying text styles, a text information decoding module for parsing text feature columns, and a verification and comparison module for determining the correctness of the watermark.