Privacy protection method in multi-link mobile internet communication
The privacy protection method in multi-link mobile Internet communication networks uses private key calculations and SM4 encryption to address vulnerabilities in complex environments, ensuring secure and efficient data packet transmission.
Patent Information
- Application Number
- CN202411501581.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-03
AI Technical Summary
Multi-link mobile Internet communication networks face challenges in ensuring privacy and security due to vulnerabilities such as identity masquerade attacks, lack of source authentication, and susceptibility to eavesdropping, particularly in complex mobile environments where devices frequently change IP addresses.
A privacy protection method involving mobile routers and aggregation routers that calculate private keys, perform identity authentication, and use the SM4 algorithm for data packet encryption and integrity detection, along with fragment-based encryption and decryption to enhance security.
The method achieves source authentication and integrity detection, reduces authentication delays, and enhances confidentiality by encrypting data packets using fragment scheduling, thereby resisting eavesdropping attacks.
Smart Images

Figure CN119255226A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication security technology, and in particular to a privacy protection method in multi-link mobile Internet communication. Background Art
[0002] With the rapid development of mobile scenarios such as drones, high-speed railways, and highways, a single network access method can no longer meet the new needs of users to obtain computing power and other resources in a timely and reliable manner in complex scenarios. In order to improve users' ability to obtain computing power resources, people try to use multiple wireless or wired networks to achieve parallel communication. Like all communication and computing networks, information security issues in the multi-link transmission process have become an important link that cannot be ignored.
[0003] In multi-link mobile Internet communication networks, network coding technology is often used to improve transmission reliability and further enhance security. Although we can use methods such as data encryption and network coding to enhance data confidentiality, there is still a risk that the traffic characteristics of sensitive data flows will be statistically analyzed. These traffic characteristics include the size of data packets, the time interval between arrival of data packets, and the number and interaction mode of data packets. In addition, the lack of identity authentication for on-board devices and ground devices makes them vulnerable to identity masquerade attacks. At the same time, since on-board devices are on the move, privacy protection also needs to support the mobility of devices.
[0004] In order to solve the problem of stable communication in complex mobile environments, "A Bignum Network Coding Scheme for Multipath Transmission in Vehicular Networks" proposes a method for large integer network coding in multi-link transmission. The principle of this method is to convert the 01 sequence that constitutes the data packet into a very large integer through large integer coding, which usually exceeds the standard integer range supported by computer hardware. Multiple (assuming K) data packets perform matrix operations in the large integer space, output N (not less than K) large integer values, and then remap the data packet from the large integer back to the data packet format. In this process, the content and number of K data packets are changed, thereby realizing the encryption and redundancy of the data packet content. Finally, the sender forwards the encrypted data packet. At the receiving end, according to the properties of matrix operations, the matrix is also solved using the large number coding method. As long as any K of the N are received, the original data packet can be restored, thereby improving the system's ability to resist packet loss. While encrypting the data packet, the generated redundant data packets are used to improve the reliability of the mobile transmission process.
[0005] IKEv2 is often used to negotiate and establish secure communication channels for device access authentication, including identity authentication of both parties and negotiation of keys required for secure communication. IKEv2 requires the exchange of four messages to complete authentication, and usually requires the use of certificates. IKEv2's MOBIKE mechanism supports device mobility and multi-homing.
[0006] IKEv2 communication begins with an initial connection request sent by the initiator (usually the client). The request includes information such as the selected encryption and authentication algorithms and the method for negotiating key materials. The receiver (usually a server or gateway) responds to the initial request. The response includes the encryption and authentication algorithms selected by the server, random numbers (Nonce), and certificates. Subsequently, the communicating parties authenticate themselves using their own authentication methods and negotiate a "shared secret" (Shared Secret). Different authentication methods can be selected, including pre-shared keys, digital certificates, and extended authentication protocols. After successful completion, both communicating parties share a symmetric key for subsequent communications. This key is usually called IKE SA (IKE Security Association). The two parties exchange messages again and negotiate the encryption and hash algorithms used for data transmission. The communicating parties are ready to start secure communication. They use the negotiated encryption and hash algorithms to protect the data.
[0007] In the method of large integer network coding in multi-link transmission, the data packets transmitted by the vehicle and ground terminals lack source identity authentication and are vulnerable to spoofing attacks. The mobility of vehicle-mounted devices requires frequent changes of IP addresses to access the network, which can easily be spoofed by IP. At the same time, there is a lack of integrity authentication for data packets, and the length distribution of data packets can be easily statistically analyzed, which may expose sensitive information in communication. Data packets transmitted by a single link are complete data packets. An attacker who eavesdrops on a single link can intercept complete data packets, resulting in insufficient security. The authentication mechanism of IKEv2 usually requires the exchange of six messages in the first phase and four messages in the second phase to complete identity authentication and negotiation, with more authentication delays and switching delays. Summary of the invention
[0008] The object of the present invention is to provide a privacy protection method in multi-link mobile Internet communication to solve at least one technical problem existing in the above-mentioned background technology.
[0009] In order to achieve the above object, the present invention adopts the following technical solutions:
[0010] The present invention provides a privacy protection method in multi-link mobile Internet communication, comprising:
[0011] The mobile router and the aggregation router calculate their own private keys; the mobile router and the aggregation router respectively obtain the identity information of the other end; the link detection thread of the mobile router detects whether the IP address of the network card has changed. If so, the mobile router re-obtains the private key and the aggregation router re-reads the identity information of the mobile router. Otherwise, the mobile router and the aggregation router calculate the shared key using the identity information of the other end and the private keys of their own network cards; the mobile router or the aggregation router calculates the hash value of the data packet using the shared key and adds it to the header of the data packet to perform data packet source authentication and integrity detection;
[0012] The uplink data packet from the client network segment will be sent to the tun port of the virtual network card. If the tun network card monitors any data packet, the data packet will be fragmented; the fragmented data packet will be encrypted using the SM4 algorithm; the fragmented encrypted data packet will be added with a fragment header and sent in a scheduling manner; the ordinary network card at the receiving end detects the arrival of the data and decrypts it using the SM4 algorithm; the fragment header information is read, and the fragment header is removed to reassemble the data packet.
[0013] Furthermore, the mobile router and the aggregation router calculate their own private keys, including:
[0014] The private key is calculated by sharing the master private key;
[0015]
[0016] S SAR =sH(IP SAR ||ID SAR )
[0017] The mobile router and the aggregation router initialize the master private key s; including: reading the key stored in the system file; initializing the key to type A pairing;
[0018] The mobile router calculates the private key of each network card. The private key of each network card is equal to the dot product of the master private key and the identity information of the network card. H represents mapping a bit string of any length to group G; ID SMR Indicates the device ID of the mobile router, NIC num Indicates the serial number of the available network card. Indicates the IP address of the network card; || indicates serial connection; SMR starts the network card monitoring thread, and calculates the private key of the network card every time a new network card is detected online;
[0019] Fill the network card information into the database, including the SMR number, network card IP, network card name, and timestamp, and set the network card change value to 1;
[0020] The aggregation router also calculates its own private key S SAR , IDSAR Indicates the device ID of the aggregation router, IP SAR Indicates the IP address of the network card on the aggregation router;
[0021] Alternatively, the private key is calculated using the master private key generated by the mobile router itself;
[0022]
[0023] The mobile router and the aggregation router initialize a pair of shared keys K. The mobile router has its own private key SMRSK, and the aggregation router has the public key SMRPK of the mobile router. The mobile router randomly generates a master private key s SMR ;
[0024] The mobile router reads the configuration file and calculates the private key of the aggregation router Perform a hash operation on it to obtain summary 1, which is encrypted with SMRSK; encrypt summary 1 and the original information with the shared key k and send them to the aggregation router;
[0025] After receiving it, the aggregation router uses the shared key K to decrypt it and obtain Perform a hash operation on it to get summary 2, and compare it with summary 1 decrypted with SARPK; if they are equal, store
[0026] The mobile router calculates the private key of each network card The method includes: starting a network card monitoring thread on the mobile router end, and calculating the private key of the network card each time a new network card is detected online; filling the network card information into a database, including the label of the mobile router end, the IP address of the network card, the network card name, and the timestamp, and setting the network card change value to 1.
[0027] Furthermore, the link detection thread at the mobile router end detects whether the IP address of the network card has changed, including: the network card monitoring thread at the mobile router end first detects that a network card is offline, and then re-acquires the IP address, and then determines that the IP address of the network card has changed; the network card information is filled into the database, including the label of the mobile router end, the IP of the network card, the network card name, and the timestamp, and the network card change value is incremented by 1.
[0028] Furthermore, the mobile router end and the aggregation router end use the shared key to calculate the hash value of the data packet, and add it to the header of the data packet to perform data packet source authentication and integrity detection, including: the mobile router end uses the shared key to calculate the HMAC of the data packet, adds it to the header of the original data packet and sends it out; after receiving the data packet, the aggregation router end intercepts the original data packet and calculates its hash value with the shared key, and compares it with the hash value of the data packet header. If they are equal, the data packet source authentication is successful and the data integrity is guaranteed.
[0029] Furthermore, the uplink data packets from the client network segment will be sent to the virtual network card tun port. If the tun network card is monitored, if there is a data packet, the data packet will be fragmented, including:
[0030] The fragment header is designed as follows: 16-bit synchronization word AFAE, in order to separate the data packets in the cache; 16-bit total length of the original data packet; 16-bit total number of fragments; 16-bit fragment number, starting from 0; 16-bit current data packet size; 8-byte data packet sequence number;
[0031] Monitor the tun port to see if there is a data packet arriving; when a data packet arrives, read the total length of the data packet and calculate the length of each fragment; if it is not the last fragment, it is a fixed fragment length; if it is the last fragment, the length of the fragment is the modulo of the total length of the data packet and the fixed fragment length;
[0032] Determine whether the data packet length / fragment fixed size is 0. If so, the total number of fragments returned is equal to the data packet length / fragment fixed size; if not, the total number of fragments returned is equal to the data packet length / fragment fixed size plus 1;
[0033] Use the total number of fragments to assign fragment numbers to the data packet to determine whether it is the last fragment; if it is the last fragment, copy the offset data in a loop until the length reaches the fixed size of the fragment, and go to step B1-2; if it is not the last fragment, copy the offset data at a fixed length.
[0034] Furthermore, the fragmented data packets are encrypted using the SM4 algorithm, including: initializing the shared key to a 16-byte string; calculating the encryption round key using the key expansion algorithm; defining a 16-byte out variable as the output of each encryption; encrypting in segments, with 16 bytes as one segment; and the mobile router or aggregation router then copies the encrypted segments into the sending cache in sequence.
[0035] Furthermore, the fragmented encrypted data packet is added with a fragment header and sent in a scheduling manner, including: detecting the number of all available connections L in the system; calculating the number of fragments P of a fixed size into which the data packet is divided; using i to traverse from 0 to P-1, and the connection number sent is i%L; the data packet is sent from the corresponding network card.
[0036] Furthermore, the ordinary network card at the receiving end detects the arrival of data and uses the SM4 algorithm to decrypt, including: initializing the shared key to a 16-byte string; calculating the decryption round key using the key expansion algorithm; defining a 16-byte out variable as the output of each decryption; encrypting in segments, with 16 bytes as one segment; and the mobile router or aggregation router then copies the decrypted segments into the receiving cache in sequence.
[0037] Further, the fragment header information is read, and the fragment header is removed to reassemble the data packet, including:
[0038] Monitor whether the network card has data; if there is data, copy the data to the circular buffer; read the circular buffer, if the synchronization word AFAE is read;
[0039] If the total length of the data received is 0, it is the first time to receive the fragment. The sequence number, total number of fragments, and total length of data of the current data packet are stored, and the total length of received data and the number of received fragments are reset to 0. If the total length of the data received is not 0, read the current sequence number, total number of fragments, and total length of data.
[0040] If the current sequence number is not equal to the stored sequence number, or the current total number of fragments is not equal to the total number of stored fragments, or the current total data length is not equal to the total length of stored data, then fragments are lost and the total number of fragments, total data length, and sequence number are re-stored, the total length of received data is reset to 0, the number of received fragments is reset to 0, and the network card is re-monitored for data; otherwise, it is copied to the receiving area according to the fragment number and the current fragment size.
[0041] Furthermore, if the current sequence number is not equal to the stored sequence number, or the current total number of fragments is not equal to the total number of stored fragments, or the current total data length is not equal to the total length of stored data, then it is copied to the receiving area according to the fragment number and the current fragment size; the total length of the received data is added to the length of the received data, and the number of received fragments is incremented by one; if it is the last fragment, the excess data in the receive cache is discarded; if the total number of received fragments is equal to the total number of stored fragments, and the total length of the received fragments is equal to the total length of the stored fragments, then a frame of data is successfully reassembled.
[0042] In a third aspect, the present invention provides a non-transitory computer-readable storage medium, which is used to store computer instructions. When the computer instructions are executed by a processor, the privacy protection method in the multi-link mobile Internet communication as described above is implemented.
[0043] In a fourth aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the privacy protection method in the multi-link mobile Internet communication as described above.
[0044] In a fifth aspect, the present invention provides an electronic device, comprising: a processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes instructions for implementing the privacy protection method in multi-link mobile Internet communication as described above.
[0045] The beneficial effects of the present invention are as follows: the source authentication and integrity detection of data packets can be realized in a multi-link mobile Internet environment; the data packet interaction is performed only once, thereby reducing the authentication delay; the fragment scheduling and reorganization can resist eavesdropping attacks to a certain extent; the fixed-length characteristic of the data packet is utilized to encrypt the data packet, thereby enhancing confidentiality.
[0046] Additional advantages of the present invention will be more clearly given in the following description or learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0048] Figure 1 This is a topological diagram of the interconnected communication between multiple client devices and a server device according to an embodiment of the present invention.
[0049] Figure 2 The present invention is a flowchart of a method for identity authentication at a mobile router and a convergence router according to an embodiment of the present invention.
[0050] Figure 3 The present invention is a flowchart of the encryption, decryption and reassembly process of data packet fragments according to an embodiment of the present invention.
[0051] Figure 4 This is a flow chart of calculating a private key by sharing a master private key according to an embodiment of the present invention.
[0052] Figure 5 This is a flow chart of calculating a private key using a master private key generated by a mobile router according to an embodiment of the present invention.
[0053] Figure 6 This is a design diagram of the fragment header described in an embodiment of the present invention.
[0054] Figure 7 This is a flow chart of the sharding process described in an embodiment of the present invention.
[0055] Figure 8 This is a flow chart of data packet encryption according to an embodiment of the present invention.
[0056] Fig. 9 This is a flow chart of sending data packet fragments according to an embodiment of the present invention.
[0057] Fig.10 This is a flow chart of data packet decryption according to an embodiment of the present invention.
[0058] Fig.11 This is a flow chart of the data packet reassembly process described in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below by the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0060] It should be understood by those skilled in the art that unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which this invention belongs.
[0061] It should also be understood that terms, such as those defined in commonly used dictionaries, should be understood to have a meaning consistent with that in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless as defined herein.
[0062] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements and / or groups thereof.
[0063] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0064] To facilitate understanding of the present invention, the present invention is further explained below with reference to specific embodiments in conjunction with the accompanying drawings, and the specific embodiments do not constitute a limitation on the embodiments of the present invention.
[0065] Those skilled in the art should understand that the drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily necessary for implementing the present invention.
[0066] Example 1
[0067] In this embodiment 1, a privacy protection method in multi-link mobile Internet communication is provided, and the method specifically includes the following steps:
[0068] Step A: Source authentication and integrity detection of data packets. The shared key is calculated using the bilinear pairing principle and pre-shared key, which is used to add an authentication header to the data packet to achieve source authentication and integrity detection of the data packet. In addition, for changes in the IP address of the SMR end, the re-authentication process of the data packet requires monitoring of network interface status changes and re-binding to calculate new public and private keys and shared keys.
[0069] Step B: Design the packet fragmentation header, use fixed-length fragmentation, the total length is determined according to the length of the packet monitored by the tun port, and allow the fixed length of the fragment to be customized, and calculate the number of fragments. Arrange the fragmentation sequence number for each data packet, fill in the fragmentation header, and ensure that the last data packet is appropriately filled when it is less than the fixed length. Use the SM4 algorithm to encrypt the fixed-length fragmented data packets in segments. The fragmented data packets are sent through polling scheduling, and the receiving end uses the SM4 algorithm for decryption. Use a ring buffer to aggregate, receive and reassemble the fragmented data packets.
[0070] The sub-steps of the data packet source authentication and integrity detection process in step A include: sub-step A1: the SMR end and the SAR end calculate their own private keys; sub-step A2: the SMR end and the SAR end obtain the identity information of the other end; sub-step A3: the link detection thread of the SMR end detects that the IP address of the network card has changed, and if so, it goes to A4, otherwise it goes to A5; sub-step A4: the SMR end needs to re-obtain the private key, the SAR end needs to re-read the SMR end identity information, and go to A5; sub-step A5: the SMR end and the SAR end use the identity information of the other end and the private keys of their own network cards to calculate a shared key; sub-step A6: the SMR or SAR end uses the shared key to calculate the hash value of the data packet, and adds it to the header of the data packet to perform data packet source authentication and integrity detection.
[0071] The sub-steps of the data packet fragmentation encryption, decryption and reassembly process in step B include: sub-step B1: the uplink data packet from the client network segment will be sent to the virtual network card tun port, and if the tun network card is monitored to have a data packet, the data packet will be fragmented; sub-step B2: the fragmented data packet is encrypted using the SM4 algorithm; sub-step B3: the fragmented data packet is added with a fragment header and then sent in a scheduling manner; sub-step B4: the ordinary network card at the receiving end detects the arrival of data and decrypts it using the SM4 algorithm; sub-step B5: the fragment header information is read, the fragment header is removed and the data packet is reassembled.
[0072] Specifically, there are two ways to carry out the specific process of sub-step A1:
[0073] Method 1: Calculate the private key by sharing the master private key; (1) (2)S SAR =sH(IP SAR ||ID SAR );
[0074] A1-1-1: SMR and SAR initialize the master private key s. The original material of the master private key can be a pre-shared key material previously stored in the device. A1-1-2: SMR calculates the private key of each network card. The private key of each network card is equal to the dot product of the master private key and the identity information of the network card. H represents the mapping of a bit string of any length to the group G. ID SMR Indicates the device ID of the SMR, NIC num Indicates the serial number of the available network card. Indicates the IP address of the network card. || indicates serial connection. A1-1-3: SAR also calculates its own private key S SAR , ID SAR Indicates SAR device identification, IP SAR Indicates the IP address of the SAR network card.
[0075] Method 2: Calculate the private key using the master private key generated by SMR itself; (3) (4)
[0076] A1-2-1: SMR and SAR initialize a pair of shared keys K. SMR has its own private key SMRSK, and SAR has SMR's public key SMRPK. SMR randomly generates a master private key s SMR A1-2-2: SMR reads the configuration file and calculates the SAR private key Hash it to get summary 1, and encrypt it with SMRSK. Encrypt summary 1 and original information with shared key k and send them to SAR; A1-2-3: After receiving, SAR decrypts it with shared key K to get Perform a hash operation on it to get summary 2, and compare it with summary 1 decrypted with SARPK; if they are equal, store A1-2-4: SMR calculates the private key of each network card
[0077] The specific process of A1-1-1 is as follows: A1-1-1-1: read the key stored in the system file; A1-1-1-2: initialize the key to type A pairing. The specific process of A1-1-2 is as follows: A1-1-2-1: SMR starts the network card monitoring thread, and each time a new network card is detected online, the private key of the network card is calculated; A1-1-2-2: fill the network card information into the database, including the SMR number, the IP of the network card, the network card name, and the timestamp, and the network card change value is set to 1. The specific process of A1-2-4 is as follows: A1-2-4-1: SMR starts the network card monitoring thread, and each time a new network card is detected online, the private key of the network card is calculated; A1-2-4-2: fill the network card information into the database, including the SMR number, the IP of the network card, the network card name, and the timestamp, and the network card change value is set to 1.
[0078] The specific process of the sub-step A2 is: A2-1: SMR reads SAR's network card information from the configuration file; A2-2: SAR detects the arrival of data from a new SMR or a new network card, and reads SMR's network card information from the header information of the data packet.
[0079] The specific process of sub-step A3 is as follows: A3-1: the network card monitoring thread on the SMR side first detects that a network card is offline, and then re-acquires the IP address, and then determines that the IP address of the network card has changed; A3-2: fill the network card information into the database, including the SMR number, the IP of the network card, the network card name, and the timestamp, and the network card change value is automatically increased by 1; A3-3: if the IP address of the network card has changed, go to A4, otherwise go to A5.
[0080] The specific process of sub-step A4 is: A4-1: Since only the IP address of the SMR end has changed, only the private key of the network card corresponding to the SMR needs to be recalculated, and the private key of the SAR end does not need to be recalculated; A4-2: SAR detects the arrival of a new network card data packet, parses the header information of the data packet to obtain the IP address of the corresponding network card.
[0081] The specific process of sub-step A5 is as follows: A5-1: The shared key of the SMR end is A5-2: The shared key on the SAR side is (5) (6)
[0082]
[0083] The specific process of sub-step A6 is as follows: A6-1: SMR uses the shared key to calculate the HMAC of the data packet, adds it to the header of the original data packet and sends it out; A6-2: After receiving the data packet, SAR intercepts the original data packet and calculates its hash value using the shared key, and compares it with the hash value of the data packet header. If they are equal, the data packet source authentication is successful and the data integrity is guaranteed; the same is true for SAR.
[0084] In sub-step B1, the fragment header is designed as follows: (1) a 16-bit synchronization word AFAE, in order to separate the data packets in the cache; (2) a 16-bit total length of the original data packet; (3) a 16-bit total number of fragments; (4) a 16-bit fragment number, starting from 0; (5) a 16-bit size of the current data packet; (6) an 8-byte data packet sequence number;
[0085] The specific process of the sub-step B1 is as follows: B1-1: monitor whether there is a data packet arriving at the tun port; B1-2: when a data packet arrives, read the total length of the data packet and calculate the length of each fragment. If it is not the last fragment, it is a fixed fragment length; if it is the last fragment, the length of the fragment is the modulo of the total length of the data packet and the fixed fragment length; B1-3: determine whether the data packet length / fixed fragment size is 0; B1-4: if it is, the total number of fragments returned is equal to the data packet length / fixed fragment size; B1-5: if not, the total number of fragments returned is equal to the data packet length / fixed fragment size plus 1; B1-6: use the total number of fragments to assign fragment numbers to the data packet; B1-7: determine whether it is the last fragment; B1-8: if it is the last fragment, copy the offset data in a loop until the length reaches the fixed fragment size, and go to step B1-2. B1-9: if it is not the last fragment, copy the offset data in a fixed length.
[0086] The specific process of sub-step B2 is: step B2-1: the shared key is calculated in the SAR and SMR identity authentication step A5; the shared key is initialized to a 16-byte string; step B2-2: the key expansion algorithm calculates the encryption round key; step B2-3: define a 16-byte out variable as the output of each encryption; segment encryption, 16 bytes per segment; step B2-4: SMR or SAR then copies the encrypted segments into the sending buffer in sequence.
[0087] The specific process of the sub-step B3 is: B3-1: Detect the number of all available connections L in the system; B3-2: Steps B1-4 and B1-5 calculate the number of fixed-size fragments P into which the data packet is divided; B3-3: Use i to traverse from 0 to P-1, and the connection number sent is i%L; B3-4: The data packet is sent out from the corresponding network card.
[0088] The specific process of sub-step B4 is as follows: B4-1: the shared key is calculated in the SAR and SMR authentication step A5; the shared key is initialized to a 16-byte string; B4-2: the key expansion algorithm calculates the decryption round key; B4-3: a 16-byte out variable is defined as the output of each decryption; segmented encryption, 16 bytes per segment; B4-4: SMR or SAR then copies the decrypted segments into the receiving cache in sequence.
[0089] The specific process of the sub-step B5 is as follows: B5-1: monitor whether the network card has data; B5-2: when there is data, copy the data to the circular buffer; B5-3: read the circular buffer, if the synchronization word AFAE is read; B5-4: if the total length of the current received data is 0, then go to step B5-5, otherwise go to step B5-6; B5-5: it is the first time to receive the fragment, store the sequence number of the current data packet, the total number of fragments, the total length of the data, reset the total length of the received data to 0, and the number of received fragments to 0; B5-6: read the current sequence number, the total number of fragments, and the total length of the data; B5-7: if the current sequence number is not equal to the stored sequence number, or the current total number of fragments is not equal to the total number of stored total fragments, or the current total length of the data is not equal to the total length of the stored data, then go to step B5-8, otherwise go to step B5-9; B5-8: if there is a fragment loss, re-store the total number of fragments, the total data length, and the sequence number. Reset the total length of received data to 0, the number of received fragments to 0, and go to step B5-1; B5-9: copy to the receiving area according to the fragment number and the current fragment size; B5-10: add the total length of received data to the length of received data, and increase the number of received fragments by one; B5-11: if it is the last fragment, go to B5-12; otherwise go to B5-13; B5-12: discard the excess data in the receive buffer; B5-13: if the total number of received fragments is equal to the total number of stored fragments, and the total length of received fragments is equal to the total length of stored fragments, then go to step B5-14; otherwise go to step B5-1; B5-14: successfully reassemble one frame of data.
[0090] Example 2
[0091] In this embodiment 2, a specific network topology is taken as an example to introduce the privacy protection method in multi-link mobile Internet communication. Figure 1 As shown, the network topology includes the following main entities: client device, server device, smart mobile router SMR, and smart aggregation router SAR.
[0092] Any number of client devices and server devices communicate with each other through a multi-path transmission architecture consisting of a mobile router SMR and a convergence router SAR as endpoints. A privacy protection method in multi-link mobile Internet communication is deployed on SMR and SAR to implement fragmentation and reassembly, encryption and decryption, and source authentication of data packets.
[0093] The privacy protection method in multi-link mobile Internet communication mainly includes: step A: data packet identity authentication and integrity verification process; step B: data packet fragmentation encryption, decryption and reassembly process.
[0094] The data packet authentication process flow of step A is as follows: Figure 2 As shown, it includes: step A1: the SMR end and the SAR end calculate their own private keys; step A2: the SMR end and the SAR end obtain the identity information of the other end; step A3: the link detection thread of the SMR end detects that the IP address of the network card has changed, if so, it goes to A4, otherwise it goes to A5; step A4: the SMR end needs to recalculate the private key, and re-exchange the SMR end identity information with the SAR end, and then go to A5; step A5: the SMR end and the SAR end use the identity information of the other end and the private keys of their own network cards to calculate the shared key; step A6: the SMR or SAR end uses the shared key to calculate the hash value of the data packet, and adds it to the header of the data packet to perform data packet source authentication and integrity detection.
[0095] The data packet authentication process flow of step B is as follows: Figure 3 As shown, it includes: B1: the uplink data packet from the client network segment will be sent to the virtual network card tun port. If the tun network card is monitored to have a data packet, the data packet will be fragmented; B2: the fragmented data packet is encrypted using the SM4 algorithm; B3: the fragmented data packet is added with a fragment header and then sent in a scheduling manner; B4: the ordinary network card at the receiving end detects the arrival of data and decrypts it using the SM4 algorithm; B5: the fragment header information is read, the fragment header is removed and the data packet is reassembled.
[0096] In this embodiment 2, the specific process of each step is as follows:
[0097] Step A1: The SMR and SAR terminals calculate their own private keys;
[0098] Method 1: Calculate the private key by sharing the master private key, such as Figure 4 As shown, including:
[0099] (1)
[0100] (2)S SAR =sH(IP SAR ||ID SAR )
[0101] A1-1-1: SMR and SAR initialize the master private key s. The original material of the master private key can be a pre-shared key material previously stored in the device, including: A1-1-1-1: read the key stored in the system file; A1-1-1-2: initialize the key to type A pairing.
[0102] A1-1-2: SMR calculates the private key of each network card. The private key of each network card is equal to the dot product of the master private key and the identity information of the network card. H represents mapping a bit string of any length to group G. ID SMR Indicates the device ID of the SMR, NIC num Indicates the serial number of the available network card. Indicates the IP address of the network card, || indicates concatenation, including: A1-1-2-1: SMR starts the network card monitoring thread, and calculates the private key of each network card detected online; A1-1-2-2: Fill the network card information into the database, including the SMR number, the network card IP, the network card name, and the timestamp, and the network card change value is set to 1; A1-1-3: SAR also calculates its own private key S SAR , ID SAR Indicates SAR device identification, IP SAR Indicates the IP address of the SAR network card.
[0103] Method 2: Use the master private key generated by SMR to calculate the private key, such as Figure 5 As shown, including:
[0104] (3)
[0105] (4)
[0106] A1-2-1: SMR and SAR initialize a pair of shared keys K. SMR has its own private key SMRSK, and SAR has SMR's public key SMRPK. SMR randomly generates a master private key s SMR ; A1-2-2: SMR reads the configuration file and calculates the SAR key Hash it to get summary 1, and encrypt it with SMRSK. Encrypt summary 1 and original information with shared key K and send them to SAR; A1-2-3: After receiving, SAR decrypts it with shared key K to get Perform a hash operation on it to get summary 2, and compare it with summary 1 decrypted with SARPK; if they are equal, store A1-2-4: SMR calculates the private key of each network card Including: A1-2-4-1: SMR starts the network card monitoring thread, and each time a new network card is detected online, the private key of the network card is calculated; A1-2-4-2: fill the network card information into the database, including the SMR number, the network card I, the network card name, and the timestamp, and the network card change value is set to 1.
[0107] Step A2: The SMR end and the SAR end obtain the identity information of the other end; including: A2-1: SMR reads the network card information of SAR from the configuration file; A2-2: SAR detects the arrival of data from a new SMR or a new network card, and reads the network card information of SMR from the header information of the data packet; Step A3: The network card monitoring thread of the SMR end detects that the IP address of the network card has changed, and if so, it goes to A4, otherwise it goes to A5; Step A4: The SMR end needs to recalculate the private key, the SAR end needs to reread the identity information of the SMR end, and go to A5; Step A5: The SMR end and the SAR end use the identity information of the other end and the private keys of their own network cards to calculate a shared key; Step A6: The SMR or the SAR end uses the shared key to calculate the hash value of the data packet, and adds it to the header of the data packet to perform data packet source authentication and integrity detection.
[0108] Among them, step A3 includes: A3-1: the network card monitoring thread on the SMR side first detects that a network card is offline, and then re-acquires the IP address, and then determines that the IP address of the network card has changed; A3-2: fill the network card information into the database, including the SMR number, the IP of the network card, the network card name, and the timestamp, and the network card change value is automatically increased by 1; A3-3: if the IP address of the network card has changed, go to A4, otherwise go to A5.
[0109] Step A4 includes: A4-1: Since only the IP address of the SMR end has changed, only the private key of the network card corresponding to the SMR needs to be recalculated, and the private key of the SAR end does not need to be recalculated; A4-2: SAR detects the arrival of a new network card data packet, parses the header information of the data packet to obtain the IP address of the corresponding network card.
[0110] Step A5 includes: A5-2: The shared key of the SAR end is A5-1: The shared key on the SMR side is in,
[0111]
[0112] Step A6 includes: A6-1: SMR uses the shared key to calculate the HMAC of the data packet, adds it to the header of the original data packet and sends it out; A6-2: After receiving the data packet, SAR intercepts the original data packet and calculates its hash value with the shared key, and compares it with the hash value of the data packet header. If they are equal, the data packet source authentication is successful and the data integrity is guaranteed; SAR also does the same;
[0113] B1: The uplink data packets from the client network segment will be sent to the virtual network card tun port. If the tun network card is monitored, the data packets will be fragmented;
[0114] The fragment header is designed as Figure 6 As shown: (1) 16-bit synchronization word AFAE, in order to separate the data packets in the cache; (2) 16-bit total length of the original data packet; (3) 16-bit total number of fragments; (4) 16-bit fragment number, starting from 0; (5) 16-bit current data packet size; (6) 8-byte data packet sequence number.
[0115] Step B1: Data packet fragmentation process flow, such as Figure 7 As shown, it includes: B1-1: monitor whether there is a data packet arriving at the tun port; B1-2: when a data packet arrives, read the total length of the data packet and calculate the length of each fragment. If it is not the last fragment, it is a fixed fragment length; if it is the last fragment, the length of the fragment is the modulo of the total length of the data packet and the fixed fragment length; B1-3: determine whether the data packet length / fixed fragment size is 0; B1-4: if it is, the total number of fragments returned is equal to the data packet length / fixed fragment size; B1-5: if not, the total number of fragments returned is equal to the data packet length / fixed fragment size plus 1; B1-6: use the total number of fragments to assign fragment numbers to the data packet; B1-7: determine whether it is the last fragment; B1-8: if it is the last fragment, copy the offset data in a loop until the length reaches the fixed fragment size, and go to step B2. B1-9: if it is not the last fragment, copy the offset data at a fixed length; B2: encrypt the data packet.
[0116] B2: Encrypt the fragmented data packets using the SM4 algorithm; the encryption process of the data packet is as follows: Figure 8 As shown, it includes: step B2-1: the shared key is calculated in the SAR and SMR identity authentication step A5; the shared key is initialized to a 16-byte string; step B2-2: the key expansion algorithm calculates the encryption round key; step B2-3: define a 16-byte out variable as the output of each encryption; segment encryption, 16 bytes per segment; step B2-4: SMR or SAR then copies the encrypted segments into the sending buffer in sequence.
[0117] Step B3: Add a fragment header to the fragmented data packet and send it in a scheduling manner; the data packet fragment sending process is as follows: Fig. 9 As shown, it includes: B3-1: Detect the number of all available connections L in the system; B3-2: Calculate the number P of fragments of fixed size into which the data packet is divided; B3-3: Use i to traverse from 0 to P-1, and the connection number sent is i%L; B3-4: The data packet is sent out from the corresponding network card.
[0118] B4: The ordinary network card at the receiving end detects the arrival of data and uses the SM4 algorithm to decrypt; the data packet decryption process is as follows: Fig.10 As shown, it includes: B4-1: the shared key is calculated in the A5 stage of the SAR and SMR authentication step, and the shared key is initialized to a 16-byte string; B4-2: the key expansion algorithm calculates the decryption round key; B4-3: defines a 16-byte out variable as the output of each decryption; segmented encryption, 16 bytes per segment; B4-4: SMR or SAR then copies the decrypted segments into the receiving buffer in sequence.
[0119] B5: Read the fragment header information, remove the fragment header and reassemble the data packet; the data packet reassembly process flow is as follows: Fig.11 As shown, it includes: B5-1: monitor whether the network card has data; B5-2: when there is data, copy the data to the circular buffer; B5-3: read the circular buffer, if the synchronization word AFAE is read; B5-4: if the total length of the current received data is 0, go to step B5-5, otherwise go to step B5-6; B5-5: when receiving the fragment for the first time, store the sequence number of the current data packet, the total number of fragments, the total length of the data, reset the total length of the received data to 0, and the number of received fragments to 0; B5-6: read the current sequence number, the total number of fragments, and the total length of the data; B5-7: if the current sequence number is not equal to the stored sequence number, or the current total number of fragments is not equal to the total number of stored fragments, or the current total length of the data is not equal to the total length of the stored data, then go to step B5-8, otherwise go to step B5-9; B5-8: if there is a fragment loss, re-store the total number of fragments, the total data length, and the sequence number. Reset the total length of received data to 0, the number of received fragments to 0, and go to step B5-1; B5-9: copy to the receiving area according to the fragment number and the current fragment size; B5-10: add the total length of received data to the length of received data, and increase the number of received fragments by one; B5-11: if it is the last fragment, go to B5-12; otherwise go to B5-13; B5-12: discard the excess data in the receive buffer; B5-13: if the total number of received fragments is equal to the total number of stored fragments, and the total length of received fragments is equal to the total length of stored fragments, then go to step B5-14; otherwise go to step B5-1; B5-14: successfully reassemble one frame of data.
[0120] Example 4
[0121] This embodiment 4 provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the privacy protection method in multi-link mobile Internet communication as described above is implemented. The method includes:
[0122] The mobile router and the aggregation router calculate their own private keys; the mobile router and the aggregation router respectively obtain the identity information of the other end; the link detection thread of the mobile router detects whether the IP address of the network card has changed. If so, the mobile router re-obtains the private key and the aggregation router re-reads the identity information of the mobile router. Otherwise, the mobile router and the aggregation router calculate the shared key using the identity information of the other end and the private keys of their own network cards; the mobile router or the aggregation router calculates the hash value of the data packet using the shared key and adds it to the header of the data packet to perform data packet source authentication and integrity detection;
[0123] The uplink data packet from the client network segment will be sent to the tun port of the virtual network card. If the tun network card monitors any data packet, the data packet will be fragmented; the fragmented data packet will be encrypted using the SM4 algorithm; the fragmented encrypted data packet will be added with a fragment header and sent in a scheduling manner; the ordinary network card at the receiving end detects the arrival of the data and decrypts it using the SM4 algorithm; the fragment header information is read, and the fragment header is removed to reassemble the data packet.
[0124] Example 5
[0125] This embodiment 5 provides a computer device, including a memory and a processor, the processor and the memory communicate with each other, the memory stores program instructions executable by the processor, the processor calls the program instructions to execute a privacy protection method in multi-link mobile Internet communication, the method comprising:
[0126] The mobile router and the aggregation router calculate their own private keys; the mobile router and the aggregation router respectively obtain the identity information of the other end; the link detection thread of the mobile router detects whether the IP address of the network card has changed. If so, the mobile router re-obtains the private key and the aggregation router re-reads the identity information of the mobile router. Otherwise, the mobile router and the aggregation router calculate the shared key using the identity information of the other end and the private keys of their own network cards; the mobile router or the aggregation router calculates the hash value of the data packet using the shared key and adds it to the header of the data packet to perform data packet source authentication and integrity detection;
[0127] The uplink data packet from the client network segment will be sent to the tun port of the virtual network card. If the tun network card monitors any data packet, the data packet will be fragmented; the fragmented data packet will be encrypted using the SM4 algorithm; the fragmented encrypted data packet will be added with a fragment header and sent in a scheduling manner; the ordinary network card at the receiving end detects the arrival of the data and decrypts it using the SM4 algorithm; the fragment header information is read, and the fragment header is removed to reassemble the data packet.
[0128] Example 6
[0129] This embodiment 6 provides an electronic device, including: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory, so that the electronic device executes instructions for implementing the privacy protection method in multi-link mobile Internet communication as described above, and the method includes:
[0130] The mobile router and the aggregation router calculate their own private keys; the mobile router and the aggregation router respectively obtain the identity information of the other end; the link detection thread of the mobile router detects whether the IP address of the network card has changed. If so, the mobile router re-obtains the private key and the aggregation router re-reads the identity information of the mobile router. Otherwise, the mobile router and the aggregation router calculate the shared key using the identity information of the other end and the private keys of their own network cards; the mobile router or the aggregation router calculates the hash value of the data packet using the shared key and adds it to the header of the data packet to perform data packet source authentication and integrity detection;
[0131] The uplink data packet from the client network segment will be sent to the tun port of the virtual network card. If the tun network card monitors any data packet, the data packet will be fragmented; the fragmented data packet will be encrypted using the SM4 algorithm; the fragmented encrypted data packet will be added with a fragment header and sent in a scheduling manner; the ordinary network card at the receiving end detects the arrival of the data and decrypts it using the SM4 algorithm; the fragment header information is read, and the fragment header is removed to reassemble the data packet.
[0132] In summary, the privacy protection method in multi-link mobile Internet communication described in the embodiment of the present invention can realize source authentication and integrity detection of data packets in a multi-link mobile Internet environment. Even if the second authentication method is adopted, only one data packet interaction is performed, which reduces the authentication delay. The fragment scheduling reorganization can resist eavesdropping attacks to a certain extent. The fixed-length transmission of data packets obscures the important role of data packet length in traffic statistics analysis. At the same time, the fixed-length feature is used to encrypt the data packet to enhance confidentiality.
[0133] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0134] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or 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, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0135] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device, and a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0137] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative work on the basis of the technical solution disclosed in the present invention should be included in the scope of protection of the present invention.
Claims
1. A privacy protection method in multi-link mobile Internet communication, characterized in that: include: The mobile router and aggregation router calculate their own private keys; The mobile router and the aggregation router respectively obtain the identity information of the other party; The link detection thread on the mobile router side detects whether the IP address of the network card has changed. If so, the mobile router side re-acquires the private key, and the aggregation router side re-reads the identity information of the mobile router side. Otherwise, the mobile router side and the aggregation router side use the identity information of the other side and the private keys of their own network cards to calculate the shared key; the mobile router side or the aggregation router side uses the shared key to calculate the hash value of the data packet and adds it to the header of the data packet to perform data packet source authentication and integrity detection; The uplink data packets from the client network segment will be sent to the virtual network card tun port. If the tun network card is monitored, the data packets will be fragmented; The fragmented data packets are encrypted using the SM4 algorithm; the fragmented encrypted data packets are added with a fragment header and sent in a scheduling manner; the ordinary network card at the receiving end detects the arrival of the data and decrypts it using the SM4 algorithm; the fragment header information is read, and the fragment header is removed to reassemble the data packet.
2. The privacy protection method in multi-link mobile Internet communication according to claim 1, characterized in that: The mobile router and aggregation router calculate their own private keys, including: The private key is calculated by sharing the master private key; S SAR =sH(IP SAR ||ID SAR ) The mobile router and the aggregation router initialize the master private key s; including: reading the key stored in the system file; initializing the key to type A pairing; The mobile router calculates the private key of each network card. The private key of each network card is equal to the dot product of the master private key and the identity information of the network card. H represents mapping a bit string of any length to group G; ID SMR Indicates the device ID of the mobile router, NIC num Indicates the serial number of the available network card. Indicates the IP address of the network card; || indicates serial connection; SMR starts the network card monitoring thread, and calculates the private key of the network card every time a new network card is detected online; Fill the network card information into the database, including the SMR number, network card IP, network card name, and timestamp, and set the network card change value to 1; The aggregation router also calculates its own private key S SAR , ID SAR Indicates the device ID of the aggregation router, IP SAR Indicates the IP address of the network card on the aggregation router; Alternatively, the private key is calculated using the master private key generated by the mobile router itself; The mobile router and the aggregation router initialize a pair of shared keys K. The mobile router has its own private key SMRSK, and the aggregation router has the public key SMRPK of the mobile router. The mobile router randomly generates a master private key s SMR ; The mobile router reads the configuration file and calculates the private key of the aggregation router Perform a hash operation on it to obtain summary 1, which is encrypted with SMRSK; encrypt summary 1 and the original information with the shared key k and send them to the aggregation router; After receiving it, the aggregation router uses the shared key K to decrypt it and obtain Perform a hash operation on it to get summary 2, and compare it with summary 1 decrypted with SARPK; if they are equal, store The mobile router calculates the private key of each network card The method includes: starting a network card monitoring thread on the mobile router end, and calculating the private key of the network card each time a new network card is detected online; filling the network card information into a database, including the label of the mobile router end, the IP address of the network card, the network card name, and the timestamp, and setting the network card change value to 1.
3. The privacy protection method in multi-link mobile Internet communication according to claim 1, characterized in that: The link detection thread at the mobile router end detects whether the IP address of the network card has changed, including: the network card monitoring thread at the mobile router end first detects that a network card is offline, and then re-acquires the IP address, and then determines that the IP address of the network card has changed; the network card information is filled into the database, including the label of the mobile router end, the IP of the network card, the network card name, and the timestamp, and the network card change value is automatically increased by 1.
4. The privacy protection method in multi-link mobile Internet communication according to claim 1, characterized in that: The mobile router end and the aggregation router end use the shared key to calculate the hash value of the data packet, and add it to the header of the data packet to perform data packet source authentication and integrity detection, including: the mobile router end uses the shared key to calculate the HMAC of the data packet, adds it to the header of the original data packet and sends it out; after receiving the data packet, the aggregation router end intercepts the original data packet and calculates its hash value with the shared key, and compares it with the hash value of the data packet header. If they are equal, the data packet source authentication is successful and the data integrity is guaranteed.
5. The privacy protection method in multi-link mobile Internet communication according to claim 1, characterized in that: The uplink data packets from the client network segment will be sent to the virtual network card tun port. If the tun network card is monitored, if there is a data packet, the data packet will be fragmented, including: The fragment header is designed as follows: 16-bit synchronization word AFAE, in order to separate the data packets in the cache; 16-bit total length of the original data packet; 16-bit total number of fragments; 16-bit fragment number, starting from 0; 16-bit current data packet size; 8-byte data packet sequence number; Monitor the tun port to see if there is a data packet arriving; when a data packet arrives, read the total length of the data packet and calculate the length of each fragment; if it is not the last fragment, it is a fixed fragment length; if it is the last fragment, the length of the fragment is the modulo of the total length of the data packet and the fixed fragment length; Determine whether the data packet length / fragment fixed size is 0. If so, the total number of fragments returned is equal to the data packet length / fragment fixed size; if not, the total number of fragments returned is equal to the data packet length / fragment fixed size plus 1; Use the total number of fragments to assign fragment numbers to the data packet to determine whether it is the last fragment; if it is the last fragment, copy the offset data in a loop until the length reaches the fixed size of the fragment, and go to step B1-2; if it is not the last fragment, copy the offset data at a fixed length.
6. The privacy protection method in multi-link mobile Internet communication according to claim 5, characterized in that: The fragmented data packets are encrypted using the SM4 algorithm, including: initializing the shared key to a 16-byte string; calculating the encryption round key using the key expansion algorithm; defining a 16-byte out variable as the output of each encryption; encrypting in segments, with 16 bytes as one segment; and the mobile router or aggregation router then copies the encrypted segments into the sending buffer in sequence.
7. The privacy protection method in multi-link mobile Internet communication according to claim 6, characterized in that: The fragmented encrypted data packet is added with a fragment header and sent in a scheduling manner, including: detecting the number of all available connections L in the system; calculating the number of fixed-size fragments P into which the data packet is divided; using i to traverse from 0 to P-1, the connection number sent is i%L; and the data packet is sent from the corresponding network card.
8. The privacy protection method in multi-link mobile internet communication according to claim 7, characterized in that: The ordinary network card at the receiving end detects the arrival of data and uses the SM4 algorithm to decrypt it, including: initializing the shared key to a 16-byte string; calculating the decryption round key using the key expansion algorithm; defining a 16-byte out variable as the output of each decryption; encrypting in segments, with 16 bytes as one segment; and the mobile router or aggregation router then copies the decrypted segments into the receiving cache in sequence.
9. The privacy protection method in multi-link mobile internet communication according to claim 1, characterized in that: Read the fragment header information, remove the fragment header and reassemble the data packet, including: Monitor whether the network card has data; if there is data, copy the data to the circular buffer; read the circular buffer, if the synchronization word AFAE is read; If the total length of the data received is 0, it is the first time to receive the fragment. The sequence number, total number of fragments, and total length of data of the current data packet are stored, and the total length of received data and the number of received fragments are reset to 0. If the total length of the data received is not 0, read the current sequence number, total number of fragments, and total length of data. If the current sequence number is not equal to the stored sequence number, or the current total number of fragments is not equal to the total number of stored fragments, or the current total data length is not equal to the total length of stored data, then fragments are lost and the total number of fragments, total data length, and sequence number are re-stored, the total length of received data is reset to 0, the number of received fragments is reset to 0, and the network card is re-monitored for data; otherwise, it is copied to the receiving area according to the fragment number and the current fragment size.
10. The privacy protection method in multi-link mobile internet communication according to claim 9, characterized in that: If the current sequence number is not equal to the stored sequence number, or the current total number of fragments is not equal to the total number of stored fragments, or the current total length of data is not equal to the total length of stored data, then copy it to the receiving area according to the fragment number and the current fragment size; the total length of the received data is added to the length of the received data, and the number of received fragments is increased by one; If it is the last piece, the excess data in the receive buffer is discarded; If the total number of received fragments is equal to the total number of stored fragments, and the total length of the received fragments is equal to the total length of the stored fragments, then a frame of data is reassembled successfully.
