CN117725333A - Text steganography method and device for browser webpage and electronic equipment - Google Patents

Text steganography method and device for browser webpage and electronic equipment Download PDF

Info

Publication number
CN117725333A
CN117725333A CN202410095278.5A CN202410095278A CN117725333A CN 117725333 A CN117725333 A CN 117725333A CN 202410095278 A CN202410095278 A CN 202410095278A CN 117725333 A CN117725333 A CN 117725333A
Authority
CN
China
Prior art keywords
target
pseudo
target node
code
browser
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
CN202410095278.5A
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.)
Tianyi Electronic Commerce Co Ltd
Original Assignee
Tianyi Electronic Commerce 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 Tianyi Electronic Commerce Co Ltd filed Critical Tianyi Electronic Commerce Co Ltd
Priority to CN202410095278.5A priority Critical patent/CN117725333A/en
Publication of CN117725333A publication Critical patent/CN117725333A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a text steganography method and device for a browser webpage and electronic equipment, and relates to the technical field of information security, wherein the method comprises the following steps: converting target text information to be steganographically according to a preset character set to obtain a coding set, wherein a coding record in the coding set comprises a digital code and a coding sequence number; adjusting the original font size value of the target node in the target node set according to a preset adjustment strategy and all the coding records; creating a pseudo element set based on the adjusted target node set, wherein a first association relation exists between a specified pattern defined by the pseudo element and an original pattern of the target node, the pseudo element is used for inserting the specified pattern in a specified position in the target node, and the display attribute of the pseudo element is set to be not directly displayed on a browser webpage; a browser web page is generated based on the set of target nodes and the set of pseudo elements. The invention solves the technical problem that the text steganography can not be realized under the condition of not changing the original text in the related art.

Description

Text steganography method and device for browser webpage and electronic equipment
Technical Field
The invention relates to the technical field of information security, in particular to a text steganography method and device for a browser webpage and electronic equipment.
Background
At present, when text steganography is required to be performed in a browser webpage, a common scheme is to encode text characters to obtain contents to be hidden, insert the contents to be hidden into the existing display contents of the browser webpage, and can realize text steganography under a conventional scene, but the means is not completely hidden, and the existing display contents of the browser are detected by means of regular matching and the like to identify text abnormality, so that the inserted hidden contents are found.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a text steganography method and device for a browser webpage and electronic equipment, which at least solve the technical problem that text steganography cannot be realized under the condition of not changing an original text in the related technology.
According to an aspect of an embodiment of the present invention, there is provided a text steganography method for a browser webpage, including: converting target text information to be steganographically according to a preset character set to obtain a code set, wherein the code set comprises M code records, each code record at least comprises a digital code and a code sequence number of the digital code, the target text information comprises M target characters, each target character corresponds to one code record one by one, and M is a positive integer; according to a preset adjustment strategy and all the coding records in the coding set, adjusting the original font size values of M target nodes in a target node set to obtain an adjusted target node set; creating M pseudo elements based on M target nodes in the adjusted target node set to obtain a pseudo element set, wherein each target node corresponds to one pseudo element one by one, a specified pattern defined by the pseudo element has a first association relationship with an original pattern of the target node, the pseudo elements are used for inserting the specified pattern in specified positions in the target nodes, and display attributes of all the pseudo elements are set to be not directly displayed on a browser webpage; and generating the browser webpage based on the adjusted target node set and the pseudo element set.
Optionally, before converting the target text information to be steganographically according to the preset character set to obtain the code set, the method further includes: searching the minimum font node through the document object model to obtain the target node set, wherein the target node set comprises P target nodes, the target nodes are the minimum font nodes which are displayed on the browser webpage by the minimum font size value allowed to be displayed by the browser, and P is a positive integer greater than or equal to M.
Optionally, the step of converting the target text information to be steganographically according to a preset character set to obtain the code set includes: receiving the target text information to be hidden, and extracting the target characters in the target text information based on a pre-designated reading sequence; generating the coding sequence number based on the reading sequence, and establishing a second association relationship between the coding sequence number and the target character; for each target character, acquiring the digital code corresponding to the target character according to the preset character set, wherein the preset character set comprises N preset character mapping rules, each preset character mapping rule is used for recording a mapping relation between one target character and the digital code corresponding to the target character, and N is a positive integer greater than or equal to M; and creating an initial code set, and inputting all the digital codes into the initial code set based on the code sequence number and the second association relation to obtain the code set.
Optionally, the step of adjusting original font size values of M target nodes in the target node set according to a preset adjustment policy and all the code records in the code set to obtain an adjusted target node set includes: extracting the digital codes in the code set according to the code sequence number; in the process of extracting the digital codes, synchronously extracting the target nodes in the target node set, and setting the digital codes extracted at the same time point and the target nodes as mapping groups to obtain M mapping groups; for each mapping group, acquiring the total bit number of the digital codes in the mapping group, and calculating the digital codes based on a first preset formula and the total bit number to obtain assigned parameters; based on the preset adjustment strategy, using the assignment parameters to assign the original font size value of the target node in the mapping group, and obtaining the adjusted original font size value; and integrating M adjusted original font size values corresponding to the M mapping groups to obtain the adjusted target node set.
Optionally, creating M dummy elements based on M target nodes in the adjusted target node set, to obtain a dummy element set, including: creating a pseudo element class in the CSS selector, and setting a class display attribute of the pseudo element class not to be directly displayed on a browser webpage; for each target node in the target node set, taking a target element in the target node as a parent element, and determining the original style of the target element as a parent element style, wherein the original style at least comprises an original font size value and the original content; calculating the font size value of the pseudo element based on a second preset formula and the original font size value, and taking the original content as the appointed content of the pseudo element; generating the specified style of the dummy element based on the font size value and the specified content, and associating the specified style to the CSS selector; creating the dummy element based on the CSS selector; and integrating M pseudo elements corresponding to the M encoded records, and converting the encoding sequence numbers in the encoded records into decoding sequence numbers to obtain the pseudo element set.
Optionally, the step of generating the browser webpage based on the adjusted target node set and the pseudo element set includes: updating a CSS style sheet based on the adjusted target node set, wherein the CSS style sheet is used for recording the original font size values of all nodes in the target node set; injecting all the pseudo elements in the pseudo element set to the appointed position of the updated CSS style sheet according to the decoding sequence number; associating the CSS style sheet to an HTML document, wherein the HTML document is used for recording the original display content of all target nodes; and loading the HTML document in a browser to obtain the browser webpage.
Optionally, after generating the browser webpage based on the adjusted target node set and the pseudo element set, the method further includes: obtaining calculation styles of all the pseudo elements through a designated style calculation interface to obtain a calculation style set, wherein the calculation styles at least comprise: calculating a font size value and a decoding sequence number; calculating all the calculated font size values in the calculated style set based on a specified style formula to obtain a decoding set, wherein the decoding set contains M decoding values; for each decoding value, converting the decoding value based on all the preset character mapping rules in the preset character set to obtain decoding characters; and arranging M decoding characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoding text.
According to another aspect of the embodiment of the present invention, there is also provided a text steganography device for a browser web page, including: the conversion unit is used for converting target text information to be steganographically according to a preset character set to obtain a code set, wherein the code set comprises M code records, each code record at least comprises a digital code and a code sequence number of the digital code, the target text information comprises M target characters, each target character corresponds to one code record one by one, and M is a positive integer; the adjusting unit is used for adjusting the original font size values of M target nodes in the target node set according to a preset adjusting strategy and all the coding records in the coding set to obtain an adjusted target node set; the creating unit is used for creating M pseudo elements based on M target nodes in the adjusted target node set to obtain a pseudo element set, wherein each target node corresponds to one pseudo element one by one, a first association relation exists between a specified pattern defined by the pseudo element and an original pattern of the target node, the pseudo elements are used for inserting the specified pattern in a specified position in the target node, and the display attribute of all the pseudo elements is set to be not directly displayed on a browser webpage; and the generation unit is used for generating the browser webpage based on the adjusted target node set and the pseudo element set.
Optionally, the text steganography device for a browser webpage further includes: the searching module is used for searching the minimum font node through the document object model to obtain the target node set, wherein the target node set comprises P target nodes, the target nodes are the minimum font nodes which are displayed on the browser webpage by the minimum font size value allowed to be displayed by the browser, and P is a positive integer greater than or equal to M.
Optionally, the conversion unit includes: the receiving module is used for receiving the target text information to be hidden and extracting the target characters in the target text information based on a pre-designated reading sequence; the establishing module is used for generating the coding sequence number based on the reading sequence and establishing a second association relationship between the coding sequence number and the target character; the first acquisition module is used for acquiring the digital codes corresponding to the target characters according to the preset character set for each target character, wherein the preset character set comprises N preset character mapping rules, each preset character mapping rule is used for recording the mapping relation between one target character and the digital codes corresponding to the target character, and N is a positive integer greater than or equal to M; the first creating module is used for creating an initial code set, and inputting all the digital codes into the initial code set based on the code sequence number and the second association relation to obtain the code set.
Optionally, the adjusting unit includes: the first extraction module is used for extracting the digital codes in the code set according to the code sequence number; the second extraction module is used for synchronously extracting the target nodes in the target node set in the process of extracting the digital codes, and setting the digital codes extracted at the same time point and the target nodes as mapping groups to obtain M mapping groups; the operation module is used for acquiring the total bit number of the digital codes in each mapping group, and operating the digital codes based on a first preset formula and the total bit number to obtain assigned parameters; the assignment module is used for assigning the original font size value of the target node in the mapping group by using the assignment parameters based on the preset adjustment strategy to obtain the adjusted original font size value; the first integration module is used for integrating the M adjusted original font size values corresponding to the M mapping groups to obtain the adjusted target node set.
Optionally, the creating unit includes: a second creating module, configured to create a pseudo element class in the CSS selector, and set a class display attribute of the pseudo element class not to be directly displayed on the browser web page; a determining module, configured to, for each of the target nodes in the target node set, take a target element in the target node as a parent element, and determine the original style of the target element as a parent element style, where the original style includes at least an original font size value and the original content; the first calculation module is used for calculating the font size value of the pseudo element based on a second preset formula and the original font size value, and taking the original content as the appointed content of the pseudo element; a generation module for generating the specified style of the dummy element based on the font size value and the specified content, and associating the specified style to the CSS selector; a third creation module for creating the pseudo element based on the CSS selector; and the second integration module is used for integrating M pseudo elements corresponding to the M code records, converting the code sequence numbers in the code records into decoding sequence numbers and obtaining the pseudo element set.
Optionally, the generating unit includes: an updating module, configured to update a CSS style sheet based on the adjusted target node set, where the CSS style sheet is configured to record the original font size values of all nodes in the target node set; the injection module is used for respectively injecting all the pseudo elements in the pseudo element set to the appointed position of the updated CSS style sheet according to the decoding sequence number; the association module is used for associating the CSS style sheet to an HTML document, wherein the HTML document is used for recording the original display content of all target nodes; and the loading module is used for loading the HTML document in the browser to obtain the browser webpage.
Optionally, the text steganography device for a browser webpage further includes: the second obtaining module is configured to obtain, through a specified style computing interface, computing styles of all the pseudo elements, and obtain a computing style set, where the computing styles at least include: calculating a font size value and a decoding sequence number; the second calculation module is used for calculating all the calculated font size values in the calculated style set based on a specified style formula to obtain a decoding set, wherein the decoding set contains M decoding values; the conversion module is used for converting each decoding value based on all the preset character mapping rules in the preset character set to obtain decoding characters; and the arrangement module is used for arranging M decoding characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoding text.
According to another aspect of the embodiment of the present invention, there is also provided a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where when the computer program runs, the device where the computer readable storage medium is controlled to execute any one of the text steganography methods for a browser web page.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any one of the above methods for text steganography of a browser web page.
The invention provides a text steganography method for a browser webpage, which comprises the steps of firstly converting target text information to be steganographically according to a preset character set to obtain a coding set, wherein the coding set comprises M coding records, each coding record at least comprises a digital code and a coding sequence number of the digital code, the target text information comprises M target characters, each target character corresponds to one coding record one by one, M is a positive integer, then according to a preset adjustment strategy and all coding records in the coding set, the original font size values of M target nodes in the target node set are adjusted to obtain an adjusted target node set, then M pseudo elements are created based on M target nodes in the adjusted target node set to obtain a pseudo element set, each target node corresponds to one pseudo element one by one, a designated style defined by the pseudo element has a first association with the original style of the target node, the pseudo elements are used for inserting the designated style in designated positions in the target node, the display attributes of all the pseudo elements are not directly displayed on the browser webpage, and finally, the adjusted target node set and the browser webpage is generated based on the adjusted target node set and the pseudo element set.
According to the method, each target character in target text information to be hidden is converted into digital codes through a preset character set, the sequence number of the codes is recorded, target nodes limited by minimum fonts in a browser webpage are located, all the digital codes are converted into font size values limited by the minimum font size, the original font sizes of the target nodes are assigned by using the font size values, then pseudo elements are created on the basis of the target nodes, a first association relationship between the styles of actual contents in the pseudo elements and the original styles of the target nodes is set (namely, the first association relationship between the font size values of the pseudo elements and the original font size values of the target nodes exists), display attributes of the pseudo elements are set to be not directly displayed on the browser, finally the pseudo elements are injected into the appointed positions of the target nodes to generate the browser webpage, the actual contents of the pseudo elements are not displayed on the browser webpage by utilizing the limiting characteristics of the minimum fonts of the browser and the style characteristics of the pseudo elements in JS technology, the font size values (namely, the digital codes) of the pseudo elements can be acquired by an appointed interface, and further, the fact that the corresponding text is not written in the original text is not written under the condition of the original text, and the condition that the corresponding text is not written in the original text is changed, and the corresponding technology is not changed.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flow chart of an alternative text steganography method for a browser web page in accordance with an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative browser-minimum font-based text steganography method in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of an alternative steganographic text decoding method for a browser page, in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative text steganography device for a browser web page in accordance with an embodiment of the present invention;
fig. 5 is a block diagram of a hardware architecture of an electronic device (or mobile device) for a text steganography method of a browser web page according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
To facilitate an understanding of the invention by those skilled in the art, some terms or nouns involved in the various embodiments of the invention are explained below:
the minimum font, that is, the browser minimum font, refers to the minimum font size that can be displayed, which is set in the web browser. It is determined whether the browser will continue to shrink the text size to accommodate the page layout when the font size of the text on the web page is less than or equal to the set point. Typically, the browser defaults to a minimum font size of 12 pixels (px), which means that if a certain element on the web page is set to a smaller font size, the portion below 12px will not be reduced any further when displayed.
The text steganography utilizes the characteristic that the human visual system is insensitive to the change of the character details, and the secret information is embedded into the common text, so that the appearance of the common text is not obviously changed.
getComputedStyle, javaScript function, which is used to obtain the calculation style applied by the specified element on the page, wherein the calculation style refers to the actual style finally presented by the element, and is calculated by the browser according to the CSS style rule, but the original font value lower than the minimum font cannot be directly obtained.
pseudo-element, a special selector of CSS for adding additional styles and content to selected elements, virtual elements can be inserted before or after the specified elements without modifying the HTML structure and content.
em unit, based on the font size unit of the parent element, for example, if the font size of the parent element is set to be 1 px and the font size of the child element is set to be 10em, the actual font size of the child element is 100px.
It should be noted that, the text steganography method and the device for the browser webpage in the invention can be used in the information security technical field under the condition that the text content is hidden and written in the browser webpage, and can also be used in any field except the information security field under the condition that the text content is hidden and written in the browser webpage, and the application field of the text steganography method and the device for the browser webpage in the invention is not limited.
It should be noted that, the relevant information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present invention are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the relevant data need to comply with laws and regulations and standards of the relevant area, and a corresponding operation entry is provided for the user to select authorization or rejection. For example, an interface is provided between the system and the relevant user or institution, before acquiring the relevant information, the system needs to send an acquisition request to the user or institution through the interface, and acquire the relevant information after receiving the consent information fed back by the user or institution.
The embodiments of the invention can be applied to various systems/applications/devices which need to write the text content into the browser webpage, and can realize that the actual content of the pseudo element is not displayed on the browser webpage by utilizing the limiting characteristic of the minimum font of the browser and the style characteristic of the pseudo element in JS technology, but the font size value (namely digital code) of the pseudo element can be acquired by a designated interface, so that the aim of hiding and writing the target text information into the browser webpage only through the digital code and the pseudo element under the condition of not inserting any additional text information into the original content is realized.
The present invention will be described in detail with reference to the following examples.
Example 1
In accordance with an embodiment of the present invention, there is provided a text steganography method embodiment for a browser web page, it being noted that the steps illustrated in the flowchart of the figures may be performed in a computer system such as a set of computer executable instructions, and although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
FIG. 1 is a flowchart of an alternative text steganography method for a browser web page, in accordance with an embodiment of the present invention, as shown in FIG. 1, the method comprising the steps of:
step S101, converting target text information to be steganographically according to a preset character set to obtain a coding set.
Step S102, the original font size values of M target nodes in the target node set are adjusted according to a preset adjustment strategy and all the code records in the code set, and an adjusted target node set is obtained.
Step S103, creating M pseudo elements based on M target nodes in the adjusted target node set to obtain a pseudo element set.
Step S104, generating a browser webpage based on the adjusted target node set and the pseudo element set.
Through the steps, target text information to be hidden written can be converted according to a preset character set to obtain a coding set, wherein the coding set comprises M coding records, each coding record at least comprises a digital code and a coding sequence number of the digital code, the target text information comprises M target characters, each target character corresponds to one coding record one by one, M is a positive integer, the original font size values of M target nodes in the target node set are adjusted according to a preset adjustment strategy and all the coding records in the coding set to obtain an adjusted target node set, M pseudo elements are created based on M target nodes in the adjusted target node set to obtain a pseudo element set, each target node corresponds to one pseudo element one by one, a designated pattern defined by the pseudo element has a first association relationship with the original pattern of the target node, the pseudo elements are used for inserting the designated pattern in designated positions in the target node, the display properties of all the pseudo elements are set not to be directly displayed on a webpage of a browser, and finally the browser webpage is generated based on the adjusted target node set and the pseudo element set.
In the embodiment of the invention, each target character in target text information to be hidden is converted into a digital code through a preset character set, the code sequence number is recorded, a target node limited by the minimum font in a browser webpage is positioned, all digital codes are converted into font size values limited by the minimum font size, the original font size of the target node is assigned by using the font size values, then a pseudo element is created based on the target node, a first association relationship between the style of the actual content in the pseudo element and the original style of the target node is set (namely, the first association relationship between the font size value of the pseudo element and the original font size value of the target node exists), the display attribute of the pseudo element is set to not be directly displayed on the browser, finally, the pseudo elements are injected into the appointed position of the target node to generate the browser webpage.
Embodiments of the present invention will be described in detail with reference to the following steps.
The implementation main body of the embodiment of the invention can be a text steganography system, combines CSS cascading style sheet characteristics and JavaScript technology, converts text information to be hidden into digital codes and sets the digital codes as font size values of browser page elements, and avoids inserting extra content into original content in a browser page directly, thereby achieving the purpose of hiding more information.
Step S101, converting target text information to be steganographically according to a preset character set to obtain a coding set.
It should be noted that, the code set includes M code records, each code record includes at least a digital code and a code sequence number of the digital code, the target text information includes M target characters, each target character corresponds to one code record one by one, and M is a positive integer.
Before the embodiment of the invention performs text steganography, a preset character set is needed to be prepared, the preset character set is used for storing a preset character mapping rule (character-code comparison relation), each character corresponds to one digital code one by one, the digital code corresponding to each character can be a random number with a fixed length, and all the digital codes are ensured not to be repeated. The preset character set in the embodiment of the invention is equivalent to the codebook in the text steganography process, and the decoding party needs to master the preset character set which is completely the same as the encoding party to correctly decode the information.
Optionally, before executing step S101, the method further includes: searching the minimum font node through the document object model to obtain a target node set, wherein the target node set comprises P target nodes, the target nodes are the minimum font nodes which are displayed on a browser webpage by the minimum font size value allowed to be displayed by the browser, and P is a positive integer greater than or equal to M.
It should be noted that, the element node which is limited by the minimum font of the browser in the browser page is searched through the document object model (i.e. DOM), and is used as the target node to accept the editing of the original font size value, the digital code corresponding to the target character in the text information to be hidden is converted into the size value which is smaller than or equal to the minimum font limit value, and the original font size of the target node is assigned by using the size values, so that the display state of the target node on the browser before and after assignment is not changed, and the target node is always displayed on the page with the minimum font limit value, and the readability of the browser page is ensured.
Optionally, step S101 includes: receiving target text information to be hidden, and extracting target characters in the target text information based on a pre-designated reading sequence; generating a coding sequence number based on the reading sequence, and establishing a second association relationship between the coding sequence number and the target character; for each target character, acquiring a digital code corresponding to the target character according to a preset character set, wherein the preset character set comprises N preset character mapping rules, each preset character mapping rule is used for recording a mapping relation between one target character and the digital code corresponding to the target character, and N is a positive integer greater than or equal to M; and creating an initial code set, and inputting all digital codes into the initial code set based on the code sequence number and the second association relation to obtain the code set.
It should be noted that, coding the target characters based on the pre-designated reading sequence, converting the reading sequence into the coding sequence, which can be used as the reference of the subsequent assignment process, ensures the corresponding ordered assignment of the target characters and the target elements, and lays a foundation for ordered decoding and obtaining accurate readable decoding text.
Step S102, the original font size values of M target nodes in the target node set are adjusted according to a preset adjustment strategy and all the code records in the code set, and an adjusted target node set is obtained.
Optionally, step S102 includes: extracting digital codes in the code set according to the code sequence number; in the process of extracting the digital codes, synchronously extracting target nodes in a target node set, and setting the digital codes extracted at the same time point and the target nodes as mapping groups to obtain M mapping groups; for each mapping group, acquiring the total bit number of the digital codes in the mapping group, and calculating the digital codes based on a first preset formula and the total bit number to obtain assigned parameters; based on a preset adjustment strategy, assigning the original font size value of the target node in the mapping group by using an assignment parameter to obtain an adjusted original font size value; and integrating M adjusted original font size values corresponding to the M mapping groups to obtain an adjusted target node set.
It should be noted that, for each mapping group, the total number of digits of the digital codes in the mapping group is obtained, and the digital codes are operated based on the first preset formula and the total number of digits to obtain the assigned parameter, for example, the digital codes in a certain mapping group are 8621, the total number of digits is 4 digits, and the digital codes are reduced to 8.621 (assuming that the minimum font limit value of the browser is 12 px) by the first preset formula, so that the assigned parameter is 8.621px.
It should be noted that the assignment parameters must satisfy a minimum font constraint smaller than that of the browser, so as to ensure that the display effects of the target nodes in the browser page before and after assignment do not change.
In the embodiment of the invention, the digital codes defined in the preset character set are all fixed in length, so that the first preset formula keeps the same scaling scale for all the digital codes, and the digital codes are uniformly restored in the subsequent decoding process.
Step S103, creating M pseudo elements based on M target nodes in the adjusted target node set to obtain a pseudo element set.
It should be noted that, each target node corresponds to one pseudo element one by one, the specified style defined by the pseudo element has a first association relationship with the original style of the target node, the pseudo element is used for inserting the specified style in the specified position of the target node, and the display attributes of all the pseudo elements are set not to be directly displayed on the browser webpage.
Optionally, step S103 includes: creating a pseudo element class in the CSS selector, and setting a class display attribute of the pseudo element class not to be directly displayed on a browser webpage; for each target node in the target node set, taking a target element in the target node as a parent element, and determining an original style of the target element as a parent element style, wherein the original style at least comprises an original font size value and original content; calculating the font size value of the pseudo element based on a second preset formula and the original font size value, and taking the original content as the appointed content of the pseudo element; generating a specified style of the dummy element based on the font size value and the specified content, and associating the specified style to the CSS selector; creating a dummy element based on the CSS selector; and integrating M pseudo elements corresponding to the M code records, and converting the code sequence number in the code records into a decoding sequence number to obtain a pseudo element set.
In the embodiment of the invention, the target element is set as the father element, the dummy element established for the target element is defaulted as the child element, and the child element can inherit all content styles in the father element, and because the display attribute of the dummy element class is limited (not directly displayed on the browser page), no specific content is set in the dummy element, no matter what specific content is displayed on the browser page, the element content is not changed in the embodiment, the original content is also used as the specific content in the dummy element, and the original style is scaled by a fixed scale only on the style based on a second preset formula, so that the specific style is obtained.
Step S104, generating a browser webpage based on the adjusted target node set and the pseudo element set.
Optionally, step S104 includes: updating a CSS style sheet based on the adjusted target node set, wherein the CSS style sheet is used for recording original font size values of all nodes in the target node set; respectively injecting all pseudo elements in the pseudo element set to the appointed position of the updated CSS style sheet according to the decoding sequence number; associating the CSS style sheet to an HTML document, wherein the HTML document is used for recording the original display content of all target nodes; and loading the HTML document in the browser to obtain a browser webpage.
Optionally, after performing step S104, further includes: obtaining calculation styles of all pseudo elements through a designated style calculation interface to obtain a calculation style set, wherein the calculation styles at least comprise: calculating a font size value and a decoding sequence number; calculating all the calculated font size values in the calculated style set based on the appointed style formula to obtain a decoding set, wherein the decoding set contains M decoding values; for each decoding value, converting the decoding value based on all preset character mapping rules in a preset character set to obtain decoding characters; and arranging M decoding characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoding text.
Note that, the specified content of the dummy element is set so as not to be displayed on the browser page, but the dummy element is still associated to the HTML document through the CSS style sheet, a node of the dummy element is present in the DOM tree (document object model) in the process of generating the browser page, and the calculation style of the dummy element can be acquired through the specified style calculation interface (e.g., getComputedStyle) in the case where the font size value set by the dummy element is not limited by the minimum size of the browser.
According to the embodiment of the invention, the character set is predefined, and the unified character set is used for encoding and decoding, so that the character of the target text information and the digital codes in the digital code set can be in one-to-one correspondence, the text mistransmission can not occur in the encoding process and the decoding process, and the transmission accuracy can be ensured while the text information is steganographically ensured.
In the embodiment of the invention, the minimum font elements are selected from the browser, and the font sizes of the elements and the digital codes are in corresponding relation, so that the original content is ensured not to be displayed in the browser webpage as usual while the original font size value is changed, obvious appearance display change caused by size change is avoided, and the webpage readability and user friendliness in the browser webpage design are protected.
The embodiment of the invention also sets the pseudo element of the target element, injects the pseudo element into the target element, acquires the font size value of the amplified pseudo element by amplifying the font size of the pseudo element and utilizing the calculation style interface provided by JS, further reversely pushes the original font size value of the target element, calculates to obtain the digital code carrying the text information, and acquires the hidden text information after decoding.
The text steganography method provided by the embodiment of the invention does not need to insert or change the original content in the browser webpage, cannot be covered or perceived by naked eyes or any existing decoding algorithm, and can only find correct hidden information if the coding and decoding processes are completely known and the codebook (namely a preset character set) is mastered.
The text steganography method provided by the embodiment of the invention can keep the accessibility of the website, and the minimum font threshold is set to ensure the accessibility of the webpage and avoid the confusion of the layout, so that the information steganography is carried out on the basis, and the important readability and the user friendliness in the design of the website are not damaged.
The invention is described below in connection with another specific embodiment.
The embodiment of the invention designs a text steganography method based on the minimum font of a browser, converts text information to be hidden into digital codes, and designs the original size values of limited elements based on the digital codes, aiming at the characteristics that the original size of the elements with the original size lower than the minimum font limit in the browser is not displayed, but the content display is carried out by uniformly using the minimum font size values, and the original size values of the elements can not be directly obtained by a specific style computing interface getcomputedStyle provided by JS, and the characteristics that the minimum value can only be obtained can be obtained.
If the hidden text information is to be decoded, the original size value of the limited element is calculated by setting a pseudo element, the digital code carrying the text information is obtained by back-pushing, and the original text information is obtained by back-pushing based on the code record.
FIG. 2 is a flow chart of an alternative browser-minimum font-based text steganography method, as shown in FIG. 2, according to an embodiment of the present invention, the method comprising the steps of:
s201, defining character set char.
The character set char contains n characters, and each character corresponds to a unique m-bit digital ID, which can be a random number.
S202, traversing the DOM tree, positioning the node with the minimum calculation style, and generating a els node set.
The calculation patterns of all nodes in the DOM tree are obtained through the getComputedstyle interface, the nodes limited by the minimum font size in the browser are positioned, the calculation pattern return values of the nodes are all the minimum size (generally 12 px), and the nodes are stored in the els node set.
S203, acquiring text of the text information to be hidden.
It should be noted that, in the process of specifying the text information text to be hidden, it is noted that the total number of characters cannot exceed the number of nodes in the els node set, and if the total number of characters exceeds the total number of characters of the text information text to be properly reduced, the complete information cannot be completely hidden and transmitted.
S204, mapping text information text into a digital set numList through a character set char.
And searching unique m-bit digital IDs corresponding to all characters in the text information text through the character set char to form a digital set numList, wherein the digital set is hidden information corresponding to the text information text.
S205, uniformly shrinking all the digital IDs in the digital set numList by m bits, and recording the reduced numbers as encoeNum.
And (3) carrying out unified scale scaling on all the digital IDs, so that the scaled numerical value is smaller than the minimum size, and realizing that the element is limited by the minimum font of the browser under the condition that the scaled numerical value is taken as the original size value of the element, and uniformly displaying the element on the browser page in the minimum font size (generally 12 px).
S206, traversing the els node set, and using encoum to assign values to the original font size values of the nodes in the node set one by one.
S207, acquiring the assigned DOM tree, and generating a browser page.
The above steps are complete text steganography steps, and are also processes for encoding text information based on character sets char, and if complete readable hidden information is to be obtained, all nodes in els node sets need to be decoded after the character sets char of the encoding party are mastered.
FIG. 3 is a flow chart of an alternative method of steganographic text decoding for a browser page, in accordance with an embodiment of the present invention, as shown in FIG. 3, the method including the steps of:
s301, obtaining a DOM tree and a els node set, and injecting pseudo elements into all els nodes.
When the style setting is carried out on the pseudo element of each els node, the style of the els node is set as a parent style, so that the pseudo element style inherits the parent style, for example, the size of the element font in the els node is set to be 1em, and the size of the pseudo element font is set to be 1 multiplied by 10 cm.
S302, obtaining a calculation style of the pseudo element by using the getComputedStyle, and defining a font size value in the calculation style as an afterFontSize.
Under the condition that the font size of the pseudo element is set to be 1 multiplied by 10 cm, the afterFontSize is the encoeNum, and the font size values in all pseudo element calculation styles are integrated, so that a digital set encoeNumList can be obtained.
S303, mapping and decoding all the digital sequences in the encodingmlist according to the character set char to obtain an original text.
According to the embodiment of the invention, the character set is predefined, and the unified character set is used for encoding and decoding, so that the character of the target text information and the digital codes in the digital code set can be in one-to-one correspondence, the text mistransmission can not occur in the encoding process and the decoding process, and the transmission accuracy can be ensured while the text information is steganographically ensured.
In the embodiment of the invention, the minimum font elements are selected from the browser, and the font sizes of the elements and the digital codes are in corresponding relation, so that the original content is ensured not to be displayed in the browser webpage as usual while the original font size value is changed, obvious appearance display change caused by size change is avoided, and the webpage readability and user friendliness in the browser webpage design are protected.
The embodiment of the invention also sets the pseudo element of the target element, injects the pseudo element into the target element, acquires the font size value of the amplified pseudo element by amplifying the font size of the pseudo element and utilizing the calculation style interface provided by JS, further reversely pushes the original font size value of the target element, calculates to obtain the digital code carrying the text information, and acquires the hidden text information after decoding.
The text steganography method provided by the embodiment of the invention does not need to insert or change the original content in the browser webpage, cannot be covered or perceived by naked eyes or any existing decoding algorithm, and can only find correct hidden information if the coding and decoding processes are completely known and the codebook (namely a preset character set) is mastered.
The text steganography method provided by the embodiment of the invention can keep the accessibility of the website, and the minimum font threshold is set to ensure the accessibility of the webpage and avoid the confusion of the layout, so that the information steganography is carried out on the basis, and the important readability and the user friendliness in the design of the website are not damaged.
The invention is described below in connection with alternative embodiments.
Example two
The text steganography device for a browser webpage provided in this embodiment includes a plurality of implementation units, where each implementation unit corresponds to each implementation step in the first embodiment.
FIG. 4 is a schematic diagram of an alternative text steganography device for a browser web page, in accordance with an embodiment of the present invention, as shown in FIG. 4, the device may include: conversion unit 41, adjustment unit 42, creation unit 43, generation unit 44.
The converting unit 41 is configured to convert target text information to be steganographically according to a preset character set to obtain a code set, where the code set includes M code records, each of the code records includes at least a digital code and a code sequence number of the digital code, the target text information includes M target characters, each of the target characters corresponds to one of the code records, and M is a positive integer;
The adjusting unit 42 is configured to adjust original font size values of M target nodes in the target node set according to a preset adjustment policy and all the encoding records of the present invention in the encoding set of the present invention, so as to obtain an adjusted target node set of the present invention;
the creating unit 43 is configured to create M pseudo elements based on M inventive target nodes in the adjusted inventive target node set, so as to obtain a pseudo element set, where each inventive target node corresponds to one inventive pseudo element one by one, a first association relationship exists between a specified pattern defined by the inventive pseudo element and an original pattern of the inventive target node, the inventive pseudo element is used for inserting the inventive specified pattern in a specified position in the inventive target node, and display attributes of all inventive pseudo elements are set so as not to be directly displayed on a browser web page;
the generating unit 44 is configured to generate the web page of the browser according to the present invention based on the adjusted target node set of the present invention and the pseudo element set of the present invention.
The above-mentioned text steganography device for a browser web page may firstly convert target text information to be steganographically according to a preset character set through a conversion unit 41 to obtain an encoded set, where the encoded set includes M encoded records, each encoded record includes at least a digital code and an encoding sequence number of the digital code, the target text information includes M target characters, each target character corresponds to one encoded record one by one, M is a positive integer, then the original font size values of M target nodes in the target node set are adjusted through an adjustment unit 42 according to a preset adjustment policy and all encoded records in the encoded set to obtain an adjusted target node set, then M dummy elements are created through a creation unit 43 based on M target nodes in the adjusted target node set to obtain a dummy element set, where each target node corresponds to one dummy element one by one, a specified pattern defined by the dummy element has a first association with an original pattern of the target node, the dummy element is used to insert the specified pattern in the specified position in the target node, and the display attribute of all the dummy elements is set to be not directly displayed in the browser web page, and finally the adjusted target node set is generated through a generation unit 44 based on the adjusted target node set and the browser web page set.
In the embodiment of the invention, each target character in target text information to be hidden is converted into a digital code through a preset character set, the code sequence number is recorded, a target node limited by the minimum font in a browser webpage is positioned, all digital codes are converted into font size values limited by the minimum font size, the original font size of the target node is assigned by using the font size values, then a pseudo element is created based on the target node, a first association relationship between the style of the actual content in the pseudo element and the original style of the target node is set (namely, the first association relationship between the font size value of the pseudo element and the original font size value of the target node exists), the display attribute of the pseudo element is set to not be directly displayed on the browser, finally, the pseudo elements are injected into the appointed position of the target node to generate the browser webpage.
Optionally, the text steganography device for a browser webpage of the present invention further includes: the searching module is used for searching the minimum font node through the document object model to obtain the target node set, wherein the target node set comprises P target nodes, the target nodes refer to the minimum font node which is displayed on the webpage of the browser according to the minimum font size value which is allowed to be displayed by the browser, and P is a positive integer which is greater than or equal to M.
Optionally, the conversion unit of the present invention includes: the receiving module is used for receiving the target text information to be hidden and extracting the target characters of the invention from the target text information based on a pre-designated reading sequence; the establishing module is used for generating the coding sequence number according to the reading sequence of the invention and establishing a second association relationship between the coding sequence number according to the invention and the target character according to the reading sequence of the invention; the first acquisition module is used for acquiring the digital codes corresponding to the target characters according to the preset character set of the invention for each target character, wherein the preset character set of the invention comprises N preset character mapping rules, each preset character mapping rule is used for recording the mapping relation between one target character and the digital codes corresponding to the target character, and N is a positive integer greater than or equal to M; the first creating module is used for creating an initial code set, and inputting all the digital codes of the invention into the initial code set based on the code sequence number of the invention and the second association relation of the invention to obtain the code set of the invention.
Optionally, the adjusting unit of the present invention includes: the first extraction module is used for extracting the digital codes of the invention in the code set according to the code sequence number of the invention; the second extraction module is used for synchronously extracting the target nodes of the invention in the target node set of the invention in the process of extracting the digital codes of the invention, and setting the digital codes of the invention extracted at the same time point and the target nodes of the invention as mapping groups to obtain M mapping groups of the invention; the operation module is used for acquiring the total bit number of the digital codes of the invention in each mapping group and carrying out operation on the digital codes based on a first preset formula and the total bit number to obtain assigned parameters; the assignment module is used for assigning the original font size value of the target node of the invention in the mapping group by using the assignment parameters of the invention based on the preset adjustment strategy of the invention to obtain the adjusted original font size value of the invention; the first integration module is used for integrating M adjusted original font size values of the invention corresponding to the M mapping groups of the invention to obtain an adjusted target node set of the invention.
Optionally, the creation unit of the present invention includes: a second creating module, configured to create a pseudo element class in the CSS selector, and set a class display attribute of the pseudo element class not to be directly displayed on the browser web page; the determining module is used for regarding each object node of the object node set, taking the object element in the object node as a father element and determining the original style of the object element as a father element style, wherein the original style at least comprises an original font size value and original content; the first calculation module is used for calculating the font size value of the pseudo element according to the second preset formula and the original font size value of the pseudo element according to the invention, and taking the original content according to the invention as the appointed content of the pseudo element according to the invention; a generation module for generating the present specification style of the present pseudo-element based on the present font size value and the present specification content, and associating the present specification style to the present CSS selector; a third creation module for creating the pseudo element of the present invention based on the CSS selector of the present invention; the second integration module is used for integrating M pseudo elements of the invention corresponding to the M encoded records of the invention, and converting the encoding sequence number of the invention in the encoded records of the invention into a decoding sequence number to obtain the pseudo element set of the invention.
Optionally, the generating unit of the present invention includes: the updating module is used for updating the CSS style sheet based on the adjusted target node set, wherein the CSS style sheet is used for recording the original font size values of all nodes in the target node set; the injection module is used for respectively injecting all the pseudo elements of the invention in the pseudo element set of the invention to the appointed position of the updated CSS style sheet of the invention according to the decoding sequence number; the association module is used for associating the CSS style sheet of the invention to an HTML document, wherein the HTML document of the invention is used for recording the original display content of all target nodes; and the loading module is used for loading the HTML document in the browser to obtain the webpage of the browser.
Optionally, the text steganography device for a browser webpage of the present invention further includes: the second obtaining module is configured to obtain, through a specified style computing interface, computing styles of all pseudo elements of the present invention, to obtain a computing style set, where the computing styles of the present invention at least include: calculating a font size value and a decoding sequence number; the second calculation module is used for calculating all the calculated font size values in the calculated style set based on the appointed style formula to obtain a decoding set, wherein the decoding set comprises M decoding values; the conversion module is used for converting each decoding value based on all preset character mapping rules in the preset character set to obtain decoding characters; and the arrangement module is used for arranging M decoding characters corresponding to the M decoding values based on the decoding sequence numbers of the decoding text to obtain the decoding text.
The above-mentioned text steganography device for a browser web page may further include a processor and a memory, and the above-mentioned conversion unit 41, adjustment unit 42, creation unit 43, generation unit 44, etc. are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement the corresponding functions.
The processor includes a kernel, and the kernel fetches a corresponding program unit from the memory. The kernel may set one or more kernel parameters to create M pseudo elements based on M target nodes in the adjusted target node set, to obtain a pseudo element set, and generate a browser webpage based on the adjusted target node set and the pseudo element set.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), which includes at least one memory chip.
The present application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: converting target text information to be steganographically according to a preset character set to obtain a code set, wherein the code set comprises M code records, each code record at least comprises a digital code and a code sequence number of the digital code, the target text information comprises M target characters, each target character corresponds to one code record one by one, and M is a positive integer; according to a preset adjustment strategy and all the code records in the code set, the original font size values of M target nodes in the target node set are adjusted to obtain an adjusted target node set; creating M pseudo elements based on M target nodes in the adjusted target node set to obtain a pseudo element set, wherein each target node corresponds to one pseudo element one by one, a specified pattern defined by the pseudo element has a first association relationship with an original pattern of the target node, the pseudo elements are used for inserting the specified pattern in a specified position in the target node, and display attributes of all the pseudo elements are set to be not directly displayed on a browser webpage; and generating a browser webpage based on the adjusted target node set and the pseudo element set.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable storage medium, including a stored computer program, where the computer readable storage medium is controlled to execute the text steganography method for a browser web page according to any one of the above embodiments when the computer program is run.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the text steganography method for a browser web page of any of the above embodiments.
Fig. 5 is a block diagram of a hardware architecture of an electronic device (or mobile device) for a text steganography method of a browser web page according to an embodiment of the present invention. As shown in fig. 5, the electronic device may include one or more (shown in fig. 5 as 502a, 502b, … …,502 n) processors 502 (the processors 502 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, etc. processing means), a memory 504 for storing data. In addition, the method may further include: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a keyboard, a power supply, and/or a camera. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 5 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device may also include more or fewer components than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. A method for text steganography of a browser web page, comprising:
converting target text information to be steganographically according to a preset character set to obtain a code set, wherein the code set comprises M code records, each code record at least comprises a digital code and a code sequence number of the digital code, the target text information comprises M target characters, each target character corresponds to one code record one by one, and M is a positive integer;
according to a preset adjustment strategy and all the coding records in the coding set, adjusting the original font size values of M target nodes in a target node set to obtain an adjusted target node set;
creating M pseudo elements based on M target nodes in the adjusted target node set to obtain a pseudo element set, wherein each target node corresponds to one pseudo element one by one, a specified pattern defined by the pseudo element has a first association relationship with an original pattern of the target node, the pseudo elements are used for inserting the specified pattern in specified positions in the target nodes, and display attributes of all the pseudo elements are set to be not directly displayed on a browser webpage;
And generating the browser webpage based on the adjusted target node set and the pseudo element set.
2. The text steganography method of claim 1, further comprising, before converting the target text information to be steganographically according to a preset character set to obtain the code set:
searching the minimum font node through the document object model to obtain the target node set, wherein the target node set comprises P target nodes, the target nodes are the minimum font nodes which are displayed on the browser webpage by the minimum font size value allowed to be displayed by the browser, and P is a positive integer greater than or equal to M.
3. The text steganography method of claim 1, wherein the step of converting the target text information to be steganographically according to a preset character set to obtain the code set includes:
receiving the target text information to be hidden, and extracting the target characters in the target text information based on a pre-designated reading sequence;
generating the coding sequence number based on the reading sequence, and establishing a second association relationship between the coding sequence number and the target character;
For each target character, acquiring the digital code corresponding to the target character according to the preset character set, wherein the preset character set comprises N preset character mapping rules, each preset character mapping rule is used for recording a mapping relation between one target character and the digital code corresponding to the target character, and N is a positive integer greater than or equal to M;
and creating an initial code set, and inputting all the digital codes into the initial code set based on the code sequence number and the second association relation to obtain the code set.
4. The text steganography method of claim 1, wherein the step of adjusting original font size values of M target nodes in the target node set according to a preset adjustment policy and all the code records in the code set to obtain the adjusted target node set includes:
extracting the digital codes in the code set according to the code sequence number;
in the process of extracting the digital codes, synchronously extracting the target nodes in the target node set, and setting the digital codes extracted at the same time point and the target nodes as mapping groups to obtain M mapping groups;
For each mapping group, acquiring the total bit number of the digital codes in the mapping group, and calculating the digital codes based on a first preset formula and the total bit number to obtain assigned parameters;
based on the preset adjustment strategy, using the assignment parameters to assign the original font size value of the target node in the mapping group, and obtaining the adjusted original font size value;
and integrating M adjusted original font size values corresponding to the M mapping groups to obtain the adjusted target node set.
5. The text steganography method of claim 1, characterized in that creating M pseudo elements based on M of the adjusted target nodes in the set of target nodes, the step of obtaining a set of pseudo elements, comprises:
creating a pseudo element class in the CSS selector, and setting a class display attribute of the pseudo element class not to be directly displayed on a browser webpage;
for each target node in the target node set, taking a target element in the target node as a parent element, and determining the original style of the target element as a parent element style, wherein the original style at least comprises an original font size value and the original content;
Calculating the font size value of the pseudo element based on a second preset formula and the original font size value, and taking the original content as the appointed content of the pseudo element;
generating the specified style of the dummy element based on the font size value and the specified content, and associating the specified style to the CSS selector;
creating the dummy element based on the CSS selector;
and integrating M pseudo elements corresponding to the M encoded records, and converting the encoding sequence numbers in the encoded records into decoding sequence numbers to obtain the pseudo element set.
6. The text steganography method of claim 1, characterized in that the step of generating the browser web page based on the adjusted set of target nodes and the set of pseudo elements comprises:
updating a CSS style sheet based on the adjusted target node set, wherein the CSS style sheet is used for recording the original font size values of all nodes in the target node set;
injecting all the pseudo elements in the pseudo element set to the appointed position of the updated CSS style sheet according to the decoding sequence number;
Associating the CSS style sheet to an HTML document, wherein the HTML document is used for recording the original display content of all target nodes;
and loading the HTML document in a browser to obtain the browser webpage.
7. The text steganography method of claim 1, further comprising, after generating the browser web page based on the adjusted set of target nodes and the set of pseudo elements:
obtaining calculation styles of all the pseudo elements through a designated style calculation interface to obtain a calculation style set, wherein the calculation styles at least comprise: calculating a font size value and a decoding sequence number;
calculating all the calculated font size values in the calculated style set based on a specified style formula to obtain a decoding set, wherein the decoding set contains M decoding values;
for each decoding value, converting the decoding value based on all the preset character mapping rules in the preset character set to obtain decoding characters;
and arranging M decoding characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoding text.
8. A text steganography device for a browser web page, comprising:
The conversion unit is used for converting target text information to be steganographically according to a preset character set to obtain a code set, wherein the code set comprises M code records, each code record at least comprises a digital code and a code sequence number of the digital code, the target text information comprises M target characters, each target character corresponds to one code record one by one, and M is a positive integer;
the adjusting unit is used for adjusting the original font size values of M target nodes in the target node set according to a preset adjusting strategy and all the coding records in the coding set to obtain an adjusted target node set;
the creating unit is used for creating M pseudo elements based on M target nodes in the adjusted target node set to obtain a pseudo element set, wherein each target node corresponds to one pseudo element one by one, a first association relation exists between a specified pattern defined by the pseudo element and an original pattern of the target node, the pseudo elements are used for inserting the specified pattern in a specified position in the target node, and the display attribute of all the pseudo elements is set to be not directly displayed on a browser webpage;
And the generation unit is used for generating the browser webpage based on the adjusted target node set and the pseudo element set.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the text steganography method for a browser web page according to any of claims 1 to 7.
10. An electronic device comprising one or more processors and memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the text steganography method for a browser web page of any of claims 1-7.
CN202410095278.5A 2024-01-23 2024-01-23 Text steganography method and device for browser webpage and electronic equipment Pending CN117725333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410095278.5A CN117725333A (en) 2024-01-23 2024-01-23 Text steganography method and device for browser webpage and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410095278.5A CN117725333A (en) 2024-01-23 2024-01-23 Text steganography method and device for browser webpage and electronic equipment

Publications (1)

Publication Number Publication Date
CN117725333A true CN117725333A (en) 2024-03-19

Family

ID=90201886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410095278.5A Pending CN117725333A (en) 2024-01-23 2024-01-23 Text steganography method and device for browser webpage and electronic equipment

Country Status (1)

Country Link
CN (1) CN117725333A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118211194A (en) * 2024-05-14 2024-06-18 北京国隐科技有限公司 Steganography processing method, device and equipment of service system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118211194A (en) * 2024-05-14 2024-06-18 北京国隐科技有限公司 Steganography processing method, device and equipment of service system

Similar Documents

Publication Publication Date Title
CN117725333A (en) Text steganography method and device for browser webpage and electronic equipment
CN110245469B (en) Webpage watermark generation method, watermark analysis method, device and storage medium
TWI557590B (en) Method for tattooing digital books
Mir Copyright for web content using invisible text watermarking
US10706160B1 (en) Methods, systems, and articles of manufacture for protecting data in an electronic document using steganography techniques
CN112948776A (en) Digital watermark adding method and device, electronic equipment and storage medium
CN113283228A (en) Document generation method and device, electronic equipment and storage medium
CN114356919A (en) Watermark embedding method, tracing method and device for structured database
US7197706B1 (en) Method and system for ensuring accurate font matching in documents
Fu et al. Digital forensics of Microsoft Office 2007–2013 documents to prevent covert communication
CN115712909A (en) Text watermark embedding method, tracing method and system based on block chain
CN110874456B (en) Watermark embedding method, watermark extracting method, watermark embedding device, watermark extracting device and data processing method
US6857070B1 (en) Data processing method and apparatus, and storage medium capable of being read by a computer
CN112947911A (en) Interface script generation method, device, equipment and storage medium
CN104412255A (en) Document processing system, electronic document, document processing method, and program
US9442898B2 (en) Electronic document that inhibits automatic text extraction
CN103136166B (en) Method and device for font determination
CN116127419A (en) Data processing method, data identification method, font file generation method and device
CN115048665A (en) Excel file-based information hiding method, device, equipment and storage medium
CN114610305A (en) Development method and device of invisible webpage resources, electronic equipment and medium
KR100988309B1 (en) Inserting method of document identifier and decoding method thereof
CN114298882A (en) Watermark embedding method and tracing method for CAD data and electronic equipment
KR102300444B1 (en) Document editing device to check whether the font applied to the document is a supported font and operating method thereof
CN109840080B (en) Character attribute comparison method and device, storage medium and electronic equipment
CN109684417B (en) Data display method and device, storage medium and processor

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