Text steganography method and apparatus for browser webpage, and electronic device
By using preset character sets and pseudo-element technology in browser web pages, adjusting the font size of the target node and creating a pseudo-element collection, the problem of text steganography in the existing technology is solved, and the concealment and readability of hiding text information without changing the original content is achieved.
Patent Information
- Application Number
- PCT/CN2024/135604
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-23
- Filing Date
- 2024-11-29
- Publication Date
- 2025-07-31
AI Technical Summary
When prior art performs text steganography in browser web pages, commonly used encoding methods are easily detected, resulting in the hidden content being not concealed enough.
Convert the target text information into an encoded set by preset character sets, adjust the font size value of the target node, and create a pseudo-element collection so that it is not displayed directly on the browser web page, but its font size value can be obtained through the interface, and steganography is performed using the browser's minimum font restriction characteristics and pseudo-element style characteristics.
It realizes that hiding text information is more concealed without changing the original content, avoiding detection, and ensuring web page readability and user-friendliness.
Smart Images

Figure CN2024135604_31072025_PF_FP_ABST
Abstract
Description
Text steganography method and device for browser web pages, and electronic device
[0001] Related applications
[0002] This application claims priority to Chinese patent application No. 2024100952785, filed on January 23, 2024, entitled “Text steganography method, device, and electronic device for browser web pages,” the entire text of which is hereby incorporated by reference. Technical Field
[0003] The present application relates to the field of information security technology, and more specifically, to a text steganography method and device, and an electronic device for browser web pages. Background Art
[0004] Currently, when text steganography is required in a browser web page, a common solution is to encode text characters to obtain the content to be hidden, and then insert the content to be hidden into the existing displayed content of the browser web page. This can achieve text steganography in conventional scenarios, but this method is not completely hidden. Using regular matching and other methods to detect the existing displayed content of the browser will identify text anomalies and then discover the hidden content inserted therein.
[0005] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0006] According to a first aspect of an embodiment of the present application, a text steganography method for a browser web page is provided, comprising: converting target text information to be steganographic according to a preset character set to obtain a code set, wherein the code set includes M code records, each code record includes at least a digital code and a coding sequence number of the digital code, the target text information includes M target characters, each target character corresponds one-to-one with one code record, and M is a positive integer; adjusting original font size values of M target nodes in a target node set according to a preset adjustment strategy and all the code records in the code set to obtain an adjusted target node set; creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set, wherein each target node corresponds one-to-one with one pseudo-element, a 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 to insert the specified style at a specified position in the target node, and the display attributes of all the pseudo-elements are set to not be directly displayed on the browser web page; and generating the browser web page based on the adjusted target node set and the pseudo-element set.
[0007] Optionally, before converting the target text information to be steganographic according to a preset character set to obtain a code set, the method further includes: searching for a minimum font node through a document object model to obtain the target node set, wherein the target node set includes P target nodes, and the target node refers to the minimum font node displayed on the browser web page with the minimum font size value allowed by the browser, and P is a positive integer greater than or equal to M.
[0008] Optionally, the step of converting the target text information to be steganographic according to a preset character set to obtain a code set includes: receiving the target text information to be steganographic, and extracting the target characters in the target text information based on a pre-specified reading order; generating the code sequence number based on the reading order, and establishing a second association relationship between the code sequence number and the target character; for each target character, obtaining the digital code corresponding to the target character according to the preset character set, wherein the preset character set contains N preset character mapping rules, each of the preset character mapping rules is used to record the mapping relationship between a target character and the digital code corresponding to the target character, and N is a positive integer greater than or equal to M; creating an initial code set, entering all the digital codes into the initial code set based on the code sequence number and the second association relationship to obtain the code set.
[0009] Optionally, 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 the adjusted target node set, including: extracting the digital code in the coding set according to the coding sequence number; in the process of extracting the digital code, synchronously extracting the target node in the target node set, and setting the digital code and the target node extracted at the same time point as a mapping group to obtain M mapping groups; for each mapping group, obtaining the total number of digits of the digital code in the mapping group, and performing operations on the digital code based on a first preset formula and the total number of digits to obtain an assignment parameter; based on the preset adjustment strategy, using the assignment parameter to assign the original font size value of the target node in the mapping group to obtain the adjusted original font size value; integrating the M adjusted original font size values corresponding to the M mapping groups to obtain the adjusted target node set.
[0010] Optionally, the step of creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain the pseudo-element set includes: creating a pseudo-element class in a CSS selector, and setting the class display attribute of the pseudo-element class to not be directly displayed on the browser web page; for each target node in the target node set, taking the target element in the target node as the parent element, and determining the original style of the target element as the parent element style, wherein the original style at least includes the 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 designated content of the pseudo-element; generating the designated style of the pseudo-element based on the font size value and the designated content, and associating the designated style to the CSS selector; creating the pseudo-element based on the CSS selector; integrating the M pseudo-elements corresponding to the M encoding records, and converting the encoding sequence number in the encoding record into a decoding sequence number to obtain the pseudo-element set.
[0011] Optionally, the step of generating the browser web page 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 to record the original font size values of all nodes in the target node set; injecting all the pseudo-elements in the pseudo-element set into designated positions of the updated CSS style sheet according to decoding sequence numbers; associating the CSS style sheet with an HTML document, wherein the HTML document is used to record the original display content of all target nodes; and loading the HTML document in a browser to obtain the browser web page.
[0012] Optionally, after generating the browser web page based on the adjusted target node set and the pseudo-element set, it also includes: obtaining the calculation styles of all the pseudo-elements through a specified style calculation interface to obtain a calculation style set, wherein the calculation style at least includes: a calculation font size value and a decoding sequence number; calculating all the calculation font size values in the calculation style set based on a specified style formula to obtain a decoding set, wherein the decoding set contains M decoding values; for each of the decoding values, converting the decoding value based on all the preset character mapping rules in the preset character set to obtain a decoded character; arranging the M decoding characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoded text.
[0013] According to a second aspect of an embodiment of the present application, a text steganography device for a browser web page is further provided, comprising: a conversion unit, configured to convert target text information to be steganographic according to a preset character set to obtain a code set, wherein the code set comprises M code records, each of which comprises at least a digital code and a coding sequence number of the digital code, the target text information comprises M target characters, each of which corresponds one-to-one to one of the code records, and M is a positive integer; an adjustment unit, configured to adjust the original font size values of the M target nodes in the target node set according to a preset adjustment strategy and all the code records in the code set. The method comprises the following steps: adjusting the target node set after the adjustment to obtain the adjusted target node set; a creating unit for creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set, wherein each target node corresponds to one pseudo-element, a 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 to insert the specified style at a specified position in the target node, and the display attributes of all the pseudo-elements are set to not be directly displayed on the browser web page; a generating unit for generating the browser web page based on the adjusted target node set and the pseudo-element set.
[0014] Optionally, the text steganography device for a browser web page further includes: a search module, configured to search for a minimum font node through a document object model to obtain the target node set, wherein the target node set includes P target nodes, and the target node refers to a minimum font node displayed on the browser web page with a minimum font size value allowed by the browser, and P is a positive integer greater than or equal to M.
[0015] Optionally, the conversion unit includes: a receiving module for receiving the target text information to be steganographic, and extracting the target characters in the target text information based on a pre-specified reading order; an establishing module for generating the coding sequence number based on the reading order, and establishing a second association relationship between the coding sequence number and the target characters; a first acquiring module for acquiring the digital code corresponding to each target character according to the preset character set, wherein the preset character set contains N preset character mapping rules, each of which is used to record the mapping relationship between a target character and the digital code corresponding to the target character, and N is a positive integer greater than or equal to M; a first creating module for creating an initial coding set, entering all the digital codes into the initial coding set based on the coding sequence number and the second association relationship to obtain the coding set.
[0016] Optionally, the adjustment unit includes: a first extraction module, used to extract the digital code in the code set according to the code sequence number; a second extraction module, used to synchronously extract the target node in the target node set during the process of extracting the digital code, and set the digital code and the target node extracted at the same time point as a mapping group to obtain M mapping groups; an operation module, used to obtain the total number of digits of the digital code in the mapping group for each mapping group, and operate the digital code based on a first preset formula and the total number of digits to obtain an assignment parameter; an assignment module, used to assign the original font size value of the target node in the mapping group using the assignment parameter based on the preset adjustment strategy to obtain the adjusted original font size value; a first integration module, used to integrate the M adjusted original font size values corresponding to the M mapping groups to obtain the adjusted target node set.
[0017] Optionally, the creation unit includes: a second creation module, used to create a pseudo-element class in a CSS selector, and set the class display attribute of the pseudo-element class to not be directly displayed on the browser web page; a determination module, used to, for each target node in the target node set, take the target element in the target node as the parent element, and determine the original style of the target element as the parent element style, wherein the original style at least includes an original font size value and the original content; a first calculation module, used to calculate the font size value of the pseudo-element based on a second preset formula and the original font size value, and use the original content as the designated content of the pseudo-element; a generation module, used to generate the designated style of the pseudo-element based on the font size value and the designated content, and associate the designated style with the CSS selector; a third creation module, used to create the pseudo-element based on the CSS selector; a second integration module, used to integrate the M pseudo-elements corresponding to the M encoding records, and convert the encoding sequence number in the encoding record into a decoding sequence number to obtain the pseudo-element set.
[0018] Optionally, the generation unit includes: an update module for updating a CSS style sheet based on the adjusted target node set, wherein the CSS style sheet is used to record the original font size values of all nodes in the target node set; an injection module for injecting all the pseudo-elements in the pseudo-element set into designated positions of the updated CSS style sheet according to decoding sequence numbers; an association module for associating the CSS style sheet with an HTML document, wherein the HTML document is used to record the original display content of all target nodes; and a loading module for loading the HTML document in a browser to obtain the browser web page.
[0019] Optionally, the text steganography device for browser web pages further includes: a second acquisition module, configured to acquire the calculated styles of all the pseudo-elements through a specified style calculation interface to obtain a calculated style set, wherein the calculated style includes at least a calculated font size value and a decoding sequence number; a second calculation module, configured to calculate 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 includes M decoding values; a conversion module, configured to convert each of the decoding values based on all the preset character mapping rules in the preset character set to obtain a decoded character; and an arrangement module, configured to arrange the M decoded characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoded text.
[0020] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned text steganography methods for browser web pages.
[0021] According to a fourth aspect of an embodiment of the present application, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned text steganography methods for browser web pages.
[0022] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0024] FIG1 is a flowchart of an optional text steganographic method for a browser web page according to an embodiment of the present application;
[0025] FIG2 is a flowchart of an optional text steganography method based on the minimum browser font according to an embodiment of the present application;
[0026] FIG3 is a flowchart of an optional method for decoding steganographic text in a browser page according to an embodiment of the present application;
[0027] FIG4 is a schematic diagram of an optional text steganographic device for a browser web page according to an embodiment of the present application;
[0028] FIG5 is a hardware structure block diagram of an electronic device (or mobile device) for a text steganography method for a browser web page according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings 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 in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] To facilitate those skilled in the art to understand the present application, some of the terms or nouns involved in the embodiments of the present application are explained below:
[0032] Minimum font size, also known as the browser's minimum font size, refers to the smallest font size that can be displayed in a web browser. It determines whether the browser will continue to reduce the text size to fit the page layout when the text size on a web page is less than or equal to the set value. Typically, the default minimum font size in browsers is 12 pixels (px). This means that if an element on a web page has a smaller font size, the part below 12px will not be reduced further when displayed.
[0033] Text steganography takes advantage of the fact that the human visual system is insensitive to changes in text details and embeds secret information into ordinary text so that it does not change noticeably in appearance.
[0034] getComputedStyle is a JavaScript function used to get the computed style applied to the specified element on the page. The computed style refers to the actual style of the element that is ultimately presented, calculated by the browser based on CSS style rules. However, the original font value below the minimum font size cannot be directly obtained.
[0035] Pseudo-element, a special CSS selector, is used to add additional styles and content to selected elements. It can insert virtual elements before or after specified elements without modifying the HTML structure and content.
[0036] The em unit is based on the font size unit of the parent element. For example, if the parent element font size is 10px and the child element font size is 10em, the actual font size of the child element is 100px.
[0037] It should be noted that the text steganography method and device for browser web pages in this application can be used in the field of information security technology when text content is hidden and written in browser web pages, and can also be used in any field other than the information security field when text content is hidden and written in browser web pages. This application does not limit the application field of the text steganography method and device for browser web pages.
[0038] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the laws, regulations and standards of the relevant regions, and provide corresponding operation portals for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or institution through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or institution.
[0039] The following embodiments of the present application can be applied to various systems / applications / devices that need to secretly write text content into browser web pages. It can utilize the browser's minimum font limit characteristics and the style characteristics of pseudo-elements in JS technology to prevent the actual content of the pseudo-element from being displayed on the browser web page, but the font size value of the pseudo-element (i.e., the digital code) can be obtained by the specified interface, thereby achieving the goal of hiding the target text information in the browser web page only through the digital code and pseudo-elements without inserting any additional text information into the original content.
[0040] The present application is described in detail below with reference to various embodiments.
[0041] Example 1
[0042] According to an embodiment of the present application, an embodiment of a text steganography method for a browser web page is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0043] FIG1 is a flowchart of an optional text steganographic method for a browser web page according to an embodiment of the present application. As shown in FIG1 , the method includes the following steps:
[0044] Step S101 : converting the target text information to be steganographic according to a preset character set to obtain a code set.
[0045] Step S102 : adjusting the original font size values of the M target nodes in the target node set according to a preset adjustment strategy and all code records in the code set to obtain an adjusted target node set.
[0046] Step S103 : creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set.
[0047] Step S104 : generating a browser webpage based on the adjusted target node set and pseudo-element set.
[0048] Through the above steps, the target text information to be steganographic can be first converted according to a preset character set to obtain a code set, wherein the code set contains M code records, each code record contains at least a digital code and a coding sequence number of the digital code, the target text information contains M target characters, each target character corresponds one-to-one to a code record, and M is a positive integer. Then, according to the preset adjustment strategy and all code records in the code set, the original font size values of the M target nodes in the target node set are adjusted to obtain an adjusted target node set, and then M pseudo-elements are created based on the M target nodes in the adjusted target node set to obtain a pseudo-element set, wherein each target node corresponds one-to-one to a pseudo-element, and a 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 to insert the specified style at a specified position in the target node, and the display attributes of all pseudo-elements are set to not be directly displayed on the browser web page. Finally, a browser web page is generated based on the adjusted target node set and the pseudo-element set.
[0049] In the embodiment of the present application, each target character in the target text information to be steganographic is converted into a digital code by using a preset character set, and the code sequence number is recorded. The target node subject to the minimum font size restriction in the browser webpage is located, all digital codes are converted into font size values subject to the minimum font size restriction, and these font size values are used to assign the original font size of the target node. Then, pseudo-elements are created based on these target nodes, and the style of the actual content in the pseudo-element is set to have a first association relationship with the original style of the target node (that is, the font size value of the pseudo-element has a first association relationship with the original font size value of the target node), and then the display attributes of these pseudo-elements are set to not directly Displayed on the browser, and finally these pseudo-elements are injected into the specified position of the target node to generate a browser web page. The steganography method provided in the embodiment of the present application can utilize the limitation characteristics of the browser's minimum font and the style characteristics of the pseudo-elements in JS technology to prevent the actual content of the pseudo-element from being displayed on the browser web page, but the font size value of the pseudo-element (i.e., the digital code) can be obtained by the specified interface, thereby achieving the technical effect of hiding the target text information written in the browser web page only through the digital code and pseudo-elements without inserting any additional text information into the original content, thereby solving the technical problem in the related art that text steganography cannot be achieved without changing the original text.
[0050] The embodiments of the present application are described in detail below in combination with the above steps.
[0051] The implementing body of the embodiment of the present application can be a text steganography system, which combines the CSS cascading style sheet characteristics and JavaScript technology to convert the text information to be hidden into a digital code and set it as the font size value of the browser page element, avoiding the direct insertion of additional content into the original content in the browser page, thereby achieving the purpose of hiding information more covertly.
[0052] Step S101 : converting the target text information to be steganographic according to a preset character set to obtain a code set.
[0053] It should be noted that the encoding set contains M encoding records, each encoding record contains at least a digital code and the encoding sequence number of the digital code, the target text information contains M target characters, each target character corresponds one-to-one to a encoding record, and M is a positive integer.
[0054] Before performing text steganography, the present embodiment requires the preparation of a preset character set. This preset character set is used to store preset character mapping rules (character-code mapping relationships). Each character corresponds to a digital code. The digital code corresponding to each character can be a random number of fixed length, ensuring that all digital codes are unique. The preset character set in the present embodiment is equivalent to a code book during the text steganography process. The decoder must have the same preset character set as the encoder to correctly decode the information.
[0055] Optionally, before executing step S101, it also includes: searching for the minimum font node through the document object model to obtain a target node set, wherein the target node set includes P target nodes, and the target node refers to the minimum font node displayed on the browser web page with the minimum font size value allowed by the browser, and P is a positive integer greater than or equal to M.
[0056] It should be noted that, by searching the document object model (DOM) for an element node in the browser page that is already subject to the browser's minimum font size restriction, the element node is used as the target node to accept the original font size value editing, and the digital code corresponding to the target character in the text information to be steganographic is converted into a size value that is less than or equal to the minimum font size restriction value. These size values are used to assign the original font size of the target node. This ensures that the display status of the target node on the browser does not change before and after the assignment, and is always displayed on the page with the minimum font size restriction value, thereby ensuring the readability of the browser page.
[0057] Optionally, step S101 includes: receiving target text information to be steganographic, and extracting target characters in the target text information based on a pre-specified reading order; generating a coding sequence number based on the reading order, and establishing a second association relationship between the coding sequence number and the target character; for each target character, obtaining the digital code corresponding to the target character according to a preset character set, wherein the preset character set contains N preset character mapping rules, each preset character mapping rule is used to record the mapping relationship between a target character and the digital code corresponding to the target character, and N is a positive integer greater than or equal to M; creating an initial coding set, entering all digital codes into the initial coding set based on the coding sequence number and the second association relationship to obtain a coding set.
[0058] It should be noted that encoding the target characters based on a pre-specified reading order and converting the reading order into a coding order can serve as a reference for the subsequent assignment process, ensuring that the target characters and target elements are assigned in order, laying the foundation for orderly decoding and obtaining accurate and readable decoded text.
[0059] Step S102 : adjusting the original font size values of the M target nodes in the target node set according to a preset adjustment strategy and all code records in the code set to obtain an adjusted target node set.
[0060] Optionally, step S102 includes: extracting digital codes from 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 and target nodes extracted at the same time point as a mapping group to obtain M mapping groups; for each mapping group, obtaining the total number of digits of the digital codes in the mapping group, and performing operations on the digital codes based on a first preset formula and the total number of digits to obtain an assignment parameter; based on a preset adjustment strategy, using the assignment parameter to assign the original font size value of the target node in the mapping group to obtain an adjusted original font size value; integrating the M adjusted original font size values corresponding to the M mapping groups to obtain an adjusted target node set.
[0061] It should be noted that for each mapping group, the total number of digits of the digital code in the mapping group is obtained, and the digital code is operated based on the first preset formula and the total number of digits to obtain the assignment parameter. For example, the digital code in a mapping group is 8621, and the total number of digits is 4. The digital code is reduced to 8.621 through the first preset formula (assuming that the minimum font limit value of the browser is 12px), and the assignment parameter can be obtained as 8.621px.
[0062] It should be noted that the assigned parameters must be smaller than the browser's minimum font size to ensure that the display effects of these target nodes on the browser page do not change before and after the assignment.
[0063] In the embodiment of the present application, the digital codes defined in the preset character set are all fixed-length, so the first preset formula maintains exactly the same scaling for all digital codes to facilitate uniform restoration in the subsequent decoding process.
[0064] Step S103 : creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set.
[0065] It should be noted that each target node corresponds one-to-one to a pseudo-element, and there is a first association relationship between the specified style defined by the pseudo-element and the original style of the target node. The pseudo-element is used to insert the specified style at the specified position in the target node, and the display properties of all pseudo-elements are set to not be directly displayed on the browser web page.
[0066] Optionally, step S103 includes: creating a pseudo-element class in the CSS selector, and setting the class display attribute of the pseudo-element class to not be directly displayed on the browser web page; for each target node in the target node set, taking the target element in the target node as the parent element, and determining the original style of the target element as the parent element style, wherein the original style at least includes the original font size value and the original content; calculating the font size value of the pseudo-element based on the second preset formula and the original font size value, and taking the original content as the designated content of the pseudo-element; generating the designated style of the pseudo-element based on the font size value and the designated content, and associating the designated style to the CSS selector; creating the pseudo-element based on the CSS selector; integrating the M pseudo-elements corresponding to the M encoding records, and converting the encoding sequence number in the encoding record into a decoding sequence number to obtain a pseudo-element set.
[0067] In the embodiment of the present application, the target element is set as the parent element, and the pseudo-element corresponding to the target element is set as the child element by default. The child element can inherit all content styles in the parent element. Since the display attribute of the pseudo-element class is restricted (not directly displayed on the browser page), no matter what specified content is set in the pseudo-element, it will not be displayed on the browser page. Therefore, in this embodiment, the element content is not changed, and the original content is also used as the specified content in the pseudo-element. The original style is only scaled to a fixed scale based on the second preset formula to obtain the specified style.
[0068] Step S104 : generating a browser webpage based on the adjusted target node set and pseudo-element set.
[0069] Optionally, step S104 includes: updating a CSS style sheet based on the adjusted target node set, wherein the CSS style sheet is used to record the original font size values of all nodes in the target node set; injecting all pseudo-elements in the pseudo-element set into designated positions of the updated CSS style sheet according to the decoding sequence number; associating the CSS style sheet with an HTML document, wherein the HTML document is used to record the original display content of all target nodes; and loading the HTML document in a browser to obtain a browser web page.
[0070] Optionally, after executing step S104, the method further includes: obtaining the calculation styles of all pseudo-elements through a specified style calculation interface to obtain a calculation style set, wherein the calculation style includes at least: a calculation font size value and a decoding sequence number; calculating all the calculation font size values in the calculation 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 preset character mapping rules in a preset character set to obtain a decoded character; arranging the M decoding characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoded text.
[0071] It should be noted that the specified content of the pseudo-element is set not to be displayed on the browser page, but the pseudo-element is still associated with the HTML document through the CSS style sheet. In the process of generating the browser page, it is converted into a pseudo-element node and exists in the DOM tree (Document Object Model). If the font size value set by the pseudo-element is not subject to the minimum size limit of the browser, the calculated style of the pseudo-element can be obtained through the specified style calculation interface (for example, getComputedStyle).
[0072] In the embodiment of the present application, by pre-defining a character set and using a unified character set for encoding and decoding, it is ensured that the characters of the target text information correspond one-to-one with the digital codes in the digital code set, and no text mistransmission occurs during the encoding and decoding processes, thereby ensuring the steganography of the text information while also ensuring the accuracy of the transmission.
[0073] In the embodiment of the present application, by selecting the smallest font element in the browser and establishing a correspondence between the font sizes of these elements and digital codes, it can be ensured that the original content is displayed normally in the browser web page without changing the original font size value, and no obvious changes in the appearance display will occur due to the size change, thereby protecting the readability and user-friendliness of the web page in the browser web page design.
[0074] The embodiment of the present application also sets a pseudo-element of the target element and injects the pseudo-element into the target element. By enlarging the font size of the pseudo-element and using the calculation style interface provided by JS to obtain the font size value of the enlarged pseudo-element, the original font size value of the target element is deduced, and the digital code carrying the text information is calculated, and the hidden text information is obtained after decoding.
[0075] The text steganography method provided in the embodiments of the present application does not require any insertion or change to the original content in the browser web page, and will not be covered or detected by the naked eye or any existing decoding algorithm. Only by fully understanding the above encoding and decoding processes and mastering the code book (i.e., the preset character set) can the correct hidden information be discovered.
[0076] The text steganography method provided in the embodiments of the present application can maintain the accessibility of the website. The minimum font threshold is set to ensure the accessibility of the web page and avoid layout confusion. Information steganography is performed on this basis without destroying the important readability and user-friendliness in website design.
[0077] The present application is described below in conjunction with another specific implementation.
[0078] The embodiments of the present application address the fact that in a browser, elements whose original sizes are lower than the minimum font size limit will no longer be displayed at their original sizes, but instead the minimum font size value will be used uniformly for content display. Furthermore, the specified style calculation interface getComputedStyle provided by JS cannot directly obtain the original size values of these elements, but can only obtain the minimum value. A text steganography method based on the browser's minimum font size is designed to convert the text information to be hidden into digital codes, and the original size values of the restricted elements are designed based on these digital codes to achieve text steganography.
[0079] To decode the steganographic text information, one only needs to calculate the original size value of the above-mentioned restricted element by setting a pseudo-element, reversely deduce the digital code carrying the text information, and then reversely deduce the original text information based on the code record.
[0080] FIG2 is a flowchart of an optional text steganography method based on the minimum browser font size according to an embodiment of the present application. As shown in FIG2 , the method includes the following steps:
[0081] S201, define the character set chars.
[0082] The character set chars contains n characters and a unique m-digit numeric ID corresponding to each character. The numeric ID can be a random number.
[0083] S202, traverse the DOM tree, locate the node whose calculated style is the minimum size, and generate an els node set.
[0084] Get the computed styles of all nodes in the DOM tree through the getComputedStyle interface, locate the nodes in the browser that are subject to the minimum font size limit, and the computed style return values of these nodes are all the minimum size (usually 12px). Store these nodes in the els node set.
[0085] S203: Obtain the specified text information to be hidden.
[0086] It should be noted that when specifying the text information to be hidden, it is important to note that the total number of characters cannot exceed the number of nodes in the els node set. If it exceeds, the total number of characters in the text information should be appropriately reduced, otherwise the complete information cannot be completely hidden and transmitted.
[0087] S204 , mapping the text information text into the number set numList through the character set chars.
[0088] Use the character set chars to find the unique m-digit digital ID corresponding to all characters in the text information text, and form a digital set numList. This digital set is the hidden information corresponding to the text information text.
[0089] S205: Reduce all digital IDs in the digital set numList to m digits, and record them as encodeNum.
[0090] Scale all digital IDs to a uniform scale so that the scaled value is smaller than the minimum size. This ensures that when the scaled value is used as the original size of the element, the element will be subject to the browser's minimum font size and will be displayed in the minimum font size (usually 12px) on the browser page.
[0091] S206 , traverse the els node set, and use encodeNum to assign the original font size values of the nodes in the node set one by one.
[0092] S207, obtaining the assigned DOM tree and generating a browser page.
[0093] The above is the complete text steganography step, which is also the process of encoding text information based on the character set chars. To obtain complete and readable hidden information, it is necessary to master the character set chars of the encoder and then decode all nodes in the ELS node set.
[0094] FIG3 is a flowchart of an optional method for decoding steganographic text in a browser page according to an embodiment of the present application. As shown in FIG3 , the method includes the following steps:
[0095] S301, obtain the DOM tree and els node set, and inject pseudo elements into all els nodes.
[0096] When setting the style of each pseudo-element of the els node, set the style of the els node to the parent style so that the pseudo-element style inherits the parent style. For example, set the font size of the element in the els node to 1em and the pseudo-element font size to 1×10^mem.
[0097] S302 , using getComputedStyle to obtain the computed style of the pseudo-element, and defining the font size value in the computed style as afterFontSize .
[0098] When the pseudo-element font size is set to 1×10^m em, afterFontSize is encodeNum. By integrating the font size values in all pseudo-element calculation styles, the number set encodeNumList can be obtained.
[0099] S303 , mapping and decoding all the numeric sequences in the encodeNumList according to the character set chars to obtain the original text text.
[0100] In the embodiment of the present application, by pre-defining a character set and using a unified character set for encoding and decoding, it is ensured that the characters of the target text information correspond one-to-one with the digital codes in the digital code set, and no text mistransmission occurs during the encoding and decoding processes, thereby ensuring the steganography of the text information while also ensuring the accuracy of the transmission.
[0101] In the embodiment of the present application, by selecting the smallest font element in the browser and establishing a correspondence between the font sizes of these elements and digital codes, it can be ensured that the original content is displayed normally in the browser web page without changing the original font size value, and no obvious changes in the appearance display will occur due to the size change, thereby protecting the readability and user-friendliness of the web page in the browser web page design.
[0102] The embodiment of the present application also sets a pseudo-element of the target element and injects the pseudo-element into the target element. By enlarging the font size of the pseudo-element and using the calculation style interface provided by JS to obtain the font size value of the enlarged pseudo-element, the original font size value of the target element is deduced, and the digital code carrying the text information is calculated, and the hidden text information is obtained after decoding.
[0103] The text steganography method provided in the embodiments of the present application does not require any insertion or change to the original content in the browser web page, and will not be covered or detected by the naked eye or any existing decoding algorithm. Only by fully understanding the above encoding and decoding processes and mastering the code book (i.e., the preset character set) can the correct hidden information be discovered.
[0104] The text steganography method provided in the embodiments of the present application can maintain the accessibility of the website. The minimum font threshold is set to ensure the accessibility of the web page and avoid layout confusion. Information steganography is performed on this basis without destroying the important readability and user-friendliness in website design.
[0105] The present application is described below in conjunction with another optional embodiment.
[0106] Example 2
[0107] The text steganography device for a browser web page provided in this embodiment includes multiple implementation units, each of which corresponds to each implementation step in the above-mentioned embodiment 1.
[0108] FIG4 is a schematic diagram of an optional text steganography device for a browser web page according to an embodiment of the present application. As shown in FIG4 , the device may include: a conversion unit 41 , an adjustment unit 42 , a creation unit 43 , and a generation unit 44 .
[0109] The conversion unit 41 is configured to convert the target text information to be steganographic according to a preset character set to obtain a code set, wherein the code set includes M code records, each code record includes at least a digital code and a coding sequence number of the digital code, the target text information includes M target characters, each target character corresponds to a code record, and M is a positive integer;
[0110] An 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 strategy and all encoding records in the encoding set to obtain an adjusted target node set;
[0111] a creating unit 43 configured to create M pseudo-elements based on the M target nodes in the adjusted target node set, thereby obtaining a pseudo-element set, wherein each target node corresponds to a pseudo-element, a specified style defined by the pseudo-element has a first association relationship with an original style of the target node, the pseudo-element is used to insert the specified style at a specified position in the target node, and display properties of all pseudo-elements are set to not be directly displayed on the browser webpage;
[0112] The generating unit 44 is configured to generate a browser webpage based on the adjusted target node set and pseudo-element set.
[0113] The above-mentioned text steganography device for a browser webpage can first convert the target text information to be steganographic according to a preset character set by a conversion unit 41 to obtain a code set, wherein the code set includes M code records, each code record including at least a digital code and a coding sequence number of the digital code, and the target text information includes M target characters, each target character corresponds one-to-one with a code record, where M is a positive integer. Then, the adjustment unit 42 adjusts the original font size values of the M target nodes in the target node set according to a preset adjustment strategy and all code records in the code set to obtain an adjusted target node set. Then, the creation unit 43 creates M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set, wherein each target node corresponds one-to-one with a pseudo-element, and a 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 to insert the specified style at a specified position in the target node, and the display attribute of all pseudo-elements is set to not be directly displayed on the browser webpage. Finally, the generation unit 44 generates a browser webpage based on the adjusted target node set and the pseudo-element set.
[0114] In the embodiment of the present application, each target character in the target text information to be steganographic is converted into a digital code by using a preset character set, and the code sequence number is recorded. The target node subject to the minimum font size restriction in the browser webpage is located, all digital codes are converted into font size values subject to the minimum font size restriction, and these font size values are used to assign the original font size of the target node. Then, pseudo-elements are created based on these target nodes, and the style of the actual content in the pseudo-element is set to have a first association relationship with the original style of the target node (that is, the font size value of the pseudo-element has a first association relationship with the original font size value of the target node), and then the display attributes of these pseudo-elements are set to not directly Displayed on the browser, and finally these pseudo-elements are injected into the specified position of the target node to generate a browser web page. The steganography method provided in the embodiment of the present application can utilize the limitation characteristics of the browser's minimum font and the style characteristics of the pseudo-elements in JS technology to prevent the actual content of the pseudo-element from being displayed on the browser web page, but the font size value of the pseudo-element (i.e., the digital code) can be obtained by the specified interface, thereby achieving the technical effect of hiding the target text information written in the browser web page only through the digital code and pseudo-elements without inserting any additional text information into the original content, thereby solving the technical problem in the related art that text steganography cannot be achieved without changing the original text.
[0115] Optionally, the text steganography device for a browser web page further includes: a search module, configured to search for a minimum font node through a document object model to obtain a target node set, wherein the target node set includes P target nodes, and the target node refers to a minimum font node displayed on the browser web page with a minimum font size value allowed by the browser, and P is a positive integer greater than or equal to M.
[0116] Optionally, the conversion unit includes: a receiving module for receiving the target text information to be steganographic, and extracting the target characters in the target text information based on a pre-specified reading order; an establishing module for generating a coding sequence number based on the reading order, and establishing a second association relationship between the coding sequence number and the target character; a first acquiring module for acquiring the digital code corresponding to each target character according to a preset character set, wherein the preset character set contains N preset character mapping rules, each preset character mapping rule is used to record the mapping relationship between a target character and the digital code corresponding to the target character, and N is a positive integer greater than or equal to M; a first creating module for creating an initial coding set, entering all digital codes into the initial coding set based on the coding sequence number and the second association relationship to obtain a coding set.
[0117] Optionally, the adjustment unit includes: a first extraction module for extracting digital codes from the code set based on the code sequence number; a second extraction module for synchronously extracting the target node in the target node set during the process of extracting the digital code, and setting the digital code and the target node extracted at the same time point as a mapping group to obtain M mapping groups; an operation module for obtaining the total number of digits of the digital code in the mapping group for each mapping group, and performing an operation on the digital code based on a first preset formula and the total number of digits to obtain an assignment parameter; an assignment module for assigning the original font size value of the target node in the mapping group using the assignment parameter based on a preset adjustment strategy to obtain an adjusted original font size value; a first integration module for integrating the M adjusted original font size values corresponding to the M mapping groups to obtain an adjusted target node set.
[0118] Optionally, the creation unit includes: a second creation module, used to create a pseudo-element class in a CSS selector, and set the class display attribute of the pseudo-element class to not be directly displayed on the browser web page; a determination module, used to, for each target node in the target node set, take the target element in the target node as the parent element, and determine the original style of the target element as the parent element style, wherein the original style at least includes the original font size value and the original content; a first calculation module, used to calculate the font size value of the pseudo-element based on the second preset formula and the original font size value, and use the original content as the designated content of the pseudo-element; a generation module, used to generate the designated style of the pseudo-element based on the font size value and the designated content, and associate the designated style with the CSS selector; a third creation module, used to create the pseudo-element based on the CSS selector; a second integration module, used to integrate M pseudo-elements corresponding to M encoding records, and convert the encoding sequence number in the encoding record into a decoding sequence number to obtain a pseudo-element set.
[0119] Optionally, the generation unit includes: an update module for updating a CSS style sheet based on the adjusted target node set, wherein the CSS style sheet is used to record the original font size values of all nodes in the target node set; an injection module for injecting all pseudo-elements in the pseudo-element set into designated positions of the updated CSS style sheet according to the decoding sequence number; an association module for associating the CSS style sheet with an HTML document, wherein the HTML document is used to record the original display content of all target nodes; and a loading module for loading the HTML document in a browser to obtain a browser web page.
[0120] Optionally, the text steganography device for a browser web page further includes: a second acquisition module, configured to acquire the calculated styles of all pseudo-elements through a specified style calculation interface to obtain a calculated style set, wherein the calculated style includes at least a calculated font size value and a decoding sequence number; a second calculation module, configured to calculate 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 includes M decoding values; a conversion module, configured to convert each decoding value based on all preset character mapping rules in a preset character set to obtain a decoded character; and an arrangement module, configured to arrange the M decoded characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoded text.
[0121] The above-mentioned text steganography device for browser web pages may further include a processor and a memory. The above-mentioned conversion unit 41, adjustment unit 42, creation unit 43, generation unit 44, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions.
[0122] The processor includes a kernel that retrieves corresponding program units from a memory. One or more kernels may be provided. Kernel parameters are adjusted to create M pseudo-elements based on M target nodes in an adjusted target node set, thereby obtaining a pseudo-element set. A browser webpage is generated based on the adjusted target node set and the pseudo-element set.
[0123] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0124] The present application also provides a computer program product that, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: converting target text information to be steganographic according to a preset character set to obtain a code set, wherein the code set contains M code records, each code record contains at least a digital code and a coding sequence number of the digital code, the target text information contains M target characters, each target character corresponds one-to-one to a code record, and M is a positive integer; adjusting the original font size values of M target nodes in a target node set according to a preset adjustment strategy and all code records in the code set to obtain an adjusted target node set; creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set, wherein each target node corresponds one-to-one to a pseudo-element, a 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 to insert the specified style at a specified position in the target node, and the display attributes of all pseudo-elements are set to not be directly displayed on the browser web page; and generating a browser web page based on the adjusted target node set and the pseudo-element set.
[0125] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the text steganography methods for browser web pages in the above-mentioned embodiment 1.
[0126] According to another aspect of an embodiment of the present application, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the text steganography method for browser web pages of any one of the above-mentioned embodiments.
[0127] Figure 5 is a hardware block diagram of an electronic device (or mobile device) for a text steganography method for a browser web page according to an embodiment of the present application. As shown in Figure 5, the electronic device may include one or more (illustrated in Figure 5 using 502a, 502b, ..., 502n) processors 502 (the processor 502 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 504 for storing data. In addition, it may also 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 understood by those skilled in the art that the structure shown in Figure 5 is merely illustrative and does not limit the structure of the above-mentioned electronic device. For example, the electronic device may also include more or fewer components than shown in Figure 5, or have a configuration different from that shown in Figure 5.
[0128] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0129] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0131] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0132] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0134] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A text steganography method for browser web pages, comprising: Converting the target text information to be steganographed according to a preset character set to obtain a coding set, wherein the coding set contains M coding records, each coding record contains at least a digital code and the coding sequence number of the digital code, the target text information contains M target characters, each target character corresponds to one coding record, and M is a positive integer; Adjusting the original font size values of M target nodes in the target node set according to a preset adjustment strategy and all the coding records in the coding set to obtain the adjusted target node set; Creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set, wherein each target node corresponds to one pseudo-element, 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 to insert the specified style at a specified position in the target node, and the display attributes of all the pseudo-elements are set not to be directly displayed on the browser web page; Generating the browser web page based on the adjusted target node set and the pseudo-element set.
2. The text steganography method according to claim 1, wherein before converting the target text information to be steganographed according to a preset character set to obtain a coding set, it further comprises: Searching for the smallest font nodes through the Document Object Model to obtain the target node set, wherein the target node set contains P target nodes, and the target node refers to the smallest font node that is displayed on the browser web page with the smallest font size value allowed by the browser, and P is a positive integer greater than or equal to M.
3. The text steganography method according to claim 1, wherein the step of converting the target text information to be steganographed according to a preset character set to obtain a coding set comprises: Receiving the target text information to be steganographed and extracting the target characters in the target text information based on a pre-specified reading order; Generating the coding sequence number based on the reading order and establishing a second association relationship between the coding sequence number and the target character; For each target character, obtaining the corresponding digital code of the target character according to the preset character set, wherein the preset character set contains N preset character mapping rules, and each preset character mapping rule is used to record the mapping relationship between a target character and the corresponding digital code of the target character, and N is a positive integer greater than or equal to M; Creating an initial coding set and entering all the digital codes into the initial coding set based on the coding sequence number and the second association relationship to obtain the coding set.
4. The text steganography method according to claim 1, wherein the step of adjusting the original font size values of M target nodes in the target node set according to a preset adjustment strategy and all the coding records in the coding set to obtain the adjusted target node set comprises: Extracting the digital codes in the coding set according to the coding sequence number; During the process of extracting the digital code, synchronously extract the target nodes in the target node set, and set the digital code extracted at the same time point and the target nodes as a mapping group to obtain M mapping groups; For each mapping group, obtain the total number of digits of the digital code in this mapping group, and perform an operation on the digital code based on the first preset formula and the total number of digits to obtain an assignment parameter; Based on the preset adjustment strategy, use the assignment parameter to assign a value to the original font size value of the target node in this mapping group to obtain the adjusted original font size value; Integrate the M adjusted original font size values corresponding to the M mapping groups to obtain the adjusted target node set.
5. The text steganography method according to claim 1, wherein the step of creating M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set includes: Create a pseudo-element class in the CSS selector, and set the class display attribute of this pseudo-element class to not be directly displayed on the browser web page; For each target node in the target node set, use the target element in this target node as the parent element, and determine the original style of the target element as the parent element style, where the original style at least includes the original font size value and the original content; Calculate the font size value of the pseudo-element based on the second preset formula and the original font size value, and use the original content as the specified content of the pseudo-element; Generate the specified style of the pseudo-element based on the font size value and the specified content, and associate the specified style with the CSS selector; Create the pseudo-element based on the CSS selector; Integrate the M pseudo-elements corresponding to the M coding records, and convert the coding sequence number in the coding record into a decoding sequence number to obtain the pseudo-element set.
6. The text steganography method according to claim 1, wherein the step of generating the browser web page based on the adjusted target node set and the pseudo-element set includes: Update the CSS style sheet based on the adjusted target node set, where the CSS style sheet is used to record the original font size values of all nodes in the target node set; Inject all the pseudo-elements in the pseudo-element set into the specified positions of the updated CSS style sheet according to the decoding sequence number; Associate the CSS style sheet with the HTML document, where the HTML document is used to record the original display content of all target nodes; Load the HTML document in the browser to obtain the browser web page.
7. The text steganography method according to claim 1, wherein after generating the browser web page based on the adjusted target node set and the pseudo-element set, it further includes: Obtain the computed styles of all the pseudo-elements through a specified style calculation interface to obtain a computed style set, where the computed styles at least include: computed font size value and decoding sequence number; Calculate all the calculated font size values in the calculated style set based on the specified style formula to obtain a decoding set, where the decoding set contains M decoding values; For each of the decoding values, convert the decoding value based on all the preset character mapping rules in the preset character set to obtain a decoded character; Arrange the M decoded characters corresponding to the M decoding values based on the decoding sequence number to obtain a decoded text.
8. A text steganography device for a browser web page, comprising: A conversion unit, configured to convert target text information to be steganographed according to a preset character set to obtain an encoding set, where the encoding set contains M encoding records, each encoding record at least includes a digital encoding and an encoding sequence number of the digital encoding, the target text information contains M target characters, each target character corresponds to one encoding record, and M is a positive integer; An adjustment unit, configured to adjust the original font size values of M target nodes in the target node set according to a preset adjustment strategy and all the encoding records in the encoding set to obtain the adjusted target node set; A creation unit, configured to create M pseudo-elements based on the M target nodes in the adjusted target node set to obtain a pseudo-element set, where each target node corresponds to one pseudo-element, a 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 to insert the specified style at a specified position in the target node, and display attributes of all the pseudo-elements are set not to be directly displayed on the browser web page; A generation unit, configured to generate the browser web page based on the adjusted target node set and the pseudo-element set.
9. A computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, When the computer program runs, control the device where the computer-readable storage medium is located to execute the text steganography method for a browser web page according to any one of claims 1 to 7.
10. An electronic device includes one or more processors and a memory, where the memory is used to store one or more programs, and wherein, When the one or more programs are executed by the one or more processors, enable the one or more processors to implement the text steganography method for a browser web page according to any one of claims 1 to 7.
Citation Information
Patent Citations
Watermark adding method and device, electronic equipment and computer readable storage medium
CN111010490A
Text processing method and device, electronic equipment and storage medium
CN116881592A
Model output text processing method and device, electronic equipment and medium
CN117057359A
Text steganography method and device for browser webpage and electronic equipment
CN117725333A
System and Method for Generating User Interface Elements with a Viewing Pane
US20190095053A1
Cited By
Web font loading method and device, electronic equipment and storage medium
CN121561210A