A method and apparatus for resisting plaintext disturbances in encrypted traffic

By employing a plaintext adversarial perturbation method for encrypted traffic, and utilizing a pre-defined adversarial perturbation generator and large language model optimization, adversarial perturbations that conform to grammatical compliance are generated, thus solving the problem of metadata leakage in encrypted communication and achieving efficient and dynamic privacy protection.

CN121077832BActive Publication Date: 2026-03-06HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing encryption technologies cannot effectively protect communication metadata characteristics. Attackers can use machine learning to analyze the statistical characteristics of encrypted traffic to leak privacy. Traditional encoding technologies lack the ability to actively obfuscate traffic characteristics, and static perturbation patterns are easily adapted by attackers.

Method used

A plaintext adversarial perturbation method for encrypted traffic is adopted. Adversarial perturbations are generated by a pre-set adversarial perturbation generator, and the perturbations are added to the plaintext traffic before encryption. The perturbation generator is optimized by combining a large language model to ensure that the perturbations are grammatically compliant and the strategy is dynamically adjusted to achieve an end-to-end coding security framework.

Benefits of technology

Effective interference traffic feature analysis provides continuously evolving defense, ensuring high security while simplifying deployment processes and enhancing communication privacy protection capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121077832B_ABST
    Figure CN121077832B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for plaintext adversarial perturbation of encrypted traffic. The method includes: after acquiring the plaintext traffic to be sent, inputting random noise into a preset adversarial perturbation generator to obtain adversarial perturbation; adding the adversarial perturbation to the plaintext traffic based on preset perturbation rules to obtain perturbed plaintext traffic; encrypting the perturbed plaintext traffic to obtain ciphertext traffic and sending it. This method can generate syntax-compliant adversarial perturbations at the application layer, achieving more powerful and flexible privacy protection than ciphertext traffic perturbation. It can flexibly generate perturbation patterns resistant to adversarial retraining, and does not rely on communication platform support, achieving high-stealth communication protection at low cost. It is suitable for encrypted communication scenarios with strict privacy requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic coding technology, and in particular to a method and apparatus for resisting plaintext disturbances in encrypted traffic. Background Technology

[0002] With the rapid development of network communication technology, encoding, decoding, and code conversion technologies have become the foundation of secure data transmission. In traditional technologies, general encoding / decoding is mainly used for data format conversion, compression, or error correction, while encoding / decoding specifically for cryptography protects data content through encryption algorithms. However, existing methods still have significant shortcomings:

[0003] First, while modern encryption technologies can effectively protect data content, the metadata characteristics of communication (such as packet length, timing, and protocol fingerprints) can still be exposed. Attackers can use machine learning techniques to analyze the statistical characteristics of encrypted traffic, infer communication behavior, and lead to privacy breaches. Second, traditional encoding techniques focus on data format processing and lack the ability to actively obfuscate traffic characteristics, while confidentiality encoding techniques, although capable of encrypting data, cannot dynamically respond to metadata analysis attacks.

[0004] To counter this threat, the most effective defense technique currently is to use adversarial examples to disrupt the original traffic. This mainly involves increasing the packet length or packet time interval during packet encryption to change the characteristics of the encrypted traffic, thereby misleading the attacker's traffic classification model and causing it to output incorrect information. Summary of the Invention

[0005] To achieve more defensive network traffic communication, this invention provides a method and apparatus for plaintext anti-disturbance of encrypted traffic.

[0006] In a first aspect, embodiments of the present invention provide a method for resisting plaintext disturbances in encrypted traffic, applied to the sender, and may include:

[0007] After acquiring the plaintext traffic to be sent, random noise is input into a preset adversarial perturbation generator to obtain adversarial perturbation;

[0008] The adversarial perturbation is added to the plaintext traffic based on a preset perturbation rule to obtain the perturbed plaintext traffic;

[0009] The perturbed plaintext traffic is encrypted to obtain ciphertext traffic, which is then sent.

[0010] In one or more optional embodiments of this application, the preset adversarial disturbance generator is obtained in the following manner:

[0011] Obtain the dataset and the initial adversarial perturbation generator; the dataset includes multiple historical plaintext traffic and the category label corresponding to each historical plaintext traffic;

[0012] Random noise is input into the initial adversarial perturbation generator to obtain the predicted adversarial perturbation;

[0013] The predicted adversarial perturbation is added to any historical plaintext traffic in the dataset to obtain the perturbed historical plaintext traffic;

[0014] The disturbed historical plaintext traffic is encrypted to obtain the historical ciphertext traffic;

[0015] The historical encrypted traffic is input into a large language model to obtain the predicted category;

[0016] Based on the predicted category, the perturbed historical plaintext traffic, the historical plaintext traffic, and the corresponding category label, a preset loss function is calculated to update the initial adversarial perturbation generator, resulting in an updated adversarial perturbation generator.

[0017] Repeat the training process of the adversarial perturbation generator as described above until the preset stopping condition is met to obtain the preset adversarial perturbation generator.

[0018] In one or more optional embodiments of this application, the dataset is obtained in the following manner:

[0019] Obtain multiple historical plaintext traffic packets, and use a traffic packet extraction tool to extract the application layer protocol type of each historical plaintext traffic packet;

[0020] The application layer protocol type of each historical plaintext traffic is used as the category label of the corresponding historical plaintext traffic. Combined with the corresponding historical plaintext traffic, a dataset is obtained.

[0021] In one or more optional embodiments of this application, the step of calculating a preset loss function based on the predicted category, the perturbated historical plaintext traffic, the historical plaintext traffic, and the corresponding category label, and updating the initial adversarial perturbation generator to obtain the updated adversarial perturbation generator includes:

[0022] Based on the predicted category, the perturbed historical plaintext traffic, the historical plaintext traffic, and the corresponding category label, the label loss value and bandwidth loss value are calculated.

[0023] Based on the label loss value and bandwidth loss value, the total loss value is calculated using the following formula:

[0024]

[0025] In the formula, This represents the total loss value. This represents the label loss value. This represents the bandwidth loss value. and These are the weight parameters for label loss and bandwidth loss, respectively;

[0026] Backpropagation is performed based on the total loss value to update the initial adversarial perturbation generator, resulting in an updated adversarial perturbation generator.

[0027] In one or more optional embodiments of this application, the step of calculating the label loss value and bandwidth loss value based on the predicted category, the perturbed historical plaintext traffic, the historical plaintext traffic, and the corresponding category label includes:

[0028] Based on the predicted category and the category label corresponding to the historical plaintext traffic, the label loss value is calculated using the following formula:

[0029]

[0030] In the formula, This represents the label loss value. The category labels corresponding to the historical plaintext traffic. For the predicted category, x For the aforementioned historical plaintext traffic, The perturbation represents the historical plaintext flow, and ∑ is the summation symbol;

[0031] Based on the disturbed historical plaintext traffic and the historical plaintext traffic, the bandwidth loss value is calculated using the following formula:

[0032]

[0033] In the formula, This represents the bandwidth loss value. x For the aforementioned historical plaintext traffic, Let be the historical plaintext flow after the disturbance, and ∑ be the summation symbol.

[0034] In one or more optional embodiments of this application, after obtaining the encrypted traffic, the following steps are further included:

[0035] The encrypted traffic is perturbed.

[0036] Secondly, embodiments of the present invention provide a plaintext anti-interference and descrambling method for encrypted traffic, applied to the receiver, and may include:

[0037] The receiver decrypts and descrambles the ciphertext traffic sequentially according to the preset perturbation rules, using the corresponding decryption and descrambling algorithms to obtain the plaintext traffic.

[0038] Thirdly, embodiments of the present invention provide a plaintext anti-interference device for encrypted traffic, which may include:

[0039] The perturbation generation module is used to input random noise into a preset adversarial perturbation generator after acquiring the plaintext traffic to be sent, so as to obtain adversarial perturbation;

[0040] The perturbation merging module is used to add the adversarial perturbation to the plaintext traffic based on a preset perturbation rule to obtain the perturbed plaintext traffic;

[0041] The traffic transmission module is used to encrypt the disturbed plaintext traffic to obtain ciphertext traffic and then send it.

[0042] Fourthly, embodiments of the present invention provide a plaintext anti-scrambling and descrambling device for encrypted traffic, which may include:

[0043] The decryption and descrambling module is used to decrypt and descramble the ciphertext traffic sequentially according to the preset perturbation rules and the corresponding decryption and descrambling algorithms to obtain the plaintext traffic.

[0044] Fifthly, embodiments of the present invention provide a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the plaintext anti-scrambling method for encrypted traffic as described above, and / or the plaintext anti-scrambling descrambling method for encrypted traffic.

[0045] In a sixth aspect, embodiments of the present invention provide a computer program product, including a computer program / instruction that, when executed by a processor, implements the plaintext anti-scrambling method for encrypted traffic as described above, and / or the plaintext anti-scrambling descrambling method for encrypted traffic.

[0046] In a seventh aspect, embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, it implements the plaintext anti-scrambling method for encrypted traffic as described above, and / or the plaintext anti-scrambling descrambling method for encrypted traffic.

[0047] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:

[0048] This invention provides a method for plaintext anti-perturbation of encrypted traffic. The method generates anti-perturbation by inputting random noise into a preset anti-perturbation generator, and then adds the anti-perturbation to the plaintext traffic based on preset perturbation rules before encrypted transmission. This invention provides a more comprehensive protection mechanism for encrypted communication, achieving a significant breakthrough in traffic encoding conversion and information security. Specifically, this method proactively considers security requirements during the data encoding stage, achieving three significant advantages through dynamically generating grammatically compliant anti-perturbations: First, the intelligent perturbation generation mechanism based on application layer protocol characteristics ensures both the standardization of encoding conversion and effective interference with traffic feature analysis, addressing the shortcomings of traditional methods in metadata protection; second, the use of a dynamically adjustable encoding perturbation strategy, through the synergistic optimization of random noise and preset rules, enables continuous evolution of defense capabilities, effectively responding to constantly changing attack methods; third, the innovative end-to-end encoding security framework achieves autonomous control of the perturbation mechanism, greatly simplifying the deployment process while ensuring high security. This technological breakthrough provides a brand-new solution for communication scenarios requiring high-level protection and has significant application value in the field of traffic coding security.

[0049] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0050] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0051] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0052] Figure 1 A flowchart illustrating a plaintext anti-disturbance method for encrypted traffic provided in an embodiment of the present invention;

[0053] Figure 2 A schematic diagram illustrating the differences between the plaintext anti-disturbance method for encrypted traffic provided in this embodiment of the invention and existing technologies;

[0054] Figure 3 A schematic diagram of the network structure of the anti-disturbance generator provided in an embodiment of the present invention;

[0055] Figure 4 A training flowchart for an adversarial disturbance generator provided in an embodiment of the present invention;

[0056] Figure 5 A schematic diagram illustrating ciphertext traffic perturbation and plaintext traffic perturbation provided for embodiments of the present invention;

[0057] Figure 6 A flowchart illustrating the plaintext anti-perturbation method for encrypted traffic and the training of a preset anti-perturbation generator, provided in an embodiment of the present invention.

[0058] Figure 7 A flowchart illustrating a plaintext anti-disturbance and descrambling method for encrypted traffic provided in an embodiment of the present invention;

[0059] Figure 8 A schematic diagram of a plaintext anti-disturbance device for encrypted traffic provided in an embodiment of the present invention;

[0060] Figure 9 This is a schematic diagram of the plaintext anti-disturbance and descrambling device for encrypted traffic provided in an embodiment of the present invention. Detailed Implementation

[0061] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0062] The inventors discovered that existing technologies for defending against obfuscation based on encrypted traffic have significant shortcomings: First, current methods are mainly limited to adjusting superficial features such as packet length and time intervals. This simple parameter modification not only offers a single dimension of defense but also easily leads to decreased communication efficiency due to excessive obfuscation. Second, static obfuscation patterns are difficult to cope with the continuous evolution of attackers. With the development of machine learning technology, attackers can quickly adapt to fixed patterns of obfuscation through model retraining, and even reverse-engineer obfuscation features to improve recognition accuracy. Therefore, there is an urgent need to research more dynamic and covert methods for generating obfuscated obfuscation, achieving an adaptive defense effect to the evolution of attack models while ensuring imperceptibility and low overhead, thereby effectively protecting network communication privacy. Based on this, the inventors, through further research and development, have created this invention, providing a method and apparatus for plaintext obfuscation of encrypted traffic.

[0063] Example 1

[0064] Embodiment 1 of this invention provides a method for resisting plaintext disturbances in encrypted traffic, referring to... Figure 1 As shown, the method may include the following steps S101-S103:

[0065] S101: After acquiring the plaintext traffic to be sent, input random noise into the preset adversarial disturbance generator to obtain adversarial disturbance.

[0066] S102: Add the adversarial perturbation to the plaintext traffic to obtain the perturbed plaintext traffic.

[0067] S103: Encrypt the disturbed plaintext traffic to obtain ciphertext traffic and send it.

[0068] This invention provides a method for plaintext anti-perturbation of encrypted traffic. The method generates anti-perturbation by inputting random noise into a preset anti-perturbation generator, and then adds the anti-perturbation to the plaintext traffic based on preset perturbation rules before encrypted transmission. This invention provides a more comprehensive protection mechanism for encrypted communication, achieving a significant breakthrough in traffic encoding conversion and information security. Specifically, this method proactively considers security requirements during the data encoding stage, achieving three significant advantages through dynamically generating grammatically compliant anti-perturbations: First, the intelligent perturbation generation mechanism based on application layer protocol characteristics ensures both the standardization of encoding conversion and effective interference with traffic feature analysis, addressing the shortcomings of traditional methods in metadata protection; second, the use of a dynamically adjustable encoding perturbation strategy, through the synergistic optimization of random noise and preset rules, enables continuous evolution of defense capabilities, effectively responding to constantly changing attack methods; third, the innovative end-to-end encoding security framework achieves autonomous control of the perturbation mechanism, greatly simplifying the deployment process while ensuring high security. This technological breakthrough provides a brand-new solution for communication scenarios requiring high-level protection and has significant application value in the field of traffic coding security.

[0069] To facilitate understanding of this solution by those skilled in the art, the problem of defending against original traffic disturbances based on adversarial example technology described in the embodiments of this application is briefly described here: it is a supervised learning classification problem, and the traffic sample set is... X A single traffic sample is x The attacker's classification model is F, in the original sample x The ciphertext traffic obtained after adding perturbation is This causes the classification model F to output incorrect labels, as shown in Formula 1 below:

[0070] Formula 1

[0071] In the formula, This represents the perturbation added to the traffic sample.

[0072] To address the aforementioned issues, this solution proposes a method for resisting plaintext perturbations in encrypted traffic, with the following differences in process compared to existing technologies: Figure 2 As shown, Figure 2 The above process is the ciphertext encryption in the existing technology, which includes: encrypting plaintext messages into blocks, which can be encrypted using TLS (Transport Layer Security) to obtain encrypted blocks, i.e. encrypted ciphertext; and then perturbing the encrypted blocks, such as increasing the block length or the block time interval, to obtain perturbed encrypted traffic.

[0073] Figure 2 The following process describes the plaintext encryption implemented by this method, including perturbing the plaintext message to obtain the perturbed plaintext message, then encrypting it by blocks to obtain the encrypted blocks. After obtaining the encrypted blocks, perturbations such as increasing the block length or the block time interval can still be applied to the encrypted blocks to obtain the perturbed encrypted traffic.

[0074] In this method, plaintext messages refer to plaintext traffic, and perturbed encrypted traffic refers to ciphertext traffic.

[0075] This method applies perturbation to the plaintext traffic directly before block encryption, while existing methods apply perturbation after block encryption. This plaintext-based perturbation technique has a very broad application prospect in fields such as the transmission of small amounts of encrypted information, but the implementation of this technology faces several challenges that urgently need to be overcome:

[0076] Firstly, there is the constraint of grammatical compliance: while adversarial perturbations can deceive the traffic classification model, they must also meet the grammatical requirements of the communication protocol. This imposes a relatively strict constraint on the generation of adversarial perturbations for plaintext traffic.

[0077] Secondly, there is the plaintext-ciphertext space gap: it is difficult to predict the impact of perturbations generated in the plaintext space on the ciphertext space after encryption. In other words, due to the "gap" created by the encryption algorithm between the plaintext and ciphertext spaces, the effectiveness of perturbations generated for plaintext in deceiving traffic classification models after encryption is unpredictable. Since the impact of perturbations cannot be directly assessed, obtaining effective perturbations becomes a highly challenging problem.

[0078] The third method is receiver descrambling: the perturbation applied to the plaintext is only used to confuse the opponent's traffic analysis model and does not contain any meaningful communication content. Therefore, the sender needs to covertly inform the receiver how to remove the perturbation.

[0079] In step S101 above, after obtaining the plaintext traffic to be sent, random noise is input into a preset anti-disturbance generator to obtain anti-disturbance.

[0080] Specifically, it can be that random noise following a Gaussian distribution is input into a preset adversarial perturbation generator to obtain an adversarial perturbation that includes multiple compliant perturbation commands.

[0081] Specific forms of countering disturbances can include changing the textual representation of request fields, such as forging the source page URL, for example, changing https: / / login.example.com to https: / / news.example.com, rotating common browser identifiers, such as changing different versions of Chrome / Firefox / Safari, adding or removing custom headers, such as adding X-Proxy-Data: random_string or removing X-Device-ID.

[0082] This method, when perturbing plaintext traffic at the application layer, selects the perturbation message fields based on syntax compliance constraints, ensuring that the added perturbations do not affect normal communication and business functions. For example, taking the HTTP protocol, the application layer of plaintext traffic can perturb multiple different positions in the request header fields such as Referer, User-Agent, and Custom Headers, while ensuring syntax compliance and semantic consistency. This can more effectively hide traffic characteristics and resist attackers from performing adversarial retraining.

[0083] The preset adversarial disturbance generator is obtained through the following method, specifically including steps S1011-S1017:

[0084] S1011: Obtain the dataset and the initial adversarial perturbation generator. The dataset includes multiple historical plaintext traffic streams, along with the category label for each stream.

[0085] Specifically, this can involve acquiring multiple historical plaintext traffic streams, using a traffic packet extraction tool (such as FlowContainer) to extract the application layer protocol type (such as HTTP, FTP, DNS, and WebSocket) for each stream, and using the application layer protocol type of each stream as a category label. These labels, combined with the corresponding historical plaintext traffic streams, form a dataset. The traffic packet extraction tool can also extract feature information from the plaintext traffic, such as packet duration, total number of packets, application layer Referer and User-Agent fields, and other multi-dimensional information. Each dimension of the feature information is then used... s express, n Given the size of the dimension, the feature information... Attackers can train classification models based on these features and corresponding category labels to monitor network traffic packets for deep packet inspection (DPI), thereby deciphering others' traffic protocols and sensitive information and causing privacy leaks.

[0086] S1012: Input random noise into the initial adversarial perturbation generator to obtain the predicted adversarial perturbation.

[0087] Specifically, random noise following a Gaussian distribution can be input into the initial adversarial perturbation generator to obtain a predicted adversarial perturbation that includes multiple compliant perturbation instructions. To ensure grammatical compliance, strong constraint learning can be added to the initial adversarial perturbation generator, such as using a pre-trained protocol syntax checker (e.g., an HTTP RFC validator) or setting generation templates for key fields. The specific implementation methods are existing technologies and will not be elaborated on here.

[0088] The initial adversarial perturbation generator is built upon a Convolutional Neural Network (CNN) to generate adversarial perturbations. CNN-based adversarial perturbation generators possess powerful generation capabilities, can learn a wide range of sample feature distributions, and can be flexibly adjusted and optimized as needed. The network structure of the initial adversarial perturbation generator is as follows: Figure 3 As shown, it includes two convolutional blocks connected together. Each convolutional block includes a convolutional layer, a normalization layer, a pooling layer, and an activation function connected in sequence.

[0089] S1013: Add the predicted adversarial perturbation to any historical plaintext traffic in the dataset to obtain the perturbed historical plaintext traffic.

[0090] Specifically, it can be done by taking any historical plaintext traffic from the dataset, modifying the historical plaintext traffic based on the perturbation instructions in the prediction adversarial perturbation, and obtaining the perturbed historical plaintext traffic.

[0091] S1014: Encrypt the disturbed historical plaintext traffic to obtain the historical ciphertext traffic.

[0092] Specifically, this could involve encrypting the disturbed historical plaintext traffic (e.g., using TLS encryption) to obtain the historical ciphertext traffic.

[0093] S1015: Input the historical encrypted traffic into the large language model to obtain the predicted category.

[0094] Specifically, one approach is to input historical encrypted traffic into a Large Language Model (LLM), which then determines the application layer protocol type of the historical encrypted traffic and obtains the predicted category.

[0095] In this embodiment, the method uses a large language model to guide the adversarial perturbation generator to optimize network weights. This is because large language models typically have larger parameters and deeper hierarchical structures, enabling them to capture more complex and subtle patterns and features in the data. They can learn more general and universal feature representations in plaintext traffic, which are also well adapted to unseen data samples. When applied to new data or data from different domains, they often maintain high classification accuracy, i.e., they have strong generalization ability.

[0096] Therefore, this method uses a large language model to guide the optimization of the adversarial perturbation generator, and indirectly evaluates the impact of plaintext perturbation on ciphertext features. This effectively solves the plaintext-ciphertext feature gap problem and ensures that the attack model can still be effectively deceived after encryption.

[0097] S1016: Based on the predicted category, the perturbed historical plaintext traffic, the historical plaintext traffic and the corresponding category label, calculate the preset loss function, update the initial adversarial perturbation generator, and obtain the updated adversarial perturbation generator.

[0098] Specifically, the label loss value can be calculated based on the predicted category and the category labels corresponding to historical plaintext traffic, using the label loss function shown in Formula 2 below:

[0099] Formula 2

[0100] In the formula, Indicates the label loss value. Category tags corresponding to historical plaintext traffic. For predicting categories, x For historical plaintext traffic, ∑ represents the historical plaintext flow after perturbation, and ∑ is the summation symbol.

[0101] Based on the perturbed historical plaintext traffic and historical plaintext traffic, the bandwidth load with added perturbation is calculated to prevent excessive bandwidth load from affecting actual application deployment and user experience. The bandwidth loss value is calculated based on the bandwidth loss function shown in Formula 3 below:

[0102] Formula 3

[0103] In the formula, This represents the bandwidth loss value. x For historical plaintext traffic, ∑ represents the historical plaintext flow after perturbation, and ∑ is the summation symbol.

[0104] Based on the label loss value and bandwidth loss value, the total loss value is calculated using the following formula 4:

[0105] Formula 4

[0106] In the formula, This represents the total loss value. Indicates the label loss value. This represents the bandwidth loss value. and These are the weight parameters for label loss and bandwidth loss, respectively.

[0107] Backpropagation is performed based on the total loss value to update the parameters in the initial adversarial perturbation generator, resulting in the updated adversarial perturbation generator.

[0108] S1017: Repeat the training process of the adversarial perturbation generator in steps S1012-S1016 above until the preset stopping condition is reached, and obtain the preset adversarial perturbation generator.

[0109] The preset conditions can be set to reach a fixed number of iterations, achieve a certain accuracy threshold, or allow the accuracy to remain unchanged within a preset number of iterations. No specific limitations are required here.

[0110] To facilitate understanding of this solution by those skilled in the art, the specific implementation process of the training flow of the adversarial disturbance generator described in steps S1011-S1017 of the embodiments of this application is explained more clearly and completely below: Refer to Figure 4 As shown, random noise is input into the generator to obtain adversarial perturbation, corresponding to step S1011 above. The adversarial perturbation is added to the plaintext traffic to obtain perturbed historical plaintext traffic, corresponding to step S1012 above. The perturbed plaintext traffic is encrypted to obtain ciphertext traffic, corresponding to step S1013 above. The historical ciphertext traffic is input into the large model to obtain the predicted category, and the loss is calculated to optimize the generator network weights and update the generator, corresponding to steps S1014-S1016 above. Here, the generator is the adversarial perturbation generator described in this method.

[0111] In this embodiment, the pre-defined adversarial perturbation generator in this method achieves efficient, covert, and compliant plaintext traffic perturbation generation by combining deep learning and a large language model. Based on joint optimization of the feature space and problem space, the pre-defined adversarial perturbation generator can both modify statistical features to deceive machine learning models and physically alter traffic by inserting virtual headers / filler content, making it difficult for attackers to discover patterns through reverse engineering. Simultaneously, the pre-defined adversarial perturbation generator is continuously optimized through feedback from the large language model, dynamically adjusting the perturbation strategy for different protocol types and attack model evolutions while maintaining low bandwidth overhead. These characteristics enable this method to provide a lightweight and sustainably upgradeable privacy protection solution for encrypted communication without relying on third-party support.

[0112] S102: Add the adversarial perturbation to the plaintext traffic based on the preset perturbation rules to obtain the perturbed plaintext traffic.

[0113] Specifically, it can be that, based on the adversarial perturbation output of the generator, combined with preset perturbation rules, a perturbation command is determined, and the plaintext traffic is modified to obtain the perturbed plaintext traffic.

[0114] Among them, the preset disturbance rules are the rules agreed upon by both parties in network communication, including but not limited to the fields to be disturbed (such as Referer and User-Agent in HTTP headers), the replacement rules for field values ​​(such as replacing the real Referer with a fake path of the same domain name), and the insertion format of virtual headers (such as X-Noise: random string).

[0115] The preset perturbation rules strictly follow the preset format constraints, while the generator dynamically optimizes the perturbation parameters to generate adversarial perturbations, ensuring that the perturbation mode of each communication is unpredictable, and finally outputting plaintext traffic that conforms to the protocol standard and is adversarial.

[0116] S103: Encrypt the disturbed plaintext traffic to obtain ciphertext traffic and send it.

[0117] Specifically, this could involve encrypting the perturbed plaintext traffic (e.g., using TLS encryption) to obtain ciphertext traffic.

[0118] After obtaining the ciphertext traffic, it can be perturbed, that is, perturbed on the ciphertext traffic after block encryption, such as increasing the block length or the block time interval. Specifically, for example... Figure 5 As shown, Figure 5 The box on the left represents the perturbation of encrypted traffic. The perturbation direction (e.g., +1 / -1) indicates that a small positive or negative offset is applied to the characteristics of encrypted traffic (e.g., packet length, timing), such as adding / reducing 1 byte. Real packets carry valid communication data, while virtual packets (e.g., random padding or noise injection) mask the characteristics of real packets by inserting redundant data, thereby disrupting the attacker's statistical analysis of traffic patterns. Figure 5 The box on the right shows the plaintext traffic perturbation implemented by this method. Taking the HTTP protocol as an example, perturbation is implemented in multiple different positions such as Referer, User-Agent and Custom Headers in the HTTP field. At the same time, perturbation can also be applied to the ciphertext traffic obtained by encrypting the perturbated plaintext traffic.

[0119] In this embodiment, step S103 achieves collaborative defense through dual plaintext and ciphertext perturbations. Compliant perturbations are added to protocol fields at the application layer to disrupt application-layer feature recognition. After encryption, virtual packets are filled or inserted via TLS to interfere with packet length and timing statistics. This cross-layer combination requires attackers to simultaneously crack semantic and statistical perturbations, significantly enhancing defense strength. Ciphertext traffic perturbations cover underlying features, while plaintext traffic perturbations provide dynamic adversarial capabilities. The two complement each other to form a three-dimensional defense, maintaining normal communication while effectively resisting traffic analysis attacks.

[0120] To facilitate understanding of this solution by those skilled in the art, the input and output of each step in the plaintext anti-disturbance method for encrypted traffic provided in the embodiments of this application are illustrated below:

[0121] Taking the HTTP protocol as an example, plaintext traffic is:

[0122] GET / login HTTP / 1.1

[0123] Host: example.com

[0124] Referer: https: / / login.example.com

[0125] User-Agent: Chrome / 120.0

[0126] X-Device-ID: 12345

[0127] Input random noise into a preset adversarial perturbation generator to obtain adversarial perturbations:

[0128] {

[0129] "Referer": "https: / / news.example.com",

[0130] "User-Agent": "Chrome / 121.0 (FakeBot / 1.0)",

[0131] "insert_headers": ["X-Proxy-Data: random_string"]

[0132] }

[0133] The sender merges the anti-disturbance into the plaintext traffic, resulting in the perturbed plaintext traffic:

[0134] GET / login HTTP / 1.1

[0135] Host: example.com

[0136] Referer: https: / / news.example.com

[0137] User-Agent: Chrome / 120.0 (FakeBot / 1.0)

[0138] X-Device-ID: 12345

[0139] X-Proxy-Data: random_string

[0140] The sender performs TLS encryption on the perturbed plaintext traffic, resulting in ciphertext traffic that is empty and garbled, unreadable and unparseable, such as:

[0141] 0000 17 03 03 00 3A 00 00 00 00 00 00 00 01 ... (TLS header)

[0142] 0010 F2 8C D9 27 B0 3C EA 41 92 ... (160-byte encrypted payload)

[0143] The receiver uses the corresponding decryption algorithm, namely TLS decryption, to restore the ciphertext traffic to the plaintext traffic after the aforementioned perturbation.

[0144] The receiver operates according to preset perturbation rules, such as:

[0145] {

[0146] "User-Agent": "Chrome / 120.0", # Force restore to the specified value

[0147] "X-Proxy-Data": "DELETE" # Delete this header

[0148] },

[0149] Remove the X-Proxy-Data header, restore the User-Agent, and obtain the plaintext traffic as the final valid information.

[0150] To facilitate understanding of this solution by those skilled in the art, the following provides a clearer and more complete description of the plaintext anti-perturbation method for encrypted traffic and the overall process of training a preset anti-perturbation generator, as provided in the embodiments of this application: Figure 6As shown, the main steps of the plaintext adversarial perturbation technology for encrypted traffic include the collection and extraction of plaintext traffic, optimization guided by a large language model to train an adversarial perturbation generator, adding the generated adversarial perturbation to the plaintext traffic to obtain the perturbed plaintext traffic, and then encrypting and transmitting the perturbed plaintext traffic to achieve effective protection of privacy information in network communication.

[0151] Example 2

[0152] Based on the same inventive concept, embodiments of the present invention also provide a plaintext anti-disturbance and descrambling method for encrypted traffic, referring to... Figure 7 As shown, the method includes:

[0153] S201: According to the preset perturbation rules, the ciphertext traffic is decrypted and descrambled sequentially using the corresponding decryption and descrambling algorithms to obtain the plaintext traffic.

[0154] Specifically, upon receiving ciphertext traffic, the corresponding decryption algorithm is first applied based on the encryption algorithm (such as TLS encryption) to decrypt the ciphertext traffic, thus obtaining the perturbed plaintext traffic.

[0155] According to the preset perturbation rules, the perturbed plaintext traffic is descrambled (e.g., the virtual header X-Noise is removed) to obtain the valid communication information.

[0156] Among them, the preset perturbation rules are the positions and forms of perturbation to be added in advance by the sender and receiver in network communication, including but not limited to the fields to be perturbed (such as Referer and User-Agent in HTTP headers), the replacement rules for field values ​​(such as replacing the real Referer with a fake path of the same domain name), and the insertion format of virtual headers (such as X-Noise: random string).

[0157] Example 3

[0158] Based on the same inventive concept, embodiments of the present invention also provide a plaintext anti-interference device for encrypted traffic, referring to... Figure 8 As shown, the device includes:

[0159] The disturbance generation module 101 is used to input random noise into a preset adversarial disturbance generator after acquiring the plaintext traffic to be sent, so as to obtain adversarial disturbance;

[0160] The perturbation merging module 102 is used to add the anti-perturbation to the plaintext traffic based on a preset perturbation rule to obtain the perturbed plaintext traffic;

[0161] The traffic transmission module 103 is used to encrypt the disturbed plaintext traffic to obtain ciphertext traffic and send it.

[0162] Example 4

[0163] Based on the same inventive concept, embodiments of the present invention also provide a plaintext anti-interference and descrambling device for encrypted traffic, referring to... Figure 9 As shown, the device includes:

[0164] The decryption and descrambling module 201 is used to decrypt and descramble the ciphertext traffic sequentially according to the preset perturbation rules and the corresponding decryption and descrambling algorithms to obtain the plaintext traffic.

[0165] Example 5

[0166] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program / instruction thereon, which, when executed by a processor, implements the plaintext anti-disturbance method for encrypted traffic as described in Embodiment 1 above, and / or the plaintext anti-disturbance descrambling method for encrypted traffic as described in Embodiment 2 above.

[0167] Example 6

[0168] Based on the same inventive concept, embodiments of the present invention also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the plaintext anti-disturbance method for encrypted traffic as described in Embodiment 1 above, and / or the plaintext anti-disturbance descrambling method for encrypted traffic as described in Embodiment 2 above.

[0169] Example 7

[0170] Based on the same inventive concept, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, it implements the plaintext anti-disturbance method for encrypted traffic as described in Embodiment 1 above, and / or the plaintext anti-disturbance descrambling method for encrypted traffic as described in Embodiment 2 above.

[0171] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0172] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0173] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0174] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0175] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A plaintext against perturbation method for encrypted traffic, applied to a sender, characterized in that, The method comprises the following steps: After obtaining the plaintext traffic to be sent, random noise is input into a preset adversarial disturbance generator to obtain an adversarial disturbance; The adversarial disturbance is added to the plaintext traffic based on a preset disturbance rule to obtain disturbed plaintext traffic; The disturbed plaintext traffic is encrypted to obtain ciphertext traffic and send the ciphertext traffic; The preset adversarial disturbance generator is obtained by the following method: Obtain a data set and an initial adversarial disturbance generator; the data set comprises a plurality of historical plaintext traffics and a category label corresponding to each historical plaintext traffic; Train the preset adversarial disturbance generator: input random noise into the initial adversarial disturbance generator to obtain a predicted adversarial disturbance; add the predicted adversarial disturbance to any historical plaintext traffic of the data set to obtain disturbed historical plaintext traffic; encrypt the disturbed historical plaintext traffic to obtain historical ciphertext traffic; input the historical ciphertext traffic into an LLM to obtain a predicted category; based on the predicted category, the disturbed historical plaintext traffic, the historical plaintext traffic and the corresponding category label, a total loss value is calculated, wherein: ; wherein, represents a total loss value, represents the label loss value, represents a bandwidth loss value, is a class label corresponding to the historical plaintext traffic, is the predicted class, and are weight parameters of the label loss and bandwidth loss values, respectively; x is the historical plaintext traffic, is the perturbed historical plaintext traffic, and ∑ is a summation symbol. Based on the total loss value, the initial adversarial disturbance generator is updated by back propagation to obtain an updated adversarial disturbance generator; Repeat the process of training the adversarial disturbance generator until a preset stop condition is reached to obtain a preset adversarial disturbance generator.

2. The method of claim 1, wherein, The random noise is input into the preset adversarial disturbance generator to obtain the adversarial disturbance, which comprises inputting random noise obeying Gaussian distribution into the preset adversarial disturbance generator to obtain an adversarial disturbance comprising a plurality of compliant disturbance instructions.

3. The method of claim 1 or 2, wherein, The data set is obtained by the following method: Obtain a plurality of historical plaintext traffics, and extract the application layer protocol type of each historical plaintext traffic using a traffic packet extraction tool; The application layer protocol type of each historical plaintext traffic is taken as the category label of the corresponding historical plaintext traffic to obtain the data set in combination with the corresponding historical plaintext traffic.

4. The method of claim 1 or 2, wherein, After obtaining the ciphertext traffic, it further comprises: Performing ciphertext traffic disturbance on the ciphertext traffic.

5. The method of claim 1 or 2, wherein, The preset disturbance rule at least comprises a replacement rule for determining a field to be disturbed and a field value, and an insertion format of a virtual header.

6. A plaintext against perturbation apparatus for encrypted traffic, characterized in that, The method comprises the following steps: The disturbance generation module is configured to input random noise into a preset adversarial disturbance generator after obtaining plaintext traffic to be sent to obtain an adversarial disturbance, wherein the preset adversarial disturbance generator is obtained by the following method: obtaining a data set and an initial adversarial disturbance generator; the data set comprises a plurality of historical plaintext traffics and a category label corresponding to each historical plaintext traffic; training the preset adversarial disturbance generator: input random noise into the initial adversarial disturbance generator to obtain a predicted adversarial disturbance; add the predicted adversarial disturbance to any historical plaintext traffic of the data set to obtain disturbed historical plaintext traffic; encrypt the disturbed historical plaintext traffic to obtain historical ciphertext traffic; input the historical ciphertext traffic into an LLM to obtain a predicted category; based on the predicted category, the disturbed historical plaintext traffic, the historical plaintext traffic and the corresponding category label, a total loss value is calculated, wherein: ; In the formula, denotes a total loss value, denotes a label loss value, denotes a bandwidth loss value, is a class label corresponding to the historical plaintext traffic, is the predicted class, and are weight parameters of the label loss and bandwidth loss values respectively; x is the historical plaintext traffic, is the perturbed historical plaintext traffic, and ∑ is a summation symbol; based on the total loss value, the initial adversarial perturbation generator is updated to obtain an updated adversarial perturbation generator; The process of training the adversarial perturbation generator is repeated until a preset stop condition is reached, and a preset adversarial perturbation generator is obtained. A perturbation merging module is configured to add the adversarial perturbation to the plaintext traffic based on a preset perturbation rule to obtain perturbed plaintext traffic. A traffic sending module is configured to encrypt the perturbed plaintext traffic to obtain ciphertext traffic and send the ciphertext traffic.

7. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the plaintext adversarial perturbation method for encrypted traffic according to any one of claims 1-5.

8. A computer device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the processor to perform the method of any one of claims 1-7. The processor executes the computer program to implement the plaintext adversarial perturbation method for encrypted traffic according to any one of claims 1-5.

Citation Information

Patent Citations

  • Ciphertext confrontation sample detection and defense method based on secret sharing and medium

    CN119004529A

  • Large language model privacy protection method and device based on adaptive semantic perception

    CN120068141A