WO2024174596A1 - 一种数据加密方法和相关装置 - Google Patents

一种数据加密方法和相关装置 Download PDF

Info

Publication number
WO2024174596A1
WO2024174596A1 PCT/CN2023/131400 CN2023131400W WO2024174596A1 WO 2024174596 A1 WO2024174596 A1 WO 2024174596A1 CN 2023131400 W CN2023131400 W CN 2023131400W WO 2024174596 A1 WO2024174596 A1 WO 2024174596A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
address
server
key
traffic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2023/131400
Other languages
English (en)
French (fr)
Inventor
吴波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology (Shenzhen) Co Ltd
Original Assignee
Tencent Technology (Shenzhen) Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology (Shenzhen) Co Ltd filed Critical Tencent Technology (Shenzhen) Co Ltd
Priority to EP23923760.5A priority Critical patent/EP4614878A4/en
Publication of WO2024174596A1 publication Critical patent/WO2024174596A1/zh
Priority to US19/074,710 priority patent/US20250211425A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/56Routing software
    • H04L45/566Routing instructions carried by the data packet, e.g. active networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0407Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the identity of one or more communicating identities is hidden
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present application relates to the field of communications, and in particular to data encryption technology.
  • One mode of network communication is routing forwarding based on the destination address. Its main working principle is: after the intermediate routing node receives a message from the sender or other intermediate routing nodes, it extracts the corresponding forwarding information from the message header, such as the corresponding output port, etc. The intermediate routing node forwards the message through the port to the next-hop routing node (such as an intermediate routing node or the destination) until the destination receives the message.
  • the next-hop routing node such as an intermediate routing node or the destination
  • the security of network communication is an important condition for measuring Internet services, client experience and operators.
  • the security of network communication is mainly reflected in aspects such as communication security and privacy protection.
  • various security detection software and hardware are mainly used to perform security detection on received messages, so as to reduce the risk of data tampering, traffic hijacking and communication being illegally obtained to a certain extent; as shown in Figure 1, when a terminal device requests data from a data storage server, the server can perform security detection on the request message or message confirmation message from the terminal device through a security hardware platform, and filter the detected malicious messages to further improve the security of network communication.
  • the present application provides a data encryption method and related devices, which can reduce the possibility of leaking user privacy through the source address and destination address of the message and meet the current privacy protection needs.
  • an embodiment of the present application provides a data encryption method, which is executed by a terminal device and includes:
  • the source address of the message request message includes the terminal encryption address, which is obtained by encrypting the terminal address of the terminal device using the public key of the server;
  • traffic data in the traffic message is acquired.
  • an embodiment of the present application provides a data encryption method, which is executed by a server and includes:
  • a traffic message returned in response to the message request message is sent to the terminal device.
  • the source address of the traffic message includes the server encryption address, which is obtained by encrypting the server address of the server using the public key of the terminal device.
  • an embodiment of the present application provides a data encryption device, including a sending unit, an acquiring unit, a decryption unit and a receiving unit;
  • a sending unit used to send a message request message to the server, where the source address of the message request message includes a terminal encryption address, where the terminal encryption address is obtained by encrypting the terminal address of the terminal device using the public key of the server;
  • An acquisition unit is used to receive a flow message returned by the server in response to the message request message, wherein the source address of the flow message includes a server encryption address, and the server encryption address is obtained by encrypting the server address of the server using the public key of the terminal device;
  • a decryption unit used to decrypt the server encrypted address using the private key of the terminal device to obtain the server pending address
  • the receiving unit is used to obtain the flow data in the flow message in response to the server pending address being consistent with the server address.
  • an embodiment of the present application provides a data encryption device, including an acquisition unit, a decryption unit, and a sending unit;
  • An acquisition unit is used to receive a message request message sent by a terminal device, wherein the source address of the message request message includes a terminal encryption address, and the terminal encryption address is obtained by encrypting the terminal address of the terminal device using a public key of a server;
  • a decryption unit used to decrypt the terminal encrypted address using the server's private key to obtain the terminal address
  • the sending unit is used to send a traffic message returned in response to a message request message to a terminal device according to the terminal address.
  • the source address of the traffic message includes a server encryption address, which is obtained by encrypting the server address of the server using the public key of the terminal device.
  • an embodiment of the present application provides a data encryption system, which includes a terminal device and a server, wherein the terminal device is used to execute the method described in the above aspects, and the server is used to execute the method described in the above aspects.
  • an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
  • the memory is used to store computer programs and transmit program codes to the processor
  • the processor is configured to execute the method described above according to instructions in the computer program.
  • an embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the method described in the above aspects.
  • an embodiment of the present application provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method described in the above aspects.
  • the source addresses in the message request messages and traffic messages exchanged between them are encrypted by the public key of the receiving end, and the real source address of the message can only be obtained after decryption by the private key of the receiving end.
  • the reason for hiding the source address is that a message in network communication generally carries the source address and the destination address in order to achieve correct forwarding.
  • the attacker intercepts the message the relationship between the source address and the destination address can be obtained. Accordingly, it can be determined when the user of the terminal device What content services have been accessed online, thereby inferring the user's privacy information.
  • the terminal device as the data receiving end can also restore the real source address of the received message through its own private key, ensuring the security of message reception.
  • FIG1 is a schematic diagram of a security enhancement based on security hardware assistance
  • FIG2 is a schematic diagram of a data encryption scenario provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of an attacker obtaining user privacy based on source address and destination address
  • FIG4 is a flow chart of a data encryption method provided by an embodiment of the present application.
  • FIG5 is a schematic diagram of a message request message provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of a flow message provided in an embodiment of the present application.
  • FIG7 is a schematic diagram of a flow confirmation message provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a key creation message provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of an intermediate routing node adding an intermediate shared key to a key creation message provided by an embodiment of the present application
  • FIG10 is a schematic diagram of a key confirmation message provided in an embodiment of the present application.
  • FIG11 is a schematic diagram of a flow message with encrypted source address and destination address provided in an embodiment of the present application.
  • FIG12 is a specific flow chart of a data encryption method provided in an embodiment of the present application.
  • FIG13 is a communication diagram of a data encryption method provided in an embodiment of the present application.
  • FIG14 is a device structure diagram of a data encryption device provided in an embodiment of the present application.
  • FIG15 is a device structure diagram of another data encryption device provided in an embodiment of the present application.
  • FIG16 is a system structure diagram of a data encryption system provided in an embodiment of the present application.
  • FIG17 is a structural diagram of a terminal device provided in an embodiment of the present application.
  • FIG18 is a structural diagram of a server provided in an embodiment of the present application.
  • network communication can be security-checked through various security detection software and hardware.
  • security detection hardware can be used to perform security detection on various messages exchanged between terminal devices and data storage servers, and detect malicious messages to filter, thereby improving the security of network communication to a certain extent.
  • the security of network communication can also be improved from the perspective of communication protocols, mainly by encrypting the data in the message through encryption, thereby reducing the risk of data being illegally obtained, tampered with, and redirected during message forwarding.
  • TCP Transmission Control Protocol
  • SSL Secure Sockets Layer
  • TLS Transport Layer Security
  • UDP User Datagram Protocol
  • QUIC Quick UDP Internet Connection
  • an embodiment of the present application provides a data encryption method and related apparatus to encrypt the source address in the message exchanged between the terminal device and the server, thereby reducing the possibility of attackers obtaining the terminal user's private information through the source address and destination address of the message, and improving the security of network communications in the dimension of the message address.
  • the data encryption method provided in the embodiment of the present application can be implemented by a computer device, which can be a terminal device or a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
  • the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, a smart TV, etc., but is not limited thereto.
  • the terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
  • Cloud storage is a new concept extended and developed from the concept of cloud computing.
  • a distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
  • the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume.
  • the physical storage space may be composed of disks of a storage device or several storage devices.
  • the client stores data on a logical volume, that is, stores the data on the file system.
  • the file system divides the data into many parts, each of which is an object.
  • the object contains not only data but also additional information such as data identification (ID, ID entity).
  • ID data identification
  • the file system writes each object to the physical storage space of the logical volume, and the file system records the storage location information of each object.
  • the file system can allow the client to access the data based on the storage location information of each object.
  • the process of the storage system allocating physical storage space to logical volumes is as follows: according to the capacity estimation of the objects stored in the logical volumes (this estimation often has a large margin relative to the capacity of the actual objects to be stored) and the groups of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes.
  • One logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
  • the server in the embodiment of the present application may be a cloud server that implements cloud storage.
  • FIG 2 is a schematic diagram of a data encryption scenario provided in an embodiment of the present application, wherein the aforementioned computer devices are terminal devices and servers, and the terminal devices and the server can communicate over the network through interactive messages.
  • the server can be a cloud server that can implement cloud storage, or it can be a non-cloud server, such as a traditional physical server, etc.
  • the server can be a content server, which refers to a server that can implement the functions of a content distribution network (CDN, Content Delivery Network).
  • CDN Content Delivery Network
  • a message refers to a request message sent by a terminal device to a server.
  • a message request message may be a request message sent by a terminal device to a server for requesting to obtain target content.
  • the source address of the message request message is not directly disclosed, as shown in FIG2 . Instead, it is encrypted using the public key of the receiving end (server). Only after the server receives the message request message and decrypts it using the server's private key can the real source address of the message request message be obtained.
  • the terminal device obtains traffic messages from the server.
  • Traffic messages refer to messages sent by the server to the terminal device in response to the message request message.
  • the traffic message may be a message sent by the server for the terminal device to obtain the target content.
  • the source address of the traffic message is not directly disclosed. As shown in FIG2 , it is encrypted using the public key of the receiving end (terminal device). Only after the terminal device obtains the traffic message and decrypts it using the private key of the terminal device can the real source address of the traffic message be obtained.
  • the reason for hiding the source address in the message request message and the traffic message is that in order to realize the correct forwarding of the message in the network communication, the message generally carries the source address and the destination address.
  • the attacker intercepts the message the relationship between the source address and the destination address of the message can be obtained.
  • the private information such as when the user of the terminal device went online and what content services were obtained can be inferred.
  • the attacker between the terminal device and the server can obtain "a certain user is online" according to the source address and the destination address of the message request message and the traffic message.
  • the attacker can determine the content service the user is obtaining based on whether the message request message or traffic message contains an address in the address set.
  • the content Internet Protocol (IP) addresses used by a cloud service provider to provide services for a short video platform are: IP1, IP2, IP3, ..., IP100. If the source address or destination address in the message intercepted by the attacker contains the above IP addresses, the attacker can infer the user status of "the user is watching a short video.”
  • the terminal device which is the receiving end of the traffic message, can restore the real source address of the received traffic message through its own private key, reducing the risk of the terminal device receiving messages at will and ensuring the security of message reception.
  • FIG4 is a method flow chart of a data encryption method provided in an embodiment of the present application.
  • a computer device is used as a terminal and a server for illustration. The method includes:
  • the terminal device sends a message request message to the server.
  • the source address of the message request message includes a terminal encryption address.
  • the terminal encryption address is obtained by encrypting the terminal address of the terminal device using the public key of the server.
  • the terminal device can communicate with the server through network interaction messages.
  • a server can send messages to multiple terminal devices, and a terminal can also send request messages to multiple servers.
  • This embodiment takes the network communication between a terminal device and a server as an example for explanation.
  • the purpose of network communication between terminal devices and servers can be to allow terminal devices to obtain target content from the server.
  • the terminal device When the terminal device obtains target content from the server through interactive messages, the terminal device is the data request end and the server is the data send end.
  • the target content is the data content required by the terminal device.
  • the target content can be various forms of data content, such as text, pictures, videos, live streams, etc. Since different servers can provide different data content, the terminal Before sending a message request message, the device may first determine a corresponding server according to the target content, and then send the corresponding message request message to the determined server.
  • a message request message refers to a request message sent by a terminal device to a server.
  • the source address in the message request message is encrypted in this embodiment, that is, the source address in the message message is hidden, so that even if the attacker intercepts the message, he can only know the destination address of the message, but cannot determine the source address of the message. That is, after intercepting the message, the attacker only knows that a device has sent a message to the server, but does not know which device sent it, and it is difficult to infer the user's privacy information.
  • the source address in the message request message can be hidden, reducing the possibility of the attacker inferring the user's privacy information through the source address and destination address of the message request message.
  • terminal address of the terminal device can be encrypted by the public key of the server to obtain the corresponding terminal encrypted address.
  • IP_sec represents the terminal encryption address
  • Key_pub_server represents the public key of the server
  • IP_i represents the terminal address of the terminal device
  • Enc ⁇ , ⁇ represents the encryption operation of data ⁇ using key ⁇ .
  • the real terminal address can be encrypted by the public key of the server to obtain the corresponding terminal encrypted address, as shown in Figure 5.
  • the terminal encrypted address can be carried in the message request message (Pkt_req), for example, it can be carried in the payload of the message request message, so that the server can determine the terminal address corresponding to the terminal device through the terminal encrypted address after obtaining the message request message, that is, the receiving end of the message request message can accurately determine the sending end of the message request message, so that in the subsequent steps, the receiving end can accurately generate a traffic message with the destination address as the sending end, thereby ensuring the security and accuracy of message transmission.
  • Pkt_req message request message
  • the destination address of the message request message in this embodiment is not encrypted, that is, the message request message includes the server address of the server in plain text, so that the message request message can be accurately forwarded to the server based on the server address in network communication.
  • the source address of the message request message also includes a terminal hidden address, which is different from the terminal address.
  • the terminal hidden address refers to the virtual source address of the plain text in the message request message.
  • the terminal hidden address is obviously different from the real terminal address of the terminal device that sends the message request message.
  • the message request message includes not only the terminal encryption address IP_sec, but also the terminal hidden address IP_j.
  • the header of the message request message can carry the terminal hidden address, where IP_i and IP_j are not the same.
  • Adding a hidden terminal address to a message request message can cause an attacker to be confused by the hidden terminal address in the message request message after intercepting the message request message, thereby tricking the attacker into making the wrong judgment that the source address of the message request message is the hidden terminal address, thereby further reducing the possibility that the attacker can obtain the real source address and destination address through the message request message and infer the user's privacy information based on this.
  • the message format of the message request message will be The format of the message request message changes, and by adding the terminal hidden address to the source address of the message request message, the format of the message request message with the encrypted source address can be kept the same as that of the message with the unencrypted source address, so that in the network communication between the terminal device and the server, the forwarding device can successfully understand the meaning of the message request message according to the format of the message request message, thereby ensuring the successful forwarding of the message request message.
  • S402 The server decrypts the terminal encrypted address using the server's private key to obtain the terminal address.
  • the server After the server receives the message request message sent by the terminal device, it needs to determine the source address of the message request message in order to make an accurate response to the message request message. Since the source address in the message request message is hidden, the server cannot directly obtain the source address of the message request message. It is necessary to decrypt the terminal encrypted address in the message request message to obtain the corresponding terminal address.
  • the terminal encryption address is obtained by encrypting the terminal address of the terminal device by the public key of the server, wherein the public key of the server refers to the public key corresponding to the server, and other devices can use the public key of the server to encrypt data, and the private key of the server is the private key of the server, and only the server has this key, that is, only the server can decrypt the data encrypted by the public key of the server through the private key of the server, so the server can decrypt the terminal encryption address through the private key of the server to obtain the terminal address.
  • IP_i represents the terminal address of the terminal device
  • Key_pri_server represents the private key of the server
  • IP_sec represents the terminal encryption address
  • Dec ⁇ , ⁇ represents the decryption operation of data ⁇ using key ⁇ .
  • the terminal encrypted address can be decrypted by the server's private key to obtain the terminal address, which is the real source address of the message request message. That is to say, after the server obtains the message request message, it determines the real source address of the message request message by decrypting the terminal encrypted address therein, laying the foundation for the server to accurately send traffic messages to the terminal address in the subsequent steps.
  • the terminal device receives a traffic message returned by the server in response to the message request message.
  • the source address of the traffic message includes an encrypted address of the server.
  • the encrypted address of the server is obtained by encrypting the server address of the server using the public key of the terminal device.
  • a traffic message refers to a message sent by a server to a terminal device in response to a request in a message request message.
  • the traffic message may be a message sent by the server for the terminal device to obtain the target content. If the target content is text required by the terminal device, the traffic message will include the data corresponding to the text. When the target content is text and pictures required by the terminal device, the traffic message will include the data corresponding to the text and pictures.
  • the source address in the traffic message is also encrypted in this example, so that even if the attacker intercepts the message, he can only know the destination address of the message but cannot determine the source address of the message. That is, after intercepting the message, the attacker only knows that a device has sent a message to the terminal device, but does not know which device sent it. Accordingly, it is difficult to infer the user's private information.
  • the source address in the traffic message is concealed, which reduces the possibility of the attacker inferring the user's private information through the source address and destination address of the message request message.
  • server address can be encrypted using the public key of the terminal device to obtain the corresponding
  • IP_sec_server represents the server encryption address
  • Key_pub_client represents the public key of the terminal device
  • IP_m represents the server address
  • Enc ⁇ , ⁇ represents the encryption operation of data ⁇ using key ⁇ .
  • the real server address can be encrypted by the public key of the terminal device to obtain the corresponding server encrypted address.
  • the server encrypted address can be carried in the traffic message (Pkt_traffic), so that after the terminal device obtains the traffic message, when the source address of the traffic message is concealed, the source address of the traffic message can still be determined through subsequent steps, laying the foundation for ensuring the security of message transmission.
  • the destination address of the traffic message in this embodiment is not encrypted, that is, the traffic message includes the terminal address of the terminal device in plain text, so that the traffic message can be accurately forwarded to the terminal device that sends the message request message based on the terminal address in network communication.
  • the source address of the traffic message also includes a hidden server address, and the hidden server address is different from the server address.
  • the server hidden address refers to the virtual source address of the plain text in the traffic message.
  • the server hidden address is different from the real server address of the server sending the traffic message.
  • the traffic message includes not only the server encryption address IP_sec_server, but also the terminal hidden address IP_n, where IP_n is not the same as IP_m.
  • Adding the hidden server address to the traffic message can, on the one hand, allow attackers to be confused by the hidden server address in the traffic message after intercepting the traffic message, further reducing the possibility of attackers obtaining the real source address and destination address of the traffic message and inferring the user's privacy information based on this; on the other hand, it can ensure the message format of the traffic message, thereby ensuring the successful forwarding of the traffic message.
  • S404 The terminal device decrypts the server encrypted address using the private key of the terminal device to obtain the server pending address.
  • the terminal device In order to ensure the security of message transmission, the terminal device needs to determine the source of the obtained message to reduce the possibility of the terminal device being attacked by malicious messages. Therefore, after the terminal device obtains the traffic message from the server, it needs to determine the source address of the traffic message in order to determine the source of the traffic message. Since the source address of the traffic message is hidden, the terminal device cannot directly obtain the source address of the traffic message, and it is necessary to decrypt the server encrypted address in the traffic message to obtain the corresponding server pending address.
  • the server encrypted address is obtained by encrypting the public key of the terminal device, so the terminal device can decrypt the server encrypted address by the private key of the terminal device to obtain the server pending address.
  • IP_m 1 represents the server pending address
  • Key_pri_client represents the private key of the terminal device
  • IP_sec_server represents the server encryption address
  • Dec ⁇ , ⁇ represents the decryption operation of data ⁇ using key ⁇ .
  • the server encrypted address can be decrypted by the private key of the terminal device to obtain the server pending address, which is the real source address of the traffic message. That is to say, after the terminal device obtains the traffic message with the source address hidden, it can determine the source address of the traffic message by decrypting the server encrypted address in the traffic message. The real source address of the packet.
  • the encrypted server address included in the traffic message may also be tampered with accordingly.
  • the server address obtained by the terminal device after decrypting the encrypted server address may not be the real server address, that is, it is not the real address of the server itself encrypted; of course, when the traffic message is transmitted normally, the server address obtained by the terminal device after decrypting the encrypted server address in the traffic message is the real server address. Since the authenticity of the server address obtained by the terminal device after decrypting the encrypted server address cannot be confirmed for the time being, it is first referred to as the server pending address.
  • the terminal device After the terminal device obtains the traffic message, it determines through S404 that the real source address of the traffic message is the server pending address, and at the same time, the destination address of the message request message sent by the terminal device is the server address of the server.
  • the server address is consistent with the server pending address, it means that the destination address of the message request message sent by the terminal device is consistent with the real source address of the traffic message obtained by the terminal device, indicating that the traffic message is the message required by the terminal device to be returned for the message request message, and is not a malicious message or irrelevant message sent by other servers.
  • the terminal device can receive the traffic data in the traffic message, so that the terminal device can obtain the data content in the traffic message.
  • the data receiver may not be able to fully obtain the message content sent by the data sender, during the interaction between the terminal device and the server, it is necessary to determine whether the terminal device has successfully obtained the message content sent by the server.
  • the terminal device may also determine a message reception result for the traffic message; and send a traffic confirmation message including the message reception result to the server, wherein the source address of the traffic confirmation message includes the terminal encryption address.
  • the message reception result is used to indicate the reception status of the terminal device for the traffic message after the terminal device receives the traffic data of the traffic message, that is, the message reception result is used to reflect whether the terminal device actually successfully receives the traffic message.
  • the server in the actual network communication process between the terminal device and the server, for the message request message sent by the terminal device, the server often needs to send multiple traffic messages to respond to the request in the message request message.
  • the message request message is to request the server to obtain video content
  • the server usually needs to send multiple traffic messages to achieve the complete transmission of the video content.
  • the message reception result can be the reception status of the terminal device for the multiple traffic messages obtained by analyzing after the terminal device receives the multiple traffic messages.
  • the message reception result of the terminal device for the multiple traffic messages can be reflected according to the message number range actually received (or not received) by the terminal device.
  • the terminal device can periodically determine the message reception result, generate a corresponding traffic confirmation message after determining the message reception result each time, and report it to the server.
  • the terminal device can send a traffic confirmation message including the message reception result to the server.
  • the traffic confirmation message is used to indicate that the terminal device feeds back the message reception status to the server after receiving the traffic data of the traffic message.
  • the source address in the traffic confirmation message is also hidden, that is, the source address in the traffic confirmation message is not the terminal address, but the terminal encrypted address, thereby reducing the attacker's source address through the traffic confirmation message. address and destination address, and the possibility of inferring the user's privacy information based on this.
  • the source address of the flow confirmation message may also include a terminal concealed address.
  • the traffic confirmation message (Pkt_ack) sent by the terminal device to the server may include the terminal hidden address IP_j, the terminal encrypted address IP_sec and the currently received message number range Pkt_num_range, wherein the terminal hidden address is used to confuse attackers and maintain the message format of the traffic confirmation message, the terminal encrypted address is used to provide the server with the encrypted real source address that only the server can decrypt, and the currently received message number range is used to indicate the message reception result of the terminal device.
  • the destination address of the flow confirmation message in this embodiment is not encrypted, that is, the flow confirmation message includes the server address of the server in plain text.
  • the terminal device can send a flow confirmation message including the message reception result to the server so that the server can determine the terminal device's reception status of the flow message, thereby verifying whether the flow message is successfully transmitted and ensuring the integrity of data transmission.
  • the server receives a flow confirmation message including a message reception result sent by the terminal device, the source address of the flow confirmation message includes a terminal encryption address, and the message reception result is used to identify a reception status of the flow message by the terminal device;
  • the server determines, based on the message reception result, that the terminal device has not received the target traffic message, the server sends the target traffic message as a traffic retransmission message to the terminal device, and the source address of the traffic retransmission message includes the server encryption address.
  • the server can receive the traffic confirmation message sent by the terminal device.
  • the traffic confirmation message includes a message reception result.
  • the server can determine the terminal device's reception status of the target traffic message based on the message reception result.
  • the server determines that the terminal device has received the target traffic message based on the message reception result, the server can determine that the target traffic message has been successfully transmitted and there is no need to retransmit the target traffic message.
  • the server can send the target traffic message as a traffic retransmission message to the terminal device.
  • the traffic retransmission message refers to the traffic message that the terminal device has not received as identified by the message reception result.
  • the traffic retransmission message is used to retransmit the traffic message that the terminal device has not received.
  • the server can retransmit the above-mentioned unreceived traffic message as a traffic retransmission message so that the terminal device can obtain the unreceived traffic message.
  • the terminal device can obtain the unreceived target traffic message to ensure the reliability of message transmission between the terminal device and the server.
  • the source address in the traffic retransmission message is also hidden, that is, the source address in the traffic retransmission message is not the server address, but the server encrypted address, thereby reducing the possibility of attackers inferring the user's privacy information through the source address and destination address of the traffic retransmission message.
  • the source address of the traffic retransmission message may also include a server concealed address.
  • the traffic retransmission message in this embodiment includes the server address of the server in plain text.
  • the server After receiving the traffic confirmation message sent by the terminal device, the server can determine the terminal device's reception status of the traffic message based on the traffic confirmation message.
  • the terminal device does not receive the target traffic message, that is, when the terminal device does not completely receive the traffic message returned by the server, a message reception result is generated indicating that the terminal device has not successfully received the target traffic message returned in response to the message request message, and the message is added to the traffic confirmation message.
  • the server can send a traffic retransmission message to the terminal device in response to the traffic confirmation message to achieve packet retransmission and reduce the possibility of packet loss due to the message received by the terminal device.
  • a terminal device receives a traffic retransmission message returned by a server in response to a traffic confirmation message.
  • the traffic retransmission message is a traffic message not received by the terminal device as identified by a message reception result.
  • the source address of the traffic retransmission message includes an encrypted address of the server.
  • the terminal device may obtain, from the server, a traffic retransmission message returned in response to the traffic confirmation message.
  • the traffic retransmission message refers to a message that the terminal device has not received and needs to retransmit.
  • the terminal device may receive the unreceived traffic messages by obtaining the traffic retransmission message.
  • the source address in the traffic retransmission message is also concealed.
  • the source address of the traffic retransmission message may also include a server concealed address.
  • the terminal device obtains the traffic retransmission message returned in response to the traffic confirmation message to achieve re-reception of the unreceived traffic message, thereby ensuring the reliability of message transmission between the terminal device and the server.
  • the terminal device communicates with the server network through interactive messages
  • the source addresses in the message request messages and traffic messages exchanged between them are encrypted by the public key of the receiving end, and the real source address of the message can only be obtained after decryption by the private key of the receiving end.
  • the reason for hiding the source address is that since the message generally carries the source address and the destination address in the network communication in order to achieve correct forwarding, once the message is intercepted by the attacker, the attacker will obtain the relationship between the source address and the destination address, and then determine when the user of the terminal device goes online and what content services are obtained, thereby inferring the user's privacy information.
  • the terminal device as the data receiving end can also restore the real source address of the received message through its own private key, ensuring the security of message reception.
  • the source address of the message between the terminal device and the server is encrypted, thereby reducing the possibility of leaking user privacy through the source address and destination address of the message.
  • network communication in the related art is mainly forwarded based on the destination address, if the destination address of the message is modified without authorization, the message will not be forwarded correctly, which will cause the user experience quality (QoE, Quality of Experience) and service quality (QoS, Quality of Services) to decline. Therefore, there will still be a plaintext destination address in the message, so that the message can be accurately forwarded based on the destination address, ensuring the reliable implementation of message interaction between the terminal device and the server.
  • QoE Quality of Experience
  • QoS Quality of Services
  • the source address of the message between the terminal device and the server is encrypted, it can reduce the possibility of leaking user privacy through the source address and destination address of the message to a certain extent, but because the destination address in the message is not encrypted, it is still There is a risk of user privacy leakage, so the destination address of the largest number of traffic packets in the network communication process between the terminal device and the server can also be encrypted, so that when an attacker obtains the traffic packet, he cannot obtain the sender of the traffic packet, nor the receiver of the traffic packet, thereby further reducing the possibility of an attacker inferring the user's privacy information through the real source address and destination address.
  • the terminal device receives a traffic message returned for the message request message, and accordingly, the server may send the traffic message returned for the message request message to the terminal device according to the terminal address, and in terms of the server sending the traffic message returned for the message request message to the terminal device according to the terminal address, the data encryption method specifically includes:
  • the server determines a traffic link from the server to the terminal device according to the terminal address, where the traffic link includes N intermediate routing nodes, where N is an integer greater than or equal to 1.
  • the server sends a traffic message returned in response to the message request message to the terminal device through N intermediate routing nodes in the traffic link.
  • a traffic link refers to a link between a server and a terminal device for transmitting traffic messages.
  • the server can determine the traffic link from the server to the terminal device for transmitting traffic messages based on the terminal address, where the traffic link includes N intermediate routing nodes.
  • the intermediate routing node refers to the routing node included in the traffic link for forwarding traffic packets.
  • the intermediate routing node is used to forward the traffic packets until the previous hop routing node of the terminal device successfully forwards the traffic packet to the terminal device.
  • the server can first determine the traffic link from the server to the terminal device based on the terminal address, and then accurately forward the traffic messages from the server to the terminal device through the N intermediate routing nodes in the traffic link.
  • the server can first send a key creation message to the terminal device based on the traffic link to obtain relevant information of the intermediate routing node of the traffic link, that is, in a possible implementation manner, the data encryption method also includes:
  • the server generates a flow identifier and a shared key for the traffic link according to the terminal address and the server address;
  • the server encrypts the shared key using the public key of the terminal device to obtain key-encrypted data
  • the server sends a key creation message including key encryption data and a flow identifier to the terminal device through the traffic link.
  • the source address of the key creation message includes the server encryption address.
  • the key creation message is used to instruct N intermediate routing nodes to generate an intermediate shared key according to the flow identifier, encrypt the intermediate shared key by the public key of the terminal device, and add the encryption result to the key encryption data.
  • FlowID represents the flow identifier
  • IP_m represents the server address of the server
  • IP_i represents the terminal address of the terminal device
  • Port_server represents the server port of the server
  • Port_client represents the terminal port of the terminal device.
  • Protocol represents the communication protocol between the server and the terminal device
  • Hash() represents the hash operation
  • represents the concatenation operation.
  • the flow identifier corresponding to the flow link for transmitting flow messages between the server and the terminal device can be determined.
  • the shared key for the traffic link refers to the key information that the server calculates based on the flow identifier and shares with the terminal device.
  • the shared key will be sent to the terminal device by the server after encryption, and will be used to encrypt the data sent by the terminal device to the server in subsequent steps.
  • the shared key is generated by the server, it is not private to the server, but is key information that can be shared with the terminal device.
  • Key_share represents the shared key
  • info_server represents the server's own private information
  • FlowID represents the flow identifier
  • Hash() represents the hash operation
  • represents the splicing operation.
  • the server can calculate the shared key shared with the terminal device based on its own private information and flow identifier.
  • the shared key can be encrypted according to the public key of the terminal device to obtain the corresponding key-encrypted data.
  • Enc_share represents key encrypted data
  • Key_pub_client represents the public key of the terminal device
  • Key_share represents the shared key
  • Enc ⁇ , ⁇ represents the encryption operation of data ⁇ using key ⁇ .
  • the server can encrypt the shared key through the public key of the terminal device to obtain key-encrypted data that can only be decrypted by the terminal device.
  • the server can send the flow identifier and key encryption data to the terminal device through a key creation message, wherein, in order to prevent the key creation message from being intercepted by an attacker during forwarding and then obtaining the relationship between the source address and the destination address in the message, the source address in the key creation message is also concealed, that is, the source address in the key creation message is not the server address, but the server encryption address, thereby reducing the possibility of an attacker inferring the user's privacy information through the source address and destination address of the key creation message.
  • the source address of the key creation message can also include a server concealed address, as shown in FIG8 , the key creation message (Pkt_key) includes a server concealed address IP_n, a flow identifier FlowID, a server encryption address IP_sec_server, and key encryption data Enc_share.
  • the destination address of the key creation message is not encrypted, that is, the key creation message includes the terminal address of the terminal device in plain text, so that the key creation message can be accurately forwarded to the terminal device based on the terminal address in network communication.
  • the key creation message can be forwarded by the server to the terminal device through the intermediate routing node in the traffic link.
  • the intermediate shared key refers to the key information calculated by the intermediate routing node according to the flow identifier and shared with the terminal device and the server.
  • the intermediate shared key will be added to the key encryption data in the key creation message after encryption so as to be sent to the terminal device.
  • the terminal device can send it to the server so that the server can encrypt the destination address of the traffic message according to the intermediate shared key.
  • the intermediate shared key is generated by the intermediate routing node, it is not private to the intermediate routing node, but is key information that can be shared with the terminal device and the server.
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • info_i represents the private information of the i-th intermediate routing node
  • FlowID represents the flow identifier
  • Hash() represents the hash operation
  • represents the splicing operation.
  • each intermediate routing node in the traffic link can calculate the intermediate shared key shared with the terminal device and the server based on its own private information and flow identifier.
  • the intermediate routing node After the intermediate routing node generates an intermediate shared key shared with the terminal device and the server according to the flow identifier, in order to allow only the terminal device to obtain the intermediate shared key according to the key confirmation message, the intermediate shared key can be encrypted according to the public key of the terminal device to obtain the corresponding encryption result.
  • Enc_share_i represents the encryption result corresponding to the intermediate shared key of the i-th intermediate routing node
  • Key_pub_client represents the public key of the terminal device
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • IP_router_i represents the IP address of the i-th intermediate routing node
  • Enc ⁇ , ⁇ represents the encryption operation of data ⁇ using key ⁇
  • represents the splicing operation.
  • each intermediate routing node in the traffic link after each intermediate routing node in the traffic link generates an intermediate shared key, it can obtain the corresponding encryption result through the public key of the terminal device to the intermediate shared key.
  • the intermediate shared key of each intermediate routing node in the encryption result corresponds to its IP address one by one.
  • the server after the server generates the flow identifier and shared key for the traffic link, it can send a key creation message including key encryption data (including the encrypted shared key) and the flow identifier to the terminal device through the traffic link.
  • the key creation message can instruct the intermediate routing node to generate an intermediate shared key based on the flow identifier, and add the encrypted intermediate shared key to the key encryption data, so that in the subsequent steps, after the terminal device obtains the key creation message, it can obtain the intermediate shared key corresponding to each intermediate routing node in the traffic link through the key encryption data in the key creation message, which lays the foundation for the subsequent step in which the server encrypts the destination address in the traffic message according to the intermediate shared key, thereby improving the reliability and security of message transmission.
  • the data encryption method further includes:
  • the terminal device receives a key creation message returned by the server in response to the message request message through a traffic link with the server, where the source address of the key creation message includes the server encryption address, and the key creation message includes key encryption data obtained by encrypting the public key of the terminal device;
  • the terminal device decrypts the key-encrypted data using the private key of the terminal device to obtain a shared key between the terminal device and the server, and N intermediate shared keys, where the N intermediate shared keys correspond one-to-one to N intermediate routing nodes in the traffic link, and N is an integer greater than or equal to 1.
  • the terminal device encrypts N intermediate shared keys using the shared key to obtain intermediate key encrypted data
  • the terminal device sends a key confirmation message including the intermediate key encrypted data to the server, and the source address of the key confirmation message includes the terminal encryption address.
  • the terminal device can receive the key creation message sent by the server through the traffic link. After obtaining the key creation message, it is necessary to determine the source address of the key creation message in order to make an accurate response to the key creation message. Since the source address in the key creation message is hidden, the server address of the server can be obtained by decrypting the server encrypted address in the key creation message.
  • the key creation message includes key encryption data, which includes not only the encrypted shared key shared by the server and the terminal device, but also the encrypted intermediate shared key shared by each intermediate routing node in the traffic link and the terminal device and the server.
  • the key-encrypted data is encrypted by the public key of the terminal device
  • the key-encrypted data can be decrypted by the private key of the terminal device to obtain the shared key shared between the terminal device and the server, and the intermediate shared key corresponding to each intermediate routing node in the traffic link.
  • Key_share represents the shared key
  • Key_pri_client represents the private key of the terminal device
  • Enc_share represents the key encrypted data corresponding to the shared key
  • Dec ⁇ , ⁇ represents the decryption operation of data ⁇ using key ⁇ .
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • IP_router_i represents the IP address of the i-th intermediate routing node
  • Key_pri_client represents the private key of the terminal device
  • Enc_share_i represents the encryption result corresponding to the intermediate shared key of the i-th intermediate routing node
  • Dec ⁇ , ⁇ represents the decryption operation of data ⁇ using key ⁇ .
  • the terminal device After the terminal device obtains the intermediate shared key corresponding to each intermediate routing node in the traffic link, it needs to send the intermediate shared key to the server.
  • the N intermediate shared keys can be encrypted by the shared key between the terminal device and the server to obtain the intermediate key encrypted data.
  • Enc_share_server_i represents the intermediate key encrypted data of the i-th intermediate routing node
  • Key_share represents the shared key
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • IP_router_i represents the The IP addresses of i intermediate routing nodes
  • Enc ⁇ , ⁇ indicates the encryption operation of data ⁇ using key ⁇
  • indicates the concatenation operation.
  • the intermediate shared key can be encrypted by the shared key to obtain the corresponding intermediate key encrypted data, in which the intermediate shared key of each intermediate routing node in the intermediate key encrypted data corresponds one-to-one to its IP address.
  • the terminal device can send a key confirmation message including intermediate key encrypted data to the server, allowing the server to obtain the intermediate shared key corresponding to each intermediate routing node in the traffic link by obtaining the key confirmation message, laying the foundation for encrypting the destination address of the traffic message according to the intermediate shared key in the subsequent steps.
  • the source address in the key confirmation message is also concealed, that is, the source address in the key confirmation message is not the terminal address, but the terminal encryption address, thereby reducing the possibility of an attacker inferring the user's privacy information through the source address and destination address of the key confirmation message.
  • the source address of the key confirmation message can also include the terminal concealed address, as shown in Figure 10, the key confirmation message (Pkt_key_ack) includes the terminal concealed address IP_j, the terminal encryption address IP_sec and the intermediate key encrypted data Enc_share_server_i.
  • the destination address of the key confirmation message is not encrypted, that is, the key confirmation message includes the server address of the server in plain text, so that the key confirmation message can be accurately forwarded to the server based on the server address in network communication.
  • the key confirmation message does not need to be forwarded from the terminal device to the server based on the above-mentioned traffic link. That is, the key confirmation message only needs to be successfully forwarded from the terminal device to the server based on the server address, and does not necessarily need to be forwarded according to the intermediate routing nodes in the traffic link.
  • the terminal device can determine the intermediate shared key corresponding to each intermediate routing node in the traffic link used to transmit the traffic message through the key encryption data in the key creation message, and send a key confirmation message including the intermediate key encryption data (the intermediate shared key encrypted according to the shared key) to the server, so that the server can obtain the intermediate shared key corresponding to the intermediate routing node, laying the foundation for the server to encrypt the destination address of the traffic message according to the intermediate shared key in the subsequent steps, thereby improving the reliability and security of message transmission.
  • the data encryption method further includes:
  • the server receives a key confirmation message returned by the terminal device in response to the key creation message.
  • the source address of the key confirmation message includes the terminal encryption address.
  • the key confirmation message includes intermediate key encrypted data.
  • the intermediate key encrypted data is obtained by encrypting N intermediate shared keys with a shared key.
  • the N intermediate shared keys correspond to N intermediate routing nodes one by one.
  • the server decrypts the intermediate key encrypted data using the shared key to obtain N intermediate shared keys;
  • the server obtains the encrypted routing information corresponding to each of the N intermediate routing nodes according to the N intermediate shared keys and the routing addresses of the N intermediate routing nodes.
  • the corresponding encrypted routing information is obtained by encrypting the routing information of the i-th intermediate routing node and the routing information of the next hop node of the i-th intermediate routing node using the intermediate shared key corresponding to the i-th intermediate routing node.
  • the server adds the encrypted routing information to the traffic message, and the destination address of the traffic message is through the target
  • the intermediate shared key is obtained by encrypting the terminal address, and the target intermediate shared key is the intermediate shared key of the previous hop intermediate routing node of the terminal device in the traffic link.
  • the server can receive the key confirmation message returned by the terminal device. After receiving the key confirmation message, the server needs to determine the source address of the key confirmation message so as to be able to determine that the terminal device has successfully obtained the key creation message and returned the corresponding key confirmation message. Since the source address in the key confirmation message is hidden, the terminal encrypted address in the key confirmation message can be decrypted to determine that the real source address of the key confirmation message is the terminal address of the terminal device.
  • the intermediate key encrypted data is obtained by the terminal device encrypting the intermediate shared key corresponding to each intermediate routing node in the traffic link through the shared key
  • the shared key is the key information shared between the terminal device and the server, so the server can decrypt the intermediate key encrypted data according to the shared key to obtain the intermediate shared key corresponding to each intermediate routing node in the traffic link.
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • IP_router_i represents the IP address of the i-th intermediate routing node
  • Key_share represents the shared key
  • Enc_share_server_i represents the intermediate key encrypted data of the i-th intermediate routing node
  • Dec ⁇ , ⁇ represents the decryption operation of data ⁇ using key ⁇ .
  • the server can decrypt the intermediate key encrypted data according to the shared key to obtain the intermediate shared key corresponding to each intermediate routing node in the traffic link.
  • the intermediate shared key can be saved so that when a traffic message based on the traffic link is subsequently generated, the saved intermediate shared key can be directly obtained to encrypt each intermediate routing node in the traffic link.
  • the server can determine the encrypted routing information used to indicate the next hop node for each intermediate routing node based on the routing information of each intermediate routing node in the traffic link, the routing information of the next hop node and the corresponding intermediate shared key, thereby encrypting each intermediate routing node in the traffic link, wherein the terminal address is the routing information of the next hop node of the previous hop intermediate routing node of the terminal device in the traffic link, and is also encrypted by the corresponding target intermediate shared key, and the target intermediate shared key refers to the intermediate shared key corresponding to the previous hop intermediate routing node of the terminal device.
  • the encrypted routing information of the intermediate routing node refers to the information data encrypted by the corresponding intermediate shared key and used to indicate its next hop node.
  • Enc_routing_i represents the encrypted routing information of the i-th intermediate routing node
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • IP_router_i represents the IP address of the i-th intermediate routing node
  • IP_router_i+1 represents the IP address of the next hop node of the i-th intermediate routing node
  • Enc ⁇ , ⁇ represents the encryption operation of data ⁇ using key ⁇
  • represents the splicing operation.
  • the routing information of the next hop node of the ith intermediate routing node can be encrypted by the intermediate shared key corresponding to the ith intermediate routing node to obtain the corresponding encrypted routing information.
  • the intermediate routing node in the traffic link can only obtain the routing information of the next hop node, reducing the number of attackers who can hijack the traffic. The risk of using intermediate routing nodes to obtain the destination address of traffic packets.
  • each intermediate routing node in the traffic link can decrypt the encrypted routing information according to the intermediate shared key corresponding to the intermediate routing node after receiving the traffic message, and obtain the routing information of the intermediate routing node and the routing information of the corresponding next-hop node.
  • IP_router_i represents the IP address of the i-th intermediate routing node
  • IP_router_i+1 represents the IP address of the next hop node of the i-th intermediate routing node
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • Enc_routing_i represents the encrypted routing information of the i-th intermediate routing node
  • Dec ⁇ , ⁇ represents the decryption operation of data ⁇ using key ⁇ .
  • the encrypted routing information can be decrypted according to the intermediate shared key of the ith intermediate routing node to obtain the IP address of the ith intermediate routing node and the IP address of the next hop node. If the IP address of the ith intermediate routing node matches its own IP address, the traffic message can be forwarded to the IP address of the next hop node; if the IP address of the ith intermediate routing node does not match its own IP address, the traffic message can be directly discarded. In other words, after the intermediate routing node decrypts the encrypted routing information according to its corresponding intermediate shared key, it will obtain the routing information of a certain intermediate routing node and the corresponding next hop node. If the routing information of the certain intermediate routing node is consistent with the routing information of the intermediate routing node itself, the intermediate routing node can forward the traffic message to the next hop node, that is, the encrypted routing information can complete the sequential forwarding of traffic messages on the traffic link.
  • the server can add encrypted routing information to the traffic message, so that the traffic message does not include the plaintext destination address, but allows each intermediate routing node in the traffic link to forward the traffic message to the next-hop node in sequence according to its corresponding encrypted routing information until the traffic message is successfully forwarded to the terminal device, wherein the terminal address is encrypted by the target intermediate shared key corresponding to the previous-hop intermediate routing node of the terminal device in the traffic link.
  • the terminal address as the routing information of the next-hop node of the previous-hop intermediate routing node of the terminal device, can be encrypted in the encrypted routing information of the previous-hop intermediate routing node through the target intermediate shared key, thereby realizing the encryption of the destination address in the traffic message.
  • the source address in the traffic message is still hidden, that is, the source address in the traffic message is not the server address, but the server encrypted address.
  • the source address of the traffic message can also include the server hidden address, and correspondingly, the destination address of the traffic message can also include the terminal hidden address.
  • the traffic message (Pkt_traffic) can include the server hidden address IP_n, the terminal hidden address IP_j, the server encrypted address IP_sec_server and the encrypted routing information Enc_routing_i.
  • the server After the server obtains the intermediate shared key corresponding to each intermediate routing node in the traffic link according to the key confirmation message, it can encrypt the next-hop routing information of each intermediate routing node in the traffic link according to the intermediate shared key, so that the traffic message can be accurately forwarded to the terminal device according to the encrypted routing information without including the plaintext destination address.
  • the destination address can also be encrypted by encrypting the routing information, so that when the attacker intercepts the traffic message, not only can he not obtain the sender of the traffic message, but also the receiver of the traffic message, thereby further reducing the source address and destination address in the traffic message from being attacked. The inferred possibility improves the security of message transmission.
  • the data encryption method specifically includes:
  • the terminal device receives the traffic message returned by the server in response to the message request message through the traffic link.
  • the destination address of the traffic message is obtained by encrypting the terminal address through the target intermediate shared key.
  • the target intermediate shared key is the intermediate shared key of the previous hop intermediate routing node of the terminal device in the traffic link.
  • the intermediate routing nodes in the traffic link can decrypt the encrypted routing information, so that the traffic message can be forwarded to the terminal device in sequence through the intermediate routing nodes in the traffic link.
  • the traffic message does not include the plaintext terminal address, but the terminal address is encrypted by the target intermediate shared key in the traffic link (the intermediate shared key corresponding to the previous hop intermediate routing node of the terminal device), so that the source address and destination address of the traffic message are both encrypted in the message to achieve anonymity.
  • the destination address can also be encrypted through the target intermediate shared key.
  • the traffic message can be forwarded to the terminal device in sequence according to the intermediate routing nodes in the traffic link.
  • the traffic message can be successfully forwarded from the server to the terminal device when both the source address and the destination address are encrypted, thereby further reducing the possibility of the source address and destination address in the traffic message being inferred by attackers and improving the security of message transmission.
  • the server After the server obtains the key confirmation message sent by the terminal device, it needs to decrypt the intermediate key encrypted data in the key confirmation message according to the shared key. If the server always maintains the shared key shared with the terminal device for this purpose, this will undoubtedly increase the burden on the server. Therefore, in a possible implementation, before decrypting the intermediate key encrypted data according to the shared key in S42, the server can obtain the shared key in the following way:
  • the server decrypts the terminal encrypted address using the server's private key to obtain the terminal address
  • the server generates a flow identifier for the traffic link according to the terminal address and the server address;
  • the server generates a shared key using the terminal address and stream identifier.
  • the terminal encrypted address can be decrypted according to the server's private key to obtain the terminal address.
  • FlowID represents the flow identifier
  • IP_m represents the server address of the server
  • IP_i represents the terminal address of the terminal device
  • Port_server represents the server port of the server
  • Port_client represents the terminal port of the terminal device
  • Protocol represents the communication protocol between the server and the terminal device
  • Hash() represents the hash operation
  • represents the splicing operation.
  • the server can further determine the shared key corresponding to the terminal device according to the terminal address and the flow identifier.
  • Key_share represents the shared key
  • info_server represents the server's own private information
  • FlowID represents the flow identifier
  • Hash() represents the hash operation
  • represents the splicing operation.
  • the server does not need to maintain the shared key shared with the terminal device all the time.
  • the server can regenerate the stream based on the terminal address and server address.
  • the flow identifier and shared key corresponding to the link are obtained, and the intermediate key encrypted data is decrypted by directly generating the shared key, thereby reducing the cost of the server for maintaining the shared key.
  • the traffic message also includes a flow identifier, which is used to instruct the intermediate routing node to generate a corresponding intermediate shared key according to the flow identifier, and decrypt the encrypted routing information through the intermediate shared key to obtain the routing information of the next hop node.
  • Key_share_i represents the intermediate shared key of the i-th intermediate routing node
  • info_i represents the corresponding private information of the i-th intermediate routing node
  • FlowID represents the flow identifier
  • Hash() represents the hash operation
  • represents the splicing operation.
  • the intermediate routing nodes do not need to maintain the intermediate shared keys shared with the terminal devices and servers all the time.
  • the intermediate routing nodes can regenerate the corresponding intermediate shared keys based on the flow identifier, so as to reduce the cost of the intermediate routing nodes for maintaining the intermediate shared keys.
  • the specific process of the data encryption method includes:
  • the terminal device sends a message request message carrying a hidden terminal address and an encrypted terminal address.
  • the terminal device sends a message request message to the server, which can be used to request the server to obtain the target content.
  • the message request message does not include a plain text terminal address, but instead carries the terminal encrypted address in the message request message, so as to hide the source address in the message request message by encrypting the source address. In order to further confuse attackers and maintain the message format, the message request message also carries a hidden terminal address.
  • the server sends a key creation message.
  • the server After receiving the message request message, the server will send a key creation message in order to obtain the intermediate shared key corresponding to the intermediate routing node included in the traffic link used to transmit the traffic message.
  • the key creation message also does not include the plaintext server address. Instead, the server encrypted address is carried in the key creation message, so as to hide the source address of the key creation message by encrypting the source address. In order to further confuse attackers and maintain the message format, the key creation message also carries the server hidden address.
  • the key creation message also carries the shared key shared between the server and the terminal device and the flow identifier corresponding to the traffic link.
  • the intermediate routing node calculates the intermediate shared key, encrypts it and embeds it into the key creation message
  • the intermediate routing node When forwarding the key creation message, the intermediate routing node will calculate the corresponding intermediate shared key through its own information and flow identification information, and encrypt the calculated intermediate shared key with the public key corresponding to the destination address (terminal device) and embed it into the key creation message, so that the terminal device can obtain the intermediate shared key through the key creation message.
  • S1204 The terminal device decrypts the intermediate shared key, encrypts it, and transmits it back to the server via a key confirmation message.
  • the terminal device can decrypt the encrypted intermediate shared key information carried in the key creation message according to its own private key, and encrypt the obtained intermediate shared key with the shared key shared with the server and embed it into the key confirmation message, so that the encrypted intermediate shared key can be transmitted back to the server through the key confirmation message.
  • the key confirmation message does not include the plaintext terminal address, but carries the terminal encrypted address in the key confirmation message, so as to achieve the concealment of the source address in the key confirmation message by encrypting the source address. In order to further confuse attackers and maintain the message format, the key confirmation message also carries the terminal hidden address.
  • the server decrypts to obtain an intermediate shared key, and uses the intermediate shared key to encrypt routing information of the traffic link.
  • the server can decrypt the encrypted intermediate shared key information carried in the key confirmation message through the shared key shared with the terminal device, obtain the intermediate shared key shared with the intermediate routing node of the traffic link, and encrypt the routing information of the intermediate routing node in the traffic link through the intermediate shared key to obtain the corresponding encrypted routing information.
  • Adding the encrypted routing information to the traffic message can enable the traffic message to be forwarded through the routing information corresponding to each hop of the encrypted intermediate routing node carried by the traffic message without including the plaintext destination address.
  • the traffic message can encrypt the destination address through the intermediate shared key. On this basis, the traffic message can still encrypt the source address, thereby concealing both the source address and the destination address in the traffic message.
  • the intermediate routing node calculates the intermediate shared key and verifies the encrypted routing information in the traffic message.
  • the intermediate routing node After receiving the traffic message, the intermediate routing node can calculate the intermediate shared key again according to the flow identifier, and use the intermediate shared key to decrypt the encrypted routing information carried in the traffic message to obtain the decrypted routing information and the routing information of the corresponding next hop node.
  • S1207 The intermediate routing node verifies whether its own routing information is consistent with the decrypted routing information.
  • the intermediate routing node After decrypting the encrypted routing information carried in the traffic message, the intermediate routing node needs to verify whether its own routing information is consistent with the decrypted routing information.
  • the traffic message can be forwarded to the next hop node to achieve sequential forwarding of the traffic message in the traffic link.
  • the terminal device sends a traffic confirmation message to the server for packet loss retransmission.
  • the terminal device After receiving the traffic message, the terminal device can send a traffic confirmation message to the server.
  • the traffic confirmation message is used to allow the server to obtain the packet loss information of the terminal device, and when the terminal device loses packets, the server can retransmit the lost packet data by sending the traffic message again.
  • the traffic confirmation message does not include the plaintext terminal address, but carries the terminal encrypted address in the traffic confirmation message, so as to hide the source address in the traffic confirmation message by encrypting the source address. In order to further confuse attackers and maintain the message format, the traffic confirmation message also carries the terminal hidden address.
  • the above data encryption method is used to illustrate the network communication between the server and the terminal device B by taking the network communication between the server and the terminal device B as an example.
  • the network communication between the terminal device B and the server is realized by sending a request message, a key creation message with an encrypted source address, a key confirmation message with an encrypted source address, a traffic message with an encrypted source address and a destination address, and a traffic confirmation message with an encrypted source address.
  • At least one of the source address and the destination address of the message exchanged between the server and the terminal device is encrypted, and the source address and the destination address in the traffic message with the largest number are encrypted, thereby reducing the possibility of attackers obtaining user privacy through the source address and the destination address and enhancing the security of message interaction.
  • FIG. 14 is a device structure diagram of a data encryption device provided in an embodiment of the present application.
  • the data encryption device 1400 includes a sending unit 1401, an acquiring unit 1402, a decryption unit 1403 and a receiving unit 1404:
  • the sending unit 1401 is used to send a message request message to the server, where the source address of the message request message includes a terminal encryption address, where the terminal encryption address is obtained by encrypting the terminal address of the terminal device using the public key of the server;
  • the acquiring unit 1402 is configured to receive a traffic message returned by the server in response to the message request message, wherein the source address of the traffic message includes a server encryption address, and the server encryption address is obtained by encrypting the server address of the server using the public key of the terminal device;
  • the decryption unit 1403 is used to decrypt the server encrypted address by using the private key of the terminal device to obtain the server pending address;
  • the receiving unit 1404 is configured to obtain the flow data in the flow message in response to the pending address of the server being consistent with the server address.
  • the source address of the message request message also includes a terminal hidden address, which is a virtual terminal address different from the terminal address;
  • the source address of the traffic message also includes a server hidden address, which is a virtual server address different from the server address.
  • the sending unit 1401 is further configured to:
  • the key-encrypted data is decrypted using the private key of the terminal device to obtain a shared key between the terminal device and the server, and N intermediate shared keys, where the N intermediate shared keys correspond to N intermediate routing nodes in the traffic link, and N is an integer greater than or equal to 1;
  • a key confirmation message including the intermediate key encrypted data is sent to the server, wherein the source address of the key confirmation message includes the terminal encryption address.
  • the acquisition unit 1402 is used to receive, through a traffic link, a traffic message returned by the server in response to a message request message.
  • the destination address of the traffic message is obtained by encrypting the terminal address using a target intermediate shared key.
  • the target intermediate shared key is the intermediate shared key of the previous-hop intermediate routing node of the terminal device in the traffic link.
  • the sending unit 1401 is further configured to:
  • a flow confirmation message including a message reception result is sent to the server, wherein the source address of the flow confirmation message includes the terminal encryption address.
  • the acquiring unit 1402 is further configured to:
  • the receiving server obtains a traffic retransmission message returned in response to the traffic confirmation message.
  • the traffic retransmission message is a traffic message not received by the terminal device identified by the message reception result.
  • the source address of the traffic retransmission message includes the server encryption address.
  • FIG. 15 is a device structure diagram of another data encryption device provided in an embodiment of the present application, wherein the data encryption device 1500 includes an acquisition unit 1501 , a decryption unit 1502 , and a sending unit 1503 ;
  • the acquisition unit 1501 is used to receive a message request message sent by a terminal device, where the source address of the message request message includes a terminal encryption address, which is obtained by encrypting the terminal address of the terminal device using a public key of the server;
  • the decryption unit 1502 is used to decrypt the terminal encrypted address by using the private key of the server to obtain the terminal address;
  • the sending unit 1503 is used to send a traffic message returned in response to the message request message to the terminal device according to the terminal address.
  • the source address of the traffic message includes a server encryption address, which is obtained by encrypting the server address of the server using the public key of the terminal device.
  • the sending unit 1503 is configured to:
  • the traffic link includes N intermediate routing nodes, where N is an integer greater than or equal to 1;
  • the traffic message returned in response to the message request message is sent to the terminal device through N intermediate routing nodes in the traffic link.
  • the sending unit 1503 is further configured to:
  • a key creation message including key-encrypted data and a flow identifier is sent to the terminal device through the traffic link.
  • the source address of the key creation message includes the server encryption address.
  • the key creation message is used to instruct N intermediate routing nodes to generate an intermediate shared key according to the flow identifier, encrypt the intermediate shared key through the public key of the terminal device, and add the encryption result to the key-encrypted data.
  • the acquiring unit 1501 is further configured to:
  • the source address of the key confirmation message includes the terminal encryption address
  • the key confirmation message includes intermediate key encrypted data
  • the intermediate key encrypted data is obtained by encrypting N intermediate shared keys with a shared key
  • the N intermediate shared keys correspond one-to-one to the N intermediate routing nodes
  • the encrypted routing information corresponding to each of the N intermediate routing nodes is obtained.
  • the corresponding encrypted routing information is obtained by encrypting the routing information of the i-th intermediate routing node and the routing information of the next hop node of the i-th intermediate routing node using the intermediate shared key corresponding to the i-th intermediate routing node;
  • the encrypted routing information is added to the traffic message.
  • the destination address of the traffic message is obtained by encrypting the terminal address through the target intermediate shared key.
  • the target intermediate shared key is the previous hop intermediate routing node of the terminal device in the traffic link. Intermediate shared key.
  • the acquiring unit 1501 is further configured to:
  • the traffic message also includes a flow identifier, which is used to instruct the intermediate routing node to generate a corresponding intermediate shared key according to the flow identifier, and decrypt the encrypted routing information using the intermediate shared key to obtain the routing information of the next hop node.
  • the sending unit 1503 is further used to: receive a flow confirmation message including a message reception result sent by the terminal device, the source address of the flow confirmation message includes a terminal encryption address, and the message reception result is used to identify a reception status of the terminal device for the flow message;
  • the target traffic message is sent to the terminal device as a traffic retransmission message, and the source address of the traffic retransmission message includes the server encryption address.
  • Figure 16 is a system structure diagram of a data encryption system provided in an embodiment of the present application, wherein the data encryption system 1600 includes a terminal device 1601 and a server 1602, wherein the terminal device 1601 is used to execute the method of the aforementioned method embodiment, and the server 1602 is used to execute the method of the aforementioned method embodiment.
  • the embodiment of the present application also provides a computer device, which is the computer device described above and may include a terminal device or a server, and the data encryption device described above may be configured in the computer device.
  • a computer device which is the computer device described above and may include a terminal device or a server, and the data encryption device described above may be configured in the computer device.
  • the computer device is described below in conjunction with the accompanying drawings.
  • the computer device is a terminal device
  • the terminal device taking the terminal device as a mobile phone as an example:
  • FIG17 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application.
  • the mobile phone includes components such as a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless fidelity (WiFi) module 1470, a processor 1480, and a power supply 1490.
  • RF radio frequency
  • the RF circuit 1410 may be used for receiving and sending signals during information transmission or communication or during a call.
  • the information is sent to the processor 1480 for processing.
  • the uplink data is sent to the base station.
  • the memory 1420 can be used to store software programs and modules.
  • the processor 1480 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1420.
  • the memory 1420 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc.
  • the memory 1420 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 1430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile phone.
  • the input unit 1430 may include a touch panel 1431 and other input devices 1432 .
  • the display unit 1440 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 1440 may include a display panel 1441.
  • the mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors.
  • a sensor 1450 such as a light sensor, a motion sensor, and other sensors.
  • the audio circuit 1460 , the speaker 1461 , and the microphone 1462 can provide an audio interface between the user and the mobile phone.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1470. It provides users with wireless broadband Internet access.
  • Processor 1480 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and/or modules stored in memory 1420 and calling data stored in memory 1420.
  • the mobile phone also includes a power source 1490 (such as a battery) for supplying power to various components.
  • a power source 1490 such as a battery
  • the processor 1480 included in the terminal device is also used to execute the data encryption method on the terminal device side provided in the embodiment of the present application.
  • FIG. 18 is a structural diagram of a server 1500 provided in the embodiment of the present application.
  • the server 1500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1522 (for example, one or more processors) and a memory 1532, and one or more storage media 1530 (for example, one or more mass storage devices) storing application programs 1542 or data 1544.
  • the memory 1532 and the storage medium 1530 can be short-term storage or permanent storage.
  • the program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server.
  • the central processing unit 1522 can be configured to communicate with the storage medium 1530 to execute a series of instruction operations in the storage medium 1530 on the server 1500.
  • the server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558, and/or one or more operating systems 1541, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , etc.
  • operating systems 1541 such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , etc.
  • the steps performed by the server in the above embodiment may be based on the server structure shown in FIG. 18 .
  • an embodiment of the present application further provides a storage medium, wherein the storage medium is used to store a computer program, and the computer program is used to execute the method provided in the above embodiment.
  • the embodiments of the present application also provide a computer program product including instructions, which, when executed on a computer, enables the computer to execute the method provided in the above embodiments.
  • each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments.
  • the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
  • the device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例公开了一种数据加密方法和相关装置,当终端设备和服务器通过交互报文进行网络通信时,之间交互的消息请求报文和流量报文中的源地址均被通过接收端的公钥进行加密,只有通过接收端的私钥解密后才能获得报文真实的源地址。通过加密报文的源地址,使得攻击者即使获取报文,也仅能知晓该报文的接收端,而无法确定报文的发送端,使得攻击者仅能得到碎片化的信息,无法将碎片化的信息进行拼接,从而降低了通过报文的源地址和目的地址泄露用户隐私的可能性。而且,作为数据接收端的终端设备也能通过自身私钥还原出所接收报文的真实源地址,保证了报文接收的安全性。

Description

一种数据加密方法和相关装置
本申请要求于2023年02月23日提交中国专利局、申请号为2023102019073、申请名称为“一种数据加密方法和相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,特别涉及数据加密技术。
背景技术
网络通信的一种方式是基于目的地址的路由转发,其主要工作原理为:中间路由节点在从发送端或者其他中间路由节点收到报文后,从报文头部提取到对应的转发信息,例如对应的出端口等,中间路由节点将该报文通过该端口转发至下一跳的路由节点(例如中间路由节点或者目的端),直至目的端收到该报文。
网络通信的安全性是衡量互联网业务、客户端体验和运营商的重要条件,网络通信的安全性主要体现在通信安全和隐私保护等方面。相关技术中,为了提升网络通信的安全性,主要通过各类安全检测软硬件,对接收的报文进行安全检测,在一定概率上降低数据被篡改、流量被劫持、通信被非法获取的风险;如图1所示,当终端设备向数据存储服务器请求数据时,该服务器可以通过安全硬件平台对来自终端设备的请求报文或消息确认报文进行安全检测,并对检测出的恶意报文进行过滤,以进一步提升网络通信的安全性。
然而,相关技术对网络通信的安全性的检测维度并不全面,难以适应目前的隐私保护需求。
发明内容
为了解决上述技术问题,本申请提供了一种数据加密方法和相关装置,能够降低通过报文的源地址和目的地址泄露用户隐私的可能,满足目前的隐私保护需求。
本申请实施例公开了如下技术方案:
一方面,本申请实施例提供了一种数据加密方法,由终端设备执行,包括:
向服务器发送消息请求报文,消息请求报文的源地址包括终端加密地址,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的;
接收服务器针对消息请求报文返回的流量报文,流量报文的源地址包括服务器加密地址,服务器加密地址是为通过终端设备的公钥对所述服务器的服务器地址加密得到的;
通过终端设备的私钥对服务器加密地址进行解密,得到服务器待定地址;
响应于服务器待定地址与服务器地址一致,获取流量报文中的流量数据。
另一方面,本申请实施例提供了一种数据加密方法,由服务器执行,包括:
接收终端设备发送的消息请求报文,消息请求报文的源地址包括终端加密地址,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的;
通过服务器的私钥对终端加密地址进行解密,得到终端地址;
根据终端地址,向终端设备发送针对消息请求报文返回的流量报文,流量报文的源地址包括服务器加密地址,服务器加密地址是通过终端设备的公钥对服务器的服务器地址加密得到的。
另一方面,本申请实施例提供一种数据加密装置,包括发送单元,获取单元,解密单元和接收单元;
发送单元,用于向服务器发送用于消息请求报文,消息请求报文的源地址包括终端加密地址,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的;
获取单元,用于接收服务器针对消息请求报文返回的流量报文,流量报文的源地址包括服务器加密地址,服务器加密地址是通过终端设备的公钥对服务器的服务器地址加密得到的;
解密单元,用于通过终端设备的私钥对服务器加密地址进行解密,得到服务器待定地址;
接收单元,用于响应于服务器待定地址与服务器地址一致,获取流量报文中的流量数据。
另一方面,本申请实施例提供了一种数据加密装置,包括获取单元,解密单元,发送单元;
获取单元,用于接收终端设备发送的消息请求报文,消息请求报文的源地址包括终端加密地址,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的;
解密单元,用于通过服务器的私钥对终端加密地址进行解密,得到终端地址;
发送单元,用于根据终端地址,向终端设备发送针对消息请求报文返回的流量报文,流量报文的源地址包括服务器加密地址,服务器加密地址是通过终端设备的公钥对服务器的服务器地址加密得到的。
另一方面,本申请实施例提供了一种数据加密系统,数据加密系统包括终端设备和服务器,终端设备用于执行以上方面所述的方法,服务器用于执行以上方面所述的方法。
又一方面,本申请实施例提供了一种计算机设备,计算机设备包括处理器以及存储器:
存储器用于存储计算机程序,并将程序代码传输给处理器;
处理器用于根据计算机程序中的指令执行以上方面所述的方法。
又一方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质用于存储计算机程序,计算机程序用于执行以上方面所述的方法。
又一方面,本申请实施例提供了一种包括计算机程序的计算机程序产品,当其在计算机设备上运行时,使得计算机设备执行以上方面所述的方法。
由上述技术方案可以看出,终端设备通过交互报文和服务器进行网络通信时,之间交互的消息请求报文和流量报文中的源地址均被通过接收端的公钥进行了加密,只有通过接收端的私钥解密后才能获得报文真实的源地址。对源地址进行隐匿的原因在于,由于一个报文在网络通信中一般会携带源地址和目的地址,以便实现正确的转发,然而攻击者一旦截获报文,即可得到源地址和目的地址这一关系,相应地,可以确定终端设备的用户何时 上线并获取了哪些内容服务,从而推测出用户的隐私的信息。故通过加密报文的源地址,使得攻击者即使获取报文,也仅能知晓该报文的接收端,而无法确定报文的发送端,使得攻击者仅能得到碎片化的信息,而无法将碎片化的信息进行拼接,从而降低了通过报文的源地址和目的地址泄露用户隐私的可能性。而且,作为数据接收端的终端设备也能通过自身私钥还原出所接收报文的真实源地址,保证了报文接收的安全性。
附图说明
图1为一种基于安全硬件辅助的安全增强示意图;
图2为本申请实施例提供的一种数据加密场景的示意图;
图3为一种攻击者基于源地址和目的地址获取用户隐私的示意图;
图4为本申请实施例提供的一种数据加密方法的方法流程图;
图5为本申请实施例提供的一种消息请求报文示意图;
图6为本申请实施例提供的一种流量报文示意图;
图7为本申请实施例提供的一种流量确认报文示意图;
图8为本申请实施例提供的一种密钥创建报文示意图;
图9为本申请实施例提供的一种中间路由节点向密钥创建报文中添加中间共享密钥示意图;
图10为本申请实施例提供的一种密钥确认报文示意图;
图11为本申请实施例提供的一种加密源地址和目的地址的流量报文示意图;
图12为本申请实施例提供的一种数据加密方法的具体流程图;
图13为本申请实施例提供的一种数据加密方法的通信示意图;
图14为本申请实施例提供的一种数据加密装置的装置结构图;
图15为本申请实施例提供的另一种数据加密装置的装置结构图;
图16为本申请实施例提供的一种数据加密系统的系统结构图;
图17为本申请实施例提供的一种终端设备的结构图;
图18为本申请实施例提供的一种服务器的结构图。
具体实施方式
下面结合附图,对本申请的实施例进行描述。
相关技术中,可以通过各类安全检测软硬件对网络通信进行安全检测,如图1所示,可以通过安全检测硬件来对终端设备与数据存储服务器之间交互的各种报文进行安全检测,并对检测出的恶意报文进行过滤,在一定程度上提升了网络通信的安全性。此外,还可以从通信协议角度来提高网络通信的安全性,主要是通过加密方式来对报文中的数据进行加密,从而降低报文转发过程中数据被非法获取、篡改、重定向的风险,例如,在传输控制协议(TCP,Transport Control Protocol)基础上,通过安全套接字(SSL,Secure Sockets Layer)/传输层安全(TLS,Transport Layer Security)协议加密,或在用户数据报协议(UDP,User Datagram Protocol)基础上,提出快速UDP互联网连接(QUIC,Quick UDP Internet Connection)协议,实现对报文中的数据进行加密,从而使得恶意中间路由节点在缺乏解 密密钥的情况下无法获取报文中的数据内容。
然而,通过安全检测软硬件来对网络通信进行安全检测、以及从通信协议的角度来对数据进行加密,并不能在报文地址的维度上提升安全性,一旦被攻击者截获报文,攻击者能够得到该报文的源地址和目的地址,进而能够根据源地址和目的地址之间的关系推测出终端用户的隐私的信息,造成用户的隐私泄露。
为此,本申请实施例提供了一种数据加密方法和相关装置,对终端设备和服务器之间交互的报文中的源地址进行加密,降低攻击者通过报文的源地址和目的地址获取终端用户的隐私的信息的可能性,在报文地址的维度上提升了网络通信的安全性。
本申请实施例提供的数据加密方法可以通过计算机设备实施,该计算机设备可以是终端设备或服务器,其中,服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表、车载终端、智能电视等,但并不局限于此。终端以及服务器可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。
本申请实施例提供的数据加密方法可基于云存储(cloud storage)实现,云存储是在云计算概念上延伸和发展出来的一个新的概念,分布式云存储系统(以下简称存储系统)是指通过集群应用、网格技术以及分布存储文件系统等功能,将网络中大量各种不同类型的存储设备(也称为存储节点)通过应用软件或应用接口集合起来协同工作,共同对外提供数据存储和业务访问功能的一个存储系统。
目前,存储系统的存储方法为:创建逻辑卷,在创建逻辑卷时,为每个逻辑卷分配物理存储空间,该物理存储空间可能由某个存储设备或者某几个存储设备的磁盘组成。客户端在某一逻辑卷上存储数据,也就是将数据存储在文件系统上,文件系统将数据分成许多部分,每一部分是一个对象,对象不仅包含数据而且还包含数据标识(ID,ID entity)等额外的信息,文件系统将每个对象分别写入该逻辑卷的物理存储空间,且文件系统会记录每个对象的存储位置信息,当客户端请求访问数据时,文件系统能够根据每个对象的存储位置信息让客户端对数据进行访问。
存储系统为逻辑卷分配物理存储空间的过程,具体为:按照对存储于逻辑卷的对象的容量估量(该估量往往相对于实际要存储的对象的容量有很大余量)和独立冗余磁盘阵列(RAID,Redundant Array of Independent Disk)的组别,预先将物理存储空间划分成分条,一个逻辑卷可以理解为一个分条,从而为逻辑卷分配了物理存储空间。
例如,在本申请实施例中的服务器可以是实现云存储的云服务器。
图2为本申请实施例提供的一种数据加密场景的示意图,其中,前述的计算机设备为终端设备和服务器,终端设备和服务器之间可以通过交互报文进行网络通信,该服务器可以是能实现云存储的云服务器,也可以是非云服务器,例如传统物理服务器等,该服务器可以是内容服务器,内容服务器是指能够实现内容分发网络(CDN,Content Delivery Network)的功能的服务器。
终端设备和服务器之间进行网络通信时,终端设备会发送消息请求报文,消息请求报 文是指终端设备向服务器发送的请求报文,例如,消息请求报文可以是终端设备向服务器发送的用于请求获取目标内容的请求报文,其中,消息请求报文的源地址并未被直接公开,如图2所示,而是采用接收端(服务器)的公钥对其进行了加密,只有在服务器接收该消息请求报文之后,通过服务器的私钥解密后才能获得该消息请求报文真实的源地址。
相应的,终端设备从服务器获取流量报文,流量报文是指服务器向终端设备发送的响应于消息请求报文的报文,例如,流量报文可以是服务器发送的用于使该终端设备获取目标内容的报文,其中,流量报文的源地址也并未被直接公开,如图2所示,也是采用接收端(终端设备)的公钥对其进行了加密,只有在终端设备获取该流量报文之后,通过终端设备的私钥解密后才能获得流量报文真实的源地址。
在终端设备和服务器之间进行网络通信的过程中,对所交互的消息请求报文和流量报文中的源地址进行隐匿的原因在于,为了实现网络通信中报文的正确转发,报文中一般会携带源地址和目的地址,然而,一旦攻击者截获该报文,即可得到该报文的源地址和目的地址这一关系,进而,可以根据源地址和目的地址之间的关系推测出终端设备的用户何时上线、获取了哪些内容服务等隐私的信息,如图3所示,位于终端设备和服务器之间的攻击者可以根据消息请求报文和流量报文的源地址和目的地址,得到“某个用户正在上网”这一信息,甚至产生该用户“是否在家”等推断,同时,攻击者如果获取到某个云服务提供商的服务器的地址集合,那么根据消息请求报文或流量报文中是否存在该地址集合中的地址,可以判断用户正在获取的内容服务,例如,某个云服务提供商用于为短视频平台提供服务的内容互连网协议(IP,Internet Protocol)地址有:IP1、IP2、IP3、…、IP100,那么如果攻击者截取的报文中源地址或目的地址有上述IP地址,就能够推断“该用户正在观看短视频”这一用户状态。
在本申请实施例中,通过加密报文的源地址,使得攻击者即使截取报文,也仅能知晓该报文的接收端,无法确定报文的发送端,使得攻击者仅能得到碎片化的信息,而无法对碎片化的信息进行拼接,从而降低了通过报文的源地址和目的地址泄露用户隐私的可能。
同时,作为流量报文的接收端的终端设备能够通过自身私钥还原出所接收的流量报文的真实源地址,降低了终端设备随意接收报文带来的危险,保证了报文接收的安全性。
图4为本申请实施例提供的一种数据加密方法的方法流程图,在本实施例中,以计算机设备为终端和服务器来进行说明,该方法包括:
S401、终端设备向服务器发送消息请求报文,消息请求报文的源地址包括终端加密地址,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的。
终端设备可以和服务器通过交互报文的方式进行网络通信,在实际应用中,一个服务器可以向多个终端设备发送报文,一个终端也可以向多个服务器发送请求报文,本实施例中以一个终端设备和一个服务器进行网络通信为例进行说明。
终端设备和服务器之间网络通信的目的可以是让终端设备从服务器处获取目标内容,当终端设备通过交互报文来从服务器获取目标内容时,终端设备为数据请求端,服务器为数据发送端。目标内容为终端设备所需的数据内容,目标内容可以是各种形式的数据内容,例如文字、图片、视频、直播流等,由于不同的服务器可以提供不同的数据内容,故终端 设备在发送消息请求报文前,可以先根据目标内容确定对应的服务器,再向确定的服务器发送对应的消息请求报文。
消息请求报文是指终端设备向服务器发送的请求报文,为了避免消息请求报文被攻击者截获之后获得该报文中源地址和目的地址之间的关系,进而得到用户的隐私的信息,消息请求报文中的源地址在本实施例中被加密,即对消息报文中的源地址实现了隐匿,使得攻击者即使截获该报文,也仅能知晓该报文的目的地址,而无法确定该报文的源地址,即攻击者在截获了该报文之后,仅知道有设备向服务器发送了报文,但是不知道是哪个设备发送的,难以推断出用户的隐私的信息,也就是说,通过对消息请求报文的源地址进行加密,可以实现对消息请求报文中源地址的隐匿,降低了攻击者通过消息请求报文的源地址和目的地址推断出用户的隐私的信息的可能性。
需要说明的是,可以通过服务器的公钥对终端设备的终端地址进行加密,得到对应的终端加密地址,例如,可以通过下述公式得到终端加密地址:
IP_sec=Enc{Key_pub_server,IP_i}
其中,IP_sec表示终端加密地址,Key_pub_server表示服务器的公钥,IP_i表示终端设备的终端地址,Enc{α,β}表示使用密钥α对数据β进行加密操作。
根据上述公式,可以通过服务器的公钥对真实的终端地址进行加密得到对应的终端加密地址,如图5所示,终端加密地址可以被携带在消息请求报文(Pkt_req)中,例如,可以被携带在消息请求报文的payload中,以便服务器能够在获取消息请求报文之后通过终端加密地址确定终端设备对应的终端地址,即让消息请求报文的接收端能够准确确定该消息请求报文的发送端,以便在后续步骤中该接收端能够准确生成目的地址为该发送端的流量报文,保证报文传播的安全性和准确性。
需要说明的是,为了保证消息请求报文能够被准确转发,本实施例中消息请求报文的目的地址并未被加密,即消息请求报文中包括明文的服务器的服务器地址,以便消息请求报文在网络通信中可以基于服务器地址被准确转发至服务器。
为了在攻击者截获消息请求报文之后进一步的混淆攻击者,进一步降低攻击者通过消息请求报文中真实的源地址和目的地址推断出用户的隐私的信息的可能性,在一种可能的实现方式中,消息请求报文的源地址还包括终端隐匿地址,终端隐匿地址与终端地址不同。
终端隐匿地址是指消息请求报文中的明文的虚拟源地址,其中,为了能够对消息请求报文真实的源地址进行隐匿,终端隐匿地址显然不同于发送消息请求报文的终端设备真实的终端地址,如图5所示,当终端设备的终端地址为IP_i时,消息请求报文中不仅包括终端加密地址IP_sec,还包括终端隐匿地址IP_j,例如,消息请求报文的头部可以携带终端隐匿地址,其中,IP_i与IP_j并不相同。
在消息请求报文中加入终端隐匿地址,可以让攻击者在截获该消息请求报文之后,被消息请求报文中的终端隐匿地址混淆,诱使攻击者得到该消息请求报文的源地址为终端隐匿地址这一错误判断,进一步降低攻击者通过消息请求报文获得真实的源地址和目的地址,并据此推断出用户的隐私的信息的可能性。
此外,由于对消息请求报文的真实源地址进行了隐匿,会导致消息请求报文的报文格 式发生变化,而通过在消息请求报文的源地址中加入终端隐匿地址,可以保持加密了源地址的消息请求报文与未加密源地址的报文在格式上并无区别,使得在终端设备和服务器的网络通信中,用于转发的设备可以根据消息请求报文的格式成功理解消息请求报文的涵义,进而保证消息请求报文的成功转发。
S402、服务器通过服务器的私钥对终端加密地址进行解密,得到终端地址。
服务器接收终端设备发送的消息请求报文之后,需要确定消息请求报文的源地址,以便对消息请求报文做出准确响应,由于消息请求报文中的源地址被隐匿,故服务器无法直接得到消息请求报文的源地址,需要通过对消息请求报文中的终端加密地址进行解密才能得到对应的终端地址。
如S401所述,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的,其中,服务器的公钥是指该服务器对应的公开的密钥,其他设备都可以用服务器的公钥来加密数据,而服务器的私钥是该服务器私有的密钥,只有服务器拥有这个密钥,即只有服务器可以通过服务器的私钥来解密被服务器的公钥加密的数据,故服务器可以通过服务器的私钥对终端加密地址进行解密得到终端地址,例如,可以通过下述公式得到终端地址:
IP_i=Dec{Key_pri_server,IP_sec}
其中,IP_i表示终端设备的终端地址,Key_pri_server表示服务器的私钥,IP_sec表示终端加密地址,Dec{α,β}表示使用密钥α对数据β进行解密操作。
根据上述公式,可以通过服务器的私钥对终端加密地址进行解密,得到终端地址,该终端地址就是消息请求报文真实的源地址,也就是说,服务器在获取到消息请求报文之后,通过解密其中的终端加密地址确定该消息请求报文真实的源地址,为后续步骤中服务器能够准确向该终端地址发送流量报文打下了基础。
S403、终端设备接收服务器针对消息请求报文返回的流量报文,流量报文的源地址包括服务器加密地址,服务器加密地址是通过终端设备的公钥对服务器的服务器地址加密得到的。
流量报文是指服务器向终端设备发送的响应于消息请求报文中的请求的报文,例如,当消息请求报文为终端设备向服务器请求获取目标内容的报文时,流量报文可以是服务器发送的用于让该终端设备获取目标内容的报文,若目标内容为终端设备所需的文字,流量报文会相应的包括该文字对应的数据,当目标内容为终端设备所需的文字和图片时,流量报文会相应的包括该文字和图片对应的数据。
为了避免流量报文被攻击者截获之后获得该报文中源地址和目的地址之间的关系,进而得到用户的隐私的信息,流量报文中的源地址在本实例中也被加密,使得攻击者即使截获该报文,也仅能知晓该报文的目的地址,而无法确定该报文的源地址,即攻击者在截获了该报文之后,仅知道有设备向终端设备发送了报文,但是不知道是哪个设备发送的,相应地,难以推断出用户的隐私的信息,也就是说,通过对流量报文的源地址进行加密实现对流量报文中源地址的隐匿,降低了攻击者通过消息请求报文的源地址和目的地址来推断出用户的隐私的信息的可能性。
需要说明的是,可以通过终端设备的公钥来对服务器的服务器地址进行加密得到对应 的服务器加密地址,例如,可以通过下述公式得到服务器加密地址:
IP_sec_server=Enc{Key_pub_client,IP_m}
其中,IP_sec_server表示服务器加密地址,Key_pub_client表示终端设备的公钥,IP_m表示服务器地址,Enc{α,β}表示使用密钥α对数据β进行加密操作。
通过上述公式,可以通过终端设备的公钥来对真实的服务器地址进行加密得到对应的服务器加密地址,如图6所示,服务器加密地址可以被携带在流量报文(Pkt_traffic)中,以便终端设备在获取该流量报文之后,在该流量报文的源地址被隐匿的情况下,通过后续步骤依然能够确定该流量报文的源地址,为保证报文传播的安全性打下了基础。
需要说明的是,为了保证流量报文能够被准确转发,本实施例中流量报文的目的地址并未被加密,即流量报文中包括明文的终端设备的终端地址,以便流量报文在网络通信中可以基于终端地址被准确转发至发送消息请求报文的终端设备。
在一种可能的实现方式中,流量报文的源地址还包括服务器隐匿地址,服务器隐匿地址与服务器地址不同。
服务器隐匿地址是指流量报文中的明文的虚拟源地址,服务器隐匿地址不同于发送流量报文的服务器真实的服务器地址,如图6所示,当服务器地址为IP_m时,流量报文中不仅包括服务器加密地址IP_sec_server,还包括终端隐匿地址IP_n,其中,IP_n与IP_m并不相同。
在流量报文中加入服务器隐匿地址,一方面可以让攻击者在截获该流量报文之后,被流量报文中的服务器隐匿地址混淆,进一步降低攻击者获取到流量报文真实的源地址和目的地址,并据此推断出用户的隐私的信息的可能性;另一方面可以保证流量报文的报文格式,进而保证流量报文的成功转发。
S404、终端设备通过终端设备的私钥对服务器加密地址进行解密,得到服务器待定地址。
为了保证报文传输的安全性,终端设备需要确定获取的报文的来源,以降低终端设备被恶意报文攻击的可能性,故终端设备从服务器获取到流量报文之后,需要确定流量报文的源地址,以便确定该流量报文的来源,由于流量报文的源地址被隐匿,故终端设备无法直接得到流量报文的源地址,需要通过对流量报文中的服务器加密地址进行解密来得到对应的服务器待定地址。
如S403所述,服务器加密地址是通过终端设备的公钥加密得到的,故终端设备可以通过终端设备的私钥对服务器加密地址进行解密,得到服务器待定地址,例如,可以通过下述公式得到服务器待定地址:
IP_m1=Dec{Key_pri_client,IP_sec_server}
其中,IP_m1表示服务器待定地址,Key_pri_client表示终端设备的私钥,IP_sec_server表示服务器加密地址,Dec{α,β}表示使用密钥α对数据β进行解密操作。
根据上述公式,可以通过终端设备的私钥对服务器加密地址进行解密,得到服务器待定地址,该服务器待定地址就是流量报文真实的源地址,也就是说,终端设备在获取到隐匿了源地址的流量报文之后,通过对流量报文中的服务器加密地址进行解密,确定了该流 量报文真实的源地址。
需要说明的是,考虑到流量报文在传输过程中可能被非法截取并篡改,相应地,该流量报文中包括的服务器加密地址也可能被篡改,在该种情况下,终端设备对该服务器加密地址进行解密得到的服务器地址,可能并非真实的服务器地址,即并非服务器加密的自身的真实地址;当然,在流量报文正常传输的情况下,终端设备对该流量报文中的服务器加密地址进行解密得到的服务器地址,即为真实的服务器地址。鉴于终端设备对服务器加密地址进行解密得到的服务器地址,暂且无法确认其真实性,故先将其称为服务器待定地址。
S405、终端设备响应于服务器待定地址与服务器地址一致,获取流量报文中的流量数据。
终端设备获取了流量报文之后,通过S404确定了该流量报文真实的源地址为服务器待定地址,同时,终端设备发送的消息请求报文的目的地址为服务器的服务器地址。当服务器地址与服务器待定地址一致时,表示终端设备发送的消息请求报文的目的地址与终端设备获取的流量报文真实的源地址一致,表示该流量报文为终端设备所需的针对消息请求报文返回的报文,并不是其他服务器发送的恶意报文或者无关报文,终端设备可以接收该流量报文中的流量数据,从而使得终端设备能够获取流量报文中的数据内容。
由于网络通信过程中,数据的接收端并不一定能够完整获取数据的发送端发送的报文内容,故在终端设备和服务器的交互过程中,需要对终端设备是否成功获取了服务器发送的报文内容进行判断。
在一种可能的实现方式中,终端设备还可以确定针对流量报文的报文接收结果;向服务器发送包括报文接收结果的流量确认报文,流量确认报文的源地址包括终端加密地址。
报文接收结果用于在终端设备接收流量报文的流量数据之后表示该终端设备对流量报文的接收状态,即报文接收结果用于反映终端设备实际上是否成功接收到该流量报文。
需要注意的是,在终端设备和服务器的实际网络通信过程中,针对终端设备发送的消息请求报文,服务器经常会需要发送多条流量报文来响应消息请求报文中的请求,例如,当消息请求报文为向服务器请求获取视频内容时,服务器通常需要发送多条流量报文才能实现该视频内容的完整传输,此时,报文接收结果可以是在终端设备接收到多条流量报文之后分析得到的终端设备对该多条流量报文的接收状态,例如,可以根据终端设备实际接收到的(或未接收到的)报文编号范围,反映终端设备针对多条流量报文的报文接收结果。为了能够让服务器及时的获取终端设备对多条流量报文的接收状态,终端设备可以周期性的进行报文接收结果的确定,在每次确定出报文接收结果后生成对应的流量确认报文,并向服务器进行上报。
为了使服务器能够判断终端设备是否成功获取了服务器发送的数据内容,终端设备可以向服务器发送包括报文接收结果的流量确认报文,流量确认报文用于表示终端设备在接收流量报文的流量数据之后、向服务器反馈报文接收情况的报文。
为了避免流量确认报文被攻击者截获之后获得该报文中源地址和目的地址之间的关系,进而得到用户的隐私的信息,流量确认报文中的源地址也被隐匿,即流量确认报文中的源地址也不为终端地址,而是终端加密地址,进而降低了攻击者通过流量确认报文的源 地址和目的地址,并据此推断出用户的隐私的信息的可能性。
当流量确认报文的源地址被隐匿时,为了进一步混淆攻击者且保持报文格式,流量确认报文的源地址还可以包括终端隐匿地址。
如图7所示,由终端设备向服务器发送的流量确认报文(Pkt_ack)中可以包括终端隐匿地址IP_j、终端加密地址IP_sec和当前接收到的报文编号范围Pkt_num_range,其中,终端隐匿地址用于混淆攻击者和保持流量确认报文的报文格式,终端加密地址用于向服务器提供仅服务器可以解密的加密后的真实源地址,当前接收到的报文编号范围用于表示终端设备的报文接收结果。
需要说明的是,为了保证流量确认报文能够被准确转发,本实施例中流量确认报文的目的地址并未被加密,即流量确认报文包括明文的服务器的服务器地址。
终端设备在获取了流量报文的流量数据之后,可以向服务器发送包括报文接收结果的流量确认报文,以便服务器能够确定终端设备对流量报文的接收状态,从而验证流量报文是否成功传输,保证数据传输的完整性。
在一种可能的实现方式中,服务器接收终端设备发送的包括报文接收结果的流量确认报文,流量确认报文的源地址包括终端加密地址,报文接收结果用于标识终端设备对流量报文的接收状态;
当服务器根据报文接收结果确定终端设备未接收到目标流量报文时,服务器向终端设备发送作为流量重传报文的目标流量报文,流量重传报文的源地址包括服务器加密地址。
在终端设备向服务器发送流量确认报文之后,服务器可以接收终端设备发送的流量确认报文,流量确认报文中包括报文接收结果,服务器可以根据报文接收结果确定终端设备对目标流量报文的接收情况。
当服务器根据报文接收结果确定终端设备已接收到目标流量报文时,服务器可以确定目标流量报文传输成功,无需再对目标流量报文进行重传处理。
当服务器根据报文接收结果确定终端设备未接收到目标流量报文时,服务器可以向终端设备发送作为流量重传报文的目标流量报文,流量重传报文是指报文接收结果标识的终端设备未接收到的流量报文,流量重传报文用于对终端设备未接收到的流量报文进行重传。也就是说,当存在终端设备未接收到的流量报文时,服务器可以将上述未接收到的流量报文作为流量重传报文进行重传,以便终端设备能够获取未接收到的流量报文。通过让服务器发送流量重传报文,可以让终端设备获取未接收到的目标流量报文,以保证终端设备和服务器之间的报文传输的可靠性。
为了避免流量重传报文重传时被攻击者截获之后获得该报文中源地址和目的地址之间的关系,流量重传报文中的源地址也被隐匿,即流量重传报文中的源地址也不为服务器地址,而是服务器加密地址,进而降低了攻击者通过流量重传报文的源地址和目的地址,并据此推断出用户的隐私的信息的可能性。
当流量重传报文的源地址被隐匿时,为了进一步混淆攻击者且保持报文格式,流量重传报文的源地址还可以包括服务器隐匿地址。
需要说明的是,为了保证流量重传报文能够被准确转发,本实施例中流量重传报文的 目的地址并未被加密,即流量重传报文包括明文的服务器的服务器地址。
服务器在接收到终端设备发送的流量确认报文之后,可以根据流量确认报文确定终端设备对流量报文的接收情况,在终端设备并未接收到目标流量报文的情况下,即在终端设备并未完整接收到服务器返回的流量报文的情况下,生成表示该终端设备并未成功接收到针对消息请求报文返回的目标流量报文的报文接收结果,并将其添加至流量确认报文中,服务器可以响应该流量确认报文向终端设备发送流量重传报文,以便实现丢包重传,降低由于终端设备所接收的报文发生丢包的可能性。
在一种可能的实现方式中,终端设备接收服务器获取响应流量确认报文返回的流量重传报文,流量重传报文是报文接收结果标识的终端设备未接收到的流量报文,流量重传报文的源地址包括服务器加密地址。
当服务器根据流量确认报文确定终端设备存在未接收到的流量报文时,终端设备可以从服务器获取响应流量确认报文返回的流量重传报文,流量重传报文是指终端设备未接收到的需要重传的报文,终端设备通过获取流量重传报文可以实现对未接收到的流量报文的接收,其中,为了避免终端设备获取流量重传报文时,流量重传报文被攻击者截获之后获得该报文中源地址和目的地址之间的关系,流量重传报文中的源地址也被隐匿,当流量重传报文的源地址被隐匿时,为了进一步混淆攻击者且保持报文格式,流量重传报文的源地址还可以包括服务器隐匿地址。
终端设备获取响应流量确认报文返回的流量重传报文,以实现对未接收到的流量报文的再次接收,从而保证终端设备和服务器之间的报文传输的可靠性。
由此可见,终端设备通过交互报文来和服务器网络通信时,之间交互的消息请求报文和流量报文中的源地址均被通过接收端的公钥进行了加密,只有通过接收端的私钥解密后才能获得报文真实的源地址。对源地址进行隐匿的原因在于,由于报文在网络通信中一般会携带源地址和目的地址,以便实现正确的转发,然而一旦报文被攻击者截获,攻击者将得到源地址和目的地址这一关系,进而确定终端设备的用户何时上线并获取了哪些内容服务,从而推测出用户的隐私的信息。故通过加密报文的源地址,使得攻击者即使获取报文,也仅能知晓该报文的接收端,而无法确定报文的发送端,使得攻击者仅能得到碎片化的信息,而无法将碎片化的信息拼接,从而降低了通过报文的源地址和目的地址泄露用户隐私的可能。而且,作为数据接收端的终端设备也能通过自身私钥还原出所接收的报文的真实源地址,保证了报文接收的安全性。
在前述实施例中,会对终端设备和服务器之间的报文的源地址进行加密,从而降低通过报文的源地址和目的地址泄露用户隐私的可能。由于相关技术中网络通信主要是基于目的地址来进行转发的,如果擅自修改报文的目的地址,则会造成报文无法被正确转发,进而造成用户体验质量(QoE,Quality of Experience)和服务质量(QoS,Quality of Services)的下滑,故报文中仍然会有明文的目的地址,从而让该报文可以基于该目的地址被准确转发,保证终端设备和服务器之间的报文交互的可靠实现。
虽然终端设备和服务器之间的报文的源地址被加密可以在一定程度上降低通过报文的源地址和目的地址泄露用户隐私的可能,但是由于该报文中的目的地址并未被加密,还 是会存在用户隐私泄露的风险,故可以对终端设备和服务器之间网络通信过程中数量最多的流量报文的目的地址也进行加密,使得攻击者在获取流量报文时,不仅无法获取流量报文的发送端,也无法获取流量报文的接收端,从而进一步降低攻击者通过真实的源地址和目的地址推断出用户的隐私的信息的可能性。
在一种可能的实现方式中,S403中终端设备接收针对消息请求报文返回的流量报文,相应的,即服务器可以根据终端地址,向终端设备发送针对消息请求报文返回的流量报文,而在服务器根据终端地址向终端设备发送针对消息请求报文返回的流量报文方面,数据加密方法具体包括:
S11、服务器根据终端地址,确定从服务器到终端设备的流量链路,流量链路包括N个中间路由节点,N为大于等于1的整数;
S12、服务器通过流量链路中的N个中间路由节点,向终端设备发送针对消息请求报文返回的流量报文。
流量链路是指服务器和终端设备之间用于传输流量报文的链路,在服务器和终端设备的报文交互的实际过程中,由于服务器通常会向终端设备发送多条流量报文,为了能够得到稳定的链路来对流量报文进行可靠转发,可以由服务器根据终端地址确定从服务器到终端设备用于传输流量报文的流量链路,其中,流量链路包括N个中间路由节点。
中间路由节点是指流量链路包括的用于转发流量报文的路由节点,在服务器根据流量链路向终端设备发送流量报文的过程中,中间路由节点用于对流量报文进行转发,直至终端设备的上一跳路由节点将该流量报文顺利转发至终端设备。
为了能够让流量报文从服务器成功发送至终端设备,服务器可以先根据终端地址确定服务器到终端设备的流量链路,再通过该流量链路中的N个中间路由节点实现流量报文由服务器至终端设备的准确转发。
在服务器可以根据终端地址确定用于转发流量报文的流量链路的基础上,服务器可以先基于该流量链路向终端设备发送密钥创建报文,以获取该流量链路的中间路由节点的相关信息,即在一种可能的实现方式中,数据加密方法还包括:
S21、服务器根据终端地址和服务器地址,生成针对流量链路的流标识和共享密钥;
S22、服务器通过终端设备的公钥加密共享密钥,得到密钥加密数据;
S23、服务器通过流量链路,向终端设备发送包括密钥加密数据和流标识的密钥创建报文,密钥创建报文的源地址包括服务器加密地址,密钥创建报文用于指示N个中间路由节点根据流标识生成中间共享密钥,通过终端设备的公钥加密中间共享密钥,并将加密结果添加到密钥加密数据中。
如前所述,流量链路是指服务器和终端设备之间用于传输流量报文的链路,由于服务器和终端设备之间可以存在多条链路,故可以根据流标识来准确标识流量链路,即流标识是唯一标识流量链路的标识数据,例如,可以根据下述公式来确定流量链路的流标识:
FlowID=Hash(IP_m||IP_i||Port_server||Port_client||Protocol)
其中,FlowID表示流标识,IP_m表示服务器的服务器地址,IP_i表示终端设备的终端地址,Port_server表示服务器的服务器端口、Port_client表示终端设备的终端端口, Protocol表示服务器和终端设备之间的通信协议,Hash()表示哈希操作,||表示拼接操作。
根据上述公式可以确定服务器和终端设备之间用于传输流量报文的流量链路对应的流标识。
针对该流量链路的共享密钥是指服务器根据流标识计算的、与终端设备共享的密钥信息,共享密钥会在加密后由服务器发送给终端设备,在后续步骤中用于给终端设备向服务器发送的数据进行加密,也就是说,共享密钥虽然是服务器生成的,但是并不是服务器私有的,而是可以与终端设备共享的密钥信息。例如,可以根据下述公式计算针对该流量链路的共享密钥:
Key_share=Hash(info_server||FlowID)
其中,Key_share表示共享密钥,info_server表示服务器的自身私有信息,FlowID表示流标识,Hash()表示哈希操作,||表示拼接操作。
根据上述公式可以让服务器根据自身私有信息和流标识计算得到与终端设备共享的共享密钥。
在服务器根据流标识生成与终端设备共享的共享密钥之后,为了只让终端设备获取该共享密钥,可以根据终端设备的公钥对共享密钥进行加密,得到对应的密钥加密数据,例如,可以通过下述公式得到共享密钥对应的密钥加密数据:
Enc_share=Enc{Key_pub_client,Key_share}
其中,Enc_share表示密钥加密数据,Key_pub_client表示终端设备的公钥,Key_share表示共享密钥,Enc{α,β}表示使用密钥α对数据β进行加密操作。
根据上述公式可以让服务器通过终端设备的公钥对共享密钥进行加密,得到仅有终端设备可以解密的密钥加密数据。
在服务器获取了针对流量链路的流标识和密钥加密数据之后,服务器可以通过密钥创建报文向终端设备发送流标识和密钥加密数据,其中,为了避免密钥创建报文在转发时被攻击者截获之后获得该报文中源地址和目的地址之间的关系,密钥创建报文中的源地址也被隐匿,即密钥创建报文中的源地址也不为服务器地址,而是服务器加密地址,进而降低了攻击者通过密钥创建报文的源地址和目的地址来推断出用户的隐私的信息的可能性。当密钥创建报文的源地址被隐匿时,为了进一步混淆攻击者且保持报文格式,密钥创建报文的源地址还可以包括服务器隐匿地址,如图8所示,密钥创建报文(Pkt_key)中包括服务器隐匿地址IP_n、流标识FlowID、服务器加密地址IP_sec_server和密钥加密数据Enc_share。
需要说明的是,为了保证密钥创建报文能够被准确转发,本实施例中,密钥创建报文的目的地址并未被加密,即密钥创建报文中包括明文的终端设备的终端地址,以便密钥创建报文在网络通信中可以基于终端地址被准确转发至终端设备。
密钥创建报文通过流量链路中的中间路由节点可以由服务器转发至终端设备,在转发过程中,为了能够获取中间路由节点和服务器以及终端设备共享的中间共享密钥,中间共享密钥是指中间路由节点根据流标识计算的、与终端设备以及服务器共享的密钥信息,中间共享密钥会在加密后被添加到密钥创建报文中的密钥加密数据中,以便发送给终端设备, 并且在后续步骤中可以再由终端设备发送给服务器,以便服务器可以根据中间共享密钥对流量报文的目的地址进行加密,也就是说,中间共享密钥虽然是由中间路由节点生成的,但是并不是中间路由节点私有的,而是可以与终端设备以及服务器共享的密钥信息。例如,可以根据下述公式计算针对该流量链路的中间共享密钥:
Key_share_i=Hash(Info_i||FlowID)
其中,Key_share_i表示第i个中间路由节点的中间共享密钥,info_i表示第i个中间路由节点的自身私有信息,FlowID表示流标识,Hash()表示哈希操作,||表示拼接操作。
根据上述公式可以让流量链路中的每个中间路由节点根据自身私有信息和流标识,计算得到与终端设备以及服务器共享的中间共享密钥。
在中间路由节点根据流标识生成与终端设备和服务器共享的中间共享密钥之后,为了只让终端设备能够根据密钥确认报文获取该中间共享密钥,可以根据终端设备的公钥对中间共享密钥进行加密,得到对应的加密结果,例如,可以通过下述公式得到中间共享密钥对应的加密结果:
Enc_share_i=Enc{Key_pub_client,Key_share_i||IP_router_i}
其中,Enc_share_i表示第i个中间路由节点的中间共享密钥对应的加密结果,Key_pub_client表示终端设备的公钥,Key_share_i表示第i个中间路由节点的中间共享密钥,IP_router_i表示第i个中间路由节点的IP地址,Enc{α,β}表示使用密钥α对数据β进行加密操作,||表示拼接操作。
根据上述公式,可以让流量链路中每个中间路由节点在生成中间共享密钥之后,通过终端设备的公钥对中间共享密钥得到对应的加密结果,加密结果中每个中间路由节点的中间共享密钥与其IP地址一一对应。
在中间路由节点得到中间共享密钥对应的加密结果之后,为了能够让终端设备根据密钥创建报文获取该加密结果,如图9所示,图9中示例性的将流量链路中的中间路由节点确定为3个,以R1、R2和R3表示,其中,可以将流量链路中每个中间路由节点对应的加密结果(Enc_share_i)都添加到密钥创建报文(Pkt_key)中,图9中的“+=”符号表示在密钥创建报文中嵌入中间共享密钥的加密结果,该加密结果可以嵌入至密钥创建报文的头部的“扩展”部分。也可以嵌入至payload中,在此不做限定。将该加密结果添加到密钥创建报文中可以让终端设备通过密钥创建报文不仅可以获取共享密钥,还可以获取中间共享密钥。
也就是说,服务器在生成针对流量链路的流标识和共享密钥之后,通过流量链路可以向终端设备发送包括密钥加密数据(包括加密后的共享密钥)和流标识的密钥创建报文,在通过流量链路中的中间路由节点将该密钥创建报文向终端设备转发的过程中,密钥创建报文可以指示中间路由节点根据流标识生成中间共享密钥,并把加密后的中间共享密钥添加至该密钥加密数据中,以便后续步骤中终端设备在获取密钥创建报文之后,可以通过密钥创建报文中的密钥加密数据,获取流量链路中每个中间路由节点对应的中间共享密钥,为后续步骤中服务器根据中间共享密钥来加密流量报文中的目的地址这一步骤打下了基础,提高了报文传输的可靠性和安全性。
在一种可能的实现方式中,在S23中服务器通过流量链路向终端设备发送包括密钥加密数据和流标识的密钥创建报文之后,数据加密方法还包括:
S31、终端设备通过与服务器间的流量链路,接收服务器针对消息请求报文返回的密钥创建报文,密钥创建报文的源地址包括服务器加密地址,密钥创建报文包括通过终端设备的公钥加密得到的密钥加密数据;
S32、终端设备通过终端设备的私钥对密钥加密数据进行解密,得到终端设备与服务器间的共享密钥,以及N个中间共享密钥,这N个中间共享密钥与流量链路中的N个中间路由节点一一对应,N为大于等于1的整数;
S33、终端设备通过共享密钥对N个中间共享密钥进行加密,得到中间密钥加密数据;
S34、终端设备向服务器发送包括中间密钥加密数据的密钥确认报文,密钥确认报文的源地址包括终端加密地址。
终端设备可以通过流量链路,接收服务器发送的密钥创建报文,在获取密钥创建报文之后,需要确定密钥创建报文的源地址,以便对密钥创建报文做出准确响应,由于密钥创建报文中的源地址被隐匿,故可以通过对密钥创建报文中的服务器加密地址进行解密得到服务器的服务器地址。
如前所述,密钥创建报文包括密钥加密数据,密钥加密数据中不仅包括加密后的服务器与终端设备共享的共享密钥,还包括加密后的、流量链路中每个中间路由节点与终端设备以及服务器共享的中间共享密钥。
由于密钥加密数据是通过终端设备的公钥进行加密的,故可以通过终端设备的私钥对该密钥加密数据进行解密,得到终端设备和服务器之间共享的共享密钥,以及与流量链路中每个中间路由节点对应的中间共享密钥,例如,可以通过下述公式得到共享密钥:
Key_share=Dec{Key_pri_client,Enc_share}
其中,Key_share表示共享密钥,Key_pri_client表示终端设备的私钥,Enc_share表示共享密钥对应的密钥加密数据,Dec{α,β}表示使用密钥α对数据β进行解密操作。
也可以通过下述公式得到中间共享密钥:
Key_share_i,IP_router_i=Dec{Key_pri_client,Enc_share_i}
其中,Key_share_i表示第i个中间路由节点的中间共享密钥,IP_router_i表示第i个中间路由节点的IP地址,Key_pri_client表示终端设备的私钥,Enc_share_i表示第i个中间路由节点的中间共享密钥对应的加密结果,Dec{α,β}表示使用密钥α对数据β进行解密操作。
在终端设备获取到流量链路中每个中间路由节点对应的中间共享密钥之后,需要向服务器发送该中间共享密钥,为了仅让服务器可以获取该中间共享密钥,可以通过终端设备和服务器之间的共享密钥,对该N个中间共享密钥进行加密,得到中间密钥加密数据。例如,可以根据下述公式计算中间密钥加密数据:
Enc_share_server_i=Enc{Key_share,Key_share_i||IP_router_i}
其中,Enc_share_server_i表示第i个中间路由节点的中间密钥加密数据,Key_share表示共享密钥,Key_share_i表示第i个中间路由节点的中间共享密钥,IP_router_i表示第 i个中间路由节点的IP地址,Enc{α,β}表示使用密钥α对数据β进行加密操作,||表示拼接操作。
根据上述公式,可以通过共享密钥对中间共享密钥进行加密,得到对应的中间密钥加密数据,中间密钥加密数据中每个中间路由节点的中间共享密钥与其IP地址一一对应。
终端设备可以通过向服务器发送包括中间密钥加密数据的密钥确认报文,让服务器通过获取密钥确认报文,来获取流量链路中每个中间路由节点对应的中间共享密钥,为后续步骤中根据中间共享密钥来对流量报文的目的地址的加密打下了基础。
为了避免密钥确认报文在转发时被攻击者截获之后获得该报文中源地址和目的地址之间的关系,密钥确认报文中的源地址也被隐匿,即密钥确认报文中的源地址也不为终端地址,而是终端加密地址,进而降低了攻击者通过密钥确认报文的源地址和目的地址来推断出用户的隐私的信息的可能性。当密钥确认报文的源地址被隐匿时,为了进一步混淆攻击者且保持报文格式,密钥确认报文的源地址还可以包括终端隐匿地址,如图10所示,密钥确认报文(Pkt_key_ack)中包括终端隐匿地址IP_j、终端加密地址IP_sec和中间密钥加密数据Enc_share_server_i。
需要说明的是,为了保证密钥确认报文能够被准确转发,本实施例中,密钥确认报文的目的地址并未被加密,即密钥确认报文中包括明文的服务器的服务器地址,以便密钥确认报文在网络通信中可以基于服务器地址被准确转发至服务器。
此外,如图10所示,密钥确认报文并不需要基于上述流量链路从终端设备转发至服务器,也就是说,密钥确认报文只需基于服务器地址从终端设备成功转发至服务器即可,并不需要一定根据流量链路中的中间路由节点进行转发。
终端设备在获取了密钥创建报文之后,可以通过密钥创建报文中的密钥加密数据,确定用于传输流量报文的流量链路中的每个中间路由节点对应的中间共享密钥,并通过向服务器发送包括中间密钥加密数据(根据共享密钥加密后的中间共享密钥)的密钥确认报文,使服务器可以获取中间路由节点对应的中间共享密钥,为后续步骤中服务器可以根据中间共享密钥来加密流量报文的目的地址打下了基础,提高了报文传输的可靠性和安全性。
在一种可能的实现方式中,在S34中终端设备向服务器发送包括中间密钥加密数据的密钥确认报文之后,数据加密方法还包括:
S41、服务器接收终端设备响应密钥创建报文返回的密钥确认报文,密钥确认报文的源地址包括终端加密地址,密钥确认报文包括中间密钥加密数据,中间密钥加密数据为通过共享密钥对N个中间共享密钥加密得到的,N个中间共享密钥与N个中间路由节点一一对应;
S42、服务器通过共享密钥对中间密钥加密数据进行解密,得到N个中间共享密钥;
S43、服务器根据N个中间共享密钥和N个中间路由节点的路由地址,得到N个中间路由节点各自对应的加密路由信息,针对N个中间路由节点中的第i个中间路由节点,其对应的加密路由信息是通过第i个中间路由节点对应的中间共享密钥对第i个中间路由节点的路由信息、以及第i个中间路由节点的下一跳节点的路由信息加密得到的;
S44、服务器将加密路由信息添加到流量报文中,流量报文的的目的地址是通过目标 中间共享密钥对终端地址加密得到的,目标中间共享密钥为流量链路中终端设备的上一跳中间路由节点的中间共享密钥。
服务器可以接收终端设备返回的密钥确认报文,服务器在接收密钥确认报文之后,需要确定密钥确认报文的源地址,以便能够确定终端设备已成功获取了密钥创建报文且返回了对应的密钥确认报文,由于密钥确认报文中的源地址被隐匿,故可以通过对密钥确认报文中的终端加密地址进行解密,确定密钥确认报文的真实源地址为终端设备的终端地址。
由于密钥确认报文中包括中间密钥加密数据,如前所述,中间密钥加密数据为终端设备通过共享密钥对流量链路中每个中间路由节点对应的的中间共享密钥进行加密得到的,且共享密钥是终端设备和服务器之间共享的密钥信息,故服务器可以根据共享密钥对中间密钥加密数据进行解密,得到流量链路中每个中间路由节点对应的中间共享密钥,例如,可以通过下述公式得到中间共享密钥:
Key_share_i,IP_router_i=Dec{Key_share,Enc_share_server_i}
其中,Key_share_i表示第i个中间路由节点的中间共享密钥,IP_router_i表示第i个中间路由节点的IP地址,Key_share表示共享密钥,Enc_share_server_i表示第i个中间路由节点的中间密钥加密数据,Dec{α,β}表示使用密钥α对数据β进行解密操作。
通过上述公式,服务器可以根据共享密钥对中间密钥加密数据进行解密,得到流量链路中每个中间路由节点对应的中间共享密钥。
在服务器获取了流量链路中每个中间路由节点对应的中间共享密钥之后,可以对中间共享密钥进行保存,以便后续在生成基于流量链路传输的流量报文时,可以直接获取已保存的中间共享密钥来对流量链路中的每个中间路由节点进行加密。
服务器在获取了流量链路中每个中间路由节点对应的中间共享密钥之后,为了能够对基于流量链路传输的流量报文的目的地址进行加密,可以基于流量链路中每个中间路由节点的路由信息、下一跳节点的路由信息和对应的中间共享密钥,来为每个中间路由节点确定用于指示其下一跳节点的加密路由信息,从而对流量链路中每个中间路由节点进行加密,其中,终端地址则作为流量链路中终端设备的上一跳中间路由节点的下一跳节点的路由信息,也被对应的目标中间共享密钥进行了加密,目标中间共享密钥是指终端设备的上一跳中间路由节点对应的中间共享密钥。中间路由节点的加密路由信息是指被对应的中间共享密钥加密的、用于指示其下一跳节点的信息数据,例如,可以通过下述公式得到流量链路中每个中间路由节点对应的加密路由信息:
Enc_routing_i=Enc{Key_share_i,IP_router_i||IP_router_i+1}
其中,Enc_routing_i表示第i个中间路由节点的加密路由信息,Key_share_i表示第i个中间路由节点的中间共享密钥,IP_router_i表示第i个中间路由节点的IP地址,,IP_router_i+1表示第i个中间路由节点的下一跳节点的IP地址,Enc{α,β}表示使用密钥α对数据β进行加密操作,||表示拼接操作。
根据上述公式,可以通过第i个中间路由节点对应的中间共享密钥对第i个中间路由节点的下一跳节点的路由信息进行加密,得到对应的加密路由信息。通过加密路由信息可以使得流量链路中的中间路由节点仅能获取下一跳节点的路由信息,减少了攻击者通过劫 持中间路由节点来获取流量报文的目的地址的风险。
当服务器将加密路由信息添加至流量报文中时,流量链路中每个中间路由节点在收到该流量报文后,就可以根据该中间路由节点对应的中间共享密钥对加密路由信息进行解密,得到该中间路由节点的路由信息和对应的下一跳节点的路由信息,例如,可以通过下述公式得到解密后的路由信息:
IP_router_i,IP_router_i+1=Dec{Key_share_i,Enc_routing_i}
其中,IP_router_i表示第i个中间路由节点的IP地址,,IP_router_i+1表示第i个中间路由节点的下一跳节点的IP地址,Key_share_i表示第i个中间路由节点的中间共享密钥,Enc_routing_i表示第i个中间路由节点的加密路由信息,Dec{α,β}表示使用密钥α对数据β进行解密操作。
通过上述公式,可以根据第i个中间路由节点的中间共享密钥对加密路由信息进行解密,得到第i个中间路由节点的IP地址和下一跳节点的IP地址。若第i个中间路由节点的IP地址和自身IP地址相符,就可以将流量报文转发至下一跳节点的IP地址;若第i个中间路由节点的IP地址和自身IP地址不相符,则可以将该流量报文直接丢弃。也就是说,当中间路由节点根据其对应的中间共享密钥对加密路由信息进行解密之后,会得到某个中间路由节点的路由信息和对应的下一跳节点的路由信息,若该某个中间路由节点的路由信息与该中间路由节点的自身路由信息一致,则该中间路由节点就可以将该流量报文转发至下一跳节点,即通过加密路由信息可以完成流量报文在流量链路上的依次转发。
服务器可以将加密路由信息添加到流量报文中,进而使得该流量报文可以不包括明文的目的地址,而是让流量链路中每个中间路由节点根据其对应的加密路由信息将该流量报文依次转发至下一跳节点处,直至该流量报文被成功转发至终端设备,其中,终端地址就被流量链路中该终端设备的上一跳中间路由节点对应的目标中间共享密钥实现了加密,具体的,终端地址作为终端设备的上一跳中间路由节点的下一跳节点的路由信息,可以通过目标中间共享密钥被加密在该上一跳中间路由节点的加密路由信息中,从而实现了对流量报文中的目的地址的加密。
此外,流量报文中的源地址依然被隐匿,即流量报文中的源地址不为服务器地址,而是服务器加密地址。当流量报文的源地址和目的地址都被隐匿时,为了进一步混淆攻击者且保持报文格式,流量报文的源地址还可以包括服务器隐匿地址,相应的,流量报文的目的地址还可以包括终端隐匿地址,如图11所示,流量报文(Pkt_traffic)中可以包括服务器隐匿地址IP_n、终端隐匿地址IP_j、服务器加密地址IP_sec_server和加密路由信息Enc_routing_i。
服务器在根据密钥确认报文获取流量链路中每个中间路由节点对应的中间共享密钥之后,可以根据该中间共享密钥,加密流量链路中每个中间路由节点的下一跳路由信息,从而让流量报文在不包括明文的目的地址的情况下,根据加密路由信息被准确转发至终端设备。也就是说,流量报文在对源地址实现了加密的基础上,可以通过加密路由信息对目的地址也实现了加密,使得攻击者在截取了流量报文时,不仅无法获取流量报文的发送端,也无法获取流量报文的接收端,从而进一步降低了流量报文中源地址和目的地址被攻击者 推测出的可能,提高了报文传输的安全性。
相应的,在一种可能的实现方式中,在S403中终端设备接收针对消息请求报文返回的流量报文中,数据加密方法具体包括:
终端设备通过流量链路,接收服务器针对消息请求报文返回的流量报文,流量报文的目的地址是通过目标中间共享密钥对终端地址加密得到的,目标中间共享密钥为流量链路中终端设备的上一跳中间路由节点的中间共享密钥。
当服务器将加密路由信息添加至流量报文时,流量链路中的中间路由节点可以对加密路由信息进行解密,从而让流量报文通过流量链路中的中间路由节点依次转发至终端设备。此时,流量报文中并不包括明文的终端地址,而是通过流量链路中目标中间共享密钥(终端设备的上一跳中间路由节点对应的中间共享密钥)对终端地址进行了加密,使得该流量报文的源地址和目的地址均通过被加密在报文中实现了隐匿。
在流量报文的源地址被加密的基础上,还可以通过目标中间共享密钥对目的地址进行加密,此时,流量报文可以根据流量链路中的中间路由节点被依次转发至终端设备,也就是说,流量报文可以在源地址和目的地址均被加密的情况下,实现由服务器至终端设备的成功转发,从而进一步降低了流量报文中的源地址和目的地址被攻击者推测出的可能,提高了报文传输的安全性。
服务器在获取了终端设备发送的密钥确认报文之后,需要根据共享密钥来对密钥确认报文中的中间密钥加密数据进行解密,如果服务器为此一直维护与终端设备共享的共享密钥,这无疑会加大服务器的负担,故在一种可能的实现方式中,在S42中根据共享密钥对中间密钥加密数据进行解密之前,服务器可以通过如下方式获取共享密钥:
服务器通过服务器的私钥对终端加密地址进行解密,得到终端地址;
服务器根据终端地址和服务器地址,生成针对流量链路的流标识;
服务器通过终端地址和流标识生成共享密钥。
由于密钥确认报文中包括终端加密地址,故可以根据服务器的私钥对终端加密地址进行解密,得到终端地址。服务器可以根据终端地址和服务器地址,再次生成针对流量链路的流标识,例如,可以根据下述公式来确定流量链路的流标识:
FlowID=Hash(IP_m||IP_i||Port_server||Port_client||Protocol)
其中,FlowID表示流标识,IP_m表示服务器的服务器地址,IP_i表示终端设备的终端地址,Port_server表示服务器的服务器端口、Port_client表示终端设备的终端端口,Protocol表示服务器和终端设备之间的通信协议,Hash()表示哈希操作,||表示拼接操作。
服务器在确定了流量链路的流标识的基础上,可以根据终端地址和流标识再次确定和终端设备对应的共享密钥,例如,可以根据下述公式计算针对该流量链路的共享密钥:
Key_share=Hash(info_server||FlowID)
其中,Key_share表示共享密钥,info_server表示服务器的自身私有信息,FlowID表示流标识,Hash()表示哈希操作,||表示拼接操作。
服务器无需一直维护与终端设备共享的共享密钥,当需要根据共享密钥对密钥确认报文中的中间密钥加密数据进行解密时,服务器可以根据终端地址和服务器地址再次生成流 量链路对应的流标识和共享密钥,并通过直接生成的共享密钥,对中间密钥加密数据进行解密,从而降低服务器用于维护共享密钥的成本。
同理,为了避免中间路由节点用于维护中间共享密钥的成本,在一种可能的实现方式中,流量报文还包括流标识,流标识用于指示中间路由节点根据流标识生成对应的中间共享密钥,并通过中间共享密钥对加密路由信息进行解密,得到下一跳节点的路由信息。
当流量报文包括加密路由信息时,中间路由节点需要基于对应的中间共享密钥来对加密路由信息进行解密,以得到下一跳节点的路由信息,而中间路由节点如果为此一直维护中间共享密钥显然会造成一定的成本,故让流量报文中还可以包括流标识,如图11所示,流量报文(Pkt_traffic)中还可以包括流标识FlowID,以便中间路由节点可以根据流标识直接生成对应的中间共享密钥,例如,可以根据下述公式计算中间共享密钥:
Key_share_i=Hash(Info_i||FlowID)
其中,Key_share_i表示第i个中间路由节点的中间共享密钥,info_i表示对应的第i个中间路由节点的自身私有信息,FlowID表示流标识,Hash()表示哈希操作,||表示拼接操作。
中间路由节点无需一直维护与终端设备和服务器共享的中间共享密钥,当需要根据中间共享密钥对流量报文中的加密路由信息进行解密时,中间路由节点可以根据流标识再次生成对应的中间共享密钥,以便降低中间路由节点用于维护中间共享密钥的成本。
下面通过一个方法实施例,对本申请中的数据加密方法在实际情况中的具体流程进行说明,如图12所示,该数据加密方法的具体流程包括:
S1201、终端设备发送携带终端隐匿地址和终端加密地址的消息请求报文。
终端设备向服务器发送消息请求报文,该消息请求报文可以用于向服务器请求获取目标内容,其中,消息请求报文中不包括明文的终端地址,而是将终端加密地址携带于消息请求报文中,以便通过源地址加密的方式实现对于消息请求报文中源地址的隐匿,并为了进一步混淆攻击者和保持报文格式,消息请求报文还携带有终端隐匿地址。
S1202、服务器发送密钥创建报文。
服务器在获取了消息请求报文之后,为了获取用于传输流量报文的流量链路包括的中间路由节点对应的中间共享密钥,服务器会发送密钥创建报文,其中,密钥创建报文中也不包括明文的服务器地址,而是将服务器加密地址携带于密钥创建报文中,以便通过对源地址加密的方式实现对于密钥创建报文的源地址的隐匿,并为了进一步混淆攻击者和保持报文格式,密钥创建报文还携带有服务器隐匿地址。
同时,密钥创建报文中还携带有服务器和终端设备之间共享的共享密钥和流量链路对应的流标识。
S1203、中间路由节点计算中间共享密钥,并加密后嵌入至密钥创建报文中
中间路由节点在转发密钥创建报文时,会通过自身信息和流标识信息计算得到对应的中间共享密钥,并将计算的中间共享密钥通过目的地址(终端设备)对应的公钥加密后嵌入至密钥创建报文中,以便终端设备可以通过密钥创建报文获取中间共享密钥。
S1204、终端设备解密得到中间共享密钥,并加密后通过密钥确认报文回传至服务器。
终端设备在获取密钥创建报文之后,可以根据自身私钥解密该密钥创建报文中携带的加密后的中间共享密钥信息,并将得到的中间共享密钥通过和服务器共享的共享密钥加密后嵌入至密钥确认报文中,以便将加密后的中间共享密钥可以通过密钥确认报文回传至服务器,其中,密钥确认报文中也不包括明文的终端地址,而是将终端加密地址携带于密钥确认报文中,以便通过对源地址加密的方式实现对于密钥确认报文中源地址的隐匿,并为了进一步混淆攻击者和保持报文格式,密钥确认报文还携带有终端隐匿地址。
S1205、服务器解密得到中间共享密钥,并使用中间共享密钥加密流量链路的路由信息。
服务器在收到密钥确认报文之后,通过与终端设备共享的共享密钥可以解密密钥确认报文中携带的加密后的中间共享密钥信息,获得与流量链路的中间路由节点共享的中间共享密钥,并通过中间共享密钥加密流量链路中的中间路由节点的路由信息,得到对应的加密路由信息,将该加密路由信息添加至流量报文中可以使得流量报文在不包括明文的目的地址的情况下,通过该流量报文携带的加密后中间路由节点每一跳对应的路由信息来完成流量报文的转发,也就是说,流量报文可以通过中间共享密钥实现目的地址的加密,在此基础上,流量报文依然能够对源地址也进行加密,从而对流量报文中源地址和目的地址均实现隐匿。
S1206、中间路由节点计算中间共享密钥,并验证流量报文中的加密路由信息。
中间路由节点在收到流量报文之后,中间路由节点可以根据流标识再次计算中间共享密钥,并使用中间共享密钥来对流量报文中的携带的加密路由信息进行解密,以获取解密后的路由信息和对应的下一跳节点的路由信息。
S1207、中间路由节点验证中间路由节点的自身路由信息与解密后的路由信息是否一致。
中间路由节点在对流量报文携带的加密路由信息进行解密之后,需要验证中间路由节点的自身路由信息与解密后的路由信息是否一致。
S1208a、若中间路由节点的自身路由信息与解密后的路由信息一致,则可以将该流量报文转发至下一跳节点,以实现流量报文在流量链路的依次转发。
S1208b、若中间路由节点的自身路由信息与解密后的路由信息不一致,中间路由节点则可以丢弃该报文。
S1209、终端设备发送流量确认报文至服务器,以便丢包重传。
终端设备在收到流量报文之后,可以向服务器发送流量确认报文,流量确认报文用于让服务器可以获知终端设备的丢包信息,并在终端设备丢包时可以通过再次发送流量报文的方式来对丢包数据进行重传,流量确认报文也不包括明文的终端地址,而是将终端加密地址携带至流量确认报文中,以便通过对源地址加密的方式实现对于流量确认报文中源地址的隐匿,并为了进一步混淆攻击者和保持报文格式,流量确认报文还携带有终端隐匿地址。
如图13所示,采用上述数据加密方法,以服务器和终端设备B的网络通信为例,可以对服务器和终端设备之间的网络通信进行说明,本申请可以通过加密了源地址的消息请 求报文、加密了源地址的密钥创建报文、加密了源地址的密钥确认报文、加密了源地址和目的地址的流量报文和加密了源地址的流量确认报文,来实现终端设备B和服务器之间的网络通信,并在报文交互过程中,服务器和终端设备之间交互的报文源地址和目的地址之间至少有一个被加密,并且对数量最多的流量报文中的源地址和目的地址均实现了加密,从而降低了攻击者通过源地址和目的地址来获取用户隐私的可能,增强了报文交互的安全性。
在前述图1-13所对应的实施例的基础上,图14为本申请实施例提供的一种数据加密装置的装置结构图,数据加密装置1400包括发送单元1401、获取单元1402、解密单元1403和接收单元1404:
发送单元1401,用于向服务器发送消息请求报文,消息请求报文的源地址包括终端加密地址,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的;
获取单元1402,用于接收服务器针对消息请求报文返回的流量报文,流量报文的源地址包括服务器加密地址,服务器加密地址是通过终端设备的公钥对服务器的服务器地址加密得到的;
解密单元1403,用于通过终端设备的私钥对服务器加密地址进行解密,得到服务器待定地址;
接收单元1404,用于响应于服务器待定地址与服务器地址一致,获取流量报文中的流量数据。
在一种可能的实现方式中,消息请求报文的源地址还包括终端隐匿地址,终端隐匿地址为与终端地址不同的虚拟终端地址;流量报文的源地址还包括服务器隐匿地址,服务器隐匿地址为与服务器地址不同的虚拟服务器地址。
在一种可能的实现方式中,发送单元1401还用于:
通过与服务器间的流量链路,接收服务器针对消息请求报文返回的密钥创建报文,密钥创建报文的源地址包括服务器加密地址,密钥创建报文包括通过终端设备的公钥加密得到的密钥加密数据;
通过终端设备的私钥对密钥加密数据进行解密,得到终端设备与服务器间的共享密钥、以及N个中间共享密钥,N个中间共享密钥与流量链路中的N个中间路由节点一一对应,N为大于等于1的整数;
通过共享密钥对N个中间共享密钥进行加密,得到中间密钥加密数据;
向所述服务器发送包括中间密钥加密数据的密钥确认报文,密钥确认报文的源地址包括终端加密地址。
在一种可能的实现方式中,获取单元1402用于通过流量链路,接收服务器针对消息请求报文返回的的流量报文,流量报文的目的地址是通过目标中间共享密钥对终端地址加密得到的,目标中间共享密钥为流量链路中终端设备的上一跳中间路由节点的中间共享密钥。
在一种可能的实现方式中,发送单元1401还用于:
确定针对流量报文的报文接收结果;
向服务器发送包括报文接收结果的流量确认报文,流量确认报文的源地址包括终端加密地址。
在一种可能的实现方式中,获取单元1402还用于:
接收服务器获取响应流量确认报文返回的流量重传报文,流量重传报文是根据报文接收结果标识的终端设备未接收到的流量报文,流量重传报文的源地址包括服务器加密地址。
在前述图1-13所对应的实施例的基础上,图15为本申请实施例提供的另一种数据加密装置的装置结构图,数据加密装置1500包括获取单元1501,解密单元1502,发送单元1503;
获取单元1501,用于接收终端设备发送的消息请求报文,消息请求报文的源地址包括终端加密地址,终端加密地址是通过服务器的公钥对终端设备的终端地址加密得到的;
解密单元1502,用于通过服务器的私钥对终端加密地址进行解密,得到终端地址;
发送单元1503,用于根据终端地址,向终端设备发送针对消息请求报文返回的流量报文,流量报文的源地址包括服务器加密地址,服务器加密地址是通过终端设备的公钥对服务器的服务器地址加密得到的。
在一种可能的实现方式中,发送单元1503用于:
根据终端地址,确定从服务器到终端设备的流量链路,流量链路包括N个中间路由节点,N为大于等于1的整数;
通过流量链路中的N个中间路由节点,向所终端设备发送针对消息请求报文返回的流量报文。
在一种可能的实现方式中,发送单元1503还用于:
根据终端地址和服务器地址,生成针对流量链路的流标识和共享密钥;
通过终端设备的公钥加密共享密钥,得到密钥加密数据;
通过流量链路,向终端设备发送包括密钥加密数据和流标识的密钥创建报文,密钥创建报文的源地址包括服务器加密地址,密钥创建报文用于指示N个中间路由节点根据流标识生成中间共享密钥,通过终端设备的公钥加密中间共享密钥,并将加密结果添加到密钥加密数据中。
在一种可能的实现方式中,获取单元1501还用于:
接收终端设备响应密钥创建报文返回的密钥确认报文,密钥确认报文的源地址包括终端加密地址,密钥确认报文包括中间密钥加密数据,中间密钥加密数据为通过共享密钥对N个中间共享密钥加密得到的,N个中间共享密钥与N个中间路由节点一一对应;
通过共享密钥对中间密钥加密数据进行解密,得到N个中间共享密钥;
根据N个中间共享密钥和N个中间路由节点的路由地址,得到N个中间路由节点各自对应的加密路由信息,针对N个中间路由节点中的第i个中间路由节点,其对应的加密路由信息是通过第i个中间路由节点对应的中间共享密钥对第i个中间路由节点的路由信息、以及第i个中间路由节点的下一跳节点的路由信息加密得到的;
将加密路由信息添加到流量报文中,流量报文的目的地址是通过目标中间共享密钥对终端地址加密得到的,目标中间共享密钥为流量链路中终端设备的上一跳中间路由节点的 中间共享密钥。
在一种可能的实现方式中,获取单元1501还用于:
通过服务器的私钥对终端加密地址进行解密,得到终端地址;
根据终端地址和服务器地址,生成针对流量链路的流标识;
通过终端地址和流标识生成共享密钥。
在一种可能的实现方式中,流量报文还包括流标识,流标识用于指示中间路由节点根据流标识生成对应的中间共享密钥,并通过中间共享密钥对加密路由信息进行解密,得到下一跳节点的路由信息。
在一种可能的实现方式中,发送单元1503还用于:接收终端设备发送的包括报文接收结果的流量确认报文,流量确认报文的源地址包括终端加密地址,报文接收结果用于标识终端设备对流量报文的接收状态;
当根据报文接收结果确定终端设备未接收到目标流量报文时,向终端设备发送作为流量重传报文的目标流量报文,流量重传报文的源地址包括服务器加密地址。
在前述图1-13所对应的实施例的基础上,图16为本申请实施例提供的一种数据加密系统的系统结构图,数据加密系统1600包括终端设备1601和服务器1602,终端设备1601用于执行前述方法实施例的方法,服务器1602用于执行前述方法实施例的方法。
私的信本申请实施例还提供了一种计算机设备,该计算机设备为前述介绍的计算机设备,可以包括终端设备或服务器,前述的数据加密装置可以配置在该计算机设备中。下面结合附图对该计算机设备进行介绍。
若该计算机设备为终端设备,请参见图17所示,本申请实施例提供了一种终端设备,以终端设备为手机为例:
图17示出的是与本申请实施例提供的终端设备相关的手机的部分结构的框图。参考图17,手机包括:射频(Radio Frequency,简称RF)电路1410、存储器1420、输入单元1430、显示单元1440、传感器1450、音频电路1460、无线保真(简称WiFi)模块1470、处理器1480、以及电源1490等部件。本领域技术人员可以理解,图17中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图17对手机的各个构成部件进行具体的介绍:
RF电路1410可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器1480处理;另外,将设计上行的数据发送给基站。
存储器1420可用于存储软件程序以及模块,处理器1480通过运行存储在存储器1420的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器1420可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器1420可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元1430可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。具体地,输入单元1430可包括触控面板1431以及其他输入设备1432。
显示单元1440可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元1440可包括显示面板1441。
手机还可包括至少一种传感器1450,比如光传感器、运动传感器以及其他传感器。
音频电路1460、扬声器1461,传声器1462可提供用户与手机之间的音频接口。
WiFi属于短距离无线传输技术,手机通过WiFi模块1470可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。
处理器1480是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1420内的软件程序和/或模块,以及调用存储在存储器1420内的数据,执行手机的各种功能和处理数据。
手机还包括给各个部件供电的电源1490(比如电池)。
在本实施例中,该终端设备所包括的处理器1480还用于执行本申请实施例提供的终端设备侧的数据加密方法。
若计算机设备为服务器,本申请实施例还提供一种服务器,请参见图18所示,图18为本申请实施例提供的服务器1500的结构图,服务器1500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(Central Processing Units,简称CPU)1522(例如,一个或一个以上处理器)和存储器1532,一个或一个以上存储应用程序1542或数据1544的存储介质1530(例如一个或一个以上海量存储设备)。其中,存储器1532和存储介质1530可以是短暂存储或持久存储。存储在存储介质1530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对服务器中的一系列指令操作。更进一步地,中央处理器1522可以设置为与存储介质1530通信,在服务器1500上执行存储介质1530中的一系列指令操作。
服务器1500还可以包括一个或一个以上电源1526,一个或一个以上有线或无线网络接口1550,一个或一个以上输入输出接口1558,和/或,一个或一个以上操作系统1541,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
上述实施例中由服务器所执行的步骤可以基于图18所示的服务器结构。
另外,本申请实施例还提供了一种存储介质,所述存储介质用于存储计算机程序,所述计算机程序用于执行上述实施例提供的方法。
本申请实施例还提供了一种包括指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例提供的方法。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质可以是下述介质中的至少一种:只读存储器(英文:Read-only Memory,缩写:ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述,仅为本申请的一种具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本申请的保护范围之内。而且本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。因此,本申请的保护范围应该以权利要求的保护范围为准。

Claims (19)

  1. 一种数据加密方法,所述方法由终端设备执行,所述方法包括:
    向服务器发送消息请求报文,所述消息请求报文的源地址包括终端加密地址,所述终端加密地址是通过所述服务器的公钥对所述终端设备的终端地址加密得到的;
    接收所述服务器针对所述消息请求报文返回的流量报文,所述流量报文的源地址包括服务器加密地址,所述服务器加密地址是通过所述终端设备的公钥对所述服务器的服务器地址加密得到的;
    通过所述终端设备的私钥对所述服务器加密地址进行解密,得到服务器待定地址;
    响应于所述服务器待定地址与所述服务器地址一致,获取所述流量报文中的流量数据。
  2. 根据权利要求1所述的方法,所述消息请求报文的源地址还包括终端隐匿地址,所述终端隐匿地址为与所述终端地址不同的虚拟终端地址;所述流量报文的源地址还包括服务器隐匿地址,所述服务器隐匿地址为与所述服务器地址不同的虚拟服务器地址。
  3. 根据权利要求1或2所述的方法,所述方法还包括:
    通过与所述服务器间的流量链路,接收所述服务器针对所述消息请求报文返回的密钥创建报文,所述密钥创建报文的源地址包括所述服务器加密地址,所述密钥创建报文包括通过所述终端设备的公钥加密得到的密钥加密数据;
    通过所述终端设备的私钥对所述密钥加密数据进行解密,得到所述终端设备与所述服务器间的共享密钥以及N个中间共享密钥,所述N个中间共享密钥与所述流量链路中的N个中间路由节点一一对应,所述N为大于等于1的整数;
    通过所述共享密钥对所述N个中间共享密钥进行加密,得到中间密钥加密数据;
    向所述服务器发送包括所述中间密钥加密数据的密钥确认报文,所述密钥确认报文的源地址包括所述终端加密地址。
  4. 根据权利要求3所述的方法,所述接收所述服务器针对所述消息请求报文返回的流量报文,包括:
    通过所述流量链路,接收所述服务器针对所述消息请求报文返回的所述流量报文,所述流量报文的目的地址是通过目标中间共享密钥对所述终端地址加密得到的,所述目标中间共享密钥为所述流量链路中所述终端设备的上一跳中间路由节点对应的中间共享密钥。
  5. 根据权利要求1至4任一项所述的方法,所述方法还包括:
    确定针对所述流量报文的报文接收结果;
    向所述服务器发送包括所述报文接收结果的流量确认报文,所述流量确认报文的源地址包括所述终端加密地址。
  6. 根据权利要求5所述的方法,所述方法还包括:
    接收所述服务器获取响应所述流量确认报文返回的流量重传报文,所述流量重传报文是所述报文接收结果标识的所述终端设备未接收到的流量报文,所述流量重传报文的源地址包括所述服务器加密地址。
  7. 一种数据加密方法,所述方法由服务器执行,所述方法包括:
    接收终端设备发送的消息请求报文,所述消息请求报文的源地址包括终端加密地址, 所述终端加密地址是通过所述服务器的公钥对所述终端设备的终端地址加密得到的;
    通过所述服务器的私钥对所述终端加密地址进行解密,得到所述终端地址;
    根据所述终端地址,向所述终端设备发送针对所述消息请求报文返回的流量报文,所述流量报文的源地址包括服务器加密地址,所述服务器加密地址是通过所述终端设备的公钥对所述服务器的服务器地址加密得到的。
  8. 根据权利要求7所述的方法,所述根据所述终端地址,向所述终端设备发送针对所述消息请求报文返回的流量报文,包括:
    根据所述终端地址,确定从所述服务器到所述终端设备的流量链路,所述流量链路包括N个中间路由节点,所述N为大于等于1的整数;
    通过所述流量链路中的所述N个中间路由节点,向所述终端设备发送所述流量报文。
  9. 根据权利要求8所述的方法,所述方法还包括:
    根据所述终端地址和所述服务器地址,生成针对所述流量链路的流标识和共享密钥;
    通过所述终端设备的公钥加密所述共享密钥,得到密钥加密数据;
    通过所述流量链路,向所述终端设备发送包括所述密钥加密数据和所述流标识的密钥创建报文,所述密钥创建报文的源地址包括所述服务器加密地址,所述密钥创建报文用于指示所述N个中间路由节点根据所述流标识生成中间共享密钥,并通过所述终端设备的公钥加密所述中间共享密钥,并将加密结果添加到所述密钥加密数据中。
  10. 根据权利要求9所述的方法,所述方法还包括:
    接收所述终端设备响应所述密钥创建报文返回的密钥确认报文,所述密钥确认报文的源地址包括所述终端加密地址,所述密钥确认报文包括中间密钥加密数据,所述中间密钥加密数据为通过所述共享密钥对N个中间共享密钥加密得到的,所述N个中间共享密钥与所述N个中间路由节点一一对应;
    通过所述共享密钥对所述中间密钥加密数据进行解密,得到所述N个中间共享密钥;
    根据所述N个中间共享密钥和所述N个中间路由节点的路由地址,得到所述N个中间路由节点各自对应的加密路由信息,针对所述N个中间路由节点中的第i个中间路由节点,其对应的加密路由信息是通过所述第i个中间路由节点对应的中间共享密钥,对所述第i个中间路由节点的路由信息、以及第i个中间路由节点的下一跳节点的路由信息加密得到的;
    将所述加密路由信息添加到所述流量报文中,所述流量报文的目的地址是通过目标中间共享密钥对所述终端地址加密得到的,所述目标中间共享密钥为所述流量链路中所述终端设备的上一跳中间路由节点的中间共享密钥。
  11. 根据权利要求10所述的方法,在所述通过所述共享密钥对所述中间密钥加密数据进行解密,得到所述N个中间共享密钥之前,所述方法还包括:
    通过所述服务器的私钥对所述终端加密地址进行解密,得到所述终端地址;
    根据所述终端地址和所述服务器地址,生成针对所述流量链路的流标识;
    通过所述终端地址和所述流标识生成所述共享密钥。
  12. 根据权利要求9至11任一项所述的方法,所述流量报文还包括流标识,所述流 标识用于指示所述中间路由节点根据所述流标识生成对应的中间共享密钥,并通过所述中间共享密钥对所述加密路由信息进行解密,得到下一跳节点的路由信息。
  13. 根据权利要求7至12任一项所述的方法,所述方法还包括:
    接收所述终端设备发送的包括报文接收结果的流量确认报文,所述流量确认报文的源地址包括所述终端加密地址,所述报文接收结果用于标识所述终端设备对所述流量报文的接收状态;
    当根据所述报文接收结果确定所述终端设备未接收到目标流量报文时,向所述终端设备发送作为流量重传报文的所述目标流量报文,所述流量重传报文的源地址包括所述服务器加密地址。
  14. 一种数据加密装置,所述装置包括发送单元,获取单元,解密单元和接收单元;
    所述发送单元,用于向服务器发送消息请求报文,所述消息请求报文的源地址包括终端加密地址,所述终端加密地址是通过所述服务器的公钥对所述终端设备的终端地址加密得到的;
    所述获取单元,用于接收所述服务器针对所述消息请求报文返回的流量报文,所述流量报文的源地址包括服务器加密地址,所述服务器加密地址是通过所述终端设备的公钥对所述服务器的服务器地址加密得到的;
    所述解密单元,用于通过所述终端设备的私钥对所述服务器加密地址进行解密,得到服务器待定地址;
    所述接收单元,用于响应于所述服务器待定地址与所述服务器地址一致,获取所述流量报文中的流量数据。
  15. 一种数据加密装置,所述装置包括获取单元,解密单元,发送单元;
    所述获取单元,用于接收终端设备发送的消息请求报文,所述消息请求报文的源地址包括终端加密地址,所述终端加密地址是通过所述服务器的公钥对所述终端设备的终端地址加密得到的;
    所述解密单元,用于通过所述服务器的私钥对所述终端加密地址进行解密,得到所述终端地址;
    所述发送单元,用于根据所述终端地址,向所述终端设备发送针对所述消息请求报文返回的流量报文,所述流量报文的源地址包括服务器加密地址,所述服务器加密地址是通过所述终端设备的公钥对所述服务器的服务器地址加密得到的。
  16. 一种数据加密系统,所述系统包括终端设备和服务器,所述终端设备用于执行权利要求1-6中任意一项所述的方法,所述服务器用于执行权利要求7-13中任意一项所述的方法。
  17. 一种计算机设备,所述计算机设备包括处理器以及存储器:
    所述存储器用于存储计算机程序,并将所述程序代码传输给所述处理器;
    所述处理器用于根据所述计算机程序中的指令执行权利要求1-6中任意一项所述的方法,或者,执行权利要求7-13中任意一项所述的方法。
  18. 一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,所述 计算机程序用于执行权利要求1-6中任意一项所述的方法,或者,执行权利要求7-13中任意一项所述的方法。
  19. 一种包括计算机程序的计算机程序产品,当其在计算机设备上运行时,使得所述计算机设备执行权利要求1-6中任意一项所述的方法,或者,执行权利要求7-13中任意一项所述的方法。
PCT/CN2023/131400 2023-02-23 2023-11-14 一种数据加密方法和相关装置 Ceased WO2024174596A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP23923760.5A EP4614878A4 (en) 2023-02-23 2023-11-14 DATA ENCRYPTION METHOD AND ASSOCIATED APPARATUS
US19/074,710 US20250211425A1 (en) 2023-02-23 2025-03-10 Data encryption method and related apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310201907.3A CN118540087B (zh) 2023-02-23 2023-02-23 一种数据加密方法和相关装置
CN202310201907.3 2023-02-23

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US19/074,710 Continuation US20250211425A1 (en) 2023-02-23 2025-03-10 Data encryption method and related apparatus

Publications (1)

Publication Number Publication Date
WO2024174596A1 true WO2024174596A1 (zh) 2024-08-29

Family

ID=92393376

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/131400 Ceased WO2024174596A1 (zh) 2023-02-23 2023-11-14 一种数据加密方法和相关装置

Country Status (4)

Country Link
US (1) US20250211425A1 (zh)
EP (1) EP4614878A4 (zh)
CN (1) CN118540087B (zh)
WO (1) WO2024174596A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119854015A (zh) * 2025-01-10 2025-04-18 北京汇元吉祥科技有限公司 一种端到端的安全通讯加密方法和系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110264908A1 (en) * 2008-10-31 2011-10-27 Chengdu Huawei Symantec Technologies Co., Ltd. Method and device for preventing network attacks
CN105978798A (zh) * 2016-06-29 2016-09-28 深圳中兴网信科技有限公司 报文加密传输方法、终端和服务器
CN109462594A (zh) * 2018-11-28 2019-03-12 视联动力信息技术股份有限公司 一种基于视联网的数据处理方法及系统
CN110493367A (zh) * 2019-08-20 2019-11-22 清华大学 无地址的IPv6非公开服务器、客户机与通信方法
CN114915583A (zh) * 2021-02-08 2022-08-16 中兴通讯股份有限公司 报文处理方法、客户端设备、服务器端设备和介质

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4434680B2 (ja) * 2003-09-30 2010-03-17 エヌ・ティ・ティ・ソフトウェア株式会社 電子メール処理装置用プログラム
KR101083127B1 (ko) * 2010-08-25 2011-11-11 경희대학교 산학협력단 멀티홉 무선 통신 환경에서 센서 노드들의 비밀값 공유 방법
US9143508B2 (en) * 2010-12-30 2015-09-22 Verizon Patent And Licensing Inc. Service location based authentication
US10678709B2 (en) * 2013-07-15 2020-06-09 Infineon Technologies Ag Apparatus and method for memory address encryption
US20160285834A1 (en) * 2014-11-10 2016-09-29 Qualcomm Incorporated Techniques for encrypting fields of a frame header for wi-fi privacy
CN105847034B (zh) * 2016-03-16 2019-02-05 清华大学 源验证和路径认证方法及装置
CN108521331A (zh) * 2018-04-11 2018-09-11 西安邮电大学 基于源地址的隐蔽信息发送系统及发送方法
US11218454B2 (en) * 2019-02-05 2022-01-04 Cisco Technology, Inc. Facilitating user privacy in communications involving semantic-bearing IPv6 addresses
CN111740943B (zh) * 2020-03-31 2022-04-01 新华三信息安全技术有限公司 一种防攻击方法、装置、设备及机器可读存储介质
US11658800B2 (en) * 2020-06-19 2023-05-23 Duality Technologies, Inc. Privacy preserving routing
US11258774B1 (en) * 2020-08-24 2022-02-22 Juniper Networks, Inc. Adaptive control of secure sockets layer proxy

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110264908A1 (en) * 2008-10-31 2011-10-27 Chengdu Huawei Symantec Technologies Co., Ltd. Method and device for preventing network attacks
CN105978798A (zh) * 2016-06-29 2016-09-28 深圳中兴网信科技有限公司 报文加密传输方法、终端和服务器
CN109462594A (zh) * 2018-11-28 2019-03-12 视联动力信息技术股份有限公司 一种基于视联网的数据处理方法及系统
CN110493367A (zh) * 2019-08-20 2019-11-22 清华大学 无地址的IPv6非公开服务器、客户机与通信方法
CN114915583A (zh) * 2021-02-08 2022-08-16 中兴通讯股份有限公司 报文处理方法、客户端设备、服务器端设备和介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4614878A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119854015A (zh) * 2025-01-10 2025-04-18 北京汇元吉祥科技有限公司 一种端到端的安全通讯加密方法和系统

Also Published As

Publication number Publication date
CN118540087B (zh) 2025-05-27
EP4614878A4 (en) 2025-10-08
EP4614878A1 (en) 2025-09-10
CN118540087A (zh) 2024-08-23
US20250211425A1 (en) 2025-06-26

Similar Documents

Publication Publication Date Title
US8364772B1 (en) System, device and method for dynamically securing instant messages
US11303431B2 (en) Method and system for performing SSL handshake
US8418242B2 (en) Method, system, and device for negotiating SA on IPv6 network
US11297115B2 (en) Relaying media content via a relay server system without decryption
AU2016369606A1 (en) Systems and methods for secure multi-party communications using a proxy
CN114844729B (zh) 一种网络信息隐藏方法及系统
US20170126623A1 (en) Protected Subnet Interconnect
CN105516062B (zh) 一种实现L2TP over IPsec接入的方法
CN110493367B (zh) 无地址的IPv6非公开服务器、客户机与通信方法
CN112637069B (zh) 数据报文的传输方法和装置
CN115378659A (zh) 基于用户身份的高可靠文件加密和细粒度访问控制方法
CN113904809A (zh) 一种通信方法、装置、电子设备及存储介质
CN108429682A (zh) 一种网络传输链路的优化方法及系统
US20250211425A1 (en) Data encryption method and related apparatus
WO2014205703A1 (zh) 一种共享接入的检测方法、设备和终端设备
CN113037762A (zh) 通信方法、装置、设备及存储介质
CN119788436B (zh) 数据保护方法、设备以及存储介质
CN103546442A (zh) 浏览器的通讯监听方法及装置
CN115459949A (zh) 一种数据传输方法及装置
JP5326815B2 (ja) パケット送受信装置およびパケット送受信方法
CN110995730B (zh) 数据传输方法、装置、代理服务器和代理服务器集群
CN117914525A (zh) 一种数据报文处理方法及系统
CN111490988B (zh) 一种数据传输方法、装置、设备及计算机可读存储介质
CN112470438B (zh) 用于发现中间功能和选择两个通信装置之间的路径的方法
US9369442B2 (en) System and method for the safe spontaneous transmission of confidential data over unsecure connections and switching computers

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23923760

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023923760

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2023923760

Country of ref document: EP

Effective date: 20250605

WWP Wipo information: published in national office

Ref document number: 2023923760

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE