Data flashing method, computer equipment and storage medium
By performing certificate application confirmation and security authentication between the terminal device and the management server, the problem of man-in-the-middle attack during certificate transmission in the prior art is solved, ensuring the authenticity and integrity of the certificate and improving communication security sex.
Patent Information
- Application Number
- CN202411368799.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-27
AI Technical Summary
The existing data flushing methods have the risk of man-in-the-middle attacks during transmission, resulting in certificate leakage and insecure communication.
By introducing a flashing device between the terminal device and the management server, using mechanisms such as certificate application confirmation request, security authentication and key derivation, we ensure that the transmission data of the certificate is first and second securely authenticated during the transmission process, and only in the authentication Perform a flashing action when passing to prevent illegal or damaged certificates from being installed.
Improve the security of the transmitted data, prevent man-in-the-middle attacks, ensure the authenticity and integrity of the certificate, and avoid tampering or forgery during the transmission process.
Smart Images

Figure CN119227047A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and specifically provides a data flashing method, a computer device and a storage medium. Background Art
[0002] With the increasing intelligence and networking of vehicles, there are more and more scenarios for communication between vehicles and other terminal devices, for example, communication between vehicles and terminal devices at battery swap stations.
[0003] In order to achieve vehicle communication security, it is necessary to issue trusted certificates for terminal devices. If the data related to these certificates is leaked, resulting in vehicle communications being attacked / hijacked, such as man-in-the-middle attacks, it will have a serious impact on the privacy, property and even life safety of vehicle users. Summary of the invention
[0001] In order to overcome the above defects, the present application is proposed to provide a solution or at least partially solve the technical problem of low security of data transmission corresponding to the existing data flashing method. The present application provides a data flashing method, a computer device and a storage medium.
[0002] In a first aspect, the present application provides a data flashing method, which is applied to a terminal device, wherein the terminal device communicates with a flashing device, and is characterized in that the method comprises:
[0003] Responding to the certificate application confirmation request sent by the flashing device, obtaining certificate application information;
[0004] Sending the certificate application information to the flashing device, so that the flashing device sends the certificate application information to the management server;
[0005] Receiving certificate flashing information sent by the flashing device;
[0006] Performing a first security authentication on the certificate flashing information;
[0007] When the first security authentication passes, a flashing action is performed based on the certificate flashing information.
[0008] In a specific implementation of the present application, the certificate application information includes a certificate application request and a first message authentication code;
[0009] The obtaining of certificate application information includes:
[0010] Obtaining a certificate application request based on the certificate application confirmation request;
[0011] Perform key derivation based on the first shared key to obtain a first temporary key;
[0012] A first message authentication code is obtained based on the first temporary key and the certificate application request.
[0013] In a specific implementation of the present application, the certificate flashing information includes a second message authentication code;
[0014] The step of performing security authentication on the certificate flashing information includes:
[0015] Perform key derivation based on the first shared key to obtain a second temporary key; Acquire a third message authentication code based on the second temporary key and the certificate flashing information;
[0016] The second message authentication code is authenticated based on the third message authentication code.
[0017] In a second aspect, a data flashing method is provided, which is applied to a management server, wherein the management server communicates with a flashing device, and the method comprises:
[0018] Receiving certificate application information sent by the flashing device;
[0019] Performing a second security authentication on the certificate application information;
[0020] When the second security authentication is passed, obtaining certificate flashing information based on the certificate application information;
[0021] The certificate flashing information is sent to a flashing device, so that the flashing device sends the certificate flashing information to a terminal device.
[0022] In a specific implementation of the present application, the second security authentication of the certificate application information includes:
[0023] Perform key derivation based on the first shared key to obtain a first temporary key;
[0024] Acquire a fourth message authentication code based on the first temporary key and the certificate application information;
[0025] The first message authentication code in the certificate application information is authenticated based on the fourth message authentication code.
[0026] In a specific implementation of the present application, the certificate flashing information includes a first certificate and a second message authentication code;
[0027] The obtaining certificate flashing information based on the certificate application information includes:
[0028] Acquire a first certificate based on the certificate application information;
[0029] Perform key derivation based on the first shared key to obtain a second temporary key;
[0030] A second message authentication code is obtained based on the second temporary key and the first certificate.
[0031] In a specific implementation of the present application, before receiving the certificate application information sent by the flashing device, the method further includes:
[0032] Receiving a key application request sent by the flashing device;
[0033] Verifying whether the key application request is complete based on the second certificate;
[0034] If yes, obtain the third temporary key;
[0035] The second shared key is encrypted based on the third temporary key and sent to the flashing device.
[0036] In a specific implementation of the present application, before sending the certificate flashing information to the flashing device, the method further includes: securely encapsulating the certificate flashing information based on the second shared key and sending the resultant to the flashing device.
[0037] In a third aspect, a computer device is provided, comprising:
[0038] at least one processor;
[0039] and, a memory communicatively coupled to the at least one processor;
[0040] Wherein, a computer program is stored in the memory, and the computer program is the aforementioned data flashing method when executed by the at least one processor.
[0041] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored in the computer-readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute any of the aforementioned data flashing methods.
[0042] The above one or more technical solutions of this application have at least one or more of the following Beneficial effects:
[0043] The data flashing method in this application specifically includes: obtaining certificate application information in response to a certificate application confirmation request sent by a flashing device; sending the certificate application information to the flashing device so that the flashing device can send the certificate application information to the management server, so that the management server obtains the certificate flashing information based on the certificate application information; receiving the certificate flashing information sent by the flashing device; performing a first security authentication on the certificate flashing information; and executing a flashing action based on the certificate flashing information when the first security authentication passes. In this way, the terminal device will perform a first security authentication on it, and will only execute the flashing action after the authentication passes, which increases the security of transmitted data and prevents illegal or damaged certificates from being installed due to man-in-the-middle attacks. At the same time, the authenticity and integrity of the certificate flashing information are ensured through a security authentication mechanism, avoiding tampering or forgery of transmitted data during transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The disclosure of the present application will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. In addition, similar numbers in the drawings are used to represent similar components, among which:
[0045] Figure 1 , Figure 2 This is a schematic diagram of a man-in-the-middle attack between a vehicle and a terminal device;
[0046] Figure 3 This is a schematic diagram of the main steps of a data flashing method in one embodiment of the present application;
[0047] Figure 4 This is a schematic diagram of the main steps of a data flashing method in another embodiment of the present application;
[0048] Figure 5 This is a complete schematic diagram of a data flashing method in one embodiment of the present application;
[0049] Figure 6 It is a schematic diagram of the structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0050] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.
[0051] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.
[0052] At present, the traditional data flashing method may have the risk of man-in-the-middle attack. Man-in-the-Middle Attack (MITM attack) is an "indirect" intrusion attack. This attack mode uses various technical means to virtually place a computer controlled by the intruder between two communicating computers in the network connection. This computer is called the "middleman". Figure 1 As shown, for the communication between the terminal equipment of the battery swap station and the car company's server, that is, the message may be hijacked or tampered with by other devices in the network link during the transmission process between the flashing device and the management server. In this case, the transmission data between the flashing device and the management server is unreliable.
[0053] Since the flashing device may be deployed in an untrusted communication environment such as an after-sales center, the terminal device and the management server cannot communicate directly in this case. Figure 2 As shown. Since terminal devices often cannot communicate directly with the management server, if there is no data protection measure between the two, and if the flashing device is untrustworthy, only data encryption and signature protection on the flashing device and the management server is not enough to protect the security of the data obtained by the terminal device.
[0054] To this end, the present application proposes a data flashing method, a computer device and a storage medium.
[0055] The data flashing method in this application can be applied to terminal devices, which generally refer to hardware devices that need to obtain digital certificates for secure communication. The terminal devices in this application may include mobile phones, tablet computers, vehicle-mounted devices, smart cars and other devices, and this application does not impose any special restrictions on the specific form of the terminal devices. For example, a battery swap station system can be used as an example of the terminal device.
[0056] See attached Figure 3 , Figure 3 FIG. 1 is a flow chart of the main steps of a data flashing method according to an embodiment of the present application. Figure 3 As shown, the data flashing method in the embodiment of the present application mainly includes the following steps S101 to S105.
[0057] Step S101: In response to a certificate application confirmation request sent by a flashing device, obtain certificate application information.
[0058] A certificate application confirmation request is a request sent by the flashing device to the terminal device to confirm that the terminal device is ready to receive a new certificate and can start the subsequent certificate application process.
[0059] The certificate application information refers to the information obtained when responding to the certificate application confirmation request sent by the flashing device, including the certificate application request and the first message authentication code.
[0060] A certificate application request is a request generated by a terminal device and sent to a flashing device during the certificate update process. This request is used to apply for a new digital certificate so that the terminal device can prove its identity and communicate securely with relevant parties.
[0061] Exemplarily, the certificate application request may include public key information, device identification information, and other information, which is not specifically limited.
[0062] The public key information is the public key part of the asymmetric key pair generated by the terminal device. The public key is used to create a digital certificate, and the certificate will be used to verify the identity of the device terminal.
[0063] Device identification information may include a unique identifier for the device or other relevant information that helps a certificate authority (CA) confirm the identity and authorization of the device.
[0064] Other relevant information may be some additional information, such as certificate validity period, certificate purpose, etc.
[0065] Step S102: Send the certificate application information to the flashing device, so that the flashing device sends the certificate application information to the management server.
[0066] The management server can provide a platform for downloading the terminal device software package, and the management server can communicate with the flashing tool. The management server can also communicate with the certificate authority (CA) so that the certificate authority (CA) issues the terminal device certificate according to the certificate application request sent by the management server and returns it to the management server.
[0067] Specifically, the terminal device sends the certificate application information to the flashing device, and the flashing device forwards the certificate application information to the management server, so that the management server obtains the certificate flashing information according to the certificate application information.
[0068] Step S103: receiving certificate flashing information sent by the flashing device.
[0069] Certificate flashing information refers to all data and metadata involved in the certificate flashing process, which is used to update or replace the digital certificate and its related keys on the terminal device.
[0070] Step S104: Perform a first security authentication on the certificate flashing information.
[0071] Specifically, the first security authentication operation is mainly to verify whether the certificate flashing information has been tampered with by a middleman.
[0072] Step S105: When the first security authentication is passed, a flashing action is performed based on the certificate flashing information.
[0073] Specifically, when the certificate flashing information has not been tampered with by a middleman, it means that the terminal device certificate information applied for at this time is authentic and reliable, and the certificate of the terminal device can be flashed according to the terminal device certificate information.
[0074] Based on the above steps S101-S105, first respond to the certificate application confirmation request sent by the flashing device to obtain the certificate application information; send the certificate application information to the flashing device so that the flashing device can send the certificate application information to the management server, so that the management server obtains the certificate flashing information based on the certificate application information; receive the certificate flashing information sent by the flashing device; perform a first security authentication on the certificate flashing information; when the first security authentication passes, perform the flashing action based on the certificate flashing information. In this way, the terminal device will perform the first security authentication on it, and will only perform the flashing action after the authentication passes, which increases the security of the transmitted data and prevents the installation of illegal or damaged certificates caused by man-in-the-middle attacks. At the same time, the authenticity and integrity of the certificate flashing information are ensured through the security authentication mechanism, avoiding tampering or forgery of the transmitted data during the transmission process.
[0075] The above step S101 and step S104 are further explained below.
[0076] The certificate application information includes the certificate application request and the first message authentication code. Step S101 can be implemented through the following steps S1011 to S1013.
[0077] Step S1011: Obtain a certificate application request based on the certificate application confirmation request.
[0078] Step S1012: Perform key derivation based on the first shared key to obtain a first temporary key.
[0079] Specifically, a common key derivation algorithm may be used to generate the first temporary key according to the first shared key, such as using a key derivation function or an algorithm such as PBKDF2 or bcrypt to derive the key.
[0080] Step S1013: Obtain a first message authentication code based on the first temporary key and the certificate application request.
[0081] A message authentication code (MAC) is a security code used to verify the integrity and authenticity of a message. The MAC value is calculated using a hash function using a key and some plaintext data (such as part of a message or request).
[0082] Specifically, firstly, a first shared key is pre-configured in the terminal device, and then a hash function, such as SHA-256, is selected. The HMAC is calculated using the hash function, the preset first shared key and the terminal device information (such as device ID, timestamp, etc.) in the certificate application request, and the result of the HMAC is the first message authentication code.
[0083] By generating a certificate application request, the security of the certificate application process is enhanced, the integrity and non-repudiation of data during transmission are ensured, and the security of data is also improved.
[0084] The above is a further description of step S101, and the following is a further description of step S104. Step S104 can be implemented through the following steps S1041 to S1043.
[0085] Step S1041: derive a key based on the first shared key to obtain a second temporary key.
[0086] Specifically, a common key derivation algorithm may be used to generate the second temporary key according to the first shared key, such as using a key derivation function or an algorithm such as PBKDF2 or bcrypt.
[0087] Step S1042: Obtain a third message authentication code based on the second temporary key and the certificate flashing information.
[0088] Specifically, a hash function, such as SHA-256, is selected. The hash function is used to calculate HMAC using the second temporary key and the terminal device certificate in the certificate flashing information. The result of HMAC is the third message authentication code.
[0089] Step S1043: authenticating the second message authentication code based on the third message authentication code.
[0090] The second message authentication code is a message authentication code calculated by the management server according to the terminal device certificate in the certificate flashing information.
[0091] In this embodiment, the second message authentication code is specifically matched with the third message authentication code. When the two match, it indicates that the certificate data of the terminal device has not been tampered with, and the certificate information of the terminal device is credible.
[0092] By matching the message authentication code obtained by the management server with the authentication code obtained by the terminal device, it is possible to determine whether the certificate flashing information has been tampered with, thereby improving data security.
[0093] The flash device is used to communicate with the terminal device and the management server, send data information to the terminal device, and implement data management and update of the terminal device. The flash device can be built into the terminal device or an external device, that is, it can be a diagnostic flash device or a production line flash device.
[0094] The flashing device itself stores a second shared key for encrypting the data sent by the terminal device and then sending it to the management server.
[0095] The second shared key has a validity period. The flashing device periodically checks the validity of the second shared key. When the second shared key is about to expire or has expired, the flashing device sends a key application request to the management server, and the management server obtains the second shared key through the following steps.
[0096] In a specific embodiment of the present application, before receiving the certificate application information sent by the flashing device, the method also includes: receiving a key application request sent by the flashing device; verifying whether the key application request is complete based on the second certificate; if so, obtaining a third temporary key; encrypting the second shared key based on the third temporary key and sending it to the flashing device.
[0097] The key application request refers to a request sent by the flashing device to the management server in order to obtain the second shared key. The shared key is an encryption key used to encrypt and decrypt data to ensure the security of communication.
[0098] Specifically, after receiving the certificate application information sent by the terminal device, the management server verifies whether the key application request is complete through the certificate of the certificate flashing device, and generates a second shared key when the key application request is complete. At the same time, a third temporary key is negotiated using the key agreement algorithm, and the second shared key is encrypted with the third temporary key and sent to the flashing device. For example, ECDH (Elliptic Curve Diffie-Hellman) can be used as an example of the key agreement algorithm.
[0099] After receiving the second shared key, the flashing device first verifies the integrity and authenticity of the message returned by the management server. The third temporary key is generated using the same key negotiation algorithm, and the third temporary key is used to decrypt and obtain a new shared key (the second shared key). The flashing device confirms the second shared key (the second shared key includes the key validity period and identifier), and sends a confirmation message to the management server, including the summary information of the decryption key, so that the management server can verify whether the decryption is correct.
[0100] By effectively updating the second shared key through the flashing device, the effective encryption of the transmission data by the flashing device can be improved, thereby improving the security and integrity of the data.
[0101] Furthermore, when the flashing device receives the certificate application information sent by the terminal device, the second shared key can be used to encrypt the certificate application information to obtain ciphertext information, and then the identifier and ciphertext information of the second shared key can be filled into the pre-constructed data structure to obtain the filled data structure, and the filled data structure can be encoded to obtain the encoded data, and finally the encoded data can be signed and sent to the management server.
[0102] The pre-constructed data structure may be an arrangement order of the identification information and the ciphertext information, for example, the identification of the second shared key is located before the ciphertext information, so that the identification information can be read before the ciphertext information.
[0103] In another embodiment of the present application, Figure 4 As shown, a data flashing method is also provided, which is applied to a management server, and the management server communicates with a flashing device. The data flashing method in this embodiment can be specifically implemented through the following steps S201 to S204.
[0104] Step S201: receiving certificate application information sent by the flashing device.
[0105] Step S202: Perform a second security authentication on the certificate application information.
[0106] Specifically, the second security authentication operation is mainly to verify whether the certificate application information has been tampered with by a middleman.
[0107] Step S203: When the second security authentication is passed, the certificate flashing information is obtained based on the certificate application information.
[0108] The certificate flashing information may include the terminal device certificate and the second message authentication code. The terminal device certificate refers to a digital certificate that can be installed on the terminal device. The certificate contains the device's identity information and public key, as well as the signature of the certificate authority (CA).
[0109] Specifically, when the second security authentication is passed, the management server obtains the terminal device certificate according to the certificate application request in the certificate application information.
[0110] Step S204: Send the certificate flashing information to the flashing device, so that the flashing device sends the certificate flashing information to the terminal device.
[0111] Based on the above steps S201 to S204, firstly, the certificate application information sent by the flashing device is received; the second security authentication is performed on the certificate application information; when the second security authentication is passed, the certificate flashing information is obtained based on the certificate application information; the certificate flashing information is sent to the flashing device, so that the flashing device can send the certificate flashing information to the terminal device. By performing security authentication on the certificate application information, it is ensured that only verified flashing devices can continue to perform subsequent operations, which helps to prevent unauthorized access and malicious operations. At the same time, security authentication can ensure that the certificate application information has not been tampered with during transmission, thereby protecting the integrity of the data.
[0112] The above steps S202 and S204 are further explained below.
[0113] Regarding step S202, in a specific implementation of the present application, it can be implemented through the following steps S2021 to S2023.
[0114] Step S2021: Perform key derivation based on the first shared key to obtain a first temporary key.
[0115] Specifically, the management server pre-stores the first shared key, and can use a common key derivation algorithm to derive the first temporary key from the first shared key, such as using a key derivation function or algorithms such as PBKDF2 and bcrypt.
[0116] Step S2022: Obtain a fourth message authentication code based on the first temporary key and the certificate application information.
[0117] Specifically, a hash function, such as SHA-256, is selected. HMAC is calculated using the hash function according to the first temporary key and the terminal device information (such as device ID, timestamp, etc.) in the certificate application request, and the result of HMAC is the fourth message authentication code.
[0118] Step S2023: Authenticate the first message authentication code in the book application information based on the fourth message authentication code.
[0119] In this embodiment, the first message authentication code is specifically matched with the fourth message authentication code. When the two match, it indicates that the certificate application information of the terminal device has not been tampered with, and the certificate application information of the terminal device is credible.
[0120] By matching the message authentication code calculated by the management server with the authentication code calculated by the terminal device, it is possible to determine whether the certificate application information has been tampered with, thereby improving the security of transmitted data.
[0121] The above is a detailed description of step S202. The following is a detailed description of step S203.
[0122] The certificate flashing information includes the first certificate and the second message authentication code. Regarding the above step S203, it can be specifically implemented through the following steps S2031 to S2033.
[0123] Step S2031: Obtain a first certificate based on the certificate application information.
[0124] The first certificate refers to the digital certificate of the terminal device.
[0125] Specifically, the service manager can communicate with the certificate authority (CA) and send a certificate application request to the certificate authority (CA), so that the certificate authority (CA) issues a terminal device certificate according to the certificate application request sent by the management server and returns it to the management server.
[0126] Step S2032: derive a key based on the first shared key to obtain a second temporary key.
[0127] Specifically, a common key derivation algorithm may be used to generate the second temporary key based on the first shared key, such as using a Password-Based Key Derivation Function (PBKDF).
[0128] Step S2033: Obtain a second message authentication code based on the second temporary key and the first certificate.
[0129] Specifically, a hash function, such as SHA-256, is selected, and HMAC is calculated based on the second temporary key and the first certificate using the hash function, and the result of HMAC is the second message authentication code.
[0130] In a specific implementation of the present application, before sending the certificate flashing information to the flashing device, the method further includes: securely encapsulating the certificate flashing information based on the second shared key and then sending the result to the flashing device.
[0131] Specifically, the management server obtains the certificate flashing information (including the terminal device certificate and the second message authentication code), and can first encrypt the certificate flashing information to obtain the ciphertext information, then fill the second shared key identifier and ciphertext information into the pre-constructed data structure to obtain the filled data structure, encode the filled data structure to obtain the encoded data, and finally sign the encoded data and send it to the flashing device. The pre-constructed data structure can be the arrangement order of the second shared key identifier and the ciphertext information, for example, the identifier information is located before the ciphertext information, so that the identifier information can be read before the ciphertext information.
[0132] By securely packaging the certificate flashing information and sending it to the flashing device, it is helpful to improve the security and integrity of the data.
[0133] Combine the following Figure 5 , the complete steps of the data flashing method of this application are described in detail.
[0134] Step S10: The flashing device initiates a certificate application confirmation request to the terminal device.
[0135] A certificate application confirmation request is a request sent by the flashing device to the terminal device to confirm that the terminal device is ready to receive a new certificate and can start the subsequent certificate application process.
[0136] Step S20: The terminal device generates a certificate application request in response to the certificate flash confirmation request. The first temporary key is obtained by key derivation through the first shared key, and the first message authentication code of the certificate application request is calculated according to the first temporary key, and finally the certificate application information (certificate application request and the first message authentication code) is sent to the flash device.
[0137] A certificate application request refers to a request generated by a terminal device and sent to a flashing device during the certificate update process. This request is used to apply for a new digital certificate so that the terminal device can prove its identity and communicate securely with relevant parties. Exemplarily, a certificate application request may include public key information, device identification information, signature algorithm, signature, and other information, etc., which are not specifically limited. Public key information is the public key part of an asymmetric key pair generated by a terminal device. The public key is used to create a digital certificate, and the certificate will be used to verify the identity of the device terminal. Device identification information may include a unique identifier for the device or other related information that helps a certificate authority (CA) confirm the identity and authorization of the device. The signature algorithm is an algorithm used to sign a certificate application request, such as RSA, ECDH, etc. Other related information may be some additional information, such as the validity period of the certificate, the purpose of the certificate, etc.
[0138] Step S30: The flashing device receives the certificate application information sent by the terminal device, first encrypts it using the second shared key, then signs it with its own private key, and securely encapsulates the encrypted and signed certificate application information and sends it to the management server.
[0139] Step S40: The management server uses the public key to verify the signature, and uses the identifier of the second shared key to obtain the second shared key to decrypt the certificate application information. After the decryption is completed, the corresponding first shared key is found through the identifier of the first shared key, and the second temporary key is derived and generated, and the fourth message authentication code of the certificate application information is calculated. By comparing the first authentication code with the fourth message authentication code, it is determined whether the certificate application information has been tampered with. After all verifications are completed, the management server performs certificate-related operations according to the certificate application information and obtains the terminal device certificate. The management server derives the third temporary key based on the first shared key, and calculates the second message authentication code of the terminal device certificate based on the third temporary key, and then securely encapsulates the certificate flashing information and returns it to the flashing device.
[0140] Step S40: After receiving the certificate flashing information sent by the management server, the flashing device first verifies the signature to ensure the legitimacy of the message, then obtains the second shared key according to the identifier of the second shared key, decrypts the certificate flashing information and returns it to the terminal.
[0141] Step S50: The terminal device derives a third temporary key based on the first shared key, calculates a third message authentication code of the certificate flash information based on the third temporary key, and ensures that the message has not been tampered with by comparing the third message authentication code with the fourth message authentication code.
[0142] Step S60: The terminal device sends a request to the cloud before going offline, and the terminal device forwards the request to the CA trusted domain through the network. If the communication is successful, it proves that the overall certificate writing process of the terminal device is successfully completed.
[0143] In addition, the present application can use the ECIES algorithm and fuse programming to preset symmetric keys for terminal devices, thereby solving the problem of end-to-end encrypted communication between terminal devices and management servers. ECIES is a key negotiation algorithm that protects the security of symmetric keys during transmission and avoids key exposure. Fuse programming ensures that the preset shared key of the terminal device cannot be changed after burning. The terminal device and the server hold the same shared key, and the middleman cannot obtain the key. By using the key to encrypt and verify the transmitted information during communication, the middleman attack caused by the certificate flashing device can be avoided.
[0144] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.
[0145] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above-mentioned embodiment of the present application can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
[0146] Furthermore, the present application also provides a computer device, which may include at least one processor; and a memory connected to the at least one processor; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method 6 described in any one of the above embodiments is implemented. Figure 6 As shown, Figure 6 , the structure of a computer device is exemplarily shown in FIG. 6 , which includes a processor 61 and a memory 62 .
[0147] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the data flushing method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned data flushing method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a memory device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.
[0148] The relevant user personal information that may be involved in the various embodiments of this application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.
[0149] The user personal information processed by this application will vary depending on the specific product / service scenario, and will be based on the specific scenario in which the user uses the product / service. It may involve the user's account information, device information, driving information, vehicle information or other related information. The applicant will treat the user's personal information and its processing with a high degree of diligence.
[0150] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.
[0151] So far, the technical solutions of the present application have been described in conjunction with the specific implementations shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific implementations. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.
Claims
1. A data flashing method, applied to a terminal device, wherein the terminal device communicates with a flashing device, characterized in that: The method comprises: Responding to the certificate application confirmation request sent by the flashing device, obtaining certificate application information; Sending the certificate application information to the flashing device, so that the flashing device sends the certificate application information to the management server, so that the management server obtains the certificate flashing information based on the certificate application information; Receiving certificate flashing information sent by the flashing device; Performing a first security authentication on the certificate flashing information; When the first security authentication passes, a flashing action is performed based on the certificate flashing information.
2. The data flashing method according to claim 1, characterized in that: The certificate application information includes a certificate application request and a first message authentication code; The obtaining of certificate application information includes: Obtaining a certificate application request based on the certificate application confirmation request; Perform key derivation based on the first shared key to obtain a first temporary key; A first message authentication code is obtained based on the first temporary key and the certificate application request.
3. The data flashing method according to claim 1, characterized in that: The certificate flashing information includes a second message authentication code; The step of performing security authentication on the certificate flashing information includes: Perform key derivation based on the first shared key to obtain a second temporary key; Acquire a third message authentication code based on the second temporary key and the certificate flashing information; The second message authentication code is authenticated based on the third message authentication code.
4. A data flashing method, applied to a management server, wherein the management server communicates with a flashing device, characterized in that: The method comprises: Receiving certificate application information sent by the flashing device; Performing a second security authentication on the certificate application information; When the second security authentication is passed, obtaining certificate flashing information based on the certificate application information; The certificate flashing information is sent to a flashing device, so that the flashing device sends the certificate flashing information to a terminal device.
5. The data flashing method according to claim 4, characterized in that: The performing a second security authentication on the certificate application information includes: Perform key derivation based on the first shared key to obtain a first temporary key; Acquire a fourth message authentication code based on the first temporary key and the certificate application information; The first message authentication code in the certificate application information is authenticated based on the fourth message authentication code.
6. The data flashing method according to claim 4, characterized in that: The certificate flashing information includes a first certificate and a second message authentication code; The obtaining certificate flashing information based on the certificate application information includes: Acquire a first certificate based on the certificate application information; Perform key derivation based on the first shared key to obtain a second temporary key; A second message authentication code is obtained based on the second temporary key and the first certificate.
7. The data flashing method according to claim 4, characterized in that: Before receiving the certificate application information sent by the flashing device, the method further includes: Receiving a key application request sent by the flashing device; Verifying whether the key application request is complete based on the second certificate; If yes, obtain the third temporary key; The second shared key is encrypted based on the third temporary key and sent to the flashing device.
8. The data flashing method according to claim 7, characterized in that: Before sending the certificate flashing information to the flashing device, the method further includes: securely encapsulating the certificate flashing information based on the second shared key and then sending the resultant to the flashing device.
9. A computer device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; Wherein, a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the data flashing method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the data flashing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Certificate rewriting method and device, storage medium, equipment and system
CN111404678A
Data transmission method and device, verification method and device and automobile
CN112702166A
Vehicle flashing method, vehicle networking box, vehicle and storage medium
CN112883382A
Vehicle terminal identity certificate application method
CN113114699A
Safe canning method and system, storage medium, front-end processor and TSP platform
CN114626045A
