Key negotiation method for initiating end and key negotiation method for responding end
Through the key negotiation method based on the State Secret algorithm, the asymmetric encryption mechanism of random numbers and digital certificates is used to solve the problems of data theft and man-in-the-middle attack in wireless communications, and the secure communication tunnel and symmetry in the rail transit signal system are realized The reliability of the key improves the security and flexibility of data transmission.
Patent Information
- Application Number
- CN202411446265.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-10-16
Smart Images

Figure CN119316211A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communications, and in particular to a key negotiation method for an initiating end, a key negotiation system for an initiating end and a computer-readable storage medium, and a key negotiation method for a responding end, a key negotiation system for a responding end and a computer-readable storage medium. Background Art
[0002] Rail transit signal systems use the communication between trains and track equipment to manage traffic and control infrastructure. They integrate train command and train operation control and are key systems that affect train safety and efficiency. For business needs, data related to train operation and control needs to be transferred to on-board train control equipment.
[0003] Traditional manual dressing has problems such as low efficiency and high error probability. Therefore, more and more scenarios are now adopting wireless dressing. Figure 1 The topology diagram of a typical wireless refitting network of a train control system is shown, which includes three parts: an on-board LKJ (train operation monitoring device) system 110, a wireless communication network 120, and a ground system 130. The on-board LKJ system 110 mainly includes two types: LKJ2000 and LKJ-15. The wireless communication network 120 is a public mobile communication network (3G / 4G / 5G). By establishing a proprietary virtual private network (VPN) based on IPSec (Internet Protocol Security), the communication channel of the wireless communication network 120 is encrypted, thereby realizing two-way encrypted data transmission between the train and the ground. The ground system 130 is composed of a railway security transmission platform, a system server, and various refitting terminals. The data refitting module of the on-board LKJ system 110 communicates with the ground refitting console 131 of the ground system 130 through the communication channel of the wireless communication network 120, thereby realizing the wireless refitting of the on-board train control equipment.
[0004] Due to the natural defects of wireless channels, there are security risks such as theft of dressing data or man-in-the-middle attacks. The existing technology (for example, Chinese patent CN220043678U) is mainly used to realize the wireless dressing function on LKJ, and lacks security content description. The method provided by the existing technology (for example, Chinese patent CN115913727A) is mainly used for mutual recognition and identification of vehicle-ground communication identities, focusing on the confirmation of the identities of both the vehicle and the ground. When the authentication fails, the ground firewall initiates the access prohibition action, lacking security protection for the wireless communication network. The existing technology (for example, Chinese patent CN114162190A) transmits LKJ wireless dressing data to the ground server through multi-threading technology to improve transmission efficiency, focusing on transmission efficiency. However, the establishment of the existing secure channel for communication is highly coupled with the business and has poor flexibility.
[0005] In addition, the traditional RFC IPSec VPN is based on internationally accepted cryptographic algorithms such as AES, SHA256, and RSA. These cryptographic algorithms are designed by foreign institutions and are not controllable. In addition, the RFC IPSec VPN negotiation process has certain security risks. For example, the basis of its main mode key exchange is DH (Diffie-Hellman) key exchange. The exchange process lacks the identity authentication of the communicating parties and cannot determine the credibility of the message. The existing technology (for example, Chinese patent CN116647824A) uses national secret algorithms SM2, SM3, and SM4 to encrypt communications in vehicle-to-ground data transmission, but the patent does not describe the specific encryption form.
[0006] In order to overcome the above-mentioned defects of the prior art, this field urgently needs a key negotiation technology based on the national secret IPSec VPN technology, which can establish a business-independent security negotiation process, build a secure communication tunnel to ensure the security of transmitted data, achieve the effect of reliable data transmission in wireless channels, and achieve the reliability of symmetric key negotiation. Summary of the invention
[0007] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.
[0008] In order to overcome the above-mentioned defects of the prior art, the present invention provides a key negotiation method for an initiating end, a key negotiation system for an initiating end and a computer-readable storage medium, as well as a key negotiation method for a responding end, a key negotiation system for a responding end and a computer-readable storage medium, which can establish a security negotiation process independent of the business, build a secure communication tunnel to ensure the security of transmitted data, achieve the effect of reliable data transmission in a wireless channel, and achieve the reliability of symmetric key negotiation.
[0009] Specifically, the key negotiation method for the initiator provided according to the first aspect of the present invention comprises the following steps: Step S11: sending a first data packet including a first random number to a responder; Step S12: obtaining a second data packet including a second random number and a digital certificate of the responder sent back by the responder; Step S13: generating a first key source random number and a third random number, symmetrically encrypting the first key source random number based on the third random number, and asymmetrically encrypting the third random number based on the responder public key in the digital certificate of the responder; Step S14: sending the initiator's digital certificate to the responder to obtain the encrypted second key source random number and fourth random number sent back by the responder; Step S15: determining the fourth random number according to the initiator's public key in the digital certificate of the initiator, and determining the second key source random number according to the fourth random number; and Step S16: determining the symmetric key between the initiator and the responder based on the first random number, the second random number, the first key source random number and the second key source random number.
[0010] Preferably, in one embodiment of the present invention, the step S14 also includes: sending the encrypted third random number and the encrypted first key source random number to the responder, the responder determines the third random number based on the responder public key, and determines the first key source random number based on the third random number.
[0011] Preferably, in one embodiment of the present invention, step S13 and step S14 also include: symmetrically encrypting the first local identifier of the initiator based on the third random number; and sending the encrypted first local identifier to the responder to identify the identity of the initiator.
[0012] Preferably, in one embodiment of the present invention, step S13 and step S14 also include: based on the initiator's private key, signing the initiator's digital certificate, the encrypted third random number, the encrypted first key source random number and the encrypted first local end identifier as a whole; and sending the signature to the responder to ensure the authenticity of the sent data.
[0013] Preferably, in an embodiment of the present invention, the step S13 includes: using the SM1 algorithm or the SM4 algorithm to perform the symmetric encryption, and using the SM2 algorithm or the SM9 algorithm to perform the asymmetric encryption.
[0014] Preferably, in an embodiment of the present invention, the step S14 comprises: generating a digital certificate of the initiator based on an SM2 algorithm.
[0015] Preferably, in an embodiment of the present invention, the step S16 comprises: determining the symmetric key between the initiator and the responder using a hash operation of an SM3 algorithm.
[0016] Preferably, in one embodiment of the present invention, the initiator is a vehicle-mounted wireless reloading device, and the responder is a ground server.
[0017] In addition, a key negotiation method for a responder provided according to a second aspect of the present invention includes the following steps: Step S21: in response to receiving a first data packet including a first random number from an initiator, sending back a second data packet including a second random number and a digital certificate of the responder to the initiator; Step S22: in response to receiving the digital certificate of the initiator, the encrypted first key source random number and the encrypted third random number, determining the third random number according to the responder public key in the digital certificate of the responder, and determining the first key source random number according to the third random number; Step S23: generating a second key source random number and a fourth random number, symmetrically encrypting the second key source random number based on the fourth random number, asymmetrically encrypting the fourth random number based on the initiator public key in the digital certificate of the initiator, and sending back the encrypted fourth random number and the encrypted second key source random number to the initiator; and Step S24: determining the symmetric key between the initiator and the responder based on the first random number, the second random number, the first key source random number and the second key source random number.
[0018] Preferably, in one embodiment of the present invention, the step S23 also includes: symmetrically encrypting the second local end identifier of the responder based on the fourth random number; and sending the encrypted second local end identifier back to the sender to identify the identity of the responder.
[0019] Preferably, in one embodiment of the present invention, the step S23 also includes: based on the responder private key, signing the encrypted fourth random number, the encrypted second key source random number and the encrypted second local identifier as a whole; and sending the signature back to the sender to ensure the authenticity of the returned data.
[0020] Preferably, in an embodiment of the present invention, the step S21 comprises: generating a digital certificate of the responder based on an SM2 algorithm.
[0021] Preferably, in an embodiment of the present invention, the step S23 includes: using the SM1 algorithm or the SM4 algorithm to perform the symmetric encryption, and using the SM2 algorithm or the SM9 algorithm to perform the asymmetric encryption.
[0022] Preferably, in an embodiment of the present invention, the step S24 comprises: determining the symmetric key between the initiator and the responder using a hash operation of an SM3 algorithm.
[0023] Preferably, in one embodiment of the present invention, the initiator is a vehicle-mounted wireless reloading device, and the responder is a ground server.
[0024] In addition, the key agreement system for the initiator provided according to the third aspect of the present invention includes a memory and a processor. The memory stores computer instructions. The processor is connected to the memory and is configured to execute the computer instructions stored in the memory to implement the key agreement method for the initiator provided in the first aspect of the present invention.
[0025] In addition, the key agreement system for the responder provided according to the fourth aspect of the present invention includes a memory and a processor. The memory stores computer instructions. The processor is connected to the memory and is configured to execute the computer instructions stored in the memory to implement the key agreement method for the responder provided in the second aspect of the present invention.
[0026] In addition, the computer-readable storage medium provided according to the fifth aspect of the present invention stores computer instructions. When the computer instructions are executed by the processor, the key negotiation method for the initiator provided by the first aspect of the present invention is implemented.
[0027] In addition, the computer-readable storage medium provided according to the sixth aspect of the present invention stores computer instructions. When the computer instructions are executed by the processor, the key negotiation method for the responder provided by the second aspect of the present invention is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above features and advantages of the present invention can be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or features may have the same or similar reference numerals.
[0029] Figure 1 A typical wireless switching network topology diagram of a train control system is shown;
[0030] Figure 2 A flow chart of a key negotiation method for an initiator provided according to some embodiments of the present invention is shown;
[0031] Figure 3 A flowchart of a key negotiation method for a responder provided according to some embodiments of the present invention is shown;
[0032] Figure 4 A schematic diagram of a key agreement system for an initiator provided according to some embodiments of the present invention is shown; and
[0033] Figure 5 A schematic diagram of a key agreement system for a responder provided according to some embodiments of the present invention is shown.
[0034] Reference numerals:
[0035] 110: Vehicle-mounted LKJ system;
[0036] 120: wireless communication network;
[0037] 130: Ground system;
[0038] 131: Ground level change console;
[0039] 10: Key negotiation method for the initiator;
[0040] 20: Key negotiation method for the responder;
[0041] S11~S16: steps;
[0042] S21-S24: steps;
[0043] 400: key negotiation system for the initiator;
[0044] 500: Key agreement system for responder;
[0045] 410, 510: memory;
[0046] 411, 511: Computer readable storage medium; and
[0047] 420, 520: Processor. DETAILED DESCRIPTION
[0048] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the accompanying drawings and specific embodiments are only exemplary and should not be construed as limiting the scope of protection of the present invention in any way.
[0049] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0050] In addition, the terms "upper", "lower", "left", "right", "top", "bottom", "horizontal" and "vertical" used in the following description should be understood as the directions shown in the paragraph and the related drawings. Such relative terms are only used for the convenience of description and do not mean that the device described therein must be manufactured or operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0051] It is understood that although the terms "first", "second", "third", etc. may be used herein to describe various components, regions, layers and / or parts, these components, regions, layers and / or parts should not be limited by these terms, and these terms are only used to distinguish different components, regions, layers and / or parts. Therefore, the first component, region, layer and / or part discussed below may be referred to as a second component, region, layer and / or part without departing from some embodiments of the present invention.
[0052] As mentioned above, due to the natural defects of the wireless channel, there are security risks such as theft of dressing data or man-in-the-middle attacks. The existing technology (for example, Chinese patent CN220043678U) is mainly used to realize the wireless dressing function on LKJ, and lacks a description of security content. The method provided by the existing technology (for example, Chinese patent CN115913727A) is mainly used for the mutual recognition and identification of vehicle-ground communication identities, focusing on the confirmation of the identities of both the vehicle and the ground. When the authentication fails, the ground firewall initiates the access prohibition action, lacking security protection for the wireless communication network. The existing technology (for example, Chinese patent CN114162190A) transmits LKJ wireless dressing data to the ground server through multi-threading technology to improve transmission efficiency, focusing on transmission efficiency. However, the establishment of the existing secure channel for communication is highly coupled with the business and has poor flexibility.
[0053] In addition, the traditional RFC IPSec VPN is based on internationally accepted ciphers such as AES, SHA256, and RSA. The cryptographic algorithm is designed by a foreign organization and is not controllable. In addition, the RFC IPSec VPN negotiation process has certain security risks. For example, the basis of its main mode key exchange is DH key exchange, and the exchange process lacks the identity authentication of the communicating parties, and the credibility of the message cannot be determined. The existing technology (for example, Chinese patent CN116647824A) uses SM2, SM3, and SM4 to encrypt the communication in the vehicle-ground data transmission, but the patent does not describe the specific encryption form.
[0054] In order to overcome the above-mentioned defects of the prior art, the present invention provides a key negotiation method for an initiating end, a key negotiation system for an initiating end and a computer-readable storage medium, as well as a key negotiation method for a responding end, a key negotiation system for a responding end and a computer-readable storage medium, which can establish a security negotiation process independent of the business, build a secure communication tunnel to ensure the security of transmitted data, achieve the effect of reliable data transmission in a wireless channel, and achieve the reliability of symmetric key negotiation.
[0055] In some non-limiting embodiments, the key agreement method for the initiator provided by the first aspect of the present invention can be implemented via the key agreement system for the initiator provided by the third aspect of the present invention. The key agreement method for the responder provided by the second aspect of the present invention can be implemented via the key agreement system for the responder provided by the fourth aspect of the present invention.
[0056] The key negotiation method for the initiating end and the key negotiation method for the responding end provided by the present invention can be used to solve the security problem of wireless equipment change of train control, and the security of wireless equipment change of train control is guaranteed based on the national secret IPSec VPN technology. Moreover, the network security of wireless communication can be decoupled from the specific wireless equipment change service, so that it is also applicable to other business scenarios. When the key negotiation method for the initiating end and the key negotiation method for the responding end provided by the present invention are used to solve the security problem of wireless equipment change of train control, the initiating end can be a vehicle-mounted wireless equipment change device, and the responding end can be a ground server.
[0057] The following will first describe the working principle of the key negotiation system for the initiator in combination with some embodiments of the key negotiation method for the initiator. Those skilled in the art will understand that these embodiments of the key negotiation method for the initiator are only some non-restrictive implementation methods provided by the present invention, which are intended to clearly demonstrate the main concept of the present invention and provide some specific solutions that are convenient for the public to implement, rather than to limit all functions or all working modes of the key negotiation system for the initiator. Similarly, the key negotiation system for the initiator is also only a non-restrictive implementation method provided by the present invention, and does not constitute a limitation on the execution subject and execution order of each step in these key negotiation methods for the initiator.
[0058] In addition, the following also combines some embodiments of the key negotiation method for the responder to describe the working principle of the key negotiation system for the responder. Those skilled in the art can understand that these embodiments of the key negotiation method for the responder are only some non-restrictive implementation methods provided by the present invention, which are intended to clearly demonstrate the main concept of the present invention and provide some specific solutions that are convenient for the public to implement, rather than to limit all functions or all working methods of the key negotiation system for the responder. Similarly, the key negotiation system for the responder is also only a non-restrictive implementation method provided by the present invention, and does not constitute a limitation on the execution subject and execution order of each step in these key negotiation methods for the responder.
[0059] Please refer to Figure 2 and Figure 3 , Figure 2 A flowchart of a key negotiation method for an initiator according to some embodiments of the present invention is shown. Figure 3 A flowchart of a key negotiation method for a responder provided according to some embodiments of the present invention is shown.
[0060] like Figure 2 As shown, the key agreement method 10 for the initiator may include step S11: sending a first data packet including a first random number to the responder.
[0061] The initiator may be a vehicle-mounted wireless refitting device, and the responder may be a ground server. The initiator may generate a first random number CKY_I, and send the first random number CKY_I as a field of a first data packet to the responder.
[0062] Afterwards, if Figure 3 As shown, the key agreement method 20 for the responder may include step S21: in response to receiving a first data packet including a first random number from the initiator, sending back to the initiator a second data packet including a second random number and a digital certificate of the responder.
[0063] After receiving the first data packet including the first random number from the initiator, the responder may generate a second random number CKY_R, and send the second random number CKY_R back to the initiator as a field of the second data packet. The second data packet may also include the digital certificate of the responder. The digital certificate may be the signature certificate and encryption certificate of the responder, and the digital certificate may be generated based on SM2.
[0064] In addition, in step S11, the first data packet may also include a payload, which may be used for the user data portion of the actual transmission. In the wireless dressing scenario, the on-board wireless dressing device may send a SA (Security Association) payload encapsulated with a suggested payload to the responding ground server, and the suggested payload may further be encapsulated with a transformation payload. Here, SA is an agreement established by negotiation between two concentric entities, and the SA payload may be used to agree on the security protocol between the initiator and the responder, the message encapsulation method, encryption and verification algorithm, etc.
[0065] Correspondingly, the second data packet also includes an SA payload sent back to the initiator. The SA payload in the second data packet is used to respond to the suggested payload encapsulated in the SA payload sent by the initiator in step S11.
[0066] Please continue to refer to Figure 2 , the key agreement method 10 for the initiator may include step S12 and step S13:
[0067] Obtain a second data packet sent back by the responder, including a second random number and a digital certificate of the responder;
[0068] Generate a first key source random number and a third random number, symmetrically encrypt the first key source random number based on the third random number, and asymmetrically encrypt the third random number based on the responder public key in the digital certificate of the responder.
[0069] After receiving the second random number and the digital certificate of the responder, the initiator can obtain the responder's public key pub_r in the certificate according to the digital certificate of the responder. After that, the initiator can randomly generate the first key source random number Nonce_i and the third random number Ski_i.
[0070] The first key source random number Nonce_i is symmetrically encrypted by the third random number Ski_i, and the algorithm of the symmetric encryption can adopt the SM1 algorithm or the SM4 algorithm; the third random number Ski_i is asymmetrically encrypted using the responder's public key pub_r, thereby realizing a digital envelope mechanism to protect the third random number Ski_i and prevent the first key source random number Nonce_i from being easily cracked, so that the key of each negotiation session (i.e., the third random number Ski_i) is protected by the digital envelope, effectively improving the security of the key. Preferably, the SM2 algorithm or the SM9 algorithm can be used for asymmetric encryption. The controllability of cryptographic technology can be achieved by using the national secret algorithms SM1, SM2, SM3, SM4, and SM9.
[0071] Afterwards, the key agreement method 10 for the initiator may execute step S14: sending the initiator's digital certificate to the responder to obtain the encrypted second key source random number and the fourth random number sent back by the responder. Here, the initiator's digital certificate may be generated based on SM2.
[0072] Preferably, in addition to sending the digital certificate of the initiator, the initiator may also send the encrypted third random number and the encrypted first key source random number to the responder.
[0073] Please refer to Figure 3 The key agreement method 20 for the responder may include step S22: in response to receiving the initiator's digital certificate, the encrypted first key source random number and the encrypted third random number, determining the third random number according to the responder's public key in the responder's digital certificate, and determining the first key source random number according to the third random number.
[0074] In this preferred embodiment, the responder may determine the third random number Ski_i according to the responder public key pub_r, and then determine the first key source random number Nonce_i according to the third random number Ski_i.
[0075] Preferably, in step S13, the initiator can also symmetrically encrypt the initiator's first local identification IDi based on the third random number Ski_i, and the symmetric encryption algorithm can adopt the SM1 algorithm or the SM4 algorithm. Afterwards, in step S14, the encrypted first local identification IDi is sent to the responder, and the responder can identify the identity of the initiator accordingly. This can improve the problem of being unable to verify the identity of the other party caused by the DH negotiation algorithm in the traditional IPSec VPN technology using RFC. Here, the first local identification IDi can be a specific wireless refitting device ID number or a train number.
[0076] In this more preferred embodiment, in step S13, the initiator can sign the initiator's digital certificate, the encrypted third random number, the encrypted first key source random number and the encrypted first local identifier as a whole based on the initiator's private key; and in step S14, the signature is sent to the responder together, thereby ensuring the authenticity of the content of the sent data.
[0077] Afterwards, if Figure 3 As shown, the key agreement method 20 for the responding end may include step S23: generating a second key source random number and a fourth random number, symmetrically encrypting the second key source random number based on the fourth random number, asymmetrically encrypting the fourth random number based on the initiator's public key in the initiator's digital certificate, and sending the encrypted fourth random number and the encrypted second key source random number back to the initiator.
[0078] The responder obtains the initiator's public key pub_i in the certificate according to the initiator's digital certificate received in step S22. Afterwards, the responder can randomly generate a second key source random number Nonce_r and a fourth random number Ski_r.
[0079] The second key source random number Nonce_r is symmetrically encrypted by the fourth random number Ski_r, and the algorithm of the symmetric encryption can adopt the SM1 algorithm or the SM4 algorithm; the fourth random number Ski_r is asymmetrically encrypted by using the initiator's public key pub_i, thereby realizing the digital envelope mechanism, protecting the fourth random number Ski_r, and preventing the second key source random number Nonce_r from being easily cracked, so that the key fourth random number Ski_r of each negotiation session is carried out under the protection of the digital envelope, effectively improving the security of the key. Preferably, the SM2 algorithm or the SM9 algorithm can be used for asymmetric encryption. Thus, the asymmetric key is used to protect the symmetric key to achieve reliable key negotiation and the subsequent unification of the keys at both ends.
[0080] After the responder encrypts the randomly generated second key source random number Nonce_r and the fourth random number Ski_r, the encrypted fourth random number and the encrypted second key source random number can be sent back to the initiator. Preferably, the responder can also symmetrically encrypt the responder's second local identifier IDr based on the fourth random number Ski_r, and the symmetric encryption algorithm can adopt the SM1 algorithm or the SM4 algorithm. When the encrypted fourth random number and the encrypted second key source random number are sent back, the encrypted second local identifier IDr is sent back to the initiator, and the initiator can identify the identity of the responder accordingly.
[0081] More preferably, the data sent back to the initiator, including the encrypted fourth random number, the encrypted second key source random number and the encrypted second local identifier, may also be signed as a whole via the responder's private key to ensure the authenticity of the sent back data.
[0082] like Figure 1 As shown, after the initiator receives the encrypted fourth random number and the encrypted second key source random number sent back by the responder, it can execute step S15 of the key agreement method 10 for the initiator: determine the fourth random number based on the initiator's public key in the initiator's digital certificate, and determine the second key source random number based on the fourth random number.
[0083] The initiator may decrypt the encrypted fourth random number according to its own initiator public key pub_i to determine the fourth random number Ski_r, and then decrypt the encrypted second key source random number according to the determined fourth random number Ski_r to determine the second key source random number Nonce_r.
[0084] Therefore, in this preferred embodiment, through steps S11 to S15 of the key agreement method 10 for the initiator and steps S21 to S23 of the key agreement method 20 for the responder, both the initiator and the responder can confirm the first random number CKY_I, the second random number CKY_R, the first key source random number Nonce_i and the second key source random number Nonce_r.
[0085] like Figure 2 , Figure 3 As shown, the initiator can execute step S16 and the responder can execute step S24, and determine the symmetric key between the initiator and the responder based on the first random number CKY_I, the second random number CKY_R, the first key source random number Nonce_i and the second key source random number Nonce_r. The generated symmetric key can be used for subsequent business communications between the initiator and the responder.
[0086] Preferably, the initiator and the responder can use the hash operation of SM3 to determine the symmetric key between the two ends. For example, the symmetric key SKEYID is determined using the HMAC (Keyed-Hash Message Authentication Code, hash operation with key) of SM3, and the specific calculation method is as follows:
[0087] SKEYID=HMAC(HASH(Nonce_i|Nonce_r),CKY_I|CKY_R)
[0088] After splicing the first key source random number Nonce_i and the second key source random number Nonce_r, the output value is determined by using the HASH algorithm, and then the output value and the spliced value of the first random number CKY_I and the second random number CKY_R are hashed by the HMAC algorithm to determine the final symmetric key SKEYID. The final symmetric key SKEYID can unify the keys at both ends, and the symmetric key SKEYID can be used for symmetrical encryption of data during subsequent communication between the initiator and the responder. Preferably, the symmetric encryption of subsequent communication between the two ends can be implemented using the SM4 algorithm.
[0089] To sum up, the key negotiation method provided by the present invention adopts a digital envelope mechanism based on the national secret algorithm, and uses the SM2 algorithm to generate a digital certificate to verify the identities of both parties first. Under this premise, the public key of the other party is used to encrypt and protect the key source random number generated by this device, which is then received by the other party and decrypted using the public key and private key of this end to obtain the key source random number of the other end. The key source random number of the other end and the key source random number generated by this end are used as input sources to calculate and generate the session key for subsequent services.
[0090] Therefore, the key negotiation method provided by the present invention can be independent of the business, has low coupling, and establishes a set of secure communication tunnels, solves the potential security risks in wireless communications, and effectively improves the security of the key.
[0091] Also, please refer to Figure 4 and Figure 5 , Figure 4 A schematic diagram of a key agreement system for an initiator provided according to some embodiments of the present invention is shown. Figure 5 A schematic diagram of a key agreement system for a responder provided according to some embodiments of the present invention is shown.
[0092] like Figure 4 As shown, the key agreement system 400 for the initiator may be configured with a memory 410 and a processor 420. The memory 410 includes but is not limited to the computer-readable storage medium 411 provided in the fifth aspect of the present invention, on which computer instructions are stored. The processor 420 is connected to the memory 410 and is configured to execute the computer instructions stored in the memory 410 to implement the key agreement method for the initiator provided in the first aspect of the present invention.
[0093] Likewise, Figure 5The key agreement system 500 for the responder shown may be configured with a memory 510 and a processor 520. The memory 510 includes but is not limited to the computer-readable storage medium 511 provided in the sixth aspect of the present invention, on which computer instructions are stored. The processor 520 is connected to the memory 510 and is configured to execute the computer instructions stored in the memory 510 to implement the key agreement method for the responder provided in the second aspect of the present invention.
[0094] Although the above methods are illustrated and described as a series of actions for simplicity of explanation, it should be understood and appreciated that these methods are not limited by the order of the actions, because according to one or more embodiments, some actions may occur in a different order and / or concurrently with other actions from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art.
[0095] Those skilled in the art will appreciate that information, signals, and data may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips cited throughout the above description may be represented by voltage, current, electromagnetic waves, magnetic fields or magnetic particles, optical fields or optical particles, or any combination thereof.
[0096] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. The technician may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.
[0097] The various illustrative logic modules and circuits described in conjunction with the embodiments disclosed herein may be implemented or executed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in cooperation with a DSP core, or any other such configuration.
[0098] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, a storage medium may be integrated into a processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.
[0099] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented as a computer program product in software, each function may be stored on or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include both computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one place to another. Storage media may be any available medium that can be accessed by a computer. As an example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer. Any connection is also properly referred to as a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein disk often reproduces data magnetically, while disc reproduces data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0100] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but should be granted the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A key negotiation method for an initiator, characterized in that: Includes steps: Step S11: Sending a first data packet including a first random number to the responder; Step S12: Obtain a second data packet sent back by the responder, including a second random number and a digital certificate of the responder; Step S13: Generate a first key source random number and a third random number, symmetrically encrypt the first key source random number based on the third random number, and asymmetrically encrypt the third random number based on the responder public key in the digital certificate of the responder; Step S14: Send the initiator's digital certificate to the responder to obtain the encrypted second key source random number and fourth random number sent back by the responder; Step S15: determining the fourth random number according to the initiator's public key in the initiator's digital certificate, and determining the second key source random number according to the fourth random number; as well as Step S16: Determine a symmetric key between the initiator and the responder based on the first random number, the second random number, the first key source random number and the second key source random number.
2. The key negotiation method according to claim 1, wherein: The step S14 further includes: The encrypted third random number and the encrypted first key source random number are sent to the responder, and the responder determines the third random number according to the responder public key, and determines the first key source random number according to the third random number.
3. The key negotiation method according to claim 2, wherein: The steps S13 and S14 further include: symmetrically encrypting the first local identifier of the initiator based on the third random number; and The encrypted first local end identifier is sent to the responder to identify the initiator.
4. The key negotiation method according to claim 3, wherein: The steps S13 and S14 further include: Based on the initiator's private key, the initiator's digital certificate, the encrypted third random number, the encrypted first key source random number, and the encrypted first local end identifier are signed as a whole; and The signature is sent to the responder to ensure the authenticity of the sent data.
5. The key negotiation method according to claim 1, wherein: The step S13 comprises: The symmetric encryption is performed using the SM1 algorithm or the SM4 algorithm, and the asymmetric encryption is performed using the SM2 algorithm or the SM9 algorithm.
6. The key negotiation method according to claim 1, wherein: The step S14 comprises: Generate the digital certificate of the initiator based on the SM2 algorithm.
7. The key negotiation method according to claim 1, wherein: The step S16 comprises: The symmetric key between the initiator and the responder is determined using a hash operation of the SM3 algorithm.
8. The key negotiation method according to claim 1, wherein: The initiator is the vehicle-mounted wireless replacement device, and the responder is the ground server.
9. A key negotiation method for a responder, characterized in that: Includes steps: Step S21: in response to receiving a first data packet including a first random number from the initiator, sending back to the initiator a second data packet including a second random number and a digital certificate of the responder; Step S22: in response to receiving the initiator's digital certificate, the encrypted first key source random number and the encrypted third random number, determining the third random number according to the responder's public key in the responder's digital certificate, and determining the first key source random number according to the third random number; Step S23: Generate a second key source random number and a fourth random number, symmetrically encrypt the second key source random number based on the fourth random number, asymmetrically encrypt the fourth random number based on the initiator public key in the initiator's digital certificate, and send the encrypted fourth random number and the encrypted second key source random number back to the initiator; as well as Step S24: Determine a symmetric key between the initiator and the responder based on the first random number, the second random number, the first key source random number, and the second key source random number.
10. The key negotiation method according to claim 9, wherein: The step S23 further comprises: symmetrically encrypting the second local end identifier of the responder based on the fourth random number; and The encrypted second local end identifier is sent back to the sender to identify the identity of the responder.
11. The key negotiation method according to claim 10, wherein: The step S23 further comprises: Based on the responder private key, the encrypted fourth random number, the encrypted second key source random number and the encrypted second local end identifier are signed as a whole; and The signature is sent back to the sender to ensure the authenticity of the sent back data.
12. The key negotiation method according to claim 9, wherein: The step S21 comprises: Generate a digital certificate of the responder based on the SM2 algorithm.
13. The key negotiation method according to claim 9, wherein: The step S23 comprises: The symmetric encryption is performed using the SM1 algorithm or the SM4 algorithm, and the asymmetric encryption is performed using the SM2 algorithm or the SM9 algorithm.
14. The key negotiation method according to claim 9, wherein: The step S24 comprises: The symmetric key between the initiator and the responder is determined using a hash operation of the SM3 algorithm.
15. The key negotiation method according to claim 9, wherein: The initiator is the vehicle-mounted wireless replacement device, and the responder is the ground server.
16. A key agreement system for an initiator, characterized in that: include: a memory having computer instructions stored thereon; as well as A processor is connected to the memory and is configured to execute computer instructions stored in the memory to implement the key negotiation method for the initiator according to any one of claims 1 to 8.
17. A key agreement system for a responder, characterized in that: include: a memory having computer instructions stored thereon; as well as A processor is connected to the memory and is configured to execute computer instructions stored in the memory to implement the key negotiation method for a responder according to any one of claims 9 to 15.
18. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the key negotiation method for an initiator according to any one of claims 1 to 8 is implemented.
19. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by the processor, the key negotiation method for the responder as claimed in any one of claims 9 to 15 is implemented.
Citation Information
Patent Citations
Multi-thread LKJ vehicle-mounted data wireless reloading data file transmission technical method
CN114162190A
Method and system for realizing wireless reloading uniqueness identification of LKJ data based on digital certificate
CN115913727A
Vehicle-mounted basic data and temporary data wireless reloading system and reloading method
CN116647824A
LKJ vehicle-mounted data wireless reloading device
CN220043678U
A method and system for network security communication
CN101145913A