Encrypted traffic countermeasure attack method, electronic device, storage medium, and product

By adding perturbations with multiple relationships to encrypted traffic to generate adversarial traffic, and then using the multiple relationships of the perturbations to restore the original traffic after the detection model, the problem of not generating real adversarial traffic and failing to restore the original traffic in the existing technology is solved, thereby improving the concealment and controllability of encrypted traffic adversarial attacks.

CN120498624BActive Publication Date: 2026-01-02CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510554370.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2026-01-02
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

Existing methods for countering encrypted traffic attacks fail to generate realistic adversarial traffic and fail to consider how to reconstruct the original traffic after the adversarial traffic passes through the detection model.

Method used

By adding a perturbation with a multiple relationship to the encrypted traffic, first and second adversarial byte sequences are generated, replacing the traffic load information to form adversarial traffic, and the original traffic is restored by using the multiple relationship of the perturbation after the detection model.

Benefits of technology

It improves the concealment and controllability of adversarial attacks, ensuring that the generated adversarial traffic can be effectively restored to the original traffic after the detection model, thus enhancing the effectiveness and concealment of the attack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120498624B_ABST
    Figure CN120498624B_ABST
Patent Text Reader

Abstract

The application provides a method for encrypted traffic confrontation attack, an electronic device, a storage medium and a product. The method comprises the following steps: extracting payload information in encrypted traffic to form a traffic byte sequence; using a confrontation attack method to attack an encrypted traffic detection model, adding a first disturbance and a second disturbance with a multiple relationship on the traffic byte sequence; respectively replacing the payload information in the encrypted traffic with a first confrontation byte sequence and a second confrontation byte sequence to obtain a first confrontation traffic and a second confrontation traffic. The application adds the disturbance to the payload field to generate legal traffic, so that the legal traffic maintains normal transmission capability. When generating the confrontation disturbance, a multiple constraint is applied, so that the generated disturbances have a multiple relationship. After the traffic passes through the detection model, the original traffic can be restored by using the multiple relationship, and the concealment and controllability of the confrontation attack are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of computer network security, and particularly relates to an encrypted traffic adversarial attack method, an electronic device, a storage medium and a product. BACKGROUND

[0002] With the rapid development of the Internet in recent years, while various software and Internet services bring us convenience in life, personal privacy and security are also greatly threatened. Although the current general Internet connection has adopted an encryption method, rather than the load transparent situation in the early days of the Internet, the traffic load is basically encrypted, and it is basically impossible to obtain other people's personal information through load analysis.

[0003] The encryption protocol based on TLS / SSL protects and hides the user's privacy to a certain extent, and ensures the invisibility of data, but at the same time, it also covers some original characteristics of the data, providing a hiding space for network malicious behavior. The encrypted malicious traffic is difficult to be identified, and the user's privacy and security are still threatened.

[0004] Traffic adversarial attack is to produce adversarial traffic similar to normal traffic to deceive the detection model, so as to achieve the purpose of adversarial attack. Traffic adversarial attack generally aims at two aspects: feature space and byte space. The feature space usually inserts some redundant data packets into the normal traffic, so as to deceive the detection system; the byte space adds disturbance on the original bytes of the traffic to deceive the detection system.

[0005] The existing adversarial attack method customizes adversarial disturbance to generate adversarial samples, but these adversarial samples are only the input form of the detection model, not the real adversarial traffic; and the problem of whether the original traffic can be restored after the adversarial traffic passes through the detection system is not considered. SUMMARY

[0006] The purpose of the present application is to overcome the shortcomings of the prior art, and provide an encrypted traffic adversarial attack method, an electronic device, a storage medium and a product, which improve the concealment and controllability of traffic adversarial attack.

[0007] In order to achieve the above purpose, the technical scheme adopted by the present application is:

[0008] An encrypted traffic adversarial attack method, comprising the following steps:

[0009] S1, obtaining encrypted traffic;

[0010] S2, extracting the load information in the encrypted traffic to obtain a traffic byte sequence;

[0011] S3, take the flow byte sequence as the input of a deep learning network model, train the deep learning network model, and obtain an encrypted traffic detection model;

[0012] S4, attack the encrypted traffic detection model by using an adversarial attack method, add a first perturbation and a second perturbation with a multiple relationship on the flow byte sequence, and obtain a first adversarial byte sequence and a second adversarial byte sequence;

[0013] S5, replace the payload information in the encrypted traffic with the first adversarial byte sequence and the second adversarial byte sequence respectively, and obtain a first adversarial traffic and a second adversarial traffic.

[0014] The present application aims at the problem that the existing method does not generate real adversarial traffic, only adds perturbation in the payload field to generate legal traffic, so that it maintains normal transmission capability, and imposes multiple constraints when generating adversarial perturbation, so that the generated perturbations have a multiple relationship. This method can restore the original traffic after the traffic passes through the detection model, improve the concealment and controllability of the adversarial attack.

[0015] Further, the process of S2 includes:

[0016] The encrypted traffic is segmented in units of flow to form a plurality of flow samples;

[0017] The payload information in each flow sample is extracted;

[0018] The payload information is converted into a flow byte sequence.

[0019] Further, any one of the DeepPacket model, the Datanet model, the TrafficCNN model, the Resnet18 model and the Densenet121 model is adjusted, the input layer is changed to a single channel, and after the last softmax layer is changed to a softmax layer with two neurons, it is used as a deep learning network model.

[0020] The byte sequence is a single channel, the input layer is adjusted to a single channel, so that it is compatible with the byte sequence input, and the last classification operation is changed to binary classification, so that it is suitable for binary classification.

[0021] Further, when the deep learning network model adopts the adjusted DeepPacket model and Datanet model, the multiple between the first perturbation and the second perturbation is 2, 3, 4, 5…; when the deep learning network model adopts the adjusted TrafficCNN model, Resnet18 model and Densenet121 model, the multiple between the first perturbation and the second perturbation is 2, 3.

[0022] Further, expressions of the first and second adversarial byte sequences are as follows:

[0023] X ADV = X + e

[0024] X' ADV = X + e'

[0025] e' = k e

[0026] wherein X ADV is the first adversarial byte sequence, X' ADV is the second adversarial byte sequence, X is the traffic byte sequence, e is the first perturbation, e' is the second perturbation, and k is a multiple between the first and second perturbations, k = 2, 3, 4, 5, …. Further, an expression of the first perturbation is as follows:

[0027] e = grad (r / s) positions

[0028] wherein grad is a gradient, r is an initial perturbation, s is a perturbation step number, and positions is a legal position.

[0029] Further, S6, by the first and second adversarial byte sequences, restores the traffic byte sequence, converts the restored traffic byte sequence into payload information, restores the encrypted traffic, and an expression of the restored traffic byte sequence is as follows:

[0030] X' = (k X ADV - X' ADV ) / (k-1)

[0031] wherein X ADV is the first adversarial byte sequence, X' ADV is the second adversarial byte sequence, k is a multiple between the first and second perturbations, and X' is the restored traffic byte sequence.

[0032] Based on the same inventive concept, the present application also provides an electronic device comprising:

[0033] one or more processors;

[0034] a memory having one or more programs stored thereon, which, when executed by the one or more processors, cause the one or more processors to implement the steps of the encrypted traffic adversarial attack method.

[0035] Based on the same inventive concept, the present application also provides a computer readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the encrypted traffic adversarial attack method.

[0036] Based on the same inventive concept, the application also provides a computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps of the method for encrypted traffic adversarial attack.

[0037] Compared with the prior art, the application has the following beneficial effects:

[0038] The application can introduce a multiple relationship of disturbance to solve the problem of restoring original traffic under the premise of generating real adversarial traffic.

[0039] In view of the fact that the prior art does not generate real adversarial traffic and does not consider the problem of restoring original traffic, the method for generating adversarial traffic in the byte space of the application only adds disturbance to the payload field to generate legal traffic, so that it maintains normal transmission capability, and imposes a multiple constraint when generating adversarial disturbance, so that the generated disturbances have a multiple relationship. This method can restore the original traffic by using this multiple relationship after the traffic passes through the detection model, thereby improving the concealment and controllability of the attack. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 Fig. 1 is a schematic diagram of the encrypted traffic adversarial method of the application;

[0041] Figure 2 Fig. 2 is a schematic diagram of the adversarial attack for generating adversarial traffic of the application. DETAILED DESCRIPTION

[0042] The application will be described in detail below with reference to the embodiments. It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other without conflict. For the sake of description, if the terms "up", "down", "left", "right" appear in the following, they only mean the up, down, left and right directions of the drawings themselves, and do not limit the structure.

[0043] EMBODIMENT

[0044] In view of the deficiencies of the prior art adversarial attack for byte space traffic, the present embodiment proposes a method for encrypted traffic adversarial attack in the byte space. The method generates traffic adversarial samples by applying customized disturbance to the payload of the data packet; and generates disturbances with a multiple relationship by imposing a multiple limit condition when performing adversarial attack, thereby generating traffic adversarial samples with disturbances having a multiple relationship. By using the multiple relationship, the original traffic can be restored after passing through the detection model, thereby better achieving the purpose of attack. The method can be well compatible with the adversarial attack method.

[0045] As Figure 1 , Figure 2 The encrypted traffic adversarial attack method of the present embodiment comprises the following steps:

[0046] Step 1, obtain standard, representative encrypted traffic data set, generally a class of traffic corresponds to a pcap file.

[0047] Step 2, data preprocessing is carried out on the obtained traffic data, and traffic load information is extracted to form traffic byte sequence.

[0048] Step 3, the preprocessed data is sent into the deep learning network model for training to obtain an encrypted traffic detection model.

[0049] Step 4, use the adversarial attack on the encrypted traffic detection model to generate an adversarial byte sequence X ADV and X′ ADV with a multiple relationship that can deceive the encrypted traffic detection model.

[0050] e′=k·e

[0051] Wherein, e is the first perturbation, e′ is the second perturbation, k is the multiple between the first perturbation and the second perturbation, k = 2, 3, 4, 5…

[0052] Step 5, generate an adversarial traffic sample that can deceive the encrypted traffic detection model through the generated adversarial byte sequence X ADV and X′ ADV .

[0053] Step 6, input the adversarial traffic sample into the encrypted traffic detection model to complete the deception, evaluate the effectiveness of the adversarial attack, then restore the original encrypted traffic using the multiple relationship of the perturbation, and evaluate the restoration performance of the method.

[0054] Step 1, obtain standard, representative encrypted traffic data set, which is USTC-TFC2016 public data set, the data set is encrypted traffic, composed of malicious traffic and benign traffic, and the malicious traffic and benign traffic are divided into 10 different traffics respectively, the benign traffic includes BitTorrent, Gmail, etc., and the malicious traffic includes Cridex, Tinba, etc. According to the demand, appropriate traffic file can be selected to form the data set for subsequent experiment.

[0055] The traffic data obtained in step 1 is preprocessed in step 2 to extract traffic load information and form traffic samples. Specifically, different types of traffic are divided into flows as the basic unit to form traffic samples, one flow corresponds to one traffic sample, and one flow includes a plurality of traffic data packets. Then, for each traffic sample, the data packets in each flow are read using a related tool kit or function library. In the process of reading the data packets, the payload information extraction is realized by using the function in the Pyshark library of Python. It is judged whether there is payload field information (payload information) in the data packet. If the payload information exists, it is extracted. If not, the data packet is skipped. After reading all the data packets, the extracted payload information is standardized, that is, the first 1024 bytes of the payload information are extracted. If the traffic sample is less than 1024 bytes, zero is filled. Then, the 1024 bytes are converted into a one-dimensional byte sequence corresponding to 1024 decimal numbers. Each byte corresponds to an integer of 0-255, which is used as the input of the subsequent model. In this embodiment, the number of traffic samples generated by each subcategory is 1000.

[0056] In step 3, the byte sequence of the sample obtained in step 2 is used as the input to train the deep learning network model. The training target is to make the model as accurate as possible in classifying traffic samples, and obtain an encrypted traffic detection model.

[0057] In this embodiment, five different deep learning network models are used, including DeepPacket model, Datanet model, TrafficCNN model, Resnet18 model and Densenet121 model. All traffic samples of the subcategories are classified into a large category, that is, only a two-class operation is performed on the traffic samples. The structure of the five deep learning network models is adjusted. The first layer input layer of the deep learning network model is changed to a single channel to make it compatible with the byte vector input. Then, the last classification softmax layer is changed to a two-neuron softmax layer for two-class classification, and the others remain unchanged. The model can output a 1*2 tensor to indicate the two-class classification result. During the specific training, the ratio of the training set to the test set is 6:4, the training is performed for 10 rounds, and the batch size is set to 8. After training, the classification accuracy of the five models for traffic samples is 99.30%, 99.75%, 99.73%, 99.75% and 99.58% respectively. The specific classification results are shown in Table 4. The model has high efficiency for traffic classification.

[0058] The specific image adversarial attack method can be used in step 4 in combination with the multiple perturbation training method to add perturbation on the byte sequence, specifically: using FGSM, DeepFool, C&W adversarial attack methods to attack the trained encrypted traffic detection model, forming adversarial byte sequences X ADV and X' ADV These adversarial byte sequences can better deceive the encrypted traffic detection model.

[0059] Adding perturbation on the byte sequence using the adversarial attack method makes the trained encrypted traffic detection model misclassify. In this embodiment, the FGSM attack method is used, which is a gradient-based adversarial attack method. By adding perturbation opposite to the gradient direction, the encrypted traffic detection model is misclassified. When attacking, the added perturbation has a multiple relationship, generating two adversarial byte sequences X ADV and X' ADV .

[0060] X ADV = X + e

[0061] X' ADV = X + e'

[0062] e' = k e

[0063] e = grad (r / s) positions

[0064] Where X ADV is the first adversarial byte sequence, X' ADV is the second adversarial byte sequence, X is the traffic byte sequence, e is the first perturbation, e' is the second perturbation, k is the multiple between the first perturbation and the second perturbation, k = 2, 3, 4, 5…, grad is the gradient, r is the initial perturbation, s is the perturbation step number, and positions is the legal position.

[0065] Preferably, when the deep learning network model adopts the adjusted DeepPacket model, Datanet model, k is selected as 2, 3, 4, 5…; when the deep learning network model adopts the adjusted TrafficCNN model, Resnet18 model, Densenet121 model, k is selected as 2, 3.

[0066] The adversarial attack uses FGSM, DeepFool, C&W methods for attack, and the inputs of these methods are gradient, vector, perturbation size and other parameters.

[0067] The flow byte sequence X is added with the gradient grad* perturbation r in each FGSM attack, and the gradient is the direction in which the loss function decreases fastest. If the sequence is updated in the opposite direction of the gradient, the loss will become larger and larger, so that the generated adversarial byte sequence is misrecognized by the model, which is the attack process.

[0068] The multiple perturbation training method is as follows:

[0069] Input: original byte sequence X, corresponding true label y, perturbation size r, perturbation multiple k, target detection model F(), loss function criterion(), perturbation step s;

[0070] Output: adversarial byte sequence X ADV , X′ ADV

[0071] 1: X ADV ←X, X ADV ←X

[0072] 2: for i <- l...s do

[0073] 3: Step 1: Calculate the gradient

[0074] 4: y1 <- F(X ADV ), y2 <- F(X′ ADV )

[0075] 5: loss <- criterion(y1, y) + criterion(y2, y)

[0076] 6: loss.backward()

[0077] 7: grad <- X ADV .grad

[0078] 8: Step 2: Calculate the legal position

[0079] 9: positions <- getLegalIndex(X ADV , X ADV .grad, k)

[0080] 10: Step 3: Adversarial attack

[0081] 11: X ADV = X ADV + grad * (r / s) * positions

[0082] 12: X′ ADV = X′ ADV + grad * (r / s) * k * positions

[0083] 13: end for

[0084] 14: Return Xadv,Xadv

[0085] where the loss function is cross-entropy function, getLegalIndex(X ADV ,X ADV .grad,k) is to calculate all legal positions, so that after the adversarial attack on these legal positions, all bytes are still in the interval range of [0-255]. Loss.backward() is gradient reversal, the number of perturbation steps s is 10, the perturbation r is 60 / 255; grad refers to the positive and negative of the gradient, that is, the direction, positions are legal positions, and after loss backward, that is, loss.backward(), X ADV will have an attribute grad, which can be accessed by X ADV .grad to get grad.

[0086] Step 5 generates an adversarial traffic sample that can deceive the encrypted traffic detection model by using the generated adversarial byte sequence, specifically: by sequentially reading the data packets in the original encrypted traffic sample, replacing the corresponding payload field in each data packet with the corresponding adversarial byte sequence to form a new data packet; Finally, all changed data packets are written into a new pcap file to obtain an adversarial traffic sample.

[0087] Use the rdpcap function in the scapy library to read the data packets in the original encrypted traffic, sequentially access the payload field in the data packet, that is, the payload information, replace it with the adversarial byte sequence, and finally use the wrpcap function in the scapy library to write all data packets into a new pcap file, which is the generated traffic adversarial sample. By comparison, the adversarial traffic sample and the original encrypted traffic sample are the same and can be normally parsed, only the payload information is different, and the data header does not change. The original encrypted traffic, adversarial traffic, and restored encrypted traffic are shown in Tables 1, 2, and 3, respectively.

[0088] Table 1 Original encrypted traffic

[0089] 00e0 3c 68 74 6d 6c 3e 3c 68 65 61 64 3e 3c 74 69 74 00f0 6c 65 3e 41 70 61 63 68 65 20 54 6f 6d 63 61 74 0100 2f 36 2e 30 2e 32 34 20 2d 20 45 72 72 6f 72 20 0110 72 65 70 6f 72 74 3c 2f 74 69 74 6c 65 3e 3c 73 0120 74 79 6c 65 3e 3c 21 2d 2d 48 31 20 7b 66 6f 6e 0130 74 2d 66 61 6d 69 6c 79 3a 54 61 68 6f 6d 61 2c

[0090] Table 2 Adversarial traffic

[0091] 00e0 b4 f0 2c f5 f4 6e 24 e0 ed e9 ec 56 b4 ec f1 ec 00f0 f4 ed c6 c9 40 a9 c3 e0 dd 98 bd ea fa e7 ea e0 0100 a7 ee a6 a8 a6 02 ac f0 8d 98 cc 9f f5 63 e9 ec 0110 fa ed e8 f7 ea ec 6c a7 ec 39 ec e4 ed c6 c4 bb 0120 ec 19 e4 ed b6 6c 81 a5 a5 48 cf e0 03 66 f7 f6 0130 fc d3 de e9 3d f1 f4 f1 3a cc d9 e0 e7 e5 91 8c

[0092] Table 3 Restored encrypted traffic

[0093] 00e0 3c 68 74 6d 6c 3e 3c 68 65 61 64 3e 3c 74 69 74 00f0 6c 65 3e 41 70 61 63 68 65 20 54 6f 6d 63 61 74 0100 2f 36 2e 30 2e 32 34 20 2d 20 45 72 72 6f 72 20 0110 72 65 70 6f 72 74 3c 2f 74 69 74 6c 65 3e 3c 73 0120 74 79 6c 65 3e 3c 21 2d 2d 48 31 20 7b 66 6f 6e 0130 74 2d 66 61 6d 69 6c 79 3a 54 61 68 6f 6d 61 2c

[0094] Step 6 inputs the adversarial traffic sample into the encrypted traffic detection model, completes the deception, and evaluates the effectiveness of the adversarial attack, then restores the original encrypted traffic using the perturbation multiple relationship, and evaluates the restoration performance of the method. The effectiveness of the method is illustrated through the experimental indicators.

[0095] X' = (k · X VDV -X' ADV ) / (k-1)

[0096] where X' is the restored traffic byte sequence.

[0097] The generated adversarial traffic sample is input into the encrypted traffic detection model, and accuracy, precision, recall, and F1 score are used as indicators. The results show that the encrypted traffic detection model has weak recognition ability and low recognition efficiency for adversarial traffic samples, as shown in Table 4.

[0098] Table 4 Comparison of encrypted traffic detection model recognition efficiency before and after adversarial attack

[0099]

[0100] Finally, through the perturbation multiple relationship between X ADV and X' ADV , the encrypted traffic is restored, and it is found that the original traffic can be restored, as shown in Tables 1 and 3. The restored encrypted traffic is consistent with the original encrypted traffic.

[0101] The encrypted traffic adversarial method is as follows:

[0102] Input: original flow f, corresponding true label y, perturbation size r, target detection model F()

[0103] Output: adversarial flow f adv

[0104] 1: Step 1: Payload extraction of flow

[0105] 2: packets <- getPackets(f)

[0106] 3: l <- len(packets)

[0107] 4: for i <- 1...l do

[0108] 5: packet <- packets i

[0109] 6: payload <- packet.payload

[0110] 7: X <- X.append(payload)

[0111] 8: end for

[0112] 9: Step 2: Adversarial Attack

[0113] 10: X ADV <- Attack(X, F(), y, r)

[0114] 11: Step 3: Change Payload

[0115] 12: index <- 0

[0116] 13: for i <- 1...l do

[0117] 14: packet <- packets i

[0118] 15: length <- len(packet)

[0119] 16: packet.payload <- X ADV [index:index+length]

[0120] 17: index <- index+length

[0121] 18: end for

[0122] 19: Step 4: Generate Adversarial Flow

[0123] 20: f adv <- generateAdversarialFlow(packets)

[0124] 21: Return f adv

[0125] where getPackets() represents processing the input flow, extracting all data packets and storing them in the packets variable, and l represents the length of packets, i.e., the number of data packets. By sequentially accessing the data packets, the payload is integrated through the append operation to obtain the original byte sequence X, and append is a vector operation that adds a vector to the end of another vector. The Attack() function mainly generates adversarial byte sequences using adversarial attack methods. generateAdversarialFlow() generates adversarial traffic samples using the modified packets.

[0126] The method uses an adversarial attack method to attack a deep learning network model, can generate an adversarial traffic sample with the same structure as the original traffic, is superior to the same type of work, meanwhile, the disturbance generated by the multiple disturbance training method has a multiple relationship, and the original traffic can be restored through the multiple relationship, and the practicability and effectiveness are good, and a new idea is provided for the encrypted traffic adversarial attack method.

[0127] The traffic adversarial sample generated through the method can well escape the detection of the detection model. After bypassing the detection system, the multiple relationship of the disturbance can well restore the original traffic. The method only affects the payload of the data packet, the validity of the data packet is verified, and certain practical significance is obtained.

[0128] Another embodiment of the application provides an electronic device, comprising:

[0129] One or more processors;

[0130] A memory having one or more programs stored thereon, which, when executed by the one or more processors, cause the one or more processors to implement the steps of the encrypted traffic adversarial attack method.

[0131] In some implementations, the memory can be a high-speed random access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory.

[0132] In other implementations, the processor can be a central processing unit (CPU), a digital signal processor (DSP), and various types of general-purpose processors, without limitation.

[0133] Another embodiment of the application provides a computer readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the encrypted traffic adversarial attack method.

[0134] Another embodiment of the application provides a computer program product comprising computer programs / instructions, which, when executed by a processor, implement the steps of the encrypted traffic adversarial attack method.

[0135] Those skilled in the art should understand that embodiments of the application can be provided as methods, systems, or computer program products. Therefore, the application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, optical storage, etc.) containing computer usable program code. Optical memory, etc.) containing computer usable program code.

[0136] The present application is described in reference to the drawings using a flowchart and / or a block diagram of the method, apparatus (system) and computer program product according to the embodiments of the present application. It will be understood that each block of the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, 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, create means for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0137] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks. Figure 1 one or more functions specified in the flowchart and / or block diagram block or blocks.

[0139] The above-described embodiments should be considered in a descriptive sense only and not for purposes of limitation. Descriptions of examples using terms such as "comprising", "having", "containing", or "including" to describe the presence of certain features, elements, steps, operations, or components should be understood as not excluding the presence of other features, elements, steps, operations, or components.

Claims

1. A method for combating encrypted traffic attacks, characterized in that, Includes the following steps: S1. Obtain encrypted traffic; S2. Extract the payload information from the encrypted traffic to form a traffic byte sequence; S3. Use the traffic byte sequence as input to the deep learning network model to train the deep learning network model and obtain the encrypted traffic detection model; S4. Attack the encrypted traffic detection model using an adversarial attack method by adding a first perturbation and a second perturbation with a multiple relationship to the traffic byte sequence to obtain a first adversarial byte sequence and a second adversarial byte sequence. S5. Replace the payload information in the encrypted traffic with the first adversarial byte sequence and the second adversarial byte sequence respectively to obtain the first adversarial traffic and the second adversarial traffic; The process of S2 includes: The encrypted traffic is segmented into multiple traffic samples based on the number of streams. Extract load information from each traffic sample; Convert the load information into a sequence of traffic bytes; Adjust any one of the DeepPacket, Datanet, TrafficCNN, Resnet18, or Densenet121 models by changing the input layer to a single channel and the final softmax layer to a softmax layer with two neurons, and use it as a deep learning network model. When using the adjusted DeepPacket model or DataNet model for deep learning network models, the multiple between the first and second perturbations is 2, 3, 4, 5, etc.; when using the adjusted TrafficCNN model, ResNet18 model, or DenseNet121 model for deep learning network models, the multiple between the first and second perturbations is 2 and 3.

2. The method for combating encrypted traffic attacks according to claim 1, characterized in that, The expressions for the first and second adversarial byte sequences are as follows: X ADV =X+e X′ ADV =X+e′ e′=k·e Among them, X ADV For the first adversarial byte sequence, X′ ADV Let X be the second adversarial byte sequence, e be the first perturbation, e′ be the second perturbation, and k be the multiple between the first and second perturbations.

3. The method for combating encrypted traffic attacks according to claim 1, characterized in that, The expression for the first perturbation is as follows: e = grad·(r / s)·positions Where grad is the gradient, r is the initial perturbation, s is the number of perturbation steps, and positions are the valid positions.

4. The method for combating encrypted traffic attacks according to claim 1, characterized in that, S6. Recover the traffic byte sequence using the first and second adversarial byte sequences, convert the recovered traffic byte sequence into payload information, and restore the encrypted traffic. The expression for the recovered traffic byte sequence is as follows: X′=(k·X ADV -X′ ADV ) / (k-1) Among them, X ADV For the first adversarial byte sequence, X′ ADV Let X' be the second adversarial byte sequence, k be the multiple between the first and second perturbations, and X' be the recovered traffic byte sequence.

5. An electronic device, characterized in that, include: One or more processors; A memory having stored one or more programs that, when executed by one or more processors, cause the one or more processors to perform the steps of the method according to any one of claims 1-4.

6. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-4.

7. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-4.