Secure communication method and secure communication system based on TLCP commercial secret protocol

By combining the PSK and ECDHE security mechanisms in the TLCP commercial secret protocol, the limited use scope of the TLCP commercial secret protocol and the shortcomings of public key encryption technology are solved, the expansion and simplification of secure communication is achieved, the calculation workload and communication costs are reduced, and the prevention of Man-in-the-middle attacks and increased granularity in security and access control.

CN117749413BActive Publication Date: 2024-09-27CHINA FINANCIAL CERTIFICATION AUTHORITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311519788.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2024-09-27
Estimated Expiration
2043-11-15

AI Technical Summary

Technical Problem

The scope of use of the TLCP commercial secret protocol is limited. Public key encryption technology has a large amount of calculations and high communication costs. It is vulnerable to man-in-the-middle attacks and relies on third-party agency verification, which increases complexity and risk.

Method used

Adopt a secure communication method based on the TLCP commercial secret protocol, combine PSK and ECDHE security mechanisms, perform identity authentication and key exchange through the ECDHE_PSK suite, and use SM2 certificates and SM2 key exchange algorithms to simplify the interaction process between the client and the server and increase access Control mechanism to dynamically adjust user permissions.

Benefits of technology

It broadens the scope of use of the TLCP commercial secret protocol, reduces the computational load and communication costs, prevents man-in-the-middle attacks, simplifies the user authentication process, and achieves forward security and fine-grained access control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117749413B
    Figure CN117749413B
Patent Text Reader

Abstract

The present invention provides a secure communication method and a secure communication system based on the TLCP commercial secret protocol. The secure communication method comprises: a client sends a ClientHello message and an extended message thereof to a server; the server sends a SeverHello message and an extended message thereof to a client; the server sends a Finished message to a client; the client decrypts the Finished message to verify the correctness of the client master key and obtain the client authority information; the client sends an encrypted Finished message to the server and sends corresponding encrypted client application data according to the client operation; the server decrypts the received encrypted Finished message and the encrypted client application data. The present invention can broaden the application scope of the TLCP commercial secret protocol, reduce the large amount of calculation and communication cost, and ensure communication security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of secure communication technology, and in particular to a secure communication method and a secure communication system based on the TLCP commercial secret protocol. Background Art

[0002] TLCP (Transport Layer Cryptographic Protocol) is a secure communication protocol based on commercial secret algorithm encryption defined in the national standard GB / T 38636-2020. It can also be referred to as the commercial secret SSL / TLS (Secure Sockets Layer / Transport Layer Security) protocol. Based on TLS1.2, the TLCP protocol uses commercial secret algorithms to replace international standard algorithms (such as using SM2 or SM9 algorithms to replace RSA algorithms), uses SM3 algorithms to replace SHA1 and SHA256 algorithms, and uses SM4 algorithms to replace AES algorithms, and dual certificates must be used. Among them, the dual certificate includes a signature certificate and an encryption certificate. The signature certificate is used for authentication, and the encryption certificate is used for encryption and key negotiation. Based on public key encryption technology, the TLCP protocol can establish a secure link between different communicating parties to achieve encrypted data transmission.

[0003] However, the TLCP commercial secret protocol only supports public key encryption technology, and both parties must configure dual certificates to communicate normally, which limits the scope of use of the TLCP commercial secret protocol; in addition, although public key encryption technology is relatively safe, it also has the following disadvantages: large amount of calculation, requiring high computing power and storage space, resulting in increased communication costs and reduced efficiency, and cannot be used in environments with limited CPU performance; vulnerable to man-in-the-middle attacks, that is, attackers can intercept the public keys of both parties in communication, and then forge their own public keys to deceive, thereby stealing or tampering with data; need to rely on a trusted third-party organization to verify the authenticity of the public key, which increases the complexity and risk of communication. In addition, the two parties using the TLCP protocol for communication need to interact twice to establish a secure communication channel. Summary of the invention

[0004] The present invention provides a secure communication method and a secure communication system based on the TLCP commercial secret protocol, so as to solve the problems in the prior art that the scope of use of the TLCP commercial secret protocol is limited and the defects in the use of public key encryption technology by the TLCP commercial secret protocol are solved, so as to achieve the expansion of the scope of use of the TLCP commercial secret protocol and secure communication.

[0005] The present invention provides a secure communication method based on the TLCP commercial secret protocol, which comprises the following steps:

[0006] The client sends a ClientHello message and its extended message to the server;

[0007] After receiving the ClientHello message and its extended message, the server sends a SeverHello message and its extended message to the client;

[0008] The server sends a Finished message to the client;

[0009] The client decrypts the received Finished message to verify the correctness of the client master key and obtain the client permission information;

[0010] The client sends an encrypted Finished message to the server and sends the corresponding encrypted client application data according to the client operation;

[0011] The server decrypts the received encrypted Finished message to verify the correctness of the server master key, and decrypts the received encrypted client application data to perform corresponding operations or return corresponding results according to the user's permissions.

[0012] According to a secure communication method based on the TLCP commercial encryption protocol provided by the present invention, the cryptographic suite in the ClientHello message is an ECDHE_PSK suite, and the ECDHE_PSK suite is a suite that combines SM2 certificate, SM2 key exchange algorithm and PSK mechanism for identity authentication and key exchange; the ECDHE_PSK suite is one of ECDHE_PSK_SM4_CBC_SM3 and ECDHE_PSK_SM4_GCM_SM3.

[0013] According to a secure communication method based on the TLCP commercial secret protocol provided by the present invention, the extended message of the ClientHello message includes a PSK identification list, client information and a temporary public key of the client;

[0014] The client information includes network environment, user identity and device information;

[0015] The calculation process of the client temporary public key is:

[0016] The client randomly selects an integer k and uses it as the client's temporary private key, and uses the client's temporary private key k and the base point G of the elliptic curve in the SM2 key generation algorithm to calculate the client's temporary public key P=kG.

[0017] Furthermore, the extended message of the SeverHello message includes a PSK identifier and a temporary public key of the server;

[0018] The PSK identifier is selected by the server from the received PSK identifier list according to a preset selection rule;

[0019] The calculation process of the server temporary public key is:

[0020] The server randomly selects an integer l and uses it as the server temporary private key, and uses the server temporary private key l and the base point G of the elliptic curve in the SM2 key generation algorithm to calculate the server temporary public key Q=lG.

[0021] Furthermore, the Finished message includes server verification information and client authority information generated by the server;

[0022] The server uses the server working key and the SM4-GCM encryption algorithm to encrypt the Finished message F, where F = SM4-GCM (WK S ,V S ||PI), WK S Represents the server working key, V S Represents server authentication information, and PI represents client permission information generated by the server.

[0023] Furthermore, the server working key WK S The server uses the server master key, two random numbers, and the server working key label "WK S "And calculated using the SM3 hash algorithm, WK S =SM3(MK S ||R C ||R S ||"WK S "), where MK S Represents the server master key, R C Represents the client random number in the ClientHello message, R S Indicates the server random number in the ServerHello message;

[0024] The server master key MK S The server uses the pre-master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And calculated using the SM3 hash algorithm, MK S =SM3(PMK S ||R C ||R S ), PMK S Indicates the server pre-master key;

[0025] The server pre-master key PMK S The server uses the server shared key Z S PMK is calculated by using the SM3 hash algorithm and two random numbers. S =SM3(Z S ||R C ||R S ).

[0026] Furthermore, the server shares a key Z S The calculation process is:

[0027] The server searches the server-side database for the PSK key corresponding to the PSK identifier according to the PSK identifier selected from the received PSK identifier list;

[0028] The server uses the server temporary private key l and the received client temporary public key P to calculate the server temporary shared key S, S = lP;

[0029] The server uses the server temporary shared key S and the PSK key and uses the SM3 hash algorithm to calculate the server shared key Z S , Z S =SM3(S||PSK).

[0030] Furthermore, the server verification information V S The server uses the server master key MK S , the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the server authentication information tag "V S "And calculated using the SM3 hash algorithm, V S =SM3(MK S ||R C ||R S ||"V S ").

[0031] Furthermore, the client permission information PI is dynamically allocated by the server to the user's access rights according to the user's attribute information, device information and network environment, and the client permission information PI is one of a permission code and a permission list.

[0032] According to a secure communication method based on the TLCP commercial secret protocol provided by the present invention, the process in which the client decrypts the received Finished message to verify the correctness of the client master key is as follows:

[0033] The client uses the client working key and the SM4-GCM encryption algorithm to decrypt the received Finished message and obtain the server verification information and client authority information V S ||PI;

[0034] The client uses the client master key MK C , the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the server authentication information tag "V S ", and use the SM3 hash algorithm to calculate the server verification information VC S , VC S =SM3(MK C ||R C ||R S ||"V S ");

[0035] The client will calculate the server verification information VC S And the decrypted server verification information V S Compare them. If they are the same, it means the client master key MK C Correct; otherwise, it indicates the client master key MK C mistake.

[0036] Furthermore, the client working key WK C The client uses the client master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And calculated using the SM3 hash algorithm, WK C =SM3(MK C ||R C ||R S ||"WK C ");

[0037] The client master key MK C The client uses the pre-master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And calculated using the SM3 hash algorithm, MK C =SM3(PMK C ||R C ||R S ), PMK C Indicates the client pre-master key;

[0038] The client pre-master key PMK C The client uses the client shared key Z C and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And calculated using the SM3 hash algorithm, PMK C =SM3(Z C ||R C ||R S ).

[0039] Furthermore, the client shares a key Z C The calculation process is:

[0040] The client searches the database of the client for the PSK key corresponding to the PSK identifier according to the received PSK identifier;

[0041] The client uses the temporary private key k of the server and the temporary public key Q received from the server to calculate the temporary shared key C, C = kQ;

[0042] The client uses the temporary shared key C and the PSK key and uses the SM3 hash algorithm to calculate the client shared key Z C , Z C =SM3(C||PSK).

[0043] According to a secure communication method based on the TLCP commercial secret protocol provided by the present invention, the Finished message encrypted by the client includes client verification information and empty authority information;

[0044] The client encrypted Finished message F m The client uses the client working key and encrypts it using the SM4-GCM encryption algorithm. m =SM4-GCM(WK C ,V C ||NULL), where WK C Indicates the client working key, NULL indicates empty permission information;

[0045] Client verification information V C The client uses the client master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the client verification information tag "V C "And calculated using the SM3 hash algorithm, VC =SM3(MK C ||R C ||R S ||"V C ").

[0046] Furthermore, the server decrypts the received encrypted Finished message to verify the correctness of the server master key in the following process:

[0047] The server uses the server working key and the SM4-GCM encryption algorithm to decrypt the received encrypted Finished message and obtain the client verification information and empty permission information V C ||NULL;

[0048] The server uses the server master key MK S , two random numbers and the client verification information tag "V C ", and use the SM3 hash algorithm to calculate the client verification information VS C , VS C =SM3(MK S ||R C ||R S ||"V C ");

[0049] The server calculates the client verification information VS C And the decrypted client verification information V C Compare them. If they are the same, it means the server master key MK S Correct; otherwise, it indicates the server master key MK S mistake.

[0050] The present invention also provides a secure communication system based on the TLCP commercial secret protocol using any of the methods described above, comprising a client and a server, wherein the client and the server perform secure communication based on the TLCP commercial secret protocol;

[0051] The client sends a ClientHello message and an extended message thereof to the server, wherein the extended message of the ClientHello message includes a PSK identification list, client information, and a temporary public key of the client;

[0052] After receiving the ClientHello message and its extended message, the server sends a SeverHello message and its extended message to the client, wherein the extended message of the SeverHello message includes a PSK identifier and a temporary public key of the server;

[0053] The server sends a Finished message to the client, wherein the Finished message includes server verification information and client authority information generated by the server;

[0054] The client decrypts the received Finished message to verify the correctness of the client master key and obtain the client authority information generated by the server;

[0055] The client sends an encrypted Finished message to the server, and at the same time sends corresponding encrypted client application data according to the client operation, wherein the Finished message encrypted by the client includes client verification information and empty permission information;

[0056] The server decrypts the received encrypted Finished message to verify the correctness of the server master key; and decrypts the received encrypted client application data A D Decryption is performed to perform corresponding operations or return corresponding results based on the user's permissions.

[0057] The secure communication method and secure communication system based on the TLCP commercial encryption protocol provided by the present invention establish an identity-centric access control mechanism by combining the TLCP commercial encryption protocol with the PSK and ECDHE security mechanisms, thereby broadening the scope of use of the TLCP commercial encryption protocol and being able to solve the problems of large computational complexity, high communication costs, man-in-the-middle attacks, and reliance on third-party organizations that exist in public key encryption technology.

[0058] In the secure communication method based on the TLCP commercial secret protocol and the secure communication system provided by the present invention, only one round trip time is required before the client sends application data, which can simplify the interaction process between the client and the server; by adding an access control mechanism, it can effectively prevent unauthorized users or malicious software from accessing sensitive or critical resources or functions; by using PSK as the user's identity, the user's authentication process can be simplified and security can be improved. Combined with the ECHDE protocol, secure passage between the two parties can be achieved, man-in-the-middle attacks or replay attacks can be prevented, and forward security can be achieved; by dynamically adjusting the user's access rights, fine and dynamic control can be achieved, and different scenarios and needs can be met. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1It is a flow chart of the secure communication method based on the TLCP commercial secret protocol provided by the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] Combine the following Figure 1 The secure communication method based on the TLCP commercial secret protocol provided by the present invention is described, which includes the following steps:

[0063] S1. The client sends a ClientHello message and its extended message to the server;

[0064] The ClientHello message is generated by the client. The cipher suite in the ClientHello message may be an ECDHE_PSK suite. The ECDHE_PSK suite is a suite that combines an SM2 certificate, an SM2 key exchange algorithm, and a PSK mechanism for identity authentication and key exchange.

[0065] Specifically, the ECDHE_PSK suite can be ECDHE_PSK_SM4_CBC_SM3 and ECDHE_PSK_SM4_GCM_SM3. Among them, PSK (Pre-Shared Key) is a key shared in advance by both communicating parties; SM4 is a block cipher algorithm defined in the national standard GB / T 32907-2016; G in GCM (Galois / Counter Mode) refers to GMAC (Gigabit Media Access Control), C refers to CTR (Countermode), GCM is an authentication mode, providing authentication and encryption functions; SM3 is a hash algorithm defined in the national standard GB / T32905-2016.

[0066] Among them, the principle of the ECDHE (Elliptic Curve Diffie-Hellman) algorithm is to use the characteristics of elliptic curve cryptography (ECC) to calculate the public key and the final session key with less calculation. Specifically, the ECDHE algorithm uses the ECC elliptic curve characteristics on the basis of the DHE algorithm. Compared with the DHE algorithm, the performance of the ECDHE algorithm is better. During the ECDHE handshake process, the private keys of both parties are randomly and temporarily generated and are not public. Even based on the public information (elliptic curve, public key, base point G), it is difficult to calculate the discrete logarithm (private key) on the elliptic curve.

[0067] The extended message of the ClientHello message includes the PSK identification list, client information and client temporary public key. Client information includes network environment, user identity and device information.

[0068] The calculation process of the client's temporary public key is:

[0069] The client uses the SM2 key generation algorithm to generate a client SM2 temporary key pair, that is, randomly selects an integer k and uses it as the client's temporary private key, and uses the client's temporary private key k and the base point G of the elliptic curve in the SM2 key generation algorithm to calculate the client's temporary public key P=kG.

[0070] S2. After receiving the ClientHello message and its extended message, the server sends a SeverHello message and its extended message to the client.

[0071] The SeverHello message is generated by the server, and the extended message of the SeverHello message includes a PSK identifier and a temporary public key of the server.

[0072] The server selects an available PSK identifier from the received PSK identifier list according to a preset selection rule. Specifically, the available PSK identifier may be the PSK identifier that is at the front of the PSK identifier list, or may be the most secure PSK identifier in the PSK identifier list.

[0073] The calculation process of the server temporary public key is:

[0074] The server uses the SM2 key generation algorithm to generate a server SM2 temporary key pair, that is, randomly selects an integer l and uses it as the server temporary private key, and uses the server temporary private key l and the base point G of the elliptic curve in the SM2 key generation algorithm to calculate the server temporary public key Q=lG.

[0075] S3. The server sends a Finished message to the client.

[0076] The Finished message includes server verification information and client authority information generated by the server.

[0077] The server uses the server working key and the SM4-GCM encryption algorithm to encrypt the Finished message F, where F = SM4-GCM (WK S ,V S ||PI), WK S Represents the server working key, V S Represents server authentication information, and PI represents client permission information generated by the server.

[0078] Specifically, the server working key WK S The server uses the server master key, two random numbers, and the server working key label "WK S ", and calculated using the SM3 hashing algorithm, that is, WK S =SM3(MK S ||R C ||R S ||"WK S "), MK S Represents the server master key, R C Represents the client random number in the ClientHello message, R S Indicates the server random number in the ServerHello message.

[0079] Server Master Key MK S The server uses the pre-master key and two random numbers and uses the SM3 hash algorithm to calculate MK S =SM3(PMK S ||R C ||R S ), PMK S Indicates the server pre-master key.

[0080] Server Pre-Master Key PMK S The server uses the server shared key Z S PMK is calculated by using the SM3 hash algorithm and two random numbers. S =SM3(Z S ||R C ||R S ).

[0081] Furthermore, the server shares the key Z S The calculation process is:

[0082] The server searches the database on the server side for the PSK key corresponding to the PSK identifier according to the PSK identifier selected from the received PSK identifier list.

[0083] The server calculates the server temporary shared key S using the server temporary private key l and the received client temporary public key P, where S=lP.

[0084] The server uses the server temporary shared key S and the PSK key and uses the SM3 hash algorithm to calculate the server shared key Z S , Z S =SM3(S||PSK).

[0085] In this step, the server verifies the information V S The server uses the server master key MK S , two random numbers and the server verification information tag "V S " and calculated using the SM3 hashing algorithm, that is, V S =SM3(MK S ||R C ||R S ||"V S ").

[0086] Specifically, the client permission information PI is dynamically allocated by the server to the user's access rights according to factors such as the user's attribute information, device information, and network environment. For example, the client permission information PI may be a permission code or a permission list.

[0087] S4. The client decrypts the received Finished message to verify the correctness of the client master key and obtain the client permission information;

[0088] The client uses the client working key and the SM4-GCM encryption algorithm to decrypt the received Finished message and obtain the server verification information and client authority information V S ||PI.

[0089] The client uses the client master key MK C , two random numbers and the server verification information tag "V S ", and use the SM3 hash algorithm to calculate the server verification information VC S , VC S =SM3(MK C ||R C ||R S ||"V S ").

[0090] The client will calculate the server verification information VCS And the decrypted server verification information V S Compare them. If they are the same, it means the client master key MK C Correct; otherwise, it indicates the client master key MK C mistake.

[0091] Specifically, the client working key WK C The client uses the client master key, two random numbers, and the client working key label "WK C " and calculated using the SM3 hashing algorithm, that is, WK C =SM3(MK C ||R C ||R S ||"WK C "), MK C Represents the client master key, R C Represents the client random number in the ClientHello message, R S Indicates the server random number in the ServerHello message.

[0092] Client master key MK C The client uses the pre-master key and two random numbers and uses the SM3 hash algorithm to calculate MK C =SM3(PMK C ||R C ||R S ), PMK C Indicates the client pre-master key.

[0093] Client Pre-Master Key (PMK) C The client uses the client shared key Z C PMK is calculated by using the SM3 hash algorithm and two random numbers. C =SM3(Z C ||R C ||R S ).

[0094] Furthermore, the client shares the key Z C The calculation process is:

[0095] The client searches the database of the client for the PSK key corresponding to the PSK identifier according to the received PSK identifier.

[0096] The client uses the temporary private key k of the server and the temporary public key Q received from the server to calculate the temporary shared key C, C = kQ.

[0097] The client uses the temporary shared key C and the PSK key and uses the SM3 hash algorithm to calculate the client shared key Z C , Z C =SM3(C||PSK).

[0098] Specifically, the client obtains its own authority information according to the decrypted client authority information PI.

[0099] S5. The client sends an encrypted Finished message to the server and sends corresponding encrypted client application data according to the client operation.

[0100] The Finished message encrypted by the client includes client verification information and empty permission information.

[0101] The client uses the client working key and the SM4-GCM encryption algorithm to encrypt the encrypted Finished message F m , F m =SM4-GCM(WK C ,V C ||NULL), WK C Represents the client working key, V C Indicates client authentication information, and NULL indicates empty permission information.

[0102] In this step, the client verifies the information V C The client uses the client master key, two random numbers and the client verification information tag "V C " and calculated using the SM3 hashing algorithm, that is, V C =SM3(MK C ||R C ||R S ||"V C ").

[0103] Client application data is stored by the client using the client working key WK C And it is encrypted using the SM4-GCM encryption algorithm, that is, A D =SM4-GCM(WK C ,D), where D represents the client application data, A D Represents encrypted client application data.

[0104] S6. The server decrypts the received encrypted Finished message to verify the correctness of the server master key, and decrypts the received encrypted client application data AD to perform corresponding operations or return corresponding results according to the user's authority.

[0105] The server uses the server working key and the SM4-GCM encryption algorithm to decrypt the received encrypted Finished message and obtain the client verification information and empty permission information V C ||NULL.

[0106] The server uses the server master key MK S , two random numbers and the client verification information tag "V C ", and use the SM3 hash algorithm to calculate the client verification information VS C , VS C =SM3(MKS||RC||RS||"V C ").

[0107] The server calculates the client verification information VS C And the decrypted client verification information V C Compare them. If they are the same, it means the server master key MK S Correct; otherwise, it indicates the server master key MK S mistake.

[0108] The server uses the server working key WK S And use SM4-GCM encryption algorithm to receive the encrypted client application data A D Decrypt it to obtain the client application data D, and then perform corresponding operations or return corresponding results according to the client's permissions.

[0109] Specifically, if the client does not have sufficient permissions and the server cannot process the operation corresponding to the client application data, the server responds with an "unauthorized" alert message. If the client permissions are normal, the server performs the operation corresponding to the client application data.

[0110] The secure communication method based on the TLCP commercial encryption protocol provided by the present invention establishes an identity-centric access control mechanism by combining the TLCP commercial encryption protocol with the PSK and ECDHE security mechanisms, thereby broadening the scope of use of the TLCP commercial encryption protocol and being able to solve the problems existing in public key encryption technology, such as large amount of computation, high communication cost, man-in-the-middle attacks and reliance on third-party organizations.

[0111] In the secure communication method based on the TLCP commercial secret protocol provided by the present invention, only one round trip time is required before the client sends application data, which can simplify the protocol process; by adding an access control mechanism, it can effectively prevent unauthorized users or malicious software from accessing sensitive or critical resources or functions; by using PSK as the user's identity, the user's authentication process can be simplified and security can be improved. Combined with the ECHDE protocol, secure passage of both parties can be achieved, man-in-the-middle attacks or replay attacks can be prevented, and forward security can be achieved; by dynamically adjusting the user's access rights, fine and dynamic control can be achieved, and different scenarios and needs can be met.

[0112] On the basis of the secure communication method based on the TLCP commercial secret protocol provided by the present invention, the present invention also provides a secure communication system based on the TLCP commercial secret protocol.

[0113] The secure communication system based on the TLCP secret protocol provided by the present invention is described below. The secure communication system based on the TLCP secret protocol described below and the secure communication method based on the TLCP secret protocol described above can refer to each other.

[0114] The secure communication system based on the TLCP commercial secret protocol provided by the present invention includes a client and a server, and the client and the server perform secure communication based on the TLCP commercial secret protocol.

[0115] Specifically, the client sends a ClientHello message and an extended message thereof to the server, wherein the extended message of the ClientHello message includes a PSK identification list, client information, and a temporary public key of the client.

[0116] After receiving the ClientHello message and its extended message, the server sends a SeverHello message and its extended message to the client, wherein the extended message of the SeverHello message includes a PSK identifier and a temporary public key of the server.

[0117] The server sends a Finished message to the client, where the Finished message includes server verification information and client authority information generated by the server.

[0118] The client decrypts the received Finished message to verify the correctness of the client master key and obtain the client authority information generated by the server.

[0119] The client sends an encrypted Finished message to the server, and at the same time sends corresponding encrypted client application data according to the client operation, wherein the Finished message encrypted by the client includes client verification information and empty permission information.

[0120] The server decrypts the received encrypted Finished message to verify the correctness of the server master key; and decrypts the received encrypted client application data A D Decryption is performed to perform corresponding operations or return corresponding results based on the user's permissions.

[0121] The secure communication system based on the TLCP public key encryption protocol provided by the present invention establishes an identity-centric access control mechanism by combining the TLCP public key encryption protocol with the PSK and ECDHE security mechanisms, thereby broadening the scope of use of the TLCP public key encryption protocol and being able to solve the problems existing in public key encryption technology, such as large amount of computation, high communication cost, man-in-the-middle attacks and reliance on third-party organizations.

[0122] In the secure communication system based on the TLCP commercial secret protocol provided by the present invention, only one round trip time is required before the client sends application data, which can simplify the interaction process with the server; by adding an access control mechanism, it can effectively prevent unauthorized users or malicious software from accessing sensitive or critical resources or functions; by using PSK as the user's identity, the user's authentication process can be simplified and security can be improved. Combined with the ECHDE protocol, secure passage between the two parties can be achieved, man-in-the-middle attacks or replay attacks can be prevented, and forward security can be achieved; by dynamically adjusting the user's access rights, fine and dynamic control can be achieved, and different scenarios and needs can be met.

[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A secure communication method based on TLCP commercial secret protocol, It is characterized in that The following steps are involved: The client sends a ClientHello message and its extended message to the server; After receiving the ClientHello message and its extended message, the server sends a SeverHello message and its extended message to the client; The server sends a Finished message to the client; The client decrypts the received Finished message to verify the correctness of the client master key and obtain the client permission information; The client sends an encrypted Finished message to the server and sends the corresponding encrypted client application data according to the client operation; The server decrypts the received encrypted Finished message to verify the correctness of the server master key, and decrypts the received encrypted client application data to perform corresponding operations or return corresponding results according to the user's permissions; The client decrypts the received Finished message to verify the correctness of the client master key as follows: The client uses the client working key and the SM4-GCM encryption algorithm to decrypt the received Finished message and obtain the server verification information and client authority information V S ||PI; The client uses the client master key MK C , the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the server authentication information tag "V S ", and use the SM3 hash algorithm to calculate the server verification information VC S , VC S =SM3(MK C ||R C ||R S ||"V S "); The client will calculate the server verification information VC S And the decrypted server verification information V S Compare them. If they are the same, it means the client master key MK C Correct; otherwise, it indicates the client master key MK C mistake; The server decrypts the received encrypted Finished message to verify the correctness of the server master key as follows: The server uses the server working key and the SM4-GCM encryption algorithm to decrypt the received encrypted Finished message and obtain the client verification information and empty permission information V C ||NULL; The server uses the server master key MK S , the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the client verification information tag "V C ", and use the SM3 hash algorithm to calculate the client verification information VS C , VS C =SM3(MK S ||R C ||R S ||"V C "); The server calculates the client verification information VS C And the decrypted client verification information V C Compare them. If they are the same, it means the server master key MK S Correct; otherwise, it indicates the server master key MK S mistake.

2. The secure communication method based on the TLCP commercial secret protocol according to claim 1, It is characterized in that The cipher suite in the ClientHello message is the ECDHE_PSK suite, which is a suite that combines the SM2 certificate, the SM2 key exchange algorithm and the PSK mechanism for identity authentication and key exchange; the ECDHE_PSK suite is one of ECDHE_PSK_SM4_CBC_SM3 and ECDHE_PSK_SM4_GCM_SM3.

3. The secure communication method based on the TLCP commercial secret protocol according to claim 1, It is characterized in that The extended message of the ClientHello message includes a PSK identification list, client information and a temporary public key of the client; The client information includes network environment, user identity and device information; The calculation process of the client temporary public key is: The client randomly selects an integer k and uses it as the client's temporary private key, and uses the client's temporary private key k and the base point G of the elliptic curve in the SM2 key generation algorithm to calculate the client's temporary public key P=kG.

4. The secure communication method based on the TLCP commercial secret protocol according to claim 3, It is characterized in that The extended message of the SeverHello message includes a PSK identifier and a temporary public key of the server; The PSK identifier is selected by the server from the received PSK identifier list according to a preset selection rule; The calculation process of the server temporary public key is: The server randomly selects an integer l and uses it as the server temporary private key, and uses the server temporary private key l and the base point G of the elliptic curve in the SM2 key generation algorithm to calculate the server temporary public key Q=lG.

5. The secure communication method based on the TLCP commercial secret protocol according to claim 4, It is characterized in that The Finished message includes server verification information and client authority information generated by the server; The server uses the server working key and the SM4-GCM encryption algorithm to encrypt the Finished message F, where F = SM4-GCM (WK S ,V S ||PI), WK S Represents the server working key, V S Represents server authentication information, and PI represents client permission information generated by the server.

6. The secure communication method based on the TLCP commercial secret protocol according to claim 5, It is characterized in that The server working key WK S The server uses the server master key, two random numbers, and the server working key label "WK S "And calculated using the SM3 hash algorithm, WK S =SM3(MK S ||R C ||R S ||"WK S "), where MK S Represents the server master key, R C Represents the client random number in the ClientHello message, R S Indicates the server random number in the ServerHello message; The server master key MK S The server uses the pre-master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And calculated using the SM3 hash algorithm, MK S =SM3(PMK S ||R C ||R S ), PMK S Indicates the server pre-master key; The server pre-master key PMK S The server uses the server shared key Z S PMK is calculated by using the SM3 hash algorithm and two random numbers. S =SM3(Z S ||R C ||R S ).

7. The secure communication method based on the TLCP commercial secret protocol according to claim 6, It is characterized in that The server shares the key Z S The calculation process is: The server searches the server-side database for the PSK key corresponding to the PSK identifier according to the PSK identifier selected from the received PSK identifier list; The server uses the server temporary private key l and the received client temporary public key P to calculate the server temporary shared key S, S = lP; The server uses the server temporary shared key S and the PSK key and uses the SM3 hash algorithm to calculate the server shared key Z S , Z S =SM3(S||PSK).

8. The secure communication method based on the TLCP commercial secret protocol according to claim 5, It is characterized in that The server verification information V S The server uses the server master key MK S , the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the server authentication information tag "V S "And calculated using the SM3 hash algorithm, V S =SM3(MK S ||R C ||R S ||"V S ").

9. The secure communication method based on the TLCP commercial secret protocol according to claim 5, It is characterized in that The client permission information PI is dynamically allocated by the server to the user's access rights according to the user's attribute information, device information and network environment. The client permission information PI is one of a permission code and a permission list.

10. The secure communication method based on the TLCP commercial secret protocol according to claim 1, It is characterized in that The client working key WK C The client uses the client master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the client working key label "WK C "And calculated using the SM3 hash algorithm, WK C =SM3(MK C ||R C ||R S ||"WK C "); The client master key MK C The client uses the pre-master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And calculated using the SM3 hash algorithm, MK C =SM3(PMK C ||R C ||R S ), PMK C Indicates the client pre-master key; The client pre-master key PMK C The client uses the client shared key Z C and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And calculated using the SM3 hash algorithm, PMK C =SM3(Z C ||R C ||R S ).

11. The secure communication method based on the TLCP commercial secret protocol according to claim 10, It is characterized in that The client shares the key Z C The calculation process is: The client searches the database of the client for the PSK key corresponding to the PSK identifier according to the received PSK identifier; The client uses the temporary private key k of the server and the temporary public key Q received from the server to calculate the temporary shared key C, C = kQ; The client uses the temporary shared key C and the PSK key and uses the SM3 hash algorithm to calculate the client shared key Z C , Z C =SM3(C||PSK).

12. The secure communication method based on the TLCP commercial secret protocol according to claim 1, It is characterized in that The Finished message encrypted by the client includes client verification information and empty authority information; The client encrypted Finished message F m The client uses the client working key and encrypts it using the SM4-GCM encryption algorithm. m =SM4-GCM(WK C ,V C ||NULL), where WK C Indicates the client working key, NULL indicates empty permission information; Client verification information V C The client uses the client master key and the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the client verification information tag "V C ", and calculated using the SM3 hashing algorithm, V C =SM3(MK C ||R C ||R S ||"V C ").

13. A secure communication system based on the TLCP commercial secret protocol using the method according to any one of claims 1 to 12, It is characterized in that The client and the server are provided with a secure communication protocol based on the TLCP commercial secret protocol. The client sends a ClientHello message and an extended message thereof to the server, wherein the extended message of the ClientHello message includes a PSK identification list, client information, and a temporary public key of the client; After receiving the ClientHello message and its extended message, the server sends a SeverHello message and its extended message to the client, wherein the extended message of the SeverHello message includes a PSK identifier and a temporary public key of the server; The server sends a Finished message to the client, wherein the Finished message includes server verification information and client authority information generated by the server; The client decrypts the received Finished message to verify the correctness of the client master key and obtain the client authority information generated by the server; The client sends an encrypted Finished message to the server, and at the same time sends corresponding encrypted client application data according to the client operation, wherein the Finished message encrypted by the client includes client verification information and empty permission information; The server decrypts the received encrypted Finished message to verify the correctness of the server master key; and decrypts the received encrypted client application data A D Decryption is performed to perform corresponding operations or return corresponding results according to the user's permissions; The client decrypts the received Finished message to verify the correctness of the client master key as follows: The client uses the client working key and the SM4-GCM encryption algorithm to decrypt the received Finished message and obtain the server verification information and client authority information V S ||PI; The client uses the client master key MK C , the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the server authentication information tag "V S ", and use the SM3 hash algorithm to calculate the server verification information VC S , VC S =SM3(MK C ||R C ||R S ||"V S "); The client will calculate the server verification information VC S And the decrypted server verification information V S Compare them. If they are the same, it means the client master key MK C Correct; otherwise, it indicates the client master key MK C mistake; The server decrypts the received encrypted Finished message to verify the correctness of the server master key as follows: The server uses the server working key and the SM4-GCM encryption algorithm to decrypt the received encrypted Finished message and obtain the client verification information and empty permission information V C ||NULL; The server uses the server master key MK S , the client random number R in the ClientHello message C and the server random number R in the ServerHello message S And the client verification information tag "V C ", and use the SM3 hash algorithm to calculate the client verification information VS C , VS C =SM3(MK S ||R C ||R S ||"V C "); The server calculates the client verification information VS C And the decrypted client verification information V C Compare them. If they are the same, it means the server master key MK S Correct; otherwise, it indicates the server master key MK S mistake.