A method, system, device and medium for secure transmission of device keys
The device key is encrypted and decrypted through dynamic negotiation keys, which solves the problem that the device key is easily leaked and tampered during transmission, and improves the security and accuracy of device key transmission.
Patent Information
- Application Number
- CN202411669260.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-11-21
AI Technical Summary
In the prior art, device keys are easily leaked and tampered during transmission, resulting in possible illegal operations and social impacts in equipment operations.
By generating and negotiating key pairs, using the root certificate signature authorization to transmit interactive certificates, the dynamic negotiation key encrypts and decrypts the device keys to ensure the signature and verification of the data area blocks.
It effectively avoids the leakage and tampering of device keys, improves the security and accuracy of device key transmission, and ensures the security of device operations.
Smart Images

Figure CN119182529B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a method, system, device and medium for securely transmitting a device key. Background Art
[0002] The device's keys, including the device's commonly used communication keys and storage keys, are important protection credentials for modifying the device's operating parameters and device remote communications. In actual use, these device key credentials will be used to transfer business in different applications or systems.
[0003] General data transmission only protects the information of the transmission link, such as the commonly used Secure Socket Layer (SSL) communication transmission, and does not encrypt or decrypt the data content itself, or performs a simple encryption and decryption process, such as fixed encryption and decryption keys, and fixed asymmetric keys for certificate signing / verification. If the transmitted data is obtained, it is easy to cause the leakage and tampering of device-related keys, causing a series of possible illegal operations on the device, such as stealing device storage data, tampering with device operation cycle, billing parameters, etc. Once the above problems occur, they will seriously undermine the production and operation activities of equipment operating enterprises and institutions, and even face adverse social impacts such as claims. Summary of the invention
[0004] In view of this, the present invention provides a method, system, device and medium for securely transmitting device keys to solve the problem that the keys related to existing devices are easily leaked and tampered with.
[0005] In a first aspect, the present invention provides a method for securely transmitting a device key, which is applied to a sender of the device key, and the method includes:
[0006] Generate a first public key and a first private key, and use the first public key to generate a first key agreement certificate request file;
[0007] Generate a signature public key and a signature private key, and use the signature public key to generate a digital signature certificate request file;
[0008] Sending a first key agreement certificate request file and a data signature certificate request file;
[0009] Receiving a root public key certificate, a first key agreement certificate, a data signature certificate, and a second key agreement certificate, and verifying the first key agreement certificate, the data signature certificate, and the second key agreement certificate using the root public key certificate;
[0010] Generate a negotiation key using the first private key, the first key negotiation certificate, and the second key negotiation certificate, and encrypt the device key using the negotiation key to obtain the encrypted device key;
[0011] Use the signature private key to sign the encrypted device key to obtain signature data;
[0012] The root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate, the encrypted device key and the signature data are packaged into a data envelope and sent out.
[0013] The secure transmission method of device keys provided by the present invention utilizes the root certificate to sign and authorize the interactive certificates involved in the transmission of both parties, obtains a dynamic negotiation key for encrypting the device key through mutual negotiation and authentication between the sender and the receiver, signs or verifies the data area blocks of the transmission parties, and utilizes the dynamic negotiation key to encrypt and decrypt the device key, thereby preventing the device key from being leaked and tampered with, and ensuring the information security of the device key in the interactive transmission between the two parties.
[0014] In an optional implementation, using a root public key certificate to verify the first key agreement certificate, the data signature certificate, and the second key agreement certificate includes:
[0015] If the verification fails, the device key transmission process is terminated.
[0016] The secure transmission method for device keys provided by the present invention authorizes the interactive certificates involved in the transmission by means of a root certificate signature, and uses the root public key certificate to verify other certificates, thereby ensuring that the four certificates are legal certificates recognized by the receiving party. If the verification fails, the transmission process is terminated, thereby improving the accuracy of certificate authentication and the security of device key transmission.
[0017] In an optional implementation, encrypting the device key according to the negotiated key includes:
[0018] Generate a negotiated key using a key exchange protocol based on an elliptic curve cryptographic algorithm;
[0019] The device key is encrypted using the Advanced Encryption Standard's symmetric encryption algorithm based on the negotiated key.
[0020] The secure transmission method of the device key provided by the present invention utilizes the AES encryption algorithm to encrypt the device key, which has higher security and faster data processing speed, thereby improving the efficiency and security of encrypting the device key.
[0021] In a second aspect, the present invention provides a method for securely transmitting a device key, which is applied to a receiver of the device key, and the method comprises:
[0022] Generate a root key pair and a root public key certificate. The root key pair includes a root public key and a root private key.
[0023] Receive a first key agreement certificate request file and a data signature certificate request file, and generate a first key agreement certificate and a data signature certificate using a root private key;
[0024] Generate a second public key and a second private key, and use the root private key to sign a second key agreement certificate for the second public key;
[0025] Send the root public key certificate, the first key agreement certificate, the data signature certificate, and the second key agreement certificate;
[0026] Receive the data envelope, verify the first key negotiation certificate, the data signature certificate and the second key negotiation certificate using the root public key certificate, verify the encrypted device key using the data signature certificate and the signature data, and obtain the negotiation key using the first key negotiation certificate, the second private key and the second key negotiation certificate;
[0027] The encrypted device key is decrypted using the negotiated key to obtain the device key.
[0028] The secure transmission method of the device key provided by the present invention obtains a dynamic negotiation key for encrypting the device key through mutual negotiation and authentication between the sender and the receiver, signs or verifies the data area blocks of the two transmission parties, and uses the dynamic negotiation key to encrypt and decrypt the device key, thereby preventing the device key from being leaked and tampered with, and ensuring the information security of the device key in the interactive transmission between the two parties.
[0029] In an optional implementation, using a root public key certificate to verify the first key agreement certificate, the data signature certificate, and the second key agreement certificate, and using the data signature certificate and the signature data to verify the encrypted device key includes:
[0030] If the root public key certificate fails to verify the first key agreement certificate, the data signature certificate and the second key agreement certificate, or the data signature certificate and the signature data fail to verify the encrypted device key, the device key transmission process is terminated.
[0031] The secure transmission method of device keys provided by the present invention uses a root public key certificate to verify whether a received device key comes from a required device, and uses a data signature certificate and signature data to verify whether the encrypted device key has been tampered with. If the verification fails, the transmission process is terminated, thereby improving the accuracy and security of device key transmission.
[0032] In an optional implementation manner, decrypting the encrypted device key using the negotiated key includes:
[0033] Based on the negotiated key, the encrypted device key is decrypted using the Advanced Encryption Standard's symmetric decryption algorithm.
[0034] The secure transmission method of the device key provided by the present invention uses the AES decryption algorithm to decrypt the device key, which has higher security and faster data processing speed, thereby improving the efficiency and security of decrypting the device key.
[0035] In a third aspect, the present invention provides a secure transmission system for a device key, which is applied to a sender of the device key, and the system includes:
[0036] A first request generation module, used to generate a first public key and a first private key, and generate a first key agreement certificate request file using the first public key;
[0037] The second request generation module is used to generate a signature public key and a signature private key, and use the signature public key to generate a digital signature certificate request file;
[0038] A request sending module, used to send a first key agreement certificate request file and a data signature certificate request file;
[0039] The certificate receiving module is used to receive the root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate, and verify the first key agreement certificate, the data signature certificate and the second key agreement certificate using the root public key certificate;
[0040] A device key encryption module, used to generate a negotiation key using the first private key, the first key negotiation certificate, and the second key negotiation certificate, and to encrypt the device key using the negotiation key to obtain the encrypted device key;
[0041] A data signature module is used to sign the encrypted device key using a signature private key to obtain signature data;
[0042] The data envelope sending module is used to pack the root public key certificate, the first key negotiation certificate, the data signature certificate and the second key negotiation certificate, the encrypted device key and the signature data into a data envelope and send it out.
[0043] In a fourth aspect, the present invention provides a secure transmission system for a device key, which is applied to a receiver of the device key, and the system includes:
[0044] A root certificate generation module is used to generate a root key pair and a root public key certificate. The root key pair includes a root public key and a root private key.
[0045] A first negotiation certificate generation module, used to receive a first key negotiation certificate request file and a data signature certificate request file, and generate a first key negotiation certificate and a data signature certificate using a root private key;
[0046] A second negotiation certificate generation module, used to generate a second public key and a second private key, and use the root private key to sign a second key negotiation certificate for the second public key;
[0047] The certificate sending module is used to send the root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate;
[0048] A data envelope receiving module is used to receive a data envelope, verify the first key negotiation certificate, the data signature certificate and the second key negotiation certificate in the received data envelope using the root public key certificate, verify the encrypted device key using the data signature certificate and the signature data, and obtain the negotiation key using the first key negotiation certificate, the second private key and the second key negotiation certificate;
[0049] The device key decryption module is used to decrypt the encrypted device key using the negotiated key to obtain the device key.
[0050] In a fifth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof, the second aspect or any corresponding embodiment thereof by executing the computer instructions.
[0051] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the method of the first aspect or any corresponding embodiment thereof, the second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 is a flow chart of a method for securely transmitting a device key according to an embodiment of the present invention applied to a sender;
[0054] Figure 2 is a flow chart of a method for securely transmitting a device key according to an embodiment of the present invention applied to a receiving party;
[0055] Figure 3 It is a schematic diagram of the flow of interaction between two parties of the secure transmission method of the device key according to an embodiment of the present invention;
[0056] Figure 4 is a structural block diagram of a secure transmission system for a device key according to an embodiment of the present invention applied to a sender;
[0057] Figure 5 is a structural block diagram of a secure transmission system for a device key according to an embodiment of the present invention applied to a receiving party;
[0058] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0060] The embodiment of the present invention provides a method for secure transmission of a device key, wherein a dynamic key is obtained through negotiation between transmission parties, and the dynamic key is used for authentication and encryption and decryption, so as to prevent the device key from being leaked or tampered with.
[0061] In the data management systems of various devices, such as power collection equipment systems, traffic monitoring equipment systems, etc., it is usually necessary to perform remote or local software interface operations on the devices, such as setting equipment operation parameters and reading equipment operation data. The communication key, storage key, etc. of the device are important credentials for performing the above operations remotely or locally. In actual use, the key credentials of these devices will be used for business flow transmission in different applications or systems. If the transmitted data is obtained by a third party during the transmission process, and we do not encrypt or decrypt the data content itself or perform a simple encryption and decryption process, such as fixed encryption and decryption keys, and fixed asymmetric keys for certificate signing / verification, it is easy to cause the leakage and tampering of device-related keys, causing a series of possible illegal operations on the device, such as stealing device storage data, tampering with device operation cycle, billing parameters, etc., which brings challenges to security. In the data management systems of various devices, basic information management of the device is already available: unique identification, device type, communication mode, network standard, etc. Since the basic information parameter management of the device is the data that the device management system itself will record in the prior art, it will not be described in detail in this embodiment. The sender in the embodiment of the present invention is the key management service system (Key Management Service, KMS) of the device, and the receiver is the remote master station control system of the device. In addition, the embodiment of the present invention is also applicable to other situations involving system-to-system interaction and system-to-device interaction involving device key interaction. The sender and receiver of the device key both include: a key management module, a certificate management module, a data encryption module, a data decryption module, and a data application storage module, which are only used as examples, but are not limited to this.
[0062] According to an embodiment of the present invention, an embodiment of a method for securely transmitting a device key is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0063] In this embodiment, a method for securely transmitting a device key is provided, which is applied to the sender of the device key and can be used in the above-mentioned computer system. Figure 1 is a flow chart of a method for securely transmitting a device key according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0064] Step S101: Generate a first public key and a first private key, and use the first public key to generate a first key agreement certificate request file.
[0065] Specifically, the device key sender generates a key pair for dynamic key negotiation, including: a first public key AES1_Public.key and a first private key AES1_Private.key, and uses the first public key AES1_Public.key to generate a first key negotiation certificate request file AES1_Public.csr. The encryption algorithm used in the dynamic key negotiation process is the key exchange protocol based on the elliptic curve encryption algorithm (Elliptic Curve Diffie-Hellman, ECDH), which is only used as an example, but not limited to this.
[0066] Step S102, generate a signature public key and a signature private key, and use the signature public key to generate a digital signature certificate request file.
[0067] Specifically, the sender of the device key generates a key pair for signing or verifying the data domain block, including the signature public key Sign_Public.key and the signature private key Sign_Private.key, and uses the signature public key Sign_Public.key to generate the data signature certificate request file Sign_Public.csr. The data domain block represents the information content of the device key encrypted with the AES dynamic negotiation key and placed in the Body node in the data envelope.
[0068] Step S103: Send a first key agreement certificate request file and a data signature certificate request file.
[0069] Specifically, the device key sender sends the first key agreement certificate request file AES1_Public.csr and the data signature certificate request file Sign_Public.csr to the receiver.
[0070] Step S104: receiving a root public key certificate, a first key agreement certificate, a data signature certificate, and a second key agreement certificate, and verifying the first key agreement certificate, the data signature certificate, and the second key agreement certificate using the root public key certificate.
[0071] Specifically, after the device key receiver performs a series of processing on the first key negotiation certificate request file and the data signature certificate request file, it returns the root public key certificate Root_Public, the first key negotiation certificate AES1_Public, the data signature certificate Sign_Public and the second key negotiation certificate AES2_Public to the sender, and the sender receives the four certificates. The root public key certificate is used to verify the legitimacy of the first key negotiation certificate, the data signature certificate and the second key negotiation certificate. After the verification is passed, the negotiation key is generated.
[0072] Step S105: Generate a negotiation key using the first private key, the first key negotiation certificate, and the second key negotiation certificate, and encrypt the device key using the negotiation key to obtain the encrypted device key.
[0073] Specifically, the first private key AES1_Private.key, the first key negotiation certificate AES1_Public, and the second key negotiation certificate AES2_Public are used to generate an AES-encrypted negotiation key using the Elliptic Curve Diffie-Hellman key Exchange (ECDH) algorithm in Elliptic Curve Cryptography (ECC). The device key is encrypted using the symmetric encryption algorithm based on the Advanced Encryption Standard (AES) using the negotiation key to obtain the encrypted device key.
[0074] Step S106, using the signature private key to sign the encrypted device key to obtain signature data.
[0075] Specifically, the encrypted device key is signed using the signature private key Sign_Private.key to obtain signature data.
[0076] Step S107: Pack the root public key certificate, the first key agreement certificate, the data signature certificate, the second key agreement certificate, the encrypted device key, and the signature data into a data envelope and send it out.
[0077] Specifically, the data envelope mainly includes three parts: header information (Header part), content area (Body part), and digital signature (Signature part), wherein the Header part is used to store the interactive digital certificate, the Body part is used to store the encrypted device key, and the Signature part is used to store the signature data after the Body part is signed. In this embodiment, the root public key certificate Root_Public, the first key agreement certificate AES1_Public, the data signature certificate Sign_Public, and the second key agreement certificate AES2_Public are stored in the Header part of the data envelope, the encrypted device key is placed in the Body part of the data envelope, and after the Body part of the data envelope is digitally signed using the signature private key, the obtained signature data is placed in the Signature part of the data envelope, thereby obtaining a complete data envelope, and the data envelope is sent to the recipient.
[0078] The secure transmission method of the device key provided in this embodiment uses the root certificate to sign the interactive certificate involving the two parties involved in the transmission, obtains the dynamic negotiation key for encrypting the device key through mutual negotiation and authentication between the sender and the receiver, signs or verifies the data area blocks of the two parties in the transmission, and uses the dynamic negotiation key to encrypt and decrypt the device key to prevent the device key from being leaked and tampered with, thereby ensuring the information security of the device key in the interactive transmission between the two parties.
[0079] In some optional implementations, verifying the first key agreement certificate, the data signature certificate, and the second key agreement certificate using a root public key certificate includes:
[0080] If the verification fails, the transmission process of the device key is terminated.
[0081] Specifically, after receiving the root public key certificate, the first key agreement certificate, the data signature certificate and the second agreement key certificate, the sender will use the root public key certificate to verify the other three business certificates to ensure that the certificate is a legitimate certificate recognized by the receiver. After verification, the four certificates will be placed in the Header part of the data envelope.
[0082] The signature verification process includes: using the root public key certificate Root_Public as the first parameter and the other three certificates as the second parameter, and using the ECC's Elliptic Curve Digital Signature Algorithm (ECDSA) for verification. If the returned Boolean value is true, the verification is successful. Otherwise, it means that the other three certificates are not certificates issued by the recipient using the root private key, the verification fails, and the device key transmission process is terminated. This is only an example, but not limited to this.
[0083] The ECC-based ECDSA algorithm is used for digital signatures and signature verification, legitimacy verification of business certificates during interaction, and integrity verification of data domain blocks of interactively transmitted information.
[0084] The secure transmission method for device keys provided in this embodiment authorizes the interactive certificates involved in the transmission by means of a root certificate signature, and uses the root public key certificate to verify other certificates, thereby ensuring that the four certificates are legitimate certificates recognized by the recipient. If the verification fails, the transmission process is terminated, thereby improving the accuracy of certificate authentication and the security of device key transmission.
[0085] In some optional implementations, encrypting the device key according to the negotiated key includes:
[0086] The negotiated key is generated using a key exchange protocol based on the elliptic curve encryption algorithm.
[0087] The device key is encrypted using the Advanced Encryption Standard's symmetric encryption algorithm based on the negotiated key.
[0088] Specifically, the ECDH algorithm of ECC is used for the encryption and decryption key negotiation process, and the interacting parties use the dynamically negotiated AES key to encrypt and decrypt the device key data. The specific process is a mature existing technology and will not be repeated here.
[0089] The secure transmission method of the device key provided in this embodiment uses the AES encryption algorithm to encrypt the device key, which has higher security and faster data processing speed, thereby improving the efficiency and security of device key encryption.
[0090] In this embodiment, a method for securely transmitting a device key is provided, which is applied to a receiver of the device key and can be used in the above-mentioned computer system. Figure 2 is a flow chart of a method for securely transmitting a device key according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0091] Step S201, generate a root key pair and a root public key certificate, the root key pair includes a root public key and a root private key.
[0092] Specifically, the receiver generates a root key pair for digitally signing all business certificates during the data interaction process, including a root public key Root_Public.key and a root private key Root_Private.key, and uses the root public key Root_Public.key to generate a self-signed root public key certificate Root_Public.
[0093] Step S202: receiving a first key agreement certificate request file and a data signature certificate request file, and generating a first key agreement certificate and a data signature certificate using a root private key.
[0094] Specifically, the first key negotiation certificate request file AES1_Public.csr and the data signature certificate request file Sign_Public.csr are received, and the first key negotiation certificate request file AES1_Public.csr and the data signature certificate request file Sign_Public.csr are signed using the root private key Root_Private.key to form the corresponding first key negotiation certificate AES1_Public and data signature certificate Sign_Public, respectively, where the data signature certificate is used to verify whether the device key has been tampered with.
[0095] Step S203: Generate a second public key and a second private key, and use the root private key to sign a second key agreement certificate for the second public key.
[0096] Specifically, the receiver generates a key pair for dynamic key negotiation, including: a second public key AES2_Public.key and a second private key AES2_Private.key, and uses the root private key Root_Private.key to sign the second public key to sign the second key negotiation certificate AES2_Public. The encryption algorithm used in the dynamic key negotiation process is the same as that of the sender.
[0097] Step S204: Send the root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate.
[0098] Specifically, the root public key certificate Root_Public generated in step S202, the first key agreement certificate AES1_Public and the data signature certificate Sign_Public signed in step S203, and the second key agreement certificate AES2_Public in step S204, a total of four business certificates are returned to the sender of the device key.
[0099] Step S205, receive the data envelope, use the root public key certificate to verify the first key negotiation certificate, the data signature certificate and the second key negotiation certificate, use the data signature certificate and the signature data to verify the encrypted device key, and use the first key negotiation certificate, the second private key and the second key negotiation certificate to obtain the negotiated key.
[0100] Specifically, the recipient of the device key receives the data envelope, uses the root public key certificate to verify the legitimacy of the first key negotiation certificate, the data signature certificate and the second key negotiation certificate, and uses the data signature certificate and signature data to verify the encrypted device key. After the verification is passed, the first key negotiation certificate AES1_Public, the second private key AES2_Private.key and the second key negotiation certificate AES2_Public are used to generate the AES decryption negotiation key using the ECC's ECDH algorithm.
[0101] Step S206: decrypt the encrypted device key using the negotiated key to obtain the device key.
[0102] Specifically, the receiver uses the negotiated key decrypted by AES to decrypt the device keys of the data domain blocks in the Body part of the data envelope one by one, obtains the device key for this interaction, and completes the secure transmission of the device keys of both parties.
[0103] The secure transmission method of the device key provided in this embodiment obtains a dynamic negotiated key for encrypting the device key through mutual negotiation and authentication between the sender and the receiver, signs or verifies the data area blocks of the two parties of the transmission, and uses the dynamic negotiated key to encrypt and decrypt the device key, thereby preventing the device key from being leaked and tampered with, and ensuring the information security of the device key in the interactive transmission between the two parties.
[0104] In some optional implementations, using a root public key certificate to verify the first key agreement certificate, the data signature certificate, and the second key agreement certificate, and using the data signature certificate and the signature data to verify the encrypted device key includes:
[0105] If the root public key certificate fails to verify the first key agreement certificate, the data signature certificate and the second key agreement certificate, or the data signature certificate and the signature data fail to verify the encrypted device key, the device key transmission process is terminated.
[0106] Specifically, after receiving the data envelope, the receiver will use the root public key certificate Root_Public generated by the receiver to verify the legitimacy of each business certificate in the Header part of the data envelope to ensure that all business certificates in the data envelope are legally issued by the receiver's interactive root certificate.
[0107] In addition, the receiver uses the data signature certificate Sign_Public, the data domain block of the Body part of the data envelope, and the signature value of the Signature part of the data envelope, and uses the signature verification algorithm in the elliptic curve algorithm to verify the legitimacy of the data domain block content in the data envelope, to ensure that the data domain block content has not been tampered with during transmission. The signature verification process includes: using the data signature certificate Sign Public as the first parameter, the data domain block of the Body part of the data envelope as the second parameter, and the signature value of the Signature part of the data envelope as the third parameter, and using the ECC's Elliptic Curve Digital Signature Algorithm (ECDSA) for verification. If the returned Boolean value is true, the verification is successful. Otherwise, it means that the data in the Body part of the data envelope is incomplete or tampered with. The verification fails and the data interaction between the two parties is terminated.
[0108] The secure transmission method of the device key provided in this embodiment uses the root public key certificate to verify whether the received device key comes from the required device, and uses the data signature certificate and signature data to verify whether the encrypted device key has been tampered with. If the verification fails, the transmission process is terminated, thereby improving the accuracy and security of the device key transmission.
[0109] In some optional implementations, decrypting the encrypted device key using the negotiated key includes:
[0110] Based on the negotiated key, the encrypted device key is decrypted using the Advanced Encryption Standard's symmetric decryption algorithm.
[0111] Specifically, the algorithm used by the device key receiver for decryption is the same as the encryption algorithm used by the sender, which will not be repeated here.
[0112] The secure transmission method of the device key provided in this embodiment uses the AES decryption algorithm to decrypt the device key, which has higher security and faster data processing speed, thereby improving the efficiency and security of decrypting the device key.
[0113] In this embodiment, a method for securely transmitting a device key is provided, which can be used in the above-mentioned computer system. Figure 3 is a flow chart of a method for securely transmitting a device key according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0114] In step S301, the sender generates a first public key and a first private key, and generates a first key agreement certificate request file using the first public key; generates a signature public key and a signature private key, and generates a data signature certificate request file using the signature public key.
[0115] Step S302: Send a first key agreement certificate request file and a data signature certificate request file.
[0116] Step S303: The receiver generates a root key pair and a root public key certificate. The root key pair includes a root public key and a root private key.
[0117] Step S304: The receiver receives the first key agreement certificate request file and the digital signature certificate request file, and generates the first key agreement certificate and the digital signature certificate using the root private key.
[0118] Step S305: The receiver generates a second public key and a second private key, and uses the root private key to sign a second key agreement certificate for the second public key.
[0119] Step S306: The recipient sends a root public key certificate, a first key agreement certificate, a data signature certificate, and a second key agreement certificate.
[0120] Step S307: The sender receives the root public key certificate, the first key agreement certificate, the data signature certificate, and the second key agreement certificate, and uses the root public key certificate to verify the first key agreement certificate, the data signature certificate, and the second key agreement certificate.
[0121] Step S308: Generate a negotiation key using the first private key, the first key negotiation certificate, and the second key negotiation certificate, and encrypt the device key using the negotiation key to obtain the encrypted device key.
[0122] Step S309: Use the signature private key to sign the encrypted device key to obtain signature data.
[0123] Step S310: Pack the root public key certificate, the first key agreement certificate, the data signature certificate, the second key agreement certificate, the encrypted device key, and the signature data into a data envelope and send it out.
[0124] Step S311, the receiver receives the data envelope, and uses the root public key certificate to verify the first key agreement certificate, the data signature certificate and the second key agreement certificate; and uses the data signature certificate and the signature data to verify the encrypted device key.
[0125] Step S312: after verification, the first key negotiation certificate, the second private key and the second key negotiation certificate are used to obtain the negotiation key.
[0126] Step S313: decrypt the encrypted device key using the negotiated key to obtain the device key.
[0127] In this embodiment, a secure transmission system for a device key is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0128] This embodiment provides a secure transmission system for a device key, which is applied to a sender of a device key, such as Figure 4 As shown, the system includes:
[0129] The first request generating module 401 is used to generate a first public key and a first private key, and generate a first key agreement certificate request file using the first public key.
[0130] The second request generating module 402 is used to generate a signature public key and a signature private key, and generate a digital signature certificate request file using the signature public key.
[0131] The request sending module 403 is used to send a first key agreement certificate request file and a data signature certificate request file.
[0132] The certificate receiving module 404 is used to receive the root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate, and use the root public key certificate to verify the legitimacy of the first key agreement certificate, the data signature certificate and the second key agreement certificate.
[0133] The device key encryption module 405 is used to generate a negotiation key using the first private key, the first key negotiation certificate, and the second key negotiation certificate, and to encrypt the device key using the negotiation key to obtain the encrypted device key.
[0134] The data signature module 406 is used to sign the encrypted device key using the signature private key to obtain signature data.
[0135] The data envelope sending module 407 is used to package the root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate, the encrypted device key and the signature data into a data envelope and send it out.
[0136] This embodiment provides a secure transmission system for a device key, which is applied to a receiver of a device key, such as Figure 5 As shown, the system includes:
[0137] The root certificate generation module 501 is used to generate a root key pair and a root public key certificate. The root key pair includes a root public key and a root private key.
[0138] The first negotiation certificate generation module 502 is used to receive a first key negotiation certificate request file and a data signature certificate request file, and generate a first key negotiation certificate and a data signature certificate using a root private key.
[0139] The second negotiation certificate generation module 503 is used to generate a second public key and a second private key, and use the root private key to sign the second key negotiation certificate for the second public key.
[0140] The certificate sending module 504 is used to send a root public key certificate, a first key agreement certificate, a data signature certificate and a second key agreement certificate.
[0141] The data envelope receiving module 505 is used to receive the data envelope, use the root public key certificate to verify the legitimacy of the first key negotiation certificate, the data signature certificate and the second key negotiation certificate in the received data envelope, use the data signature certificate and signature data in the data envelope to verify the encrypted device key data field, and use the first key negotiation certificate, the second private key and the second key negotiation certificate to obtain the negotiated key.
[0142] The device key decryption module 506 is used to decrypt the encrypted device key using the negotiated key to obtain the device key.
[0143] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0144] The secure transmission system of the device key in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0145] The embodiment of the present invention also provides a computer device having the above Figure 4 or Figure 5 A secure transmission system for device keys is shown.
[0146] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0147] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0148] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0149] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0150] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0151] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0152] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0153] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for securely transmitting a device key, characterized in that: Applied to a sender of a device key, the method comprises: Generate a first public key and a first private key, and use the first public key to generate a first key agreement certificate request file; Generate a signature public key and a signature private key, and use the signature public key to generate a digital signature certificate request file; Sending the first key agreement certificate request file and the data signature certificate request file; Receiving a root public key certificate, a first key agreement certificate, a data signature certificate, and a second key agreement certificate, and verifying the first key agreement certificate, the data signature certificate, and the second key agreement certificate using the root public key certificate; Generate a negotiation key using the first private key, the first key negotiation certificate, and the second key negotiation certificate, and encrypt the device key using the negotiation key to obtain the encrypted device key; Use the signature private key to sign the encrypted device key to obtain signature data; The root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate, the encrypted device key and the signature data are packaged into a data envelope and sent out.
2. The method according to claim 1, characterized in that Verifying the first key agreement certificate, the data signature certificate, and the second key agreement certificate by using the root public key certificate includes: If the verification fails, the transmission process of the device key is terminated.
3. The method according to claim 1, characterized in that The step of encrypting the device key by using the negotiated key includes: Generate the negotiated key using a key exchange protocol based on an elliptic curve cryptographic algorithm; The device key is encrypted according to the negotiated key using a symmetric encryption algorithm of the Advanced Encryption Standard.
4. A method for securely transmitting a device key, characterized in that: Applied to a recipient of a device key, the method comprises: Generate a root key pair and a root public key certificate, wherein the root key pair includes a root public key and a root private key; Receiving a first key agreement certificate request file and a data signature certificate request file, and using the root private key to generate a first key agreement certificate and a data signature certificate; Generate a second public key and a second private key, and use the root private key to sign the second public key to obtain a second key agreement certificate; Sending the root public key certificate, the first key agreement certificate, the data signature certificate, and the second key agreement certificate; Receive the data envelope, use the root public key certificate to verify the first key agreement certificate, the data signature certificate and the second key agreement certificate, use the data signature certificate and the signature data to verify the encrypted device key, and use the first key agreement certificate, the second private key and the second key agreement certificate to obtain the agreement key; The encrypted device key is decrypted using the negotiated key to obtain the device key.
5. The method according to claim 4, characterized in that Using the root public key certificate to verify the first key agreement certificate, the data signature certificate, and the second key agreement certificate, and using the data signature certificate and the signature data to verify the encrypted device key, including: If the root public key certificate fails to verify the first key agreement certificate, the data signature certificate and the second key agreement certificate, or the data signature certificate and the signature data fail to verify the encrypted device key, the device key transmission process is terminated.
6. The method according to claim 4, characterized in that The decrypting the encrypted device key by using the negotiated key includes: The encrypted device key is decrypted using a symmetric decryption algorithm of the Advanced Encryption Standard according to the negotiated key.
7. A secure transmission system for a device key, characterized in that: Applied to a sender of a device key, the system comprises: A first request generation module, used to generate a first public key and a first private key, and generate a first key agreement certificate request file using the first public key; The second request generation module is used to generate a signature public key and a signature private key, and use the signature public key to generate a digital signature certificate request file; A request sending module, used to send the first key agreement certificate request file and the data signature certificate request file; a certificate receiving module, configured to receive a root public key certificate, a first key agreement certificate, a data signature certificate, and a second key agreement certificate, and to verify the first key agreement certificate, the data signature certificate, and the second key agreement certificate using the root public key certificate; a device key encryption module, configured to generate a negotiation key using the first private key, the first key negotiation certificate, and the second key negotiation certificate, and to encrypt the device key according to the negotiation key to obtain an encrypted device key; A data signature module is used to sign the encrypted device key using a signature private key to obtain signature data; The data envelope sending module is used to pack the root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate, the encrypted device key and the signature data into a data envelope and send it out.
8. A secure transmission system for a device key, characterized in that: Applied to a recipient of a device key, the system comprises: A root certificate generation module, used to generate a root key pair and a root public key certificate, wherein the root key pair includes a root public key and a root private key; A first negotiation certificate generation module, used to receive a first key negotiation certificate request file and a data signature certificate request file, and generate a first key negotiation certificate and a data signature certificate using the root private key; A second negotiation certificate generation module, used to generate a second public key and a second private key, and use the root private key to sign the second public key to obtain a second key negotiation certificate; A certificate sending module, used to send the root public key certificate, the first key agreement certificate, the data signature certificate and the second key agreement certificate; A data envelope receiving module, used to receive a data envelope, verify the first key negotiation certificate, the data signature certificate and the second key negotiation certificate using the root public key certificate, verify the encrypted device key using the data signature certificate and the signature data, and obtain the negotiation key using the first key negotiation certificate, the second private key and the second key negotiation certificate; The device key decryption module is used to decrypt the encrypted device key using the negotiated key to obtain the device key.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 3 or 4 to 6 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method of any one of claims 1 to 3 or 4 to 6.
Citation Information
Patent Citations
Encryption communication method and system
CN114650173A
Secure identity authentication trust method based on key negotiation in Internet of Vehicles
CN117614624A