Encrypted communication method, system, computer device, readable storage medium and program product
By conducting key negotiation between the server and the client, using encryption certificates and randomly generated public keys, the security of the TLS/SSL communication protocol is improved, and the problem of keys being easily stolen in the existing technology is solved. Enhanced security and data protection for encrypted communications.
Patent Information
- Application Number
- CN202211197467.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-09-29
AI Technical Summary
The existing method of encrypted communication using TLS/SSL communication protocol has low security. Unauthorized third parties can easily steal the keys used in communication between the client and the server, thereby illegally accessing the server and cracking the data stored on the server. data, causing user data security to be threatened.
By receiving the client's encrypted communication request on the server, it selects a supported target cipher suite and generates server-side key negotiation information, including at least one encryption certificate, which is sent to the client for key negotiation. The client randomly generates a public key and communicates with the service. The target key is obtained through end-to-end negotiation, which improves the randomness of the key generation process and enhances the security of the key.
It greatly increases the difficulty of cracking the final target key, improves the security of encrypted communication, ensures information security, and reduces the possibility of data theft or data loss caused by a third party cracking the target key.
Smart Images

Figure CN115529129B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of network encryption communication, and in particular to an encryption communication method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the rapid popularization of the Internet, the importance of communication security is increasing. Currently, most encrypted communications use the TLS / SSL communication protocol, which can provide data integrity protection, data confidentiality protection and identity authentication functions for data communications.
[0003] However, the existing method of using TLS / SSL communication protocol for encrypted communication has low security. Unauthorized third parties can easily steal the key used when the client communicates with the server, thereby illegally accessing the server and cracking the data stored on the server. This threatens the user's data security and reduces the security performance of secure transmission services and remote access services. Summary of the invention
[0004] Based on this, it is necessary to provide an encrypted communication method, apparatus, computer device, storage medium and computer program product that can improve the security of encrypted communication in response to the above technical problems.
[0005] In a first aspect, the present application provides an encrypted communication method, applied to a server, comprising:
[0006] receiving an encrypted communication request sent by a client, wherein the encrypted communication request carries an initial cipher suite;
[0007] Selecting a supported target cipher suite from the initial cipher suite and generating server-side key negotiation information; the server-side key negotiation information carries at least one encryption certificate;
[0008] Sending the target cipher suite and the server key negotiation information to the client, wherein the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key;
[0009] Encrypted communication is performed with the client via the target key.
[0010] In one embodiment, sending the target cipher suite and the server key negotiation information to the client, wherein the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key, includes:
[0011] Sending the target cipher suite and the server key agreement information to the client, wherein the target cipher suite and the server key agreement information are used to instruct the client to determine at least one of the encryption certificate and the signature information from the server key agreement information, verify the server key agreement information based on the signature information, determine the server public key based on any one of the encryption certificates, generate the client key agreement information based on the server public key and the client public key, and send the client key agreement information to the server;
[0012] Receiving the client key negotiation information sent by the client;
[0013] The client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key.
[0014] In one embodiment, obtaining the client public key according to the client key negotiation information, and determining the target key according to the client public key includes:
[0015] The client key negotiation information is decrypted according to a server private key corresponding to at least one of the encryption certificates to obtain the client public key, and the target key is determined according to the client public key.
[0016] In a second aspect, the present application also provides an encrypted communication method, applied to a client, comprising:
[0017] Sending an encrypted communication request to the server, wherein the encrypted communication request carries an initial cipher suite;
[0018] receiving a target cipher suite and server key negotiation information sent by the server, and performing key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain a target key; the target cipher suite is one of the initial cipher suites selected by the server, and the server key negotiation information carries at least one encryption certificate;
[0019] The target key is used to perform encrypted communication with the server.
[0020] In one of the embodiments, performing key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain a target key includes:
[0021] The target key is determined according to the server key negotiation information and the target cipher suite, and client key negotiation information is generated according to the server key negotiation information and the client public key, and the client key negotiation information is sent to the server, wherein the client key negotiation information is used to instruct the server to decrypt the client key negotiation information according to a server private key corresponding to at least one of the encryption certificates, obtain the client public key, and determine the target key according to the client public key; the client public key is randomly generated by the client.
[0022] In one embodiment, generating the client key negotiation information according to the server key negotiation information and the client public key includes:
[0023] Determine at least one encryption certificate and signature information according to the server key negotiation information;
[0024] Verifying the server key agreement information based on the signature information;
[0025] The server public key is determined based on any one of the encryption certificates, and the client key negotiation information is generated based on the server public key and the client public key.
[0026] In a third aspect, the present application also provides an encrypted communication system, including a server and a client;
[0027] The server is used to:
[0028] receiving an encrypted communication request sent by the client, wherein the encrypted communication request carries an initial cipher suite;
[0029] Selecting a supported target cipher suite from the initial cipher suite and generating server-side key negotiation information; the server-side key negotiation information carries at least one encryption certificate;
[0030] Sending the target cipher suite and the server key negotiation information to the client, wherein the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key;
[0031] Receiving client key negotiation information sent by the client, and obtaining the target key through negotiation with the server according to the client key negotiation information;
[0032] Performing encrypted communication with the client via the target key;
[0033] The client is used to:
[0034] Sending the encrypted communication request to the server, wherein the encrypted communication request carries an initial cipher suite;
[0035] Receiving a target cipher suite and server key negotiation information sent by the server, and performing key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain a target key;
[0036] Performing encrypted communication with the server via the target key;
[0037] The client key negotiation information is generated according to the server key negotiation information and the client public key, and the client key negotiation information is sent to the server. The client key negotiation information is used to instruct the server to negotiate with the client to generate a target key.
[0038] In a fourth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the encrypted communication method described in any of the above embodiments is implemented.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the encryption communication method described in any of the above embodiments.
[0040] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program product is executed by a processor, implements the encryption communication method described in any of the above embodiments.
[0041] With the above-mentioned encryption communication method, apparatus, computer equipment, storage medium and computer program product, the server can provide multiple server public keys to the client, and the client can randomly generate a client public key and randomly select a key exchange algorithm to process one of the server public keys to perform key negotiation, thereby improving the randomness of the key generation process and greatly increasing the difficulty of cracking the target key finally used, so that the target key obtained after the final negotiation is more secure and less likely to be cracked by a third party; thereby greatly improving the security of encrypted communication and ensuring information security. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A diagram of an application environment of an encryption communication method in an embodiment;
[0043] Figure 2 It is a schematic diagram of the flow of the encryption communication method in the first embodiment;
[0044] Figure 3 It is a flowchart of the encryption communication method in the second embodiment;
[0045] Figure 4 It is a flowchart of the encryption communication method in the third embodiment;
[0046] Figure 5 is a flow chart of an encrypted communication method in a fourth embodiment;
[0047] Figure 6 is a flowchart of an encryption communication method in a fifth embodiment;
[0048] Figure 7 A schematic diagram of a flow chart of an encrypted communication system in one embodiment;
[0049] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The encryption communication method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the client 104 communicates with the server 102 via a network. The data storage system can store data that the server 102 needs to process.
[0052] The server 102 receives an encrypted communication request sent by the client 104, and the encrypted communication request carries an initial cipher suite; the server 102 selects a supported target cipher suite from the initial cipher suite and generates server key negotiation information; the server key negotiation information carries at least one encryption certificate; the server 102 sends the target cipher suite and the server key negotiation information to the client 104, and the target cipher suite and the server key negotiation information are used to instruct the client 104 to negotiate a key with the server 102 to obtain a target key; the client 104 performs encrypted communication with the server 102 through the target key. Among them, the client 104 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 102 can be implemented by an independent server or a server cluster composed of multiple servers. The client 104 and the server 102 can be directly or indirectly connected through wired or wireless communication, such as through a network connection.
[0053] For another example, the encryption communication method is applied to the client 104, the client 104 sends an encryption communication request to the server 102, and the encryption communication request carries an initial cipher suite; the client 104 receives the target cipher suite and the server key negotiation information sent by the server 102, and performs key negotiation with the server 102 according to the server key negotiation information and the target cipher suite to obtain the target key; the target cipher suite is one of the initial cipher suites selected by the server, and the server key negotiation information carries at least one encryption certificate; the client 104 performs encrypted communication with the server 102 through the target key. It can be understood that the memory can be an independent storage device, or the memory is located on the server, or the memory is located on another terminal.
[0054] In one embodiment, an encryption communication method is provided. This embodiment uses the encryption communication method applied to the server 102 as an example. Figure 2 As shown, the encryption communication method includes:
[0055] Step 202: Receive an encrypted communication request sent by the client, where the encrypted communication request carries an initial cipher suite.
[0056] The encrypted communication request may be a request sent by the client 104 to perform encrypted data communication with the server 102. For example, the encrypted communication request may be a handshake verification request based on the Secure Socket Layer (SSL) protocol, and the connection mode corresponding to the encrypted communication request is an SSL connection.
[0057] The initial cipher suite is a plurality of cipher suites supported by the client 104. The initial cipher suite may be a cipher suite supporting a national cryptographic algorithm. The initial cipher suite may include national commercial asymmetric cryptographic algorithms, various key exchange algorithms, digest algorithms, and foreign standard symmetric cryptographic algorithms.
[0058] In this embodiment, the server 102 receives a request for data encryption communication from the client 104 , and simultaneously obtains all cipher suites supported by the client 104 .
[0059] Step 204: Select a supported target cipher suite from the initial cipher suite and generate server-side key negotiation information; the server-side key negotiation information carries at least one encryption certificate.
[0060] The target cipher suite refers to a cipher suite selected by the server 102 from all initial cipher suites supported by the client 104 , and the server 102 supports the target cipher suite.
[0061] The encryption certificate is a digital authentication identifier issued by a certificate issuing authority and used to identify the identity of the server 102. Each encryption certificate includes an encrypted public-private key pair, which uniquely identifies the server 102 and is bound to the identity information of the server 102. It can be understood that the server key negotiation information carries at least one server public key corresponding to the server 102.
[0062] The server key negotiation information refers to a data packet including at least one encryption certificate. It can also be understood that the server key negotiation information refers to a data packet including at least one server public key.
[0063] As an example, the server public key may be a server public key required by an ECC key exchange algorithm, or a server public key required by a DH key exchange algorithm.
[0064] In this embodiment, the server 102 selects one from all cipher suites supported by the client 104 as the target cipher suite, and generates server key negotiation information including multiple encryption certificates to integrate at least one server public key corresponding to the server 102 .
[0065] Step 206: Send the target cipher suite and server key negotiation information to the client. The target cipher suite and server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key.
[0066] Key negotiation refers to the negotiation between two or more communicating parties to jointly establish a session key.
[0067] The target key refers to the session key established between the server 102 and the client 104 .
[0068] As an example, the server 102 can generate server key negotiation information based on an encryption certificate containing the server public key required for the ECC key exchange algorithm and an encryption certificate containing the server public key required for the DH key exchange algorithm. After receiving the server key negotiation information, the client 104 randomly selects a server public key corresponding to an encryption certificate. When the encryption certificate containing the server public key required for the ECC key exchange algorithm is selected, the client 104 adopts any suitable ECC key exchange algorithm to implement key negotiation with the server 102. When the encryption certificate containing the server public key required for the DH key exchange algorithm is selected, the client 104 adopts the DH key exchange algorithm to implement key negotiation with the server 102.
[0069] In this embodiment, the server 102 sends the supported target cipher suite and the server key negotiation information including at least one server public key to the client 104. The server 102 and the client 104 determine the target key after negotiation based on the target cipher suite supported by the server 102 and at least one server public key to conduct an encrypted session.
[0070] Step 208: Perform encrypted communication with the client via the target key.
[0071] In this embodiment, the server 102 and the client 104 conduct an encrypted session using the target key obtained through negotiation.
[0072] In the above encryption communication method, the server 102 receives an encryption communication request from the client 104, selects a supported cipher suite from a plurality of initial cipher suites supported by the client 104 as a target cipher suite, and sends the server key negotiation information carrying at least one encryption certificate and the target cipher suite to the client 104, so that the client 104 can use the target cipher suite and the server public key corresponding to any encryption certificate to negotiate with the server 102 to obtain the target key, and the server 102 uses the target key to conduct an encryption session with the client 104. Through this setting, the server 102 can provide multiple server public keys to the client 104, and the client 104 can randomly select a server public key for key negotiation, which improves the randomness of the key generation process, so that the target key obtained after the final negotiation is more secure and less likely to be cracked by a third party.
[0073] like Figure 3 As shown, in some optional embodiments, step 206 includes:
[0074] Step 2062: Send the target cipher suite and the server key negotiation information to the client. The target cipher suite and the server key negotiation information are used to instruct the client to determine at least one encryption certificate and signature information from the server key negotiation information, verify the server key negotiation information based on the signature information, determine the server public key based on any encryption certificate, generate the client key negotiation information based on the server public key and the client public key, and send the client key negotiation information to the server.
[0075] Step 2064: Receive client key negotiation information sent by the client.
[0076] Step 2066: Obtain the client public key according to the client key negotiation information, and determine the target key according to the client public key.
[0077] The signature information may be a signature certificate of the server 102, which is used to sign and encrypt the information of the server 102 to ensure the validity and non-repudiation of the information sent by the server 102. After receiving the target cipher suite and the server key negotiation information, the client 104 verifies the signature information according to the signature information of the server 102 using the signature public key of the server 102. If the verification is successful, the client 104 further randomly selects an encryption certificate, extracts the server public key corresponding to the selected encryption certificate, encrypts the client public key, and generates the client key negotiation information.
[0078] The client key negotiation information refers to a data packet containing the client public key encrypted with the server public key.
[0079] Furthermore, the server 102 receives the client key negotiation information sent by the client 104, obtains the client public key therefrom, and determines the target key of the server 102 according to the client public key.
[0080] In this embodiment, the server 102 sends the target cipher suite and the server key negotiation information to the client 104, so that the client 104 can determine a server public key according to the target cipher suite and at least one encryption certificate included in the server key negotiation information, and encrypt the client public key according to the determined server public key, generate the client key negotiation information and send it to the server 102, then the server 102 obtains the client key from the client key negotiation information, and determines the target key of the server 102 according to the client public key. Through this setting, the server 102 can complete the key negotiation with the client 104, obtain the target key for encrypted communication, so that the security of data transmission is enhanced, and the possibility of data theft or data loss caused by the target key being cracked by a third party is reduced.
[0081] In some optional embodiments, step 2066 includes:
[0082] The client key negotiation information is decrypted according to the server private key corresponding to at least one encryption certificate to obtain the client public key, and the target key is determined according to the client public key.
[0083] Specifically, the server 102 can obtain the server private keys corresponding to all encryption certificates contained in the server key negotiation information, and decrypt the client key negotiation information in sequence until the decryption is successful, obtain the client public key contained in the client key negotiation information, and generate the target key based on the successfully decrypted server private key and the client public key obtained after decryption.
[0084] In this embodiment, the server 102 uses its own server private key to decrypt the client key negotiation information, thereby improving the security of the key negotiation process.
[0085] In one embodiment, an encryption communication method is provided. This embodiment uses the encryption communication method applied to the client 104 as an example. Figure 4 As shown, the encryption communication method includes:
[0086] Step 402: Send an encrypted communication request to the server, where the encrypted communication request carries an initial cipher suite.
[0087] The encrypted communication request may be issued by the client 104 according to the user's instruction.
[0088] The initial cipher suite is a plurality of cipher suites supported by the client 104. The initial cipher suite may be a cipher suite supporting a national cryptographic algorithm. The initial cipher suite may include national commercial asymmetric cryptographic algorithms, various key exchange protocols, digest algorithms, and foreign standard symmetric cryptographic algorithms.
[0089] As an example, the client 104 pre-stores a list of supported cipher suites, which includes multiple cipher suites. In step 402, the client 104 extracts a preset number of cipher suites from the cipher suite list as initial cipher suites, and sends an encrypted communication request including the initial cipher suite to the server 102.
[0090] In this embodiment, the client 104 attaches a plurality of cipher suites supported by the client 104 to the encrypted communication request according to the user's instruction, and sends the encrypted communication request to the server 102 .
[0091] Step 404: Receive the target cipher suite and server key negotiation information sent by the server, and perform key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain the target key; the target cipher suite is one of the initial cipher suites selected by the server, and the server key negotiation information carries at least one encryption certificate.
[0092] In this embodiment, after receiving the target cipher suite and the server key negotiation information, the client 104 adopts the target cipher suite and performs key negotiation with the server 102 according to the server key negotiation information to obtain the target key.
[0093] Step 406: Encrypted communication is performed with the server via the target key.
[0094] In this embodiment, the client 104 and the server 102 perform an encrypted session using the target key obtained after negotiation.
[0095] In some optional embodiments, step 404 includes:
[0096] The client key negotiation information is generated according to the server key negotiation information and the client public key, and the client key negotiation information is sent to the server. The client key negotiation information is used to instruct the server to decrypt the client key negotiation information according to the server private key corresponding to at least one encryption certificate, obtain the client public key, and determine the target key according to the client public key; the client public key is randomly generated by the client.
[0097] As an example, the client 104 randomly generates a random number as a client public key, and generates client negotiation information according to the client public key and at least one server public key carried in the server key negotiation information.
[0098] In this embodiment, the client 104 randomly generates a client key, and randomly uses the server key negotiation information and the client key to negotiate a key with the server 102, so that the target key finally obtained is more random and more difficult to crack, thereby enhancing the security of encrypted communication between the client 104 and the server 102.
[0099] like Figure 5 As shown, in some optional embodiments, generating client key negotiation information according to the server key negotiation information and the client public key includes:
[0100] Step 502: Determine at least one encryption certificate and signature information according to the server key negotiation information.
[0101] Step 504: Verify the server key negotiation information based on the signature information.
[0102] Step 506: Determine the server public key based on any encryption certificate, and generate client key negotiation information based on the server public key and the client public key.
[0103] The client 104 determines at least one encryption certificate and signature information carried in the server key negotiation information from the server key negotiation information, and further verifies the server key negotiation information according to the signature information.
[0104] As an example, the client 104 uses the signature public key of the server 102 to verify the signature information of the server 102. If the verification passes, it further randomly selects an encryption certificate of the server 102, extracts the server public key corresponding to the selected encryption certificate, encrypts the randomly generated client public key, and obtains the client key negotiation information.
[0105] In one embodiment, after receiving the server key negotiation information, the client 104 first verifies the legitimacy of the encryption certificate carried in the server key negotiation information: for example, verifies the integrity of the encryption certificate, whether the domain name to be resolved is in the encryption certificate, etc. If the verification fails, it prompts that the key negotiation between the server 102 and the client 104 has failed. If successful, continue to execute step 502.
[0106] In this embodiment, after the client 104 authenticates the server 102 according to the signature information carried by the server key negotiation information, it randomly extracts an encryption certificate from the server key negotiation information, obtains the server public key corresponding to the encryption certificate, and uses the server public key to encrypt the randomly generated client public key to obtain the client key negotiation information. Through this setting, after ensuring that the server key negotiation information received by the client 104 comes from the server 102, the final client key negotiation information can be randomly generated, which increases the difficulty of cracking the information during the key negotiation process and ensures information security.
[0107] like Figure 6 As shown, in this embodiment, the encryption communication method includes:
[0108] Step 602 : The client 104 sends an encrypted communication request to the server 102 .
[0109] Step 604: The server 102 obtains the initial cipher suites supported by the client 104 from the encrypted communication request, and selects a target cipher suite therefrom.
[0110] Step 606 : The server 102 generates server key negotiation information according to at least one encryption certificate, and sends the server key negotiation information and the target cipher suite to the client 104 .
[0111] In step 608, the client 104 obtains the signature information according to the server key negotiation information, and verifies the signature information using the signature public key of the issuing agency corresponding to the signature information, and determines whether the verification is successful; if successful, continue to step 610; if unsuccessful, execute step 620.
[0112] Step 610: The client 104 selects the server public key required for the ECC key exchange algorithm from the server key negotiation information.
[0113] Step 612, the client 104 randomly generates at least one random number as the client public key, and also generates a corresponding client private key, and uses any suitable ECC key exchange algorithm to generate the client's target key based on the server public key and the client private key, and then encrypts the client public key with the server public key to obtain the client key negotiation information.
[0114] Step 614 : The client 104 sends client key negotiation information to the server 102 .
[0115] Step 616, the server 102 obtains the server private keys corresponding to all encryption certificates, and decrypts the client key negotiation information in sequence until the client public key is obtained, and generates the server's target key based on the client public key and the successfully decrypted server private key.
[0116] Step 618: The client 104 and the server 102 use the target key for encrypted communication.
[0117] Step 620: prompt the client 104 and the server 102 that the key negotiation has failed.
[0118] In the above encryption communication method, the client 104 sends multiple cipher suites supported by itself to the server 102 for selection. The server 102 then sends the selected cipher suite and at least one encryption certificate containing the corresponding public-private key pair to the client. The client randomly selects a server public key corresponding to an encryption certificate to encrypt a randomly generated client public key, and sends the encrypted client public key to the server 102. The server 102 uses the server private keys corresponding to all encryption certificates to decrypt the client public key, and generates the server's target key based on the successfully decrypted server private key and the client public key obtained after decryption, and then uses the target key to perform encrypted communication with the client 104. Through the settings in this embodiment, the client 104 can authenticate the object that sends the server key negotiation information, and after determining to perform key negotiation with the server 102, it can randomly use a server public key of the server 102 to encrypt a random client public key, which greatly increases the difficulty of cracking the target key finally used and improves the security of encrypted communication.
[0119] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed 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 part of the steps or stages in other steps.
[0120] Based on the same inventive concept, the embodiment of the present application also provides an encryption communication device for implementing the encryption communication method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more encryption communication device embodiments provided below can refer to the limitations on the encryption communication method above, and will not be repeated here.
[0121] In one embodiment, Figure 7 As shown, an encrypted communication system 700 is provided, including: a server 102 and a client 104, wherein:
[0122] The server 102 is used for:
[0123] receiving an encrypted communication request sent by the client 104, wherein the encrypted communication request carries an initial cipher suite;
[0124] Select a supported target cipher suite from the initial cipher suites and generate server key negotiation information; the server key negotiation information carries at least one encryption certificate;
[0125] Send the target cipher suite and the server key negotiation information to the client 104, where the target cipher suite and the server key negotiation information are used to instruct the client 104 to perform key negotiation with the server 102 to obtain the target key;
[0126] Communicate with the client 104 through encryption using the target key;
[0127] The client 104 is used to:
[0128] Sending an encrypted communication request to the server 102, the encrypted communication request carrying an initial cipher suite;
[0129] Receive the target cipher suite and server key negotiation information sent by the server 102, and perform key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain a target key;
[0130] Encrypted communication is performed with the server 102 via the target key.
[0131] In some optional embodiments, the server 102 is further configured to:
[0132] Sending the target cipher suite and the server key negotiation information to the client, where the target cipher suite and the server key negotiation information are used to instruct the client to determine at least one encryption certificate and signature information from the server key negotiation information, verify the server key negotiation information based on the signature information, determine the server public key based on any encryption certificate, generate the client key negotiation information based on the server public key and the client public key, and send the client key negotiation information to the server;
[0133] Receive client key negotiation information sent by the client;
[0134] The client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key.
[0135] In some optional embodiments, the server 102 is further configured to:
[0136] The client key negotiation information is decrypted according to the server private key corresponding to at least one encryption certificate to obtain the client public key, and the target key is determined according to the client public key.
[0137] In some optional embodiments, the client 104 is further configured to:
[0138] The client key negotiation information is generated according to the server key negotiation information and the client public key, and the client key negotiation information is sent to the server. The client key negotiation information is used to instruct the server to decrypt the client key negotiation information according to the server private key corresponding to at least one encryption certificate, obtain the client public key, and determine the target key according to the client public key; the client public key is randomly generated by the client.
[0139] In some optional embodiments, the client 104 is further configured to:
[0140] Determine at least one encryption certificate and signature information according to the server key negotiation information;
[0141] Verify the server key negotiation information based on the signature information;
[0142] The server public key is determined based on any encryption certificate, and the client key negotiation information is generated based on the server public key and the client public key.
[0143] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, 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 the 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 the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an encrypted communication method is implemented. The display unit of the computer device is used to form a visually visible picture, which 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, and 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 shell, or an external keyboard, touchpad or mouse.
[0144] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does 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 those shown in the figure, or combine certain components, or have a different arrangement of components.
[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:
[0146] receiving an encrypted communication request sent by a client, where the encrypted communication request carries an initial cipher suite;
[0147] Select a supported target cipher suite from the initial cipher suites and generate server key negotiation information; the server key negotiation information carries at least one encryption certificate;
[0148] Send the target cipher suite and server key negotiation information to the client, where the target cipher suite and server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain the target key;
[0149] Encrypted communication with the client is performed via the target key.
[0150] In some optional embodiments, sending the target cipher suite and the server key negotiation information to the client, where the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain the target key, includes:
[0151] Sending the target cipher suite and the server key negotiation information to the client, where the target cipher suite and the server key negotiation information are used to instruct the client to determine at least one encryption certificate and signature information from the server key negotiation information, verify the server key negotiation information based on the signature information, determine the server public key based on any encryption certificate, generate the client key negotiation information based on the server public key and the client public key, and send the client key negotiation information to the server;
[0152] Receive client key negotiation information sent by the client;
[0153] The client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key.
[0154] In some optional embodiments, obtaining a client public key according to the client key negotiation information, and determining a target key according to the client public key includes:
[0155] The client key negotiation information is decrypted according to the server private key corresponding to at least one encryption certificate to obtain the client public key, and the target key is determined according to the client public key.
[0156] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:
[0157] Send an encrypted communication request to the server, the encrypted communication request carries the initial cipher suite;
[0158] Receive the target cipher suite and server key negotiation information sent by the server, and perform key negotiation with the server to obtain the target key according to the server key negotiation information and the target cipher suite; the target cipher suite is one of the initial cipher suites selected by the server, and the server key negotiation information carries at least one encryption certificate;
[0159] Encrypted communication with the server is performed via the target key.
[0160] In some optional embodiments, performing key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain the target key includes:
[0161] The client key negotiation information is generated according to the server key negotiation information and the client public key, and the client key negotiation information is sent to the server. The client key negotiation information is used to instruct the server to decrypt the client key negotiation information according to the server private key corresponding to at least one encryption certificate, obtain the client public key, and determine the target key according to the client public key; the client public key is randomly generated by the client.
[0162] In some optional embodiments, generating client key negotiation information according to the server key negotiation information and the client public key includes:
[0163] Determine at least one encryption certificate and signature information according to the server key negotiation information;
[0164] Verify the server key negotiation information based on the signature information;
[0165] The server public key is determined based on any encryption certificate, and the client key negotiation information is generated based on the server public key and the client public key.
[0166] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps:
[0167] receiving an encrypted communication request sent by a client, where the encrypted communication request carries an initial cipher suite;
[0168] Select a supported target cipher suite from the initial cipher suites and generate server key negotiation information; the server key negotiation information carries at least one encryption certificate;
[0169] Send the target cipher suite and server key negotiation information to the client, where the target cipher suite and server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain the target key;
[0170] Encrypted communication with the client is performed via the target key.
[0171] In some optional embodiments, sending the target cipher suite and the server key negotiation information to the client, where the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain the target key, includes:
[0172] Sending the target cipher suite and the server key negotiation information to the client, where the target cipher suite and the server key negotiation information are used to instruct the client to determine at least one encryption certificate and signature information from the server key negotiation information, verify the server key negotiation information based on the signature information, determine the server public key based on any encryption certificate, generate the client key negotiation information based on the server public key and the client public key, and send the client key negotiation information to the server;
[0173] Receive client key negotiation information sent by the client;
[0174] The client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key.
[0175] In some optional embodiments, obtaining a client public key according to the client key negotiation information, and determining a target key according to the client public key includes:
[0176] The client key negotiation information is decrypted according to the server private key corresponding to at least one encryption certificate to obtain the client public key, and the target key is determined according to the client public key.
[0177] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps:
[0178] Send an encrypted communication request to the server, the encrypted communication request carries the initial cipher suite;
[0179] Receive the target cipher suite and server key negotiation information sent by the server, and perform key negotiation with the server to obtain the target key according to the server key negotiation information and the target cipher suite; the target cipher suite is one of the initial cipher suites selected by the server, and the server key negotiation information carries at least one encryption certificate;
[0180] Encrypted communication with the server is performed via the target key.
[0181] In some optional embodiments, performing key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain the target key includes:
[0182] The client key negotiation information is generated according to the server key negotiation information and the client public key, and the client key negotiation information is sent to the server. The client key negotiation information is used to instruct the server to decrypt the client key negotiation information according to the server private key corresponding to at least one encryption certificate, obtain the client public key, and determine the target key according to the client public key; the client public key is randomly generated by the client.
[0183] In some optional embodiments, generating client key negotiation information according to the server key negotiation information and the client public key includes:
[0184] Determine at least one encryption certificate and signature information according to the server key negotiation information;
[0185] Verify the server key negotiation information based on the signature information;
[0186] The server public key is determined based on any encryption certificate, and the client key negotiation information is generated based on the server public key and the client public key.
[0187] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an 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 each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0188] The technical features of the above embodiments may 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.
[0189] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An encrypted communication method, It is characterized in that Applied to the server, including: receiving an encrypted communication request sent by a client, wherein the encrypted communication request carries an initial cipher suite; Selecting a supported target cipher suite from the initial cipher suite and generating server-side key negotiation information; the server-side key negotiation information carries multiple encryption certificates; Sending the target cipher suite and the server key negotiation information to the client, wherein the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key; Performing encrypted communication with the client via the target key; The sending the target cipher suite and the server key negotiation information to the client, wherein the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key, includes: Sending the target cipher suite and the server key agreement information to the client, wherein the target cipher suite and the server key agreement information are used to instruct the client to determine a plurality of the encryption certificates and signature information from the server key agreement information, and verify the server key agreement information based on the signature information, and if the verification is successful, randomly select an encryption certificate and the target cipher suite, determine the server public key based on the selected encryption certificate, generate the client key agreement information based on the target cipher suite, the server public key and the client public key, and send the client key agreement information to the server; Receiving the client key negotiation information sent by the client; The client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key.
2. The method according to claim 1, wherein the client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key. include: The client key negotiation information is decrypted according to the server private keys corresponding to the multiple encryption certificates to obtain the client public key, and the target key is determined according to the client public key.
3. An encrypted communication method, It is characterized in that Applied to the client, including: Sending an encrypted communication request to the server, wherein the encrypted communication request carries an initial cipher suite; Receive the target cipher suite and server key negotiation information sent by the server, and perform key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain the target key, including: determining multiple encryption certificates and signature information from the server key negotiation information, and verifying the server key negotiation information based on the signature information, if the verification is successful, randomly selecting an encryption certificate and the target cipher suite, determining the server public key based on the selected encryption certificate, generating client key negotiation information based on the target cipher suite, the server public key and the client public key, and sending the client key negotiation information to the server; the client key negotiation information is used to instruct the server to obtain the client public key according to the client key negotiation information, and determine the target key according to the client public key; the target cipher suite is one of the initial cipher suites selected by the server, and the server key negotiation information carries multiple encryption certificates; The target key is used to perform encrypted communication with the server.
4. According to the method described in claim 3, the client key negotiation information is used to instruct the server to decrypt the client key negotiation information according to the server private keys corresponding to the multiple encryption certificates, obtain the client public key, and determine the target key according to the client public key; the client public key is randomly generated by the client.
5. An encrypted communication system, It is characterized in that Including server and client; The server is used to: receiving an encrypted communication request sent by the client, wherein the encrypted communication request carries an initial cipher suite; Selecting a supported target cipher suite from the initial cipher suites and generating server-side key negotiation information; The server key negotiation information carries multiple encryption certificates; Sending the target cipher suite and the server key negotiation information to the client, wherein the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key; Receiving client key negotiation information sent by the client, and obtaining the target key through negotiation with the server according to the client key negotiation information; Performing encrypted communication with the client via the target key; The client is used to: Sending the encrypted communication request to the server, wherein the encrypted communication request carries an initial cipher suite; Receiving a target cipher suite and server key negotiation information sent by the server, and performing key negotiation with the server according to the server key negotiation information and the target cipher suite to obtain a target key; Performing encrypted communication with the server via the target key; Generate client key negotiation information according to the server key negotiation information and the client public key, and send the client key negotiation information to the server, wherein the client key negotiation information is used to instruct the server to negotiate with the client to generate a target key; The sending the target cipher suite and the server key negotiation information to the client, wherein the target cipher suite and the server key negotiation information are used to instruct the client to perform key negotiation with the server to obtain a target key, includes: Sending the target cipher suite and the server key agreement information to the client, wherein the target cipher suite and the server key agreement information are used to instruct the client to determine a plurality of the encryption certificates and signature information from the server key agreement information, and verify the server key agreement information based on the signature information, and if the verification is successful, randomly select an encryption certificate and the target cipher suite, determine the server public key based on the selected encryption certificate, generate the client key agreement information based on the target cipher suite, the server public key and the client public key, and send the client key agreement information to the server; Receiving the client key negotiation information sent by the client; The client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key.
6. The system according to claim 5, wherein the client public key is obtained according to the client key negotiation information, and the target key is determined according to the client public key. include: The client key negotiation information is decrypted according to the server private keys corresponding to the multiple encryption certificates to obtain the client public key, and the target key is determined according to the client public key.
7. The system according to claim 5, It is characterized in that The server-side key negotiation information includes multiple encryption certificates.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the encryption communication method according to claim 1 or 2 or the steps of the encryption communication method according to claim 3 or 4 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the encryption communication method according to claim 1 or 2 or the encryption communication method according to claim 3 or 4 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the encryption communication method according to claim 1 or 2 or the steps of the encryption communication method according to claim 3 or 4 are implemented.
Citation Information
Patent Citations
A method, a system, a client and a server for key negotiating
WO2009076811A1
