Network communication method and apparatus, computer device, and storage medium
By sending encrypted communication connection requests and receiving compressed digital certificates for consistency verification in network communications, the problem of low transmission efficiency of traditional large digital certificates is solved, and the efficiency and security of establishing encrypted communication connections are improved.
Patent Information
- Application Number
- PCT/CN2023/112150
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-18
- Filing Date
- 2023-08-10
- Publication Date
- 2024-10-24
AI Technical Summary
In the era of quantum computers, the split transmission of large digital certificates in traditional network communications leads to the failure to establish encrypted communication connections and reduces communication efficiency.
During the establishment process of the encrypted communication connection, the encrypted communication connection request is sent to the communication end and the compressed digital certificate is received for consistency verification and the encrypted communication key is generated, thereby realizing encrypted communication.
It improves the efficiency and security of encrypted communication connection establishment, and reduces the data transmission volume and failure rate during the key negotiation process.
Smart Images

Figure CN2023112150_24102024_PF_FP_ABST
Abstract
Description
Network communication method, device, computer equipment and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 18, 2023, with application number 2023104244485 and application name “Network Communication Method, Device, Computer Equipment and Storage Medium”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a network communication method, apparatus, computer equipment, and storage medium. Background Art
[0003] With the development of network communications, to improve network security, communicating parties need to establish encrypted communication connections. During this process, digital certificates are transmitted to identify the identities of both parties. With the development of quantum computers, to improve network security in the quantum computing era, digital certificates transmitted during encrypted communication connections need to support quantum-resistant algorithms.
[0004] In traditional technology, when the data packet of the digital certificate transmitted during the process of establishing an encrypted communication connection is large, the data packet of the digital certificate is usually split into multiple smaller data packets, and then the split smaller data packets are transmitted to achieve the purpose of transmitting the digital certificate.
[0005] However, splitting a larger digital certificate data packet and sending the resulting multiple smaller data packets prolongs the transmission time, which can easily lead to connection establishment failure, thereby reducing communication efficiency.
[0006] Summary of the Invention
[0007] Based on this, it is necessary to provide a network communication method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical problems.
[0008] On the one hand, the present application provides a network communication method, which is executed by a second communication end, and the method includes: sending an encrypted communication connection request to the first communication end, the encrypted communication connection request is used to instruct the first communication end to return a first digital certificate; receiving a second digital certificate from the first communication end, the second digital certificate being the digital certificate actually received by the second communication end after the first communication end returns the first digital certificate in response to the encrypted communication connection request; sending a first key negotiation request to the first communication end, receiving a compressed digital certificate returned by the first communication end in response to the first key negotiation request, the compressed digital certificate being obtained by compressing the first digital certificate; performing consistency verification based on the second digital certificate and the compressed digital certificate; when the consistency verification passes and the identity of the first communication end is verified based on the second digital certificate, generating an encrypted communication key; and, performing encrypted communication with the first communication end based on the encrypted communication key.
[0009] On the other hand, the present application also provides a network communication device. The device includes: a connection request sending module for sending an encrypted communication connection request to a first communication terminal, wherein the encrypted communication connection request is used to instruct the first communication terminal to return a first digital certificate; a certificate receiving module for receiving a second digital certificate from the first communication terminal, wherein the second digital certificate refers to the digital certificate actually received by the second communication terminal after the first communication terminal returns the first digital certificate in response to the encrypted communication connection request; a negotiation request sending module for sending a first key negotiation request to the first communication terminal, and receiving a compressed digital certificate returned by the first communication terminal in response to the first key negotiation request, wherein the compressed digital certificate is obtained by compressing the first digital certificate; a verification module for performing consistency verification based on the second digital certificate and the compressed digital certificate; a first key generation module for generating an encrypted communication key when the consistency verification passes and the identity of the first communication terminal is verified based on the second digital certificate; and a first encryption communication module for performing encrypted communication with the first communication terminal based on the encryption communication key.
[0010] In another aspect, the present application further provides a computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the processors execute the computer program, the computer-readable instructions cause the one or more processors to perform the steps of the above-mentioned network communication method.
[0011] In another aspect, the present application further provides one or more non-volatile computer-readable storage media having computer-readable instructions stored thereon, which, when executed by one or more processors, cause the one or more processors to implement the steps of the aforementioned network communication method.
[0012] On the other hand, the present application further provides a computer program product, which includes computer-readable instructions, and when the computer-readable instructions are executed by a processor, implements the steps in the above-mentioned network communication method.
[0013] On the other hand, the present application provides a network communication method, which is executed by a first communication end, and the method includes: receiving an encrypted communication connection request sent by a second communication end; in response to the encrypted communication connection request, transmitting a first digital certificate to the second communication end, so that the second communication end actually receives a second digital certificate, and the second digital certificate is used to authenticate the identity of the first communication end; receiving a first key negotiation request sent by the second communication end; in response to the first key negotiation request, sending a compressed digital certificate to the second communication end, the compressed digital certificate is obtained by compressing the first digital certificate, and is used for consistency verification with the second digital certificate; when the consistency verification passes and the identity authentication passes, generating an encrypted communication key; and, performing encrypted communication with the second communication end based on the encrypted communication key.
[0014] On the other hand, the present application also provides a network communication device. The device includes: a connection request receiving module for receiving an encrypted communication connection request sent by a second communication terminal; a certificate transmission module for transmitting a first digital certificate to the second communication terminal in response to the encrypted communication connection request, so that the second communication terminal actually receives a second digital certificate, and the second digital certificate is used to authenticate the identity of the first communication terminal; a negotiation request receiving module for receiving a first key negotiation request sent by the second communication terminal; a negotiation request response module for sending a compressed digital certificate to the second communication terminal in response to the first key negotiation request, the compressed digital certificate being obtained by compressing the first digital certificate and being used for consistency verification with the second digital certificate; a second key generation module for generating an encrypted communication key when the consistency verification passes and the identity verification passes; and a second encrypted communication module for performing encrypted communication with the second communication terminal based on the encrypted communication key.
[0015] In another aspect, the present application further provides a computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the processors execute the computer program, the computer-readable instructions cause the one or more processors to perform the steps of the above-mentioned network communication method.
[0016] In another aspect, the present application further provides one or more non-volatile computer-readable storage media having computer-readable instructions stored thereon, which, when executed by one or more processors, cause the one or more processors to implement the steps of the aforementioned network communication method.
[0017] On the other hand, the present application further provides a computer program product, which includes computer-readable instructions, and when the computer-readable instructions are executed by a processor, implements the steps in the above-mentioned network communication method.
[0018] The details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] FIG1 is a diagram illustrating an application environment of a network communication method in some embodiments;
[0021] FIG2 is a schematic diagram of a flow chart of a network communication method in some embodiments;
[0022] FIG3 is a schematic diagram illustrating a method for generating a compressed digital certificate in some embodiments;
[0023] FIG4 is a schematic diagram illustrating a principle for determining a certificate type in some embodiments;
[0024] FIG5 is a timing diagram of a TLS connection establishment process in some embodiments;
[0025] FIG6 is a timing diagram of an improved TLS connection establishment process in some embodiments;
[0026] FIG7 is a timing diagram of an improved TLS connection establishment process in some embodiments;
[0027] FIG8 is a timing diagram of an improved TLS connection establishment process in some embodiments;
[0028] FIG9 is a schematic flow chart of a network communication method in some embodiments;
[0029] FIG10 is a schematic flow chart of a network communication method in some embodiments;
[0030] FIG11 is a block diagram of a network communication device in some embodiments;
[0031] FIG12 is a block diagram of a network communication device in some embodiments;
[0032] FIG13 is a diagram illustrating the internal structure of a computer device in some embodiments; and
[0033] FIG14 is a diagram illustrating the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0035] The network communication method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. The application environment includes a first communication terminal 102 and a second communication terminal 104. The first communication terminal 102 communicates with the second communication terminal 104 through a network. The first data storage system can store data that the first communication terminal 102 needs to process. The first data storage system can be integrated on the first communication terminal 102, or it can be placed on the cloud or other servers. The second data storage system can store data that the second communication terminal 104 needs to process. The second data storage system can be integrated on the second communication terminal 104, or it can be placed on the cloud or other servers.
[0036] Specifically, if the second communication end 104 has established a non-encrypted communication connection with the first communication end 102, for example, a TCP (Transmission Control Protocol) connection, the second communication end 104 can send an encrypted communication connection request to the first communication end 102 to conduct encrypted communication with the first communication end 102. In response to the encrypted communication connection request, the first communication end 102 transmits the first digital certificate to the second communication end. The encrypted communication connection request instructs the first communication end 102 to return a first digital certificate identifying the first communication end 102. The first communication end 102 is the other end communicating with the second communication end 104. After the first communication end 102 returns the first digital certificate to the second communication end, the second communication end 104 actually receives the second digital certificate. If the first digital certificate has not been tampered with during transmission, the second digital certificate is the same as the first digital certificate. If the first digital certificate has been tampered with during transmission, the second digital certificate is different from the first digital certificate. The second communication terminal 104 sends a first key negotiation request to the first communication terminal 102. In response to the first key negotiation request, the first communication terminal 102 returns a compressed digital certificate to the second communication terminal 104. The compressed digital certificate is obtained by compressing the first digital certificate. After receiving the compressed digital certificate, the second communication terminal 104 performs consistency verification based on the second digital certificate and the compressed digital certificate. When the consistency verification passes and the identity of the first communication terminal is verified based on the second digital certificate, the second communication terminal generates an encrypted communication key. After the encrypted communication key is generated, the second communication terminal 104 and the first communication terminal 102 perform encrypted communication based on the encrypted communication key. It should be noted that when the consistency verification passes and the identity of the first communication terminal is verified based on the second digital certificate, the first communication terminal will also generate the encrypted communication key. The encrypted communication key generated by the first communication terminal is the same as the encrypted communication key generated by the second communication terminal.
[0037] Among them, the first communication terminal 102 and the second communication terminal 104 can be, but are not limited to, various desktop computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, and can also be independent physical servers. They can also be server clusters or distributed systems composed of multiple physical servers. They can also be cloud servers that provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security and other network security services, CDN, as well as basic cloud computing services such as big data and artificial intelligence platforms. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The first communication terminal 102 and the second communication terminal 104 can be directly or indirectly connected via wired or wireless communication methods, and this application does not impose any restrictions on this.
[0038] The network communication method provided in this application can be applied to a blockchain system, which is composed of multiple nodes (any form of computing devices connected to the network, such as servers, user terminals) and clients.
[0039] A peer-to-peer (P2P) network is formed between nodes. The P2P protocol is an application layer protocol that runs on top of the Transmission Control Protocol (TCP). In a blockchain system, any machine, such as a server or terminal, can join and become a node. A node comprises a hardware layer, an intermediate layer, an operating system layer, and an application layer. For example, the first communication end and the second communication end can be nodes in a blockchain system. The network communication method provided in this application, when applied to a blockchain system, can improve the communication efficiency between nodes in the blockchain system.
[0040] In some embodiments, as shown in FIG2 , a network communication method is provided, which is described by taking the method applied to the second communication terminal 104 in FIG1 as an example, including the following steps:
[0041] Step 202: Send an encrypted communication connection request to the first communication terminal, where the encrypted communication connection request is used to instruct the first communication terminal to return a first digital certificate.
[0042] Among them, the digital certificate is used to identify the identity of the communication party in the Internet communication. The first digital certificate is used to identify the identity of the first communication terminal. The first communication terminal and the second communication terminal are the two parties communicating. The first digital certificate can be a digital certificate that conforms to any standard, for example, it can be a digital certificate that conforms to the X.509 standard. The digital certificate that conforms to the X.509 standard can also be called an X.509 digital certificate or an x509 digital certificate. X.509 is the standard format of the Public Key Infrastructure (PKI). The first digital certificate can also be an X.509 digital certificate that supports quantum-resistant algorithms. In the X.509 digital certificate that supports quantum-resistant algorithms, support for quantum-resistant algorithms is achieved by adding fields such as Alt-Signature-Algorithm (signature algorithm), Subject-Alt-Public-Key-Info (public key of the certificate subject), and Alt-Signature-Value (signature of the certificate issuer) in the extension field (X509v3 extensions). For example, the data structure of the X.509 digital certificate that supports quantum-resistant algorithms can be:
[0043] Because X.509 digital certificates that support quantum-resistant algorithms contain the public key of the certificate subject and the signature of the certificate issuer, they contain a large amount of data. Quantum-resistant algorithms are used to protect the security of transmitted data on quantum computers.
[0044] The encrypted communication connection request is used to request the establishment of an encrypted communication link. Encrypted communication refers to the encryption of data before transmission. In other words, encrypted communication means that both the data sent and received are encrypted. Data is encrypted before being sent, and encrypted data must be decrypted upon receipt.
[0045] Specifically, the encrypted communication connection request may be sent via a non-encrypted communication link when a non-encrypted communication link has already been established between the first communication end and the second communication end. The non-encrypted communication link is used to transmit data in plain text. For example, the non-encrypted communication link may be a communication link established via a TCP connection.
[0046] In some embodiments, when the data volume of the first digital certificate is greater than a data volume threshold, the encrypted communication connection request is used to instruct the first communication end to return the first digital certificate used to identify the first communication end; the first communication end is the other end communicating with the second communication end. The data volume threshold can be set as needed, for example, based on the data volume of the Maximum Transmission Unit (MTU). For example, the data volume threshold can be the data volume of the MTU, or the data volume threshold can be the product of the data volume of the MTU and a preset coefficient, where the preset coefficient is a value between 0.5 and 1, for example, 0.8 or 1.
[0047] In some embodiments, to achieve encrypted communication with the first communication terminal, the second communication terminal sends an encrypted communication connection request to the first communication terminal. In response to the encrypted communication connection request, the first communication terminal obtains a first digital certificate and sends the first digital certificate to the second communication terminal.
[0048] Step 204: Receive a second digital certificate from the first communication end. The second digital certificate is the digital certificate actually received by the second communication end after the first communication end returns the first digital certificate in response to the encrypted communication connection request.
[0049] Specifically, the first communication end, in response to the encrypted communication connection request, obtains a first digital certificate and sends the first digital certificate to the second communication end via an unencrypted communication link. Because unencrypted communication links cannot guarantee the security of data transmission, the first digital certificate may be tampered with during transmission. As a result, the result transmitted to the second communication end, i.e., the second digital certificate received by the second communication end, may not be the first digital certificate. If the tampering has not occurred, the digital certificate received by the second communication end, i.e., the second digital certificate, is the first digital certificate.
[0050] Step 206: Send a first key negotiation request to the first communication terminal, and receive a compressed digital certificate returned by the first communication terminal in response to the first key negotiation request. The compressed digital certificate is obtained by compressing the first digital certificate.
[0051] The key agreement request triggers a key agreement between the first and second communication terminals. The purpose of the key agreement is to negotiate a common key. After the common key is negotiated, the first and second communication terminals encrypt the data to be transmitted using the common key before transmitting the data, and then transmit the encrypted result. The common key is also called an encrypted communication key.
[0052] The second communication end may send the first key negotiation request to the first communication end while the first communication end is transmitting the first digital certificate, or may send the first key negotiation request to the first communication end after receiving the complete second digital certificate.
[0053] Specifically, the first communication terminal has a first public key and a first private key. The first public key can decrypt data encrypted with the first private key, and the first private key can also decrypt data encrypted with the first public key. The second communication terminal has a second public key and a second private key. The second public key can decrypt data encrypted with the second private key, and the second private key can also decrypt data encrypted with the second public key. During the key negotiation process between the first communication terminal and the second communication terminal, data sent by the first communication terminal to the second communication terminal can be encrypted using the second public key, and data sent by the second communication terminal to the first communication terminal can be encrypted using the first public key. For example, the first key negotiation request can be encrypted using the first public key.
[0054] In some embodiments, the compressed digital certificate may be pre-generated by the first communication end, or may be generated by the first communication end in response to the first key agreement request. Specifically, in response to the first key agreement request, the first communication end obtains the first digital certificate, compresses at least a portion of the content in the first digital certificate to obtain a compressed digital certificate corresponding to the first digital certificate, and transmits the compressed digital certificate to the second communication end.
[0055] In some embodiments, the first communication end may compress all contents included in the first digital certificate to obtain a compressed digital certificate. For example, the first communication end may perform a hash calculation on all contents included in the first digital certificate and use the hash calculation result as the compressed digital certificate. Alternatively, the first communication end may compress, for example, perform a hash calculation on the first content in the first digital certificate to obtain first compressed content corresponding to the first content. The first communication end may then replace the first content in the first digital certificate with the first compressed content corresponding to the first content to obtain a compressed digital certificate corresponding to the first digital certificate.
[0056] Step 208: Perform consistency verification based on the second digital certificate and the compressed digital certificate.
[0057] Specifically, the compressed digital certificate is obtained by compressing the first digital certificate according to a preset compression method. The preset compression method includes, but is not limited to, a preset compression encoding algorithm, which includes, but is not limited to, a hash algorithm, which includes, but is not limited to, SHA256, SM2, or SM3. Since the compressed digital certificate is obtained by compressing the first digital certificate, the data volume of the compressed digital certificate is smaller than that of the first digital certificate. Therefore, the compressed digital certificate can be referred to as the short certificate corresponding to the first digital certificate. Taking the first digital certificate as an x509 digital certificate using a quantum-resistant algorithm and the preset compression method being SHA256 as an example, the calculation method for the short certificate corresponding to the first digital certificate can be: segment certificate = SHA256 (x509 digital certificate using a quantum-resistant algorithm). Since the hash algorithm is collision-resistant, the x509 digital certificate using a quantum-resistant algorithm corresponds one-to-one to the short certificate. Since the short certificate obtained by the hash algorithm is only a few dozen bytes in size, the amount of transmitted data can be reduced during network transmission, thereby improving communication efficiency. The first communication terminal may have a short certificate calculation module, which is used to compress the input digital certificate according to a preset compression method to generate a corresponding short certificate. As shown in Figure 3, the x509 digital certificate of the quantum-resistant algorithm is input into the short certificate calculation module, and the short certificate is output.
[0058] In some embodiments, the second communication terminal may compress the second digital certificate using the preset compression method and use the compressed result as the comparison digital certificate. If the comparison digital certificate is consistent with the compressed digital certificate, the second digital certificate is determined to be consistent with the first digital certificate. Otherwise, the second digital certificate is determined to be inconsistent with the first digital certificate.
[0059] In some embodiments, the preset compression method corresponds to a preset decompression method. After decrypting the compressed digital certificate, the second communication terminal can decompress the compressed digital certificate using the preset decompression method to obtain the first digital certificate. The first digital certificate is then compared with the second digital certificate. If the comparison is consistent, the second digital certificate is determined to be consistent with the first digital certificate. Otherwise, the second digital certificate is determined to be inconsistent with the first digital certificate.
[0060] Step 210: When the consistency verification is passed and the identity of the first communication terminal is verified based on the second digital certificate, an encryption communication key is generated.
[0061] The encryption communication key is a symmetric key, that is, data encrypted by the encryption communication key can be decrypted by the encryption communication key.
[0062] Specifically, if the consistency verification passes, it indicates that the second digital certificate is identical to the first digital certificate, meaning that the first digital certificate was accurately transmitted to the second communication end. If the consistency verification passes, the second communication end can authenticate the first communication end using the second digital certificate, thereby preventing invalid authentication if the second digital certificate is inconsistent with the first digital certificate. After authentication passes, the second communication end generates an encryption communication key and uses the encryption communication key to conduct encrypted communication with the first communication end.
[0063] In some embodiments, if the second digital certificate is consistent with the first digital certificate, the first communication end and the second communication end each generate the same key, which serves as the encrypted communication key. If the second digital certificate is inconsistent with the first digital certificate, the second communication end sends a negotiation failure notification to the first communication end and may re-send the encrypted communication connection request to the first communication end.
[0064] In some embodiments, the second communication end generates a first random number, encrypts the first random number using the first public key of the first communication end to obtain a first encrypted random number, and the first key agreement request may carry the first encrypted random number. The first communication end may also, in response to the first key agreement request, generate a second random number, encrypt the second random number using the second public key of the second communication end to obtain a second encrypted random number, and send the second encrypted random number to the second communication end. The first communication end may decrypt the second encrypted random number using the first private key to obtain a second random number, and generate an encrypted communication key based on the first and second random numbers. The second communication end may decrypt the first encrypted random number using the second private key to obtain the first random number, and generate an encrypted communication key based on the first and second random numbers. The first and second communication ends generate the same encrypted communication key. The method for generating the encrypted communication key based on the first and second random numbers is not limited herein. For example, the first and second random numbers may be used as the encrypted communication key, or the first and second random numbers may be hashed, and the hash result may be used as the encrypted communication key.
[0065] Step 212: Perform encrypted communication with the first communication end based on the encrypted communication key.
[0066] Specifically, the encryption communication key is a symmetric key, meaning that data encrypted with the encryption communication key can be decrypted using the encryption communication key. After the first communication terminal and the second communication terminal generate the encryption communication key, data sent by the first communication terminal to the second communication terminal is encrypted using the encryption communication key, and data sent by the second communication terminal to the first communication terminal is also encrypted using the encryption communication key. After the first communication terminal receives data encrypted with the encryption communication key from the second communication terminal, it decrypts the received data using the encryption communication key. After the second communication terminal receives data encrypted with the encryption communication key from the first communication terminal, it decrypts the received data using the encryption communication key, thereby achieving encrypted communication between the first and second communication terminals.
[0067] In the above-mentioned network communication method, an encrypted communication connection request is sent to a first communication terminal, the encrypted communication connection request being used to instruct the first communication terminal to return a first digital certificate, a second digital certificate is received from the first communication terminal, the digital certificate being the digital certificate actually received by the second communication terminal after the first communication terminal returns the first digital certificate in response to the encrypted communication connection request, a first key negotiation request is sent to the first communication terminal, a compressed digital certificate is received from the first communication terminal in response to the first key negotiation request, the compressed digital certificate is obtained by compressing the first digital certificate, consistency verification is performed based on the second digital compressed certificate and the compressed digital certificate, and after the consistency verification passes and the identity of the first communication terminal is authenticated based on the second digital certificate, an encrypted communication key is generated, and encrypted communication is performed with the first communication terminal based on the encrypted communication key. Because the first digital certificate is transmitted before sending the first key negotiation request, i.e., before key negotiation, and the compressed digital certificate corresponding to the first digital certificate is transmitted after sending the first key negotiation request, i.e., during the key negotiation process, rather than during the key negotiation process, the amount of data transmitted during the key negotiation process is reduced, thereby reducing the failure rate of key negotiation and increasing the success rate of key negotiation, thereby improving the efficiency of establishing an encrypted communication connection and improving communication efficiency.
[0068] In addition, when the consistency verification is passed and the identity of the first communication terminal is verified based on the second digital certificate, an encrypted communication key is generated, so that the encrypted communication key is generated in a safe situation, thereby improving the security of encrypted communication.
[0069] In some embodiments, the first digital certificate returned by the first communication end is returned by the first communication end in response to the encrypted communication connection request when the data volume of the first digital certificate exceeds a data volume threshold. Specifically, in response to the encrypted communication connection request, the first communication end transmits the first digital certificate to the second communication end when the data volume of the first digital certificate exceeds the data volume threshold.
[0070] In some embodiments, the data volume of the digital certificate of the first certificate type is greater than the data volume threshold, and the data volume of the digital certificate of the second certificate type is less than or equal to the data volume threshold. The data volume threshold can be set as needed, for example, it can be determined based on the data volume of the MTU (Maximum Transmission Unit). For example, the data volume threshold can be the data volume of the MTU, or the data volume threshold can be the product of the data volume of the MTU and a preset coefficient. The preset coefficient is a value between 0.5 and 1, for example, it can be 0.8 or 1.
[0071] In some embodiments, the first communication terminal determines the certificate type of the first digital certificate in response to the encrypted communication connection request. If the certificate type of the first digital certificate is the first certificate type, the first digital certificate is transmitted to the second communication terminal. For example, a first request response result for the encrypted communication connection request is transmitted to the second communication terminal, and the first request response result carries the first digital certificate. The first request response result may be transmitted by the first communication terminal via a non-encrypted communication link, so that the response result actually received by the second communication terminal may be consistent with the first request response result or may not be consistent with the first request response result. In response to the received response result, the second terminal sends a first key agreement request to the first communication terminal.
[0072] In some embodiments, the data volume of a digital certificate that does not support quantum-resistant algorithms is less than or equal to a data volume threshold, while the data volume of a digital certificate that supports quantum-resistant algorithms may be greater than, equal to, or less than the data volume threshold. In response to an encrypted communication connection request, the first communication end, upon determining that the first digital certificate is a digital certificate that does not support quantum-resistant algorithms, determines the certificate type of the first digital certificate to be the second certificate type. Upon determining that the first digital certificate is a digital certificate that supports quantum-resistant algorithms, the first communication end calculates the data volume of the first digital certificate. If the data volume of the first digital certificate is greater than the data volume threshold, the certificate type of the first digital certificate is determined to be the first certificate type. If the data volume of the first digital certificate is less than or equal to the data volume threshold, the certificate type of the first digital certificate is determined to be the second certificate type. FIG4 illustrates a schematic diagram for determining the certificate type, taking the first digital certificate as an x509 digital certificate as an example. In FIG4, a non-quantum-resistant x509 digital certificate refers to an x509 digital certificate that supports quantum-resistant algorithms, and a quantum-resistant x509 digital certificate refers to an x509 digital certificate that does not support quantum-resistant algorithms. "Small certificate" indicates the certificate type is the second certificate type, and "large certificate" indicates the certificate type is the first certificate type.
[0073] In this embodiment, since the data transmission time will be increased when the data volume is large, when the data volume of the first digital certificate is greater than the data volume threshold, the first communication end returns the first digital certificate, and the first digital certificate with a large data volume can be transmitted before the key negotiation, rather than transmitting the first digital certificate with a large data volume during the key negotiation process, thereby reducing the data transmission delay during the key negotiation process, reducing the situation where the key negotiation process is interrupted due to the large transmission delay, increasing the probability of successful key negotiation, and improving communication efficiency.
[0074] In some embodiments, the network communication method also includes: when the data volume of the first digital certificate is less than or equal to a data volume threshold, receiving a response result returned by the second communication end that does not carry the first digital certificate; in response to the response result, sending a second key negotiation request to the first communication end; receiving the first digital certificate returned by the first communication end in response to the second key negotiation request; authenticating the first communication end based on the received first digital certificate; generating an encryption communication key if the authentication is successful; and performing encrypted communication with the first communication end based on the encryption communication key.
[0075] The response result that does not carry the first digital certificate may be referred to as a second request response result. The second request response result does not carry the first digital certificate. The data volume of the digital certificate of the second certificate type is less than or equal to the data volume threshold.
[0076] Specifically, in response to the encrypted communication connection request, the first communication terminal returns a response result that does not carry the first digital certificate to the second communication terminal if the data volume of the first digital certificate is less than or equal to the data volume threshold. For example, in response to the encrypted communication connection request, the first communication terminal transmits a second request response result for the encrypted communication connection to the second communication terminal if it is determined that the certificate type of the first digital certificate is the second certificate type. After receiving the second request response result, the second communication terminal sends a second key negotiation request to the first communication terminal. In response to the second key negotiation request, the first communication terminal sends the first digital certificate to the second communication terminal. The second communication terminal authenticates the first communication terminal using the first digital certificate, generates an encrypted communication key if the authentication is successful, and performs encrypted communication with the second communication terminal based on the encrypted communication key.
[0077] In some embodiments, the second communication end has a third digital certificate, and the third digital certificate is used to identify the identity of the second communication end. During the key negotiation phase, the first communication end may also verify the identity of the second communication end through the third digital certificate. Specifically, in the case where the certificate type of the third digital certificate is the first certificate type, before the second communication end sends the first key negotiation request to the first communication end, the second communication end may also send the third digital certificate to the first communication end through a non-encrypted communication link. After the second communication end sends the first key negotiation request to the first communication end, the second communication end may also compress the third digital certificate to obtain a compressed certificate. The compression process may refer to the process of compressing the first digital certificate, and the process of obtaining the compressed certificate may refer to the process of obtaining a compressed digital certificate. The second communication terminal transmits the compressed certificate to the first communication terminal, generates a third random number, encrypts the third random number using the first public key to obtain a third encrypted random number, and sends the third encrypted random number to the first communication terminal. The first communication terminal uses the compressed certificate to perform a consistency check, and authenticates the second communication terminal after the consistency check passes. As a result, the first communication terminal authenticates the second communication terminal, and the second communication terminal also authenticates the first communication terminal. If the authentication of the first communication terminal and the second communication terminal both pass, the first communication terminal decodes the third encrypted random number using the first private key to obtain a third random number, and generates an encrypted communication key based on the first random number, the second random number, and the third random number. The first communication terminal generates an encrypted communication key based on the first random number, the second random number, and the third random number.
[0078] In this embodiment, when the data volume of the first digital certificate is less than or equal to the data volume threshold, the first digital certificate is sent after the second key negotiation request triggers the key negotiation. Therefore, when the data volume is small, the first digital certificate is directly sent in the key negotiation stage without the need to first transmit the first digital certificate and then transmit the compressed digital certificate. This simplifies the transmission process, thereby avoiding unnecessary data transmission and improving communication efficiency.
[0079] The network communication method provided in this application can be used to improve the process of establishing a TLS connection or an SSL connection, thereby improving the efficiency of establishing a TLS connection or an SSL connection. Among them, TLS (Transport Layer Security) and SSL (Secure Socket Layer) are both encryption protocols for encrypting data and verifying connections when moving data on the Internet. TLS is an updated version of SSL, which fixes some security vulnerabilities in the SSL protocol. TLS and SSL connections establish encrypted communication links. In the case where the first digital certificate is an X.509 digital certificate that supports quantum-resistant algorithms, the improved TLS protocol or SSL protocol can be called a quantum-resistant TLS protocol or SSL protocol.
[0080] Taking the improvement of the process of establishing a TLS connection using the network communication method provided by the present application as an example, as shown in Figure 5, a timing diagram of the TLS connection establishment process that is not improved by the network communication method provided by the present application is shown, and as shown in Figure 6, a timing diagram of the TLS connection establishment process that is improved by the network communication method provided by the present application is shown. In the process of establishing a TLS connection, the first communication end can be understood as the client, and the second communication end can be understood as the server. The process of establishing a TLS connection, that is, the process of key negotiation, can include but is not limited to the ClientHello (client-side encrypted information sending) stage, ServerHello (server-side encrypted information sending) stage, ClientKeyExchange (random number exchange) stage or Change Cipher Spec (encrypted communication notification) stage, etc. In the ClientHello stage, the second communication end sends a key negotiation request to the first communication end, and in the ServerHello stage, the second communication end sends the first digital certificate of the second communication end to the second communication end. In the ClientKeyExchange stage, the second communication end generates a third random number, encrypts the third random number using the first public key, and sends it to the first communication end. The Change Cipher Spec stage is used to notify the use of the encrypted communication key for data transmission.
[0081] As shown in Figure 6, the improved TLS connection establishment process includes a preprocessing phase and a TLS handshake phase, also known as a key negotiation phase. In the preprocessing phase, the second communication end sends an encrypted communication connection request to the first communication end. The first communication end determines whether to return the first digital certificate to the second communication end based on the size of the first digital certificate. The preprocessing phase can also be called the large data transmission phase.
[0082] Figure 7 shows a sequence diagram of the improved TLS connection establishment process when the certificate type of the first digital certificate is the first certificate type. During the preprocessing phase, when the certificate type of the first digital certificate is the first certificate type, the first communication end returns the first digital certificate to the second communication end. The first communication end transmits the compressed digital certificate to the second communication end in the ServerHello of the TLS handshake phase.
[0083] Figure 8 shows a timing diagram of the improved TLS connection establishment process when the first digital certificate's certificate type is the second certificate type. During the preprocessing phase, if the first digital certificate's certificate type is the second certificate type, the first communication end does not return the first digital certificate to the second communication end. Instead, the first communication end transmits the first digital certificate to the second communication end in the ServerHello message during the TLS handshake phase. If the TLS handshake succeeds, i.e., if the encryption communication key is successfully negotiated, the first communication end and the second communication end engage in encrypted communication.
[0084] In some embodiments, the first digital certificate includes first content and content index information corresponding to the first content; the compressed digital certificate is obtained by compressing the first content using a preset compression method; consistency verification is performed based on the second digital certificate and the compressed digital certificate, including: using a preset compression method to compress the second content indicated by the content index information in the second digital certificate to obtain second compressed content; in the second digital certificate, the second content is updated to the second compressed content to obtain a comparison digital certificate; and consistency verification is performed on the comparison digital certificate and the compressed digital certificate.
[0085] The content index information is index information for searching the first content in the first digital certificate. If the content in the first digital certificate is in the form of a key-value pair, the content index information may include at least one key, and the first content includes the content, i.e., the value, corresponding to each key included in the content index information in the first digital certificate. The data volume of the compressed digital certificate is less than or equal to the data volume threshold. The first content is part of the content in the first digital certificate. For example, if the first digital certificate supports quantum-resistant algorithms, the first content may be part of or all of the content in the first digital certificate that supports quantum-resistant algorithms.
[0086] Specifically, the second communication terminal may compress the second content indicated by the content index information in the second digital certificate according to a preset compression method to obtain second compressed content, and then replace the second content indicated by the content index information in the second digital certificate with the second compressed content, and determine the replaced second digital certificate as the comparison digital certificate. The second communication terminal compares the comparison digital certificate with the compressed digital certificate, and if the comparison is consistent, determines that the second digital certificate is consistent with the first digital certificate. The compressed digital certificate may be generated by the first communication terminal.
[0087] In some embodiments, the first communication end responds to the first key agreement request sent by the second communication end, determines the first content to be compressed from the first digital certificate, compresses the first content according to a preset compression method to obtain first compressed content, replaces the first content in the first digital certificate with the first compressed content, and the replaced first digital certificate is the compressed digital certificate.
[0088] In this embodiment, the compressed digital certificate is obtained by compressing the first content in the first digital certificate, thereby compressing specific data in the first digital certificate instead of compressing all data, thereby achieving the purpose of compression and improving compression efficiency.
[0089] In some embodiments, the first content is content in a first digital certificate that supports a quantum-resistant algorithm. The first digital certificate supports the quantum-resistant algorithm, and the content index information is index information of the content that supports the quantum-resistant algorithm. The second communication terminal may compress the content that supports the quantum-resistant algorithm indicated by the content index information in the second digital certificate according to a preset compression method to obtain second compressed content.
[0090] The first digital certificate supports quantum-resistant algorithms, the first digital certificate includes content supporting quantum-resistant algorithms, and the content index information is index information of the content supporting quantum-resistant algorithms in the first digital certificate.
[0091] Specifically, content that supports quantum-resistant algorithms may include at least one of the public key of the first communication terminal or the signature of the certificate issuer that issued the first digital certificate. The first content may include at least one of the public key of the first communication terminal or the signature of the certificate issuer that issued the first digital certificate, and the content index information of the first content may include at least one of public key index information or signature index information. In the case where the first content includes the public key of the first communication terminal and the signature of the certificate issuer that issued the first digital certificate, the second communication terminal may search the second digital certificate for at least one of the public key indicated by the public key index information and the signature indicated by the signature index information, and determine the searched content as the content indicated by the content index information.
[0092] In some embodiments, the content index information may be sent by the first communication end to the second communication end. For example, in response to the encrypted communication connection request, the first communication end transmits a first request response result to the encrypted communication connection request to the second communication end, where the first request response result carries the content index information and the first digital certificate.
[0093] In this embodiment, since the data volume of the content supporting the quantum-resistant algorithm is generally large, compressing the content supporting the quantum-resistant algorithm can effectively reduce the data volume and improve the compression effect.
[0094] In some embodiments, as shown in FIG9 , a network communication method is provided, which is described by taking the method applied to the first communication terminal 102 in FIG1 as an example, including the following steps:
[0095] Step 902: Receive an encrypted communication connection request sent by the second communication terminal.
[0096] In order to achieve encrypted communication with the first communication terminal, the second communication terminal sends an encrypted communication connection request to the first communication terminal. In response to the encrypted communication connection request, the first communication terminal obtains the first digital certificate and sends the first digital certificate to the second communication terminal.
[0097] Step 904: In response to the encrypted communication connection request, transmit the first digital certificate to the second communication end, so that the second communication end actually receives the second digital certificate, and the second digital certificate is used to authenticate the identity of the first communication end.
[0098] Specifically, the first communication terminal transmits the first digital certificate to the second communication terminal via the non-encrypted communication link in response to the encrypted communication connection request, and the second communication terminal actually receives the second digital certificate.
[0099] Step 906: Receive a first key negotiation request sent by the second communication end.
[0100] Step 908: In response to the first key agreement request, a compressed digital certificate is sent to the second communication end. The compressed digital certificate is obtained by compressing the first digital certificate and is used for consistency verification with the second digital certificate.
[0101] Specifically, after receiving the second digital certificate, the second communication end sends a first key agreement request to the first communication end. In response to the first key agreement request, the second communication end compresses part or all of the content in the first digital certificate to obtain a compressed digital certificate, and then sends the compressed digital certificate to the second communication end. The second communication end receives the compressed digital certificate returned by the first communication end, compresses the second digital certificate to obtain a comparison digital certificate, and performs consistency verification on the comparison digital certificate and the compressed digital certificate.
[0102] Step 910: When the consistency verification passes and the identity verification passes, an encryption communication key is generated.
[0103] Specifically, if the consistency verification passes, the second communication terminal can authenticate the first terminal based on the second digital certificate. If the authentication passes, the second communication terminal can send information indicating the authentication pass to the first communication terminal, thereby instructing the first communication terminal to conduct encrypted communication with the second communication terminal. If the consistency verification passes and the authentication passes, the second communication terminal generates an encrypted communication key and can send a key generation request to the first communication terminal. The first communication terminal generates an encrypted communication key in response to the key generation request.
[0104] Step 912: Perform encrypted communication with the second communication end according to the encrypted communication key.
[0105] Specifically, the encryption communication key is a symmetric key, meaning that data encrypted using the encryption communication key can be decrypted using the encryption communication key. After the first and second communication terminals generate the encryption communication key, data sent by the first communication terminal to the second communication terminal is encrypted using the encryption communication key, and data sent by the second communication terminal to the first communication terminal is also encrypted using the encryption communication key. After the first communication terminal receives data encrypted using the encryption communication key from the second communication terminal, it decrypts the received data using the encryption communication key. After the second communication terminal receives data encrypted using the encryption communication key from the first communication terminal, it decrypts the received data using the encryption communication key, thereby achieving encrypted communication between the first and second communication terminals.
[0106] In the above-mentioned network communication method, an encrypted communication connection request sent by the second communication terminal is received, and in response to the encrypted communication connection request, a first digital certificate is transmitted to the second communication terminal, so that the second communication terminal actually receives the second digital certificate, and the second digital certificate is used to authenticate the first communication terminal. A first key negotiation request sent by the second communication terminal is received, and in response to the first key negotiation request, a compressed digital certificate is sent to the second communication terminal, which is obtained by compressing the first digital certificate. The compressed digital certificate is used to perform consistency verification with the second digital certificate. When the consistency verification passes and the identity authentication passes, an encrypted communication key is generated, and encrypted communication is performed with the second communication terminal based on the encrypted communication key. Since the first digital certificate is transmitted before sending the first key negotiation request, that is, before key negotiation is performed, and the compressed digital certificate corresponding to the first digital certificate is transmitted after sending the first key negotiation request, that is, during the key negotiation process, rather than during the key negotiation process, the amount of data transmitted during the key negotiation process is reduced, thereby reducing the failure rate of key negotiation and improving the success rate of key negotiation, thereby improving the efficiency of establishing an encrypted communication connection and improving communication efficiency.
[0107] In some embodiments, in response to an encrypted communication connection request, transmitting the first digital certificate to the second communication end includes: in response to the encrypted communication connection request, transmitting the first digital certificate to the second communication end when the data volume of the first digital certificate is greater than a data volume threshold.
[0108] Specifically, when the certificate type of the first digital certificate is the first certificate type, a first request response result for the encrypted communication connection request is transmitted to the second communication end, and the first request response result carries the first digital certificate; the data volume of the digital certificate of the first certificate type is greater than the data volume threshold; wherein, the second digital certificate refers to the digital certificate carried in the response result actually received by the second communication end after the first communication end returns the first request response result to the second communication end.
[0109] The second digital certificate refers to the digital certificate carried in the response result actually received by the second communication end after the first communication end returns the first request response result to the second communication end.
[0110] Specifically, in response to the encrypted communication connection request, the first communication end transmits a first request response result to the encrypted communication connection request to the second communication end via an unencrypted communication link if the data volume of the first digital certificate exceeds a data volume threshold. Because the first request response result is transmitted by the first communication end via the unencrypted communication link, the response result actually received by the second communication end may or may not be consistent with the first request response result.
[0111] In this embodiment, since the data transmission time will be increased when the data volume is large, the first communication end returns the first digital certificate when the data volume of the first digital certificate is greater than the data volume threshold. The first digital certificate with a large data volume can be transmitted before the key negotiation, rather than transmitting the first digital certificate with a large data volume during the key negotiation process, thereby reducing the data transmission delay during the key negotiation process, reducing the situation where the key negotiation process is interrupted due to a large transmission delay, increasing the probability of successful key negotiation, and improving communication efficiency.
[0112] In some embodiments, when the certificate type of the first digital certificate is the first certificate type, it is determined that the data volume of the first digital certificate is greater than a data volume threshold.
[0113] Specifically, when the certificate type of the first digital certificate is the first certificate type, the first communication end transmits a first request response result for the encrypted communication connection request to the second communication end via the non-encrypted communication link. The first request response result carries the first digital certificate.
[0114] In this embodiment, whether the data volume of the first digital certificate is greater than the data volume threshold is determined by the certificate type, thereby improving the efficiency of determining whether the data volume of the first digital certificate is greater than the data volume threshold.
[0115] In some embodiments, in response to an encrypted communication connection request, if the data volume of the first digital certificate is less than or equal to a data volume threshold, a response result without the first digital certificate is returned to the second communication end; a second key negotiation request sent by the second communication end is received, and in response to the second key negotiation request, the first digital certificate is sent to the second communication end; the second key negotiation request is returned by the second communication end in response to the response result without the first digital certificate; the first digital certificate is used by the second communication end to authenticate the identity of the first communication end; an encrypted communication key is generated if the identity authentication is successful, and encrypted communication is performed with the second communication end based on the encrypted communication key.
[0116] Specifically, the response result that does not carry the first digital certificate can be referred to as the second request response result. The second request response result is used to trigger the second communication end to send a second key negotiation request to the first communication end. In response to the second key negotiation request, the first communication end sends the first digital certificate to the second communication end. When the second communication end receives the first digital certificate, it authenticates the first communication end using the first digital certificate. If the authentication is successful, it generates an encryption communication key and sends a key generation request to the first communication end. The first communication end generates an encryption communication key in response to the key generation request. The first communication end and the second communication end then perform encrypted communication based on the encryption communication key.
[0117] In this embodiment, when the data volume of the first digital certificate is less than or equal to the data volume threshold, the first digital certificate is sent after the second key negotiation request triggers the key negotiation. Therefore, when the data volume is small, the first digital certificate is directly sent in the key negotiation stage, which ensures the security of data transmission, reduces the possibility of negotiation failure due to a large amount of transmitted data, and improves communication efficiency.
[0118] In some embodiments, the method further includes: when the certificate type of the first digital certificate is the second certificate type, determining that the data volume of the first digital certificate is less than or equal to a data volume threshold.
[0119] In this embodiment, whether the data volume of the first digital certificate is greater than the data volume threshold is determined by the certificate type, thereby improving the efficiency of determining whether the data volume of the first digital certificate is greater than the data volume threshold.
[0120] In some embodiments, in response to the first key negotiation request, sending a compressed digital certificate to the second communication end includes: in response to the first key negotiation request, determining the first content from the first digital certificate; compressing the first content according to a preset compression method to obtain the first compressed content; in the first digital certificate, updating the first content to the first compressed content to obtain the compressed digital certificate; and sending the compressed digital certificate to the second communication end.
[0121] The first content may be any part of the first digital certificate, and the data volume of the compressed digital certificate is less than or equal to the data volume threshold.
[0122] Specifically, the first communication end responds to the first key negotiation request, determines the first content to be compressed from the first digital certificate, compresses the first content using a preset compression method to obtain the first compressed content, and then updates the first content in the first digital certificate to the first compressed content, obtains the compressed digital certificate and sends the compressed digital certificate to the second communication end.
[0123] In this embodiment, the compressed digital certificate is obtained by compressing the first content in the first digital certificate, thereby compressing the data while improving the compression efficiency.
[0124] In some embodiments, the first digital certificate supports a quantum-resistant algorithm, and determining the first content from the first digital certificate includes: obtaining content for supporting the quantum-resistant algorithm from the first digital certificate to obtain the first content.
[0125] The first digital certificate supports quantum-resistant algorithms, the first digital certificate includes content supporting quantum-resistant algorithms, and the content index information is index information of the content of the first digital certificate supporting quantum-resistant algorithms.
[0126] Specifically, the content that supports quantum-resistant algorithms may include at least one of the public key of the first communication terminal or the signature of the certificate issuer that issues the first digital certificate, the first content may include at least one of the public key of the first communication terminal or the signature of the certificate issuer that issues the second digital certificate, and the content index information of the first content may include at least one of public key index information or signature index information.
[0127] In some embodiments, the first communication end obtains content supporting a quantum-resistant algorithm from the first digital certificate in response to a first key agreement request sent by the second communication end to obtain the first content.
[0128] In this embodiment, since the data volume of the content supporting the quantum-resistant algorithm is generally large, compressing the content supporting the quantum-resistant algorithm can effectively reduce the data volume and improve the compression effect.
[0129] In some embodiments, as shown in FIG10 , a network communication method is provided, which is described by taking the method applied to a first communication terminal and a second communication terminal as an example, including the following steps:
[0130] Step 1002: The second communication end sends an encrypted communication connection request to the first communication end.
[0131] Step 1004: The first communication end determines the certificate type of the first digital certificate in response to the encrypted communication connection request.
[0132] In step 1006, when the certificate type of the first digital certificate is the first certificate type, the first communication end sends a first request response result to the second communication end; the first request response result carries the first digital certificate, and the data volume of the digital certificate of the first certificate type is greater than the data volume threshold.
[0133] In step 1008, the second communication end actually receives the second digital certificate, where the second digital certificate is the digital certificate carried in the actually received response result.
[0134] Step 1010: The second communication end sends a first key negotiation request to the first communication end.
[0135] The first key negotiation request carries a first random number.
[0136] Step 1012: The first communication end sends a compressed digital certificate to the second communication end in response to the first key agreement request.
[0137] The compressed digital certificate is obtained by compressing the first digital certificate.
[0138] In step 1014, the second communication end compresses the second digital certificate to obtain a comparison digital certificate, and performs consistency verification on the comparison digital certificate and the compressed digital certificate.
[0139] Step 1016: During consistency verification, the first communication end is authenticated based on the second digital certificate.
[0140] In step 1018, when the certificate type of the first digital certificate is the second certificate type, the first communication end transmits a second request response result for the encrypted communication connection request to the second communication end; the second request response result does not carry the first digital certificate, and the data volume of the digital certificate of the second certificate type is less than or equal to the data volume threshold.
[0141] The second key agreement request carries the first random number.
[0142] Step 1020: The second communication end sends a second key agreement request to the first communication end in response to the received second request response result.
[0143] Step 1022: The first communication end sends a first digital certificate to the second communication end in response to the second key agreement request sent by the second communication end.
[0144] Step 1024: The second communication end authenticates the first communication end based on the first digital certificate.
[0145] Step 1026: When the identity authentication is passed, the first communication end and the second communication end generate an encryption communication key.
[0146] Step 1028: The first communication end and the second communication end perform encrypted communication based on the encrypted communication key.
[0147] In this embodiment, when the certificate type of the first digital certificate is the first certificate type, the complete digital certificate is transmitted before key negotiation is performed, and the compressed digital certificate is transmitted during the key negotiation process, thereby reducing the amount of data transmitted during the key negotiation process when the digital certificate is large. When the certificate type of the first digital certificate is the second certificate type, the complete digital certificate is transmitted during the key negotiation process, that is, when the digital certificate is small, the complete digital certificate is transmitted during the key negotiation process, thereby reducing the failure rate of key negotiation and improving the success rate of key negotiation, thereby improving the efficiency of establishing an encrypted communication connection and improving communication efficiency.
[0148] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0149] Based on the same inventive concept, embodiments of the present application also provide a network communication device for implementing the aforementioned network communication method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more network communication device embodiments provided below can be found in the above-mentioned limitations on the network communication method and will not be further elaborated here.
[0150] In some embodiments, as shown in FIG11 , a network communication device is provided, including: a connection request sending module 1102, a certificate receiving module 1104, a negotiation request sending module 1106, a verification module 1108, a first key generation module 1110, and a first encryption communication module 1112, wherein:
[0151] The connection request sending module 1102 is configured to send an encrypted communication connection request to the first communication terminal, where the encrypted communication connection request is used to instruct the first communication terminal to return a first digital certificate.
[0152] The certificate receiving module 1104 is used to receive a second digital certificate from the first communication terminal. The second digital certificate is the digital certificate actually received by the second communication terminal after the first communication terminal returns the first digital certificate in response to the encrypted communication connection request.
[0153] The negotiation request sending module 1106 is configured to send a first key negotiation request to the first communication terminal, and receive a compressed digital certificate returned by the first communication terminal in response to the first key negotiation request; the compressed digital certificate is obtained by compressing the first digital certificate.
[0154] The verification module 1108 is configured to perform consistency verification based on the second digital certificate and the compressed digital certificate.
[0155] The first key generation module 1110 is configured to generate an encryption communication key when consistency verification is passed and the identity of the first communication terminal is verified based on the second digital certificate.
[0156] The first encryption communication module 1112 is used to perform encryption communication with the first communication end based on the encryption communication key.
[0157] In some embodiments, the first digital certificate returned by the first communication end is returned by the first communication end when responding to an encrypted communication connection request and when the data volume of the first digital certificate is greater than a data volume threshold.
[0158] In some embodiments, the device is also used to: receive a response result returned by the second communication end that does not carry the first digital certificate when the data volume of the first digital certificate is less than or equal to a data volume threshold; send a second key negotiation request to the first communication end in response to the response result; receive the first digital certificate returned by the first communication end in response to the second key negotiation request; authenticate the first communication end based on the received first digital certificate; generate an encrypted communication key if the authentication is successful; and perform encrypted communication with the first communication end based on the encrypted communication key.
[0159] In some embodiments, the first digital certificate includes first content and content index information corresponding to the first content; the compressed digital certificate is obtained by compressing the first content using a preset compression method; the verification module 1108 is also used to compress the second content indicated by the content index information in the second digital certificate using a preset compression method to obtain second compressed content; in the second digital certificate, the second content is updated to the second compressed content to obtain a comparison digital certificate; and the comparison digital certificate and the compressed digital certificate are verified for consistency.
[0160] In some embodiments, the first digital certificate supports a quantum-resistant algorithm, and the first content is content in the first digital certificate used to support the quantum-resistant algorithm.
[0161] In some embodiments, as shown in FIG12 , a network communication device is provided, including: a connection request receiving module 1202, a certificate transmission module 1204, a negotiation request receiving module 1206, a negotiation request response module 1208, a second key generation module 1210, and a second encryption communication module 1212, wherein:
[0162] The connection request receiving module 1202 is configured to receive an encrypted communication connection request sent by the second communication terminal.
[0163] The certificate transmission module 1204 is used to transmit the first digital certificate to the second communication terminal in response to the encrypted communication connection request, so that the second communication terminal actually receives the second digital certificate, and the second digital certificate is used to authenticate the first communication terminal.
[0164] The negotiation request receiving module 1206 is configured to receive a first key negotiation request sent by the second communication terminal.
[0165] The negotiation request response module 1208 is used to send a compressed digital certificate to the second communication end in response to the first key negotiation request. The compressed digital certificate is obtained by compressing the first digital certificate and is used to verify consistency with the second digital certificate.
[0166] The second key generation module 1210 is used to generate an encryption communication key when the consistency verification passes and the identity verification passes.
[0167] The second encrypted communication module 1212 is used to perform encrypted communication with the second communication end according to the encrypted communication key.
[0168] In some embodiments, the certificate transmission module 1204 is further configured to: in response to an encrypted communication connection request, transmit the first digital certificate to the second communication end when the data volume of the first digital certificate is greater than a data volume threshold.
[0169] In some embodiments, the apparatus is further configured to: when the certificate type of the first digital certificate is the first certificate type, determine that the data volume of the first digital certificate is greater than a data volume threshold.
[0170] In some embodiments, a second key negotiation request is received from a second communication terminal, and in response to the second key negotiation request, a first digital certificate is sent to the second communication terminal, the second key negotiation request is returned by the second communication terminal in response to a response result that does not carry the first digital certificate, and the first digital certificate is used by the second communication terminal to authenticate the first communication terminal; if the authentication is successful, encrypted communication is performed with the second communication terminal. The device is also used to respond to an encrypted communication connection request, and if the data volume of the first digital certificate is less than or equal to a data volume threshold, return a response result that does not carry the first digital certificate to the second communication terminal; receive a second key negotiation request from the second communication terminal, and in response to the second key negotiation request, send the first digital certificate to the second communication terminal, the second key negotiation request is returned by the second communication terminal in response to a response result that does not carry the first digital certificate, and the target digital certificate is used by the second communication terminal to authenticate the first communication terminal; and, if the authentication is successful, generate an encrypted communication key, and perform encrypted communication with the second communication terminal based on the encrypted communication key.
[0171] In some embodiments, the apparatus is further configured to: when the certificate type of the first digital certificate is the second certificate type, determine that the data volume of the first digital certificate is less than or equal to a data volume threshold.
[0172] In some embodiments, the negotiation request response module 1208 is further used to determine the first content from the first digital certificate in response to the first key negotiation request; compress the first content according to a preset compression method to obtain the first compressed content; update the first content to the first compressed content in the first digital certificate to obtain a compressed digital certificate; and send the compressed digital certificate to the second communication end.
[0173] In some embodiments, the first digital certificate supports quantum-resistant algorithms; the negotiation request response module 1208 is further configured to obtain content supporting quantum-resistant algorithms from the first digital certificate to obtain first content.
[0174] Each module in the above-mentioned network communication device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0175] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be shown in Figure 13. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the network communication method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a network communication method is implemented.
[0176] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in Figure 14. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner may be implemented through WiFi, a mobile cellular network, NFC (near field communication), or other technologies. When the computer program is executed by the processor, it implements a network communication method. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0177] Those skilled in the art will understand that the structures shown in Figures 13 and 14 are merely block diagrams of partial structures related to the solution of the present application, and do not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different component arrangement.
[0178] In some embodiments, a computer device is provided, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and the processor implements the steps in the above-mentioned network communication method when executing the computer-readable instructions.
[0179] In some embodiments, one or more readable storage media are provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the steps in the above-mentioned network communication method are implemented.
[0180] In some embodiments, a computer program product is provided, comprising computer-readable instructions, which implement the steps in the above-mentioned network communication method when executed by one or more processors.
[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0182] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0183] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A network communication method, It is characterized in that Executed by the second communication terminal, the method includes: Sending an encrypted communication connection request to the first communication end, wherein the encrypted communication connection request is used to instruct the first communication end to return a first digital certificate; receiving a second digital certificate from the first communication end, wherein the second digital certificate is a digital certificate actually received by the second communication end after the first communication end returns the first digital certificate in response to the encrypted communication connection request; Sending a first key negotiation request to the first communication end, and receiving a compressed digital certificate returned by the first communication end in response to the first key negotiation request, wherein the compressed digital certificate is obtained by compressing the first digital certificate; Performing consistency verification based on the second digital certificate and the compressed digital certificate; When the consistency verification is passed, and the identity of the first communication terminal is verified based on the second digital certificate, an encrypted communication key is generated; and, Perform encrypted communication with the first communication end based on the encrypted communication key.
2. The method according to claim 1, It is characterized in that The first digital certificate returned by the first communication end is returned by the first communication end when responding to the encrypted communication connection request and when the data volume of the first digital certificate is greater than a data volume threshold.
3. The method according to claim 2, It is characterized in that The method further comprises: When the data volume of the first digital certificate is less than or equal to the data volume threshold, receiving a response result returned by the second communication end that does not carry the first digital certificate; In response to the response result, sending a second key negotiation request to the first communication end; Receiving the first digital certificate returned by the first communication end in response to the second key agreement request; authenticating the first communication terminal based on the received first digital certificate; Generate an encryption communication key if the identity verification is successful; and, Perform encrypted communication with the first communication end based on the encrypted communication key.
4. The method according to any one of claims 1 to 3, It is characterized in that The first digital certificate includes first content and content index information corresponding to the first content; the compressed digital certificate is obtained by compressing the first content in a preset compression method; The performing consistency verification based on the second digital certificate and the compressed digital certificate includes: Using the preset compression method, compressing the second content indicated by the content index information in the second digital certificate to obtain second compressed content; In the second digital certificate, the second content is updated to the second compressed content to obtain a comparison digital certificate; and, The consistency of the comparison digital certificate and the compressed digital certificate is verified.
5. The method according to claim 4, It is characterized in that The first digital certificate supports quantum-resistant algorithms, and the first content is content in the first digital certificate used to support quantum-resistant algorithms.
6. A network communication method, It is characterized in that Executed by the first communication terminal, the method includes: Receiving an encrypted communication connection request sent by a second communication terminal; In response to the encrypted communication connection request, transmitting the first digital certificate to the second communication end, so that the second communication end actually receives the second digital certificate, the second digital certificate being used to authenticate the identity of the first communication end; Receiving a first key negotiation request sent by the second communication end; In response to the first key agreement request, sending a compressed digital certificate to the second communication end, where the compressed digital certificate is obtained by compressing the first digital certificate and is used for consistency verification with the second digital certificate; When the consistency verification is passed and the identity verification is passed, an encrypted communication key is generated; and, Perform encrypted communication with the second communication end according to the encrypted communication key.
7. The method according to claim 6, It is characterized in that The transmitting the first digital certificate to the second communication end in response to the encrypted communication connection request comprises: In response to the encrypted communication connection request, when the data volume of the first digital certificate is greater than a data volume threshold, the first digital certificate is transmitted to the second communication end.
8. The method according to claim 7, It is characterized in that The method further comprises: In a case where the certificate type of the first digital certificate is the first certificate type, it is determined that the data volume of the first digital certificate is greater than a data volume threshold.
9. The method according to any one of claims 6 to 8, It is characterized in that The method further comprises: In response to the encrypted communication connection request, when the data volume of the first digital certificate is less than or equal to the data volume threshold, returning a response result without carrying the first digital certificate to the second communication end; receiving a second key negotiation request sent by the second communication end, and sending the first digital certificate to the second communication end in response to the second key negotiation request, wherein the second key negotiation request is returned by the second communication end in response to the response result not carrying the first digital certificate, and the first digital certificate is used by the second communication end to authenticate the identity of the first communication end; and, When the identity authentication is passed, an encrypted communication key is generated, and encrypted communication is performed with the second communication end based on the encrypted communication key.
10. The method according to claim 9, It is characterized in that The method further comprises: In a case where the certificate type of the first digital certificate is the second certificate type, it is determined that the data volume of the first digital certificate is less than or equal to a data volume threshold.
11. The method according to any one of claims 6 to 10, It is characterized in that The sending of the compressed digital certificate to the second communication end in response to the first key agreement request includes: In response to the first key agreement request, determining first content from the first digital certificate; Compressing the first content according to a preset compression method to obtain first compressed content; In the first digital certificate, the first content is updated to the first compressed content to obtain the compressed digital certificate; and, The compressed digital certificate is sent to the second communication end.
12. The method according to claim 11, It is characterized in that The first digital certificate supports a quantum-resistant algorithm; and determining the first content from the first digital certificate includes: Content used to support the quantum-resistant algorithm is obtained from the first digital certificate to obtain first content.
13. A network communication device, It is characterized in that The device comprises: A connection request sending module, used to send an encrypted communication connection request to the first communication end, wherein the encrypted communication connection request is used to instruct the first communication end to return a first digital certificate; a certificate receiving module, configured to receive a second digital certificate from the first communication terminal, wherein the second digital certificate refers to a digital certificate actually received by the second communication terminal after the first communication terminal returns the first digital certificate in response to the encrypted communication connection request; a negotiation request sending module, configured to send a first key negotiation request to the first communication end, and receive a compressed digital certificate returned by the first communication end in response to the first key negotiation request, wherein the compressed digital certificate is obtained by compressing the first digital certificate; A verification module, used for performing consistency verification based on the second digital certificate and the compressed digital certificate; A first key generation module is configured to generate an encrypted communication key when consistency verification is passed and identity verification of the first communication terminal is passed based on the second digital certificate; and The first encryption communication module is used to perform encryption communication with the first communication end based on the encryption communication key.
14. A network communication device, It is characterized in that The device comprises: A connection request receiving module, used to receive an encrypted communication connection request sent by the second communication terminal; a certificate transmission module, configured to transmit a first digital certificate to the second communication terminal in response to the encrypted communication connection request, so that the second communication terminal actually receives a second digital certificate, wherein the second digital certificate is used to authenticate the identity of the first communication terminal; A negotiation request receiving module, configured to receive a first key negotiation request sent by the second communication end; a negotiation request response module, configured to send a compressed digital certificate to the second communication end in response to the first key negotiation request, wherein the compressed digital certificate is obtained by compressing the first digital certificate and is used for consistency verification with the second digital certificate; A second key generation module is used to generate an encryption communication key when the consistency verification passes and the identity verification passes; and The second encrypted communication module is used to perform encrypted communication with the second communication end according to the encrypted communication key.
15. A computer device comprising a memory and one or more processors, the memory storing computer-readable instructions, It is characterized in that When the processor executes the computer-readable instructions, the steps of the method according to any one of claims 1 to 12 are implemented.
16. One or more computer-readable storage media having computer-readable instructions stored thereon, It is characterized in that When the computer readable instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
17. A computer program product comprising computer readable instructions, It is characterized in that When the computer readable instructions are executed by one or more processors, the steps of the method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Network communication method and device, computer equipment and storage medium
CN118827070A
License method, device and system based on asymmetric encryption
CN110324283A
Identity authentication method and device based on digital certificate, and computer equipment
CN114257410A
Identity verification method for handshake process of TLCP protocol
CN115021932A
Speculative acquisition of certificate validation information
US9507859B1
