A secure communication method and communication system
By using encryption authentication devices and security chips for two-way sign-in verification and key generation in the TCP connection between the master station and the terminal, the security risks existing in the existing SSL or TLS protocols are solved, and the identity authentication of both parties of the communication is realized and the confidentiality and integrity protection of data transmission improve the security of communication data.
Patent Information
- Application Number
- CN202111025925.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-02
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-09-02
AI Technical Summary
There are unknown security risks and inherent security vulnerabilities caused by improper configuration in the existing SSL or TLS protocols in the secure data transmission.
Through the TCP connection between the main station and the terminal, the encryption authentication device and the security chip are used to perform two-way sign verification, and the data encryption key and integrity protection key are generated, and the integrity verification and decryption of the packet are carried out to ensure that both parties in the communication are allowed to communicate. Trusted identity authentication and confidentiality and integrity protection of data.
It realizes a customized secure communication protocol, enhances the security of identity authentication and data transmission between both parties of the communication, prevents playback attacks and ciphertext attacks, and improves the security of communication data.
Smart Images

Figure CN113726524B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of secure communications, and in particular to a secure communication method and a communication system. Background Art
[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.
[0003] Currently, the common mechanism for achieving secure data transmission is to rely on SSL or TLS protocols, but these protocols inherently have unknown security risks, or may be threatened by inherent security vulnerabilities due to improper configuration and use. Summary of the invention
[0004] In order to solve the deficiencies of the prior art, the present invention provides a secure communication method and a communication system;
[0005] In a first aspect, the present invention provides a secure communication method;
[0006] A secure communication method, comprising:
[0007] The master station establishes a TCP connection with the terminal; during the process of establishing the TCP connection between the master station and the terminal, the encryption authentication device connected to the master station completes the signature verification operation on the terminal, and the security chip connected to the terminal completes the signature verification operation on the master station;
[0008] The main station and the terminal exchange business messages; wherein, in the process of business message interaction between the main station and the terminal, a root key is used to generate a data encryption key and an integrity protection key, the integrity protection key is used to perform integrity verification on the message, and the data encryption key is used to decrypt the message that passes the integrity verification to obtain a decrypted message.
[0009] In a second aspect, the present invention provides a secure communication system;
[0010] A secure communication system, comprising: a master station and a terminal;
[0011] The master station establishes a TCP connection with the terminal; during the process of establishing the TCP connection between the master station and the terminal, the encryption authentication device connected to the master station completes the signature verification operation on the terminal, and the security chip connected to the terminal completes the signature verification operation on the master station;
[0012] The main station and the terminal exchange business messages; wherein, in the process of business message interaction between the main station and the terminal, a root key is used to generate a data encryption key and an integrity protection key, the integrity protection key is used to perform integrity verification on the message, and the data encryption key is used to decrypt the message that passes the integrity verification to obtain a decrypted message.
[0013] Compared with the prior art, the present invention has the following beneficial effects:
[0014] This process design uses a custom secure communication protocol to achieve trusted identity authentication of both communicating parties and confidentiality and integrity protection of transmitted data.
[0015] Advantages of additional aspects of the present invention will be partially given in the following description or learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0017] Figure 1 This is a hardware connection diagram of the first embodiment;
[0018] Figure 2 A flow chart of the two-way authentication method of the first embodiment;
[0019] Figure 3 This is a flow chart of business message interaction of the first embodiment. DETAILED DESCRIPTION
[0020] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0021] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0023] In this embodiment, all data is obtained in compliance with laws and regulations and based on the user's consent, and is used legally.
[0024] Terminology explanation:
[0025] TCP, Transmission Control Protocol, Transmission Control Protocol.
[0026] Embodiment 1
[0027] This embodiment provides a secure communication method;
[0028] like Figure 1 , Figure 2 and Figure 3 As shown, a secure communication method comprises:
[0029] S101: The master station establishes a TCP connection with the terminal;
[0030] In the process of establishing a TCP connection between the master station and the terminal, the encryption authentication device connected to the master station completes the signature verification operation on the terminal, and the security chip connected to the terminal completes the signature verification operation on the master station;
[0031] S102: The main station and the terminal exchange service messages;
[0032] In the process of business message interaction between the main station and the terminal, the root key is used to generate the data encryption key and the integrity protection key, the integrity protection key is used to check the integrity of the message, and the data encryption key is used to decrypt the message that passes the integrity check to obtain the decrypted message.
[0033] Furthermore, the S101: the master station establishes a TCP connection with the terminal; specifically includes:
[0034] S1011: The master station obtains a random number R1 and sends the random number R1 to the terminal; wherein the random number is generated by the encryption authentication device;
[0035] S1012: The terminal obtains a random number R2, and signs the concatenated random numbers R1 and R2 using the terminal's own private key; the terminal sends the signature result, the random number R2, and the terminal's unique identity to the master station, initiating an authentication request; wherein the terminal's own private key is generated and stored by the security chip; and the random number R2 is generated by the security chip;
[0036] S1013: After receiving the authentication request sent by the terminal, the main station forwards the signature result, the concatenated random numbers R1 and R2, and the unique identity of the terminal to the encryption authentication device; the encryption authentication device completes the signature verification operation and feeds back the signature verification operation result to the main station;
[0037] S1014: After the master station receives the instruction of signature verification, it sends the master station signature value and the master station unique identity to the terminal, and initiates an authentication request to the terminal; wherein, the signature value is obtained by the master station using its own private key to sign the random number R2; the master station's own private key is generated and stored by the encryption authentication device.
[0038] After receiving the instruction that the signature verification fails, the master station returns to S1011;
[0039] S1015: After the terminal receives the authentication request from the master station, the terminal sends the signature value of the master station, the random number R2 and the unique identity of the master station to the security chip; the security chip completes the signature verification operation, and the security chip feeds back the signature verification operation result to the terminal;
[0040] S1016: The terminal feeds back the signature verification result to the master station; if the signature verification result received by the master station is an authentication failure message, it returns to S1011; if the signature verification result received by the master station is an authentication success message, it means that the two-way identity authentication between the master station and the terminal is completed, and the business message interaction begins.
[0041] Furthermore, the S1013 encryption authentication device completes the signature verification operation; specifically includes:
[0042] S10131: The encryption authentication device authenticates the unique identity of the terminal. If the identity authentication is successful, the signature result of the terminal is verified; if the identity authentication is unsuccessful, the encryption authentication device feeds back the signature verification result to the master station and returns to S1011;
[0043] S10132: If the signature result verification passes, the master station uses its own private key to sign the random number R2 to obtain the signature value; if the signature result verification fails, it returns to S1011.
[0044] Furthermore, the S10131: the encryption authentication device authenticates the unique identity of the terminal; specifically includes:
[0045] First, the public key of the identity issuer stored on the encryption authentication device is used to verify the signature of the unique identity of the terminal. If the signature verification is successful, it means that the unique identity of the terminal is recognized by the master station.
[0046] Then, the validity period of the terminal's unique identity is parsed and compared with the time of the encryption authentication device. If the expiration time of the terminal's unique identity is earlier than the system time of the encryption authentication device, it means that the terminal's identity is valid and the verification is successful; if it is later than the system time of the encryption authentication device, it means that the identity has expired and the identity authentication fails.
[0047] Furthermore, the S1015 security chip completes the signature verification operation; specifically including:
[0048] S10151: The security chip verifies the unique identity of the master station. If the identity verification is successful, the signature value of the master station is verified. If the identity verification fails, the result of signature verification failure is fed back to the terminal.
[0049] S10152: If the signature value of the master site is verified successfully, the result of the successful signature verification operation is fed back to the terminal; if the signature value of the master site is verified unsuccessfully, the result of the failed signature verification operation is fed back to the terminal.
[0050] It should be understood that the security chip refers to an integrated circuit chip that contains cryptographic algorithms, security functions, and can implement a key management mechanism.
[0051] It should be understood that the encryption authentication device, also known as a server cryptographic machine, is a device that can provide cryptographic services and key management for multiple application entities independently or in parallel.
[0052] Furthermore, the S102: the main station and the terminal perform service message interaction; specifically includes:
[0053] S1021: The master station uses the random number R1 in the current session authentication process as a dispersion factor and generates a data encryption key and an integrity protection key for the downlink transmission data based on the downlink root key;
[0054] The terminal uses the random number R2 in the authentication process as a dispersion factor and generates a data encryption key and integrity protection key for the uplink transmission data based on the uplink root key;
[0055] The downlink root key and the uplink root key are both the highest level in the hierarchical key structure and are used to generate the lower level keys (such as data encryption keys, etc.);
[0056] S1022: After receiving the service data sent by the terminal, the master station first performs an integrity check on the uplink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the uplink transmission data is used to decrypt the message and process it according to the service.
[0057] S1023: After receiving the service data sent by the master station, the terminal first performs an integrity check on the downlink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the downlink transmission data is used to decrypt it and relevant processing is performed according to the service.
[0058] Each time a session is established, the data encryption protection and integrity protection keys used for distribution are different, achieving one-session-one-key encryption protection. At the same time, the uplink root key and downlink root key used for distribution are different, so that each terminal uses a different encryption key, and each session uses a different encryption key, which greatly increases the complexity and difficulty of ciphertext-based attacks and can effectively prevent replay attacks.
[0059] The downlink root key is stored in the encryption authentication device, and the uplink root key is stored in the security chip. They cannot be exported, ensuring the security of key storage. The key dispersion and encryption calculation processes are also completed inside the encryption authentication device and the security chip's dedicated security equipment, ensuring the security of the calculation process, and thus ensuring that the key will not be leaked at any time, greatly improving security.
[0060] In this embodiment, two random numbers R1 and R2 are used as dispersion factors, which increases the complexity of ciphertext encryption, increases the difficulty for attackers to crack, and better improves the security of communication data.
[0061] Embodiment 2
[0062] This embodiment provides a secure communication system;
[0063] A secure communication system, comprising: a master station and a terminal;
[0064] The master station establishes a TCP connection with the terminal; during the process of establishing the TCP connection between the master station and the terminal, the encryption authentication device connected to the master station completes the signature verification operation on the terminal, and the security chip connected to the terminal completes the signature verification operation on the master station;
[0065] The main station and the terminal exchange business messages; wherein, in the process of business message interaction between the main station and the terminal, a root key is used to generate a data encryption key and an integrity protection key, the integrity protection key is used to perform integrity verification on the message, and the data encryption key is used to decrypt the message that passes the integrity verification to obtain a decrypted message.
[0066] Furthermore, the system further comprises:
[0067] The master station obtains a random number R1 and sends the random number R1 to the terminal; wherein the random number is generated by an encryption authentication device;
[0068] The terminal obtains the random number R2, and uses the terminal's own private key to sign the spliced random numbers R1 and R2; the terminal sends the signature result, the random number R2 and the terminal's unique identity to the main station to initiate an authentication request; wherein the terminal's own private key is generated and stored by the security chip; the random number R2 is generated by the security chip;
[0069] After the main station receives the authentication request sent by the terminal, it forwards the signature result, the concatenated random numbers R1 and R2, and the unique identity of the terminal to the encryption authentication device; the encryption authentication device completes the signature verification operation and feeds back the signature verification operation result to the main station;
[0070] After the master station receives the instruction of signature verification, it sends the master station signature value and the master station unique identity to the terminal, and initiates an authentication request to the terminal; wherein the signature value is obtained by the master station using its own private key to sign the random number R2; the master station's own private key is generated and stored by the encryption authentication device;
[0071] After the terminal receives the authentication request from the master station, the terminal sends the master station signature value, random number R2 and the master station unique identity to the security chip; the security chip completes the signature verification operation, and the security chip feeds back the signature verification operation result to the terminal;
[0072] The terminal feeds back the signature verification result to the master station; if the signature verification result received by the master station is an authentication failure message; if the signature verification result received by the master station is an authentication success message, it means that the two-way identity authentication between the master station and the terminal is completed, and business message interaction begins.
[0073] Furthermore, the system further comprises:
[0074] The master station uses the random number R1 in the session authentication process as a dispersion factor and generates a data encryption key and integrity protection key for the downlink transmission data based on the downlink root key;
[0075] The terminal uses the random number R2 in the authentication process as a dispersion factor and generates a data encryption key and integrity protection key for the uplink transmission data based on the uplink root key;
[0076] The downlink root key and the uplink root key are both the highest level in the hierarchical key structure and are used to generate the lower level keys (such as data encryption keys, etc.);
[0077] After receiving the service data sent by the terminal, the master station first performs an integrity check on the uplink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the uplink transmission data is used to decrypt it and process it according to the service.
[0078] After receiving the service data sent by the master station, the terminal first performs an integrity check on the downlink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the downlink transmission data is used to decrypt it and perform relevant processing according to the service.
[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A secure communication method, characterized in that: include: The master station establishes a TCP connection with the terminal; during the process of establishing the TCP connection between the master station and the terminal, the encryption authentication device connected to the master station completes the signature verification operation on the terminal, and the security chip connected to the terminal completes the signature verification operation on the master station; The main station and the terminal exchange business messages; wherein, in the process of business message exchange between the main station and the terminal, the root key is used to generate a data encryption key and an integrity protection key, the integrity protection key is used to perform integrity verification on the message, and the data encryption key is used to decrypt the message that passes the integrity verification to obtain a decrypted message; The master station establishes a TCP connection with the terminal, specifically: The main station obtains a random number R1 and sends the random number R1 to the terminal; wherein the random number is generated by an encryption authentication device; the terminal obtains a random number R2, and the terminal signs the spliced random numbers R1 and R2 using its own private key; the terminal sends the signature result, the random number R2 and the unique identity of the terminal to the main station to initiate an authentication request; wherein the terminal's own private key is generated and stored by a security chip; the random number R2 is generated by the security chip; After the main station receives the authentication request sent by the terminal, it forwards the signature result, the concatenated random numbers R1 and R2, and the unique identity of the terminal to the encryption authentication device; the encryption authentication device completes the signature verification operation and feeds back the signature verification operation result to the main station; After the master station receives the instruction of signature verification, it sends the master station signature value and the master station unique identity to the terminal, and initiates an authentication request to the terminal; wherein the signature value is obtained by the master station using its own private key to sign the random number R2; the master station's own private key is generated and stored by the encryption authentication device; After the terminal receives the authentication request from the master station, the terminal sends the master station signature value, random number R2 and the master station unique identity to the security chip; the security chip completes the signature verification operation, and the security chip feeds back the signature verification operation result to the terminal; The terminal feeds back the signature verification result to the master station. If the signature verification result received by the master station is an authentication failure message, or if the signature verification result received by the master station is an authentication success message, it means that the two-way identity authentication between the master station and the terminal is completed, and the business message interaction begins. The encryption authentication device completes the signature verification operation, specifically including: The encryption authentication device authenticates the unique identity of the terminal. If the identity authentication is successful, the signature result of the terminal is verified; if the identity authentication is unsuccessful, the encryption authentication device feeds back the signature verification operation result to the main station; If the signature result verification passes, the master station uses its own private key to sign the random number R2 to obtain the signature value; if the signature result verification fails, the master station obtains the random number R1 and sends the random number R1 to the terminal; The encryption authentication device performs identity authentication on the unique identity of the terminal, specifically including: First, the public key of the identity issuer stored on the encryption authentication device is used to verify the signature of the unique identity of the terminal. If the signature verification is successful, it means that the unique identity of the terminal is recognized by the master station. Then, the validity period of the unique identity of the terminal is parsed and compared with the time of the encryption authentication device. If the expiration time of the unique identity of the terminal is earlier than the system time of the encryption authentication device, it means that the identity of the terminal is valid and the authentication is successful; if it is later than the system time of the encryption authentication device, it means that the identity has expired and the identity authentication has failed. The security chip completes the signature verification operation, specifically including: The security chip verifies the unique identity of the master station. If the identity verification is successful, the signature value of the master station is verified. If the identity verification fails, the result of signature verification failure is fed back to the terminal. If the signature value of the main station is verified, the result of successful signature verification operation is fed back to the terminal; if the signature value of the main station is not verified, the result of failed signature verification operation is fed back to the terminal; The main station and the terminal perform service message interaction, specifically: The master station uses the random number R1 in the authentication process of this session as a dispersion factor, and generates a data encryption key and an integrity protection key for downlink transmission data based on the downlink root key; the terminal uses the random number R2 in the authentication process as a dispersion factor, and generates a data encryption key and an integrity protection key for uplink transmission data based on the uplink root key; wherein the downlink root key and the uplink root key are both the highest level in the hierarchical key structure, and are used to generate the keys of the lower levels; After receiving the service data sent by the terminal, the master station first performs an integrity check on the uplink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the uplink transmission data is used to decrypt it and process it according to the service. After receiving the service data sent by the master station, the terminal first performs an integrity check on the downlink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the downlink transmission data is used to decrypt it and perform relevant processing according to the service; Each time a session is established, the data encryption protection and integrity protection keys used in the distributed data are different, realizing encryption protection of one key per session. At the same time, the uplink root key and downlink root key used for distribution are different, so that each terminal uses a different encryption key, and each session uses a different encryption key, which increases the complexity and difficulty of ciphertext-based attacks and effectively prevents replay attacks. The downlink root key is stored in the encryption authentication device, and the uplink root key is stored in the security chip. It cannot be exported, ensuring the security of key storage. The key dispersion and encryption calculation process are also completed inside the encryption authentication device and the security chip's dedicated security device, ensuring the security of the calculation process and ensuring that the key will not be leaked at any time, thereby improving security.
2. A secure communication system, characterized in that: include: Master station and terminal; The master station establishes a TCP connection with the terminal; during the process of establishing the TCP connection between the master station and the terminal, the encryption authentication device connected to the master station completes the signature verification operation on the terminal, and the security chip connected to the terminal completes the signature verification operation on the master station; The main station and the terminal exchange business messages; wherein, in the process of business message exchange between the main station and the terminal, the root key is used to generate a data encryption key and an integrity protection key, the integrity protection key is used to perform integrity verification on the message, and the data encryption key is used to decrypt the message that passes the integrity verification to obtain a decrypted message; The master station establishes a TCP connection with the terminal, specifically: The main station obtains a random number R1 and sends the random number R1 to the terminal; wherein the random number is generated by an encryption authentication device; the terminal obtains a random number R2, and the terminal signs the spliced random numbers R1 and R2 using its own private key; the terminal sends the signature result, the random number R2 and the unique identity of the terminal to the main station to initiate an authentication request; wherein the terminal's own private key is generated and stored by a security chip; the random number R2 is generated by the security chip; After the main station receives the authentication request sent by the terminal, it forwards the signature result, the concatenated random numbers R1 and R2, and the unique identity of the terminal to the encryption authentication device; the encryption authentication device completes the signature verification operation and feeds back the signature verification operation result to the main station; After the master station receives the instruction of signature verification, it sends the master station signature value and the master station unique identity to the terminal, and initiates an authentication request to the terminal; wherein the signature value is obtained by the master station using its own private key to sign the random number R2; the master station's own private key is generated and stored by the encryption authentication device; After the terminal receives the authentication request from the master station, the terminal sends the master station signature value, random number R2 and the master station unique identity to the security chip; the security chip completes the signature verification operation, and the security chip feeds back the signature verification operation result to the terminal; The terminal feeds back the signature verification result to the master station. If the signature verification result received by the master station is an authentication failure message, or if the signature verification result received by the master station is an authentication success message, it means that the two-way identity authentication between the master station and the terminal is completed, and the business message interaction begins. The encryption authentication device completes the signature verification operation, specifically including: The encryption authentication device authenticates the unique identity of the terminal. If the identity authentication is successful, the signature result of the terminal is verified; if the identity authentication is unsuccessful, the encryption authentication device feeds back the signature verification operation result to the main station; If the signature result verification passes, the master station uses its own private key to sign the random number R2 to obtain the signature value; if the signature result verification fails, the master station obtains the random number R1 and sends the random number R1 to the terminal; The encryption authentication device performs identity authentication on the unique identity of the terminal, specifically including: First, the public key of the identity issuer stored on the encryption authentication device is used to verify the signature of the unique identity of the terminal. If the signature verification is successful, it means that the unique identity of the terminal is recognized by the master station. Then, the validity period of the unique identity of the terminal is parsed and compared with the time of the encryption authentication device. If the expiration time of the unique identity of the terminal is earlier than the system time of the encryption authentication device, it means that the identity of the terminal is valid and the authentication is successful; if it is later than the system time of the encryption authentication device, it means that the identity has expired and the identity authentication has failed. The security chip completes the signature verification operation, specifically including: The security chip verifies the unique identity of the master station. If the identity verification is successful, the signature value of the master station is verified. If the identity verification fails, the result of signature verification failure is fed back to the terminal. If the signature value of the main station is verified, the result of successful signature verification operation is fed back to the terminal; if the signature value of the main station is not verified, the result of failed signature verification operation is fed back to the terminal; The main station and the terminal perform service message interaction, specifically: The master station uses the random number R1 in the authentication process of this session as a dispersion factor, and generates a data encryption key and an integrity protection key for downlink transmission data based on the downlink root key; the terminal uses the random number R2 in the authentication process as a dispersion factor, and generates a data encryption key and an integrity protection key for uplink transmission data based on the uplink root key; wherein the downlink root key and the uplink root key are both the highest level in the hierarchical key structure, and are used to generate the keys of the lower levels; After receiving the service data sent by the terminal, the master station first performs an integrity check on the uplink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the uplink transmission data is used to decrypt it and process it according to the service. After receiving the service data sent by the master station, the terminal first performs an integrity check on the downlink message. If the integrity check fails, the message is discarded. If the integrity check is correct, the data encryption key of the downlink transmission data is used to decrypt it and perform relevant processing according to the service; Each time a session is established, the data encryption protection and integrity protection keys used in the distributed data are different, realizing encryption protection of one key per session. At the same time, the uplink root key and downlink root key used for distribution are different, so that each terminal uses a different encryption key, and each session uses a different encryption key, which increases the complexity and difficulty of ciphertext-based attacks and effectively prevents replay attacks. The downlink root key is stored in the encryption authentication device, and the uplink root key is stored in the security chip. It cannot be exported, ensuring the security of key storage. The key dispersion and encryption calculation process are also completed inside the encryption authentication device and the security chip's dedicated security device, ensuring the security of the calculation process and ensuring that the key will not be leaked at any time, thereby improving security.
Citation Information
Patent Citations
Identity authentication and key agreement method suitable for electricity consumption information collection system
CN103095696A
Encryption method based on state grid encryption protocol
CN109560928A
Authentication information processing method, and terminal and network device
WO2020215958A1