Data flashing method, computer device and storage medium
By introducing a message authentication code mechanism generated by a shared key between the terminal device and the management server, the data writing security problem caused by man-in-the-middle attacks is solved, ensuring the integrity and authenticity of the certificate writing process and improving the security of vehicle communication.
Patent Information
- Application Number
- CN202411368799.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Existing data writing methods are vulnerable to man-in-the-middle attacks, resulting in low security of vehicle communication data transmission and potentially affecting user privacy, property, and safety.
By introducing a secure authentication mechanism between the terminal device and the management server, and using a shared key to derive a temporary key to generate a message authentication code, the integrity and authenticity of certificate application and flashing information are ensured, and the flashing action is performed only after authentication is successful.
It improves the security of data transmission, prevents the installation of illegal or damaged certificates, ensures the authenticity and integrity of certificate writing information, and avoids tampering or forgery during transmission.
Smart Images

Figure CN119227047B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and specifically provides a data flashing method, a computer device and a storage medium. BACKGROUND
[0002] With the intelligentization and networking of vehicles, there are more and more communication scenarios between vehicles and other terminal devices, for example, communication between a vehicle and a terminal device of a battery swap station.
[0003] In order to realize the communication security of the vehicle, a trusted certificate needs to be issued for the terminal device. If the certificate-related data is leaked, the vehicle communication is attacked / hijacked, for example, a man-in-the-middle attack, which will have a serious impact on the privacy, property and even life safety of the vehicle user. SUMMARY
[0004] 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 transmission data security corresponding to the existing data flashing method. The present application provides a data flashing method, a computer device and a storage medium.
[0005] In a first aspect, the present application provides a data flashing method applied to a terminal device, wherein the terminal device communicates with a flashing device, and the method comprises:
[0006] In response to a certificate application confirmation request sent by the flashing device, obtaining certificate application information;
[0007] Sending the certificate application information to the flashing device, so that the flashing device sends the certificate application information to a management server;
[0008] Receiving certificate flashing information sent by the flashing device;
[0009] Performing first security authentication on the certificate flashing information;
[0010] When the first security authentication is passed, performing a flashing action based on the certificate flashing information.
[0011] In one specific embodiment of the present application, the certificate application information includes a certificate application request and a first message authentication code;
[0012] The obtaining of the certificate application information comprises:
[0013] Obtaining a certificate application request based on the certificate application confirmation request;
[0014] Deriving a first temporary key based on a first shared key;
[0015] obtain a first message authentication code based on the first temporary key and the certificate application request.
[0016] In one embodiment of the present application, the certificate flashing information comprises a second message authentication code.
[0017] The security authentication on the certificate flashing information comprises:
[0018] deriving a second temporary key based on a first shared key;
[0019] obtain a third message authentication code based on the second temporary key and the certificate flashing information;
[0020] authenticate the second message authentication code based on the third message authentication code.
[0021] In a second aspect, a data flashing method is provided, applied to a management server in communication with a flashing device, and the method comprises:
[0022] receiving certificate application information sent by the flashing device;
[0023] performing a second security authentication on the certificate application information;
[0024] obtaining certificate flashing information based on the certificate application information when the second security authentication is passed;
[0025] sending the certificate flashing information to the flashing device, so that the flashing device sends the certificate flashing information to a terminal device.
[0026] In one embodiment of the present application, the second security authentication on the certificate application information comprises:
[0027] deriving a first temporary key based on a first shared key;
[0028] obtaining a fourth message authentication code based on the first temporary key and the certificate application information;
[0029] authenticate a first message authentication code in the certificate application information based on the fourth message authentication code.
[0030] In one embodiment of the present application, the certificate flashing information comprises a first certificate and a second message authentication code.
[0031] The obtaining of the certificate flashing information based on the certificate application information comprises:
[0032] obtaining a first certificate based on the certificate application information;
[0033] Deriving a second temporary key based on the first shared key;
[0034] Obtaining a second message authentication code based on the second temporary key and the first certificate.
[0035] In one embodiment of the present application, before receiving the certificate application information sent by the flashing device, the method further comprises:
[0036] Receiving a key application request sent by the flashing device;
[0037] Verifying whether the key application request is complete based on a second certificate;
[0038] If yes, obtaining a third temporary key;
[0039] Encrypting a second shared key based on the third temporary key and sending the encrypted second shared key to the flashing device.
[0040] In one embodiment of the present application, before sending the certificate flashing information to the flashing device, the method further comprises: securely packaging the certificate flashing information based on the second shared key and sending the securely packaged certificate flashing information to the flashing device.
[0041] In a third aspect, a computer device is provided, comprising:
[0042] at least one processor;
[0043] and a memory connected to the at least one processor in communication;
[0044] wherein the memory stores a computer program, and the computer program is executed by the at least one processor to implement the data flashing method described above.
[0045] In a fourth aspect, a computer readable storage medium is provided, which stores a plurality of program codes therein, and the program codes are adapted to be loaded and run by a processor to implement the data flashing method described in any one of the preceding aspects.
[0046] The above one or more technical solutions of the present application have at least one or more of the following advantages
[0047] Advantages:
[0048] The data flashing method in the application specifically comprises: in response to a 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 certificate flashing information based on the certificate application information; receiving the certificate flashing information sent by the flashing device; performing first security authentication on the certificate flashing information; when the first security authentication passes, performing a flashing action based on the certificate flashing information. In this way, the terminal device will be subjected to first security authentication, and only after the authentication passes will the flashing action be performed, thereby increasing the security of the transmitted data, preventing illegal or damaged certificates caused by man-in-the-middle attacks from being installed, and at the same time ensuring the authenticity and integrity of the certificate flashing information through the security authentication mechanism, thereby avoiding tampering or forgery of the transmitted data in the transmission process. BRIEF DESCRIPTION OF DRAWINGS
[0049] The disclosure of the application will become more apparent with reference to the drawings. It will be readily understood to those skilled in the art that the drawings are merely intended to illustrate the present application and are not intended as a limitation thereof. In addition, similar numbers on the figures designate similar components.
[0050] Figure 1 Figure 2 is a schematic diagram of a man-in-the-middle attack between a vehicle and a terminal device;
[0051] Figure 3 is a schematic diagram of the main steps of the data flashing method in one embodiment of the application;
[0052] Figure 4 is a schematic diagram of the main steps of the data flashing method in another embodiment of the application;
[0053] Figure 5 is a complete schematic diagram of the data flashing method in one embodiment of the application;
[0054] Figure 6 is a structural schematic diagram of a computer device in one embodiment of the application. DETAILED DESCRIPTION
[0055] Some embodiments of the application will be described below with reference to the accompanying drawings. Those skilled in the art will understand that these embodiments are only used to explain the technical principles of the application and are not intended to limit the protection scope of the application.
[0056] In the description of the present application, "module", "processor" can include hardware, software or a combination of both. A module can include hardware circuit, various suitable sensors, communication port, memory, and can also include software part such as program code, and can be a combination of software and hardware. The processor can be a central processor, microprocessor, image processor, digital signal processor or any other suitable processor. The processor has data and / or signal processing function. The processor can be implemented in software, hardware or a combination of both. The non-transitory computer readable storage medium includes any suitable medium that can store program code, such as magnetic disk, hard disk, optical disk, flash memory, read-only memory, 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 of A or B" or "at least one of A and B" has similar meaning as "A and / or B", which can include only A, only B or A and B. The singular form of the term "one", "this" can also include plural forms.
[0057] Currently, the traditional data flashing method may have the risk of man-in-the-middle attack. The man-in-the-middle attack (MITM attack for short) is an "indirect" intrusion attack. This attack mode is to virtually place a computer controlled by an intruder between two communicating computers in a network connection, which is called "man-in-the-middle". As shown in Figure 1 The communication between the battery swap station terminal device and the vehicle enterprise server, i.e. the message transmission process between the flashing device and the management server, may be hijacked or tampered with by other devices in the network link, in which case the transmission data between the flashing device and the management server is not trustworthy.
[0058] Since the flashing device may be deployed in an untrusted communication environment such as an after-sales center, in which case the terminal device and the management server cannot directly communicate, as shown in Figure 2 Since the terminal device often cannot directly communicate with the management server, if there is no data protection measure between them, in the case of untrusted flashing device, only data encryption and signature protection at the flashing device end and the management server end is not enough to protect the security of the data obtained by the terminal device.
[0059] Therefore, the present application proposes a data flashing method, a computer device and a storage medium.
[0060] The data flashing method in the present application can be applied to a terminal device, which generally refers to a hardware device that needs to obtain a digital certificate for secure communication. The terminal device in the present application can be a device including a mobile phone, a tablet computer, a vehicle-mounted device, a smart car, etc., and the specific form of the terminal device is not specially limited in the present application. Exemplarily, a battery replacement station system can be taken as an example of the terminal device.
[0061] Referring to the accompanying Figure 3 , Figure 3 is a main step flow diagram of a data flashing method according to an embodiment of the present application. As shown in Figure 3 , the data flashing method in the embodiment of the present application mainly includes the following steps S101-S105.
[0062] Step S101: In response to a certificate application confirmation request sent by a flashing device, obtaining certificate application information.
[0063] The certificate application confirmation request refers to a request sent by the flashing device to the terminal device, which aims to confirm that the terminal device has prepared to receive a new certificate and can start the subsequent certificate application process.
[0064] The certificate application information refers to the information obtained in response to the certificate application confirmation request sent by the flashing device, including a certificate application request and a first message authentication code.
[0065] The certificate application request refers to a request generated by the terminal device and sent to the flashing device in the certificate update process, which is used to apply for a new digital certificate so that the terminal device can prove its identity and communicate securely with relevant parties.
[0066] Exemplarily, the certificate application request can contain public key information, device identification information and other information, etc., which are not specifically limited.
[0067] The public key information is the public key part of the asymmetric key pair generated by the terminal device, which is used to create a digital certificate, and the certificate will be used to verify the identity of the device terminal.
[0068] The device identification information can include a unique identifier of the device or other related information, which helps the certificate authority (CA) to confirm the identity and authorization of the device.
[0069] The other related information can be some additional information, such as certificate validity period, certificate purpose, etc.
[0070] Step S102: Sending the certificate application information to the flashing device, so that the flashing device sends the certificate application information to the management server.
[0071] The management server can provide a platform for downloading terminal device software packages, and the management server can communicate with the flashing tool. The management server can also communicate with a certificate authority (CA) to enable the certificate authority (CA) to issue a terminal device certificate according to a certificate application sent by the management server and return the terminal device certificate to the management server.
[0072] Specifically, the terminal device sends 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 certificate flashing information according to the certificate application information.
[0073] Step S103: receiving certificate flashing information sent by the flashing device.
[0074] The certificate flashing information refers to all data and metadata involved in the certificate flashing process, for updating or replacing a digital certificate and related keys on the terminal device.
[0075] Step S104: performing first security authentication on the certificate flashing information.
[0076] Specifically, the first security authentication operation mainly verifies whether the certificate flashing information has been tampered with by a man-in-the-middle.
[0077] Step S105: when the first security authentication passes, performing a flashing action based on the certificate flashing information.
[0078] Specifically, when the certificate flashing information has not been tampered with by a man-in-the-middle, it means that the terminal device certificate information applied at this time is authentic and reliable, and the certificate of the terminal device can be flashed according to the terminal device certificate information.
[0079] Based on the above steps S101-S105, first, in response to a certificate application confirmation request sent by the flashing device, certificate application information is obtained; the certificate application information is sent to the flashing device, so that the flashing device sends the certificate application information to the management server, so that the management server obtains certificate flashing information based on the certificate application information; receiving certificate flashing information sent by the flashing device; performing first security authentication on the certificate flashing information; when the first security authentication passes, performing a flashing action based on the certificate flashing information. In this way, the terminal device performs first security authentication, and only performs a flashing action after the authentication passes, thereby increasing the security of the transmitted data and preventing illegal or damaged certificates caused by man-in-the-middle attacks from being installed. At the same time, the security authentication mechanism ensures the authenticity and integrity of the certificate flashing information, avoiding tampering or forgery of the transmitted data during transmission.
[0080] The above steps S101 and S104 are further described below.
[0081] The certificate application information includes a certificate application request and a first message authentication code. For step S101, the following steps S1011 to S1013 can be implemented.
[0082] Step S1011: Obtain the certificate application request based on the certificate application confirmation request.
[0083] Step S1012: Perform key derivation based on the first shared key to obtain a first temporary key.
[0084] Specifically, a common key derivation algorithm can be used to generate the first temporary key from the first shared key, such as using a key derivation function or PBKDF2, bcrypt, etc.
[0085] Step S1013: Obtain the first message authentication code based on the first temporary key and the certificate application request.
[0086] The message authentication code (MAC) is a kind of security code used to verify the integrity and authenticity of a message. The MAC value is a value calculated by a key and some plaintext data (such as part of the message or request) using a hash function.
[0087] Specifically, the 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 pre-configured first shared key, and the terminal device information (such as device ID, timestamp, etc.) in the certificate application request. The result of HMAC is the first message authentication code.
[0088] By generating the certificate application request, the security of the certificate application process is enhanced, ensuring the integrity and non-repudiation of data during transmission, and also improving the security of data.
[0089] The above is a further description of step S101, and the following will further describe step S104. For step S104, the following steps S1041 to S1043 can be implemented.
[0090] Step S1041: Perform key derivation based on the first shared key to obtain a second temporary key.
[0091] Specifically, a common key derivation algorithm can be used to generate the second temporary key from the first shared key, such as using a key derivation function or PBKDF2, bcrypt, etc.
[0092] Step S1042: Obtain the third message authentication code based on the second temporary key and the certificate flashing information.
[0093] Specifically, a hash function, such as SHA-256, is selected. An HMAC is calculated using the hash function, the second temporary key, and the terminal device certificate in the certificate flashing information, and the result of the HMAC is the third message authentication code.
[0094] Step S1043: authenticating the second message authentication code based on the third message authentication code.
[0095] The second message authentication code is a message authentication code calculated by the management server based on the terminal device certificate in the certificate flashing information.
[0096] In this embodiment, specifically, the second message authentication code is matched with the third message authentication code, and when the two are matched, it indicates that the certificate data of the terminal device has not been tampered with, and at this time, the terminal device certificate information is trusted.
[0097] By matching the message authentication code obtained by the management server with the authentication code obtained by the terminal device, it is determined whether the certificate flashing information has been tampered with, thereby improving the security of the data.
[0098] The flashing device is used to communicate with the terminal device and the management server, and sends data information to the terminal device to achieve data management and update of the terminal device. The flashing device can be built-in in the terminal device, or can be an external device, that is, can be a diagnostic flashing device or a production line flashing device.
[0099] The flashing device itself stores a second shared key, which is used to encrypt the data sent by the terminal device and then send it to the management server.
[0100] The second shared key has a validity period, and 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.
[0101] In one specific embodiment of the present application, before receiving the certificate application information sent by the flashing device, the method further comprises: 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; and encrypting the second shared key based on the third temporary key and sending it to the flashing device.
[0102] 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.
[0103] 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 verification key of the brush writing 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 a key negotiation algorithm, and the second shared key is encrypted using the third temporary key and sent to the brush writing device. Exemplarily, ECDH (Elliptic Curve Diffie-Hellman) can be used as an example of the key negotiation algorithm.
[0104] After the brush writing device receives the second shared key, it 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 new shared key (second shared key) is obtained by decrypting the third temporary key. The brush writing device confirms the second shared key (the second shared key includes the key validity period and the identifier), and sends a confirmation message to the management server, including the digest information of the decrypted key, for the management server to verify whether the decryption is correct.
[0105] By effectively updating the second shared key through the brush writing device, the effective encryption of the transmitted data by the brush writing device can be improved, thereby improving the security and integrity of the data.
[0106] Further, when the brush writing 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 of the second shared key and the ciphertext information are filled into a pre-constructed data structure to obtain a filled data structure. The filled data structure is encoded to obtain encoded data, and finally the encoded data can be signed and sent to the management server.
[0107] The pre-constructed data structure can be the arrangement order of the identifier information and the ciphertext information, for example, the identifier of the second shared key is located before the ciphertext information, so that the identifier information can be read before the ciphertext information.
[0108] In another embodiment of the present application, as Figure 4 shown, a data writing method is also provided, applied to a management server in communication with a brush writing device. The data writing method in this embodiment can be implemented through the following steps S201 to S204.
[0109] Step S201: receiving certificate application information sent by the brush writing device.
[0110] Step S202: performing second security authentication on the certificate application information.
[0111] Specifically, the second security authentication operation mainly verifies whether the certificate application information is tampered with by an intermediate person.
[0112] Step S203: obtaining the certificate flashing information based on the certificate application information when the second security authentication is passed.
[0113] The certificate flashing information can include a terminal device certificate and a second message authentication code. The terminal device certificate refers to a digital certificate that can be installed on a terminal device. The certificate contains the identity information and public key of the device, as well as the signature of the certificate authority (CA).
[0114] Specifically, when the second security authentication is passed, the terminal device certificate is obtained by the management server according to the certificate application request in the certificate application information.
[0115] Step S204: sending the certificate flashing information to the flashing device, so that the flashing device sends the certificate flashing information to the terminal device.
[0116] Based on the above steps S201-S204, first, the certificate application information sent by the flashing device is received; the certificate application information is subjected to second security authentication; when the second security authentication is passed, the certificate flashing information is obtained based on the certificate application information; and the certificate flashing information is sent to the flashing device, so that the flashing device sends the certificate flashing information to the terminal device. By performing security authentication on the certificate application information, it is ensured that only the verified flashing device can continue the subsequent operation, which helps to prevent unauthorized access and malicious operation, and at the same time, the security authentication can ensure that the certificate application information has not been tampered with during transmission, thereby protecting the integrity of the data.
[0117] The above steps S202 and S204 will be further described below.
[0118] For step S202, in one specific embodiment of the present application, it can be implemented through the following steps S2021-S2023.
[0119] Step S2021: obtaining a first temporary key based on key derivation of the first shared key.
[0120] Specifically, the first shared key is pre-stored in the management server, and the first temporary key can be generated by derivation based on the first shared key using common key derivation algorithms, such as key derivation function or PBKDF2, bcrypt, etc.
[0121] Step S2022: obtaining a fourth message authentication code based on the first temporary key and the certificate application information.
[0122] Specifically, a hash function, such as SHA-256, is selected. An HMAC is calculated based on the first temporary key and terminal device information (such as a device ID, a timestamp, etc.) in the certificate application request by using the hash function, and a result of the HMAC is the fourth message authentication code.
[0123] Step S2023: authenticating the first message authentication code in the certificate application information based on the fourth message authentication code.
[0124] In this embodiment, specifically, the first message authentication code is matched with the fourth message authentication code, and when the two are matched, it is indicated that the certificate application information of the terminal device is not tampered with, and at this time, the terminal device certificate application information is trusted.
[0125] By matching the message authentication code calculated by the management server with the authentication code calculated by the terminal device, it is determined whether the certificate application information is tampered with, and the security of the transmitted data is improved.
[0126] The above is a detailed description of step S202, and the following continues to describe step S203 in detail.
[0127] The certificate flashing information includes the first certificate and the second message authentication code, and for the above step S203, the following steps S2031 to S2033 can be specifically implemented.
[0128] Step S2031: obtaining the first certificate based on the certificate application information.
[0129] The first certificate refers to a digital certificate of the terminal device.
[0130] Specifically, the service manager can communicate with a certificate authority (CA), and send the 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.
[0131] Step S2032: performing key derivation based on the first shared key to obtain a second temporary key.
[0132] Specifically, a common key derivation algorithm can be used to generate the second temporary key based on the first shared key, such as using a key derivation function (Password-Based Key Derivation Function, PBKDF).
[0133] Step S2033: obtaining the second message authentication code based on the second temporary key and the first certificate.
[0134] Specifically, a hash function, such as SHA-256, is selected. An HMAC is calculated based on the second temporary key and the first certificate using the hash function, and the result of the HMAC is the second message authentication code.
[0135] In one embodiment of the present application, before the certificate flashing information is sent to the flashing device, the method further comprises: sending the certificate flashing information to the flashing device after the certificate flashing information is securely packaged based on the second shared key.
[0136] Specifically, the management server obtains the certificate flashing information (including the terminal device certificate and the second message authentication code), can first encrypt the certificate flashing information to obtain ciphertext information, then fill the identification of the second shared key and the ciphertext information into a pre-constructed data structure to obtain a filled data structure, encode the filled data structure to obtain encoded data, and finally send the encoded data to the flashing device after signing. The pre-constructed data structure can be the arrangement order of the identification of the second shared key and the ciphertext information, for example, the identification information is located before the ciphertext information, so that the identification information can be read before the ciphertext information.
[0137] By securely packaging the certificate flashing information before sending it to the flashing device, the security and integrity of the data can be improved.
[0138] The complete steps of the data flashing method of the present application will be described in detail below. Figure 5 The complete steps of the data flashing method of the present application will be described in detail below.
[0139] Step S10: The flashing device initiates a certificate application confirmation request to the terminal device.
[0140] The certificate application confirmation request is a request sent by the flashing device to the terminal device, which aims to confirm that the terminal device is ready to receive a new certificate and can start the subsequent certificate application process.
[0141] Step S20: The terminal device generates a certificate application request in response to the certificate flashing confirmation request. The first temporary key is obtained by key derivation based on the first shared key, and the first message authentication code of the certificate application request is calculated according to the first temporary key. Finally, the certificate application information (certificate application request and first message authentication code) is sent to the flashing device.
[0142] The certificate application request refers to a request generated by the terminal device and sent to the flashing device in 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. The certificate application request may include public key information, device identification information, signature algorithm, signature, and other information, without specific limitation. The public key information is the public key part of the asymmetric key pair generated by the terminal device, which is used to create a digital certificate, and the certificate will be used to verify the identity of the device terminal. The device identification information can include a unique identifier of the device or other related information, which helps the certificate authority (CA) to confirm the identity and authorization of the device. The signature algorithm is the algorithm used to sign the certificate application request, such as RSA, ECDH, etc. Other related information can be some additional information, such as certificate validity period, certificate purpose, etc.
[0143] 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 sends it to the management server after securely packaging the encrypted and signed certificate application information.
[0144] Step S40: The management server verifies the signature using the public key, obtains the second shared key using the identification of the second shared key to decrypt the certificate application information, finds the corresponding first shared key through the identification of the first shared key after completing the decryption, generates a second temporary key by derivation, and calculates a fourth message authentication code of the certificate application information. By comparing the first authentication code and the fourth message authentication code, it is determined whether the certificate application information has been tampered with. After all the verifications are completed, the management server performs certificate-related operations according to the certificate application information to obtain the terminal device certificate. The management server derives a third temporary key from the first shared key, calculates a second message authentication code of the terminal device certificate according to the third temporary key, and then securely packages the certificate flashing information and returns it to the flashing device.
[0145] Step S40: After receiving the certificate flashing information sent by the management server, the flashing device first verifies the signature to ensure the legality of the message, then obtains the second shared key according to the identification of the second shared key to decrypt the certificate flashing information and returns it to the terminal.
[0146] Step S50: The terminal device derives a third temporary key from the first shared key, calculates a third message authentication code of the certificate flashing information according to the third temporary key, and ensures that the message has not been tampered with by comparing the third message authentication code and the fourth message authentication code.
[0147] 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 when connected to the network. If the communication is successful, it proves that the overall certificate writing process of the terminal device is successfully completed.
[0148] In addition, the application can use the ECIES algorithm and fuse programming to preset the symmetric key for the terminal device, so as to solve the end-to-end encryption communication problem between the terminal device and the management server. The ECIES is a key agreement algorithm, which protects the security of the symmetric key in the transmission process and avoids key exposure. The fuse programming ensures that the preset shared key of the terminal device cannot be changed after programming. The terminal device and the server hold the same shared key, and the intermediate person cannot obtain the key. When communicating, the key is used to encrypt and verify the transmission information, which can avoid the man-in-the-middle attack caused by the certificate programming device.
[0149] It should be noted that, although the above embodiments describe the steps in a specific order, those skilled in the art can understand that, in order to achieve the effect of the application, the different steps do not have to be executed in such an order, they can be executed simultaneously (in parallel) or in other orders, and these changes are within the protection scope of the application.
[0150] Those skilled in the art can understand that all or part of the processes in the method of the above embodiment 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. When the processor executes the computer program, the steps of the above various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form, etc. The computer readable storage medium can include any entity or device, medium, U disk, mobile hard disk, magnetic 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.
[0151] Further, the application also provides a computer device, which can include at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program, and the computer program is executed by the at least one processor to implement the method of any one of the above embodiments. Referring to Figure 6 as shown, Figure 6 The structure of the computer device is shown in the above embodiment, which includes a processor 61 and a memory 62.
[0152] Further, the present application also provides a computer readable storage medium. In an embodiment of the computer readable storage medium according to the present application, the computer readable storage medium can be configured to store a program of a data flashing method for implementing the above-mentioned method embodiments, which can be loaded and run by a processor to implement the above-mentioned data flashing method. For the convenience of illustration, only the parts related to the embodiments of the present application are shown, and the specific technical details not disclosed are referred to the method part of the embodiments of the present application. The computer readable storage medium can be a memory device formed by various electronic devices, and optionally, the computer readable storage medium in the embodiments of the present application is a non-transitory computer readable storage medium.
[0153] The related user personal information that may be involved in the embodiments of the present application is strictly in accordance with the requirements of laws and regulations, follows the principles of legality, legitimacy and necessity, is based on the reasonable purpose of business scenarios, and processes the personal information that is actively provided by the user in the process of using the product / service or generated due to the use of the product / service, and authorized by the user.
[0154] The user personal information processed by the present application will be different due to specific product / service scenarios, and the specific scenarios of the user using the product / service shall be used as the reference, which 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 high diligence and obligation.
[0155] The present application attaches great importance to the security of user personal information, and has taken security protection measures in accordance with industry standards, which are reasonable and feasible to protect the user's information, prevent unauthorized access, public disclosure, use, modification, damage or loss of personal information.
[0156] So far, the technical solutions of the present application have been described in combination with the specific embodiments shown in the 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 embodiments. Those skilled in the art can make equivalent changes or replacements to the related technical features without departing from the principles of the present application, and the technical solutions after the changes or replacements will fall within the protection scope of the present application.
Claims
1. A data writing method applied to a terminal device, wherein the terminal device communicates with a writing device, and the writing device communicates with a management server, characterized in that, The flashing device stores a second shared key, the second shared key is generated by the management server, and the method comprises: In response to the certificate application confirmation request sent by the flashing device, the certificate application information is obtained, wherein the certificate application information comprises a certificate application request and a first message authentication code, and the first message authentication code is generated based on a first shared key pre-configured in the terminal device; The certificate application information is sent to the flashing device, so that the flashing device sends the certificate application information to the management server, so that the management server performs second security authentication on the certificate application information based on the first message authentication code and a fourth message authentication code, and obtains certificate flashing information based on the certificate application information after the second security authentication passes, wherein the fourth message authentication code is generated by the management server based on the first shared key pre-stored in the management server, and the management server and the flashing device perform data encryption transmission based on the second shared key; The certificate flashing information sent by the flashing device is received, wherein the certificate flashing information comprises a second message authentication code, and the second message authentication code is generated by the management server based on the first shared key; The certificate flashing information is subjected to first security authentication based on the second message authentication code and a third message authentication code, wherein the third message authentication code is generated based on the first shared key; When the first security authentication passes, a flashing action is performed based on the certificate flashing information.
2. The data flashing method of claim 1, wherein, The certificate application information is obtained, comprising: The certificate application request is obtained based on the certificate application confirmation request; The first temporary key is obtained through key derivation based on the first shared key; The first message authentication code is obtained based on the first temporary key and the certificate application request.
3. The data flashing method of claim 1, wherein, The method further comprises: The second temporary key is obtained through key derivation based on the first shared key; The third message authentication code is obtained based on the second temporary key and the certificate flashing information.
4. A data writing method applied to a management server, wherein the management server communicates with a writing device, and the writing device communicates with a terminal device, characterized in that, The flashing device stores a second shared key, the second shared key is generated by the management server, and the management server and the flashing device perform data encryption transmission based on the second shared key, and the method comprises: The certificate application information sent by the flashing device is received, wherein the certificate application information is generated by the terminal device and sent to the flashing device, and the certificate application information comprises a certificate application request and a first message authentication code, and the first message authentication code is generated based on a first shared key pre-configured in the terminal device; The certificate application information is subjected to second security authentication based on the first message authentication code and a fourth message authentication code, wherein the fourth message authentication code is generated based on the first shared key pre-stored in the management server; When the second security authentication passes, certificate flashing information is obtained based on the certificate application information, and the certificate flashing information comprises a second message authentication code, and the second message authentication code is generated based on the first shared key; The certificate flashing information is sent to the flashing device, so that the flashing device sends the certificate flashing information to the terminal device, so that the terminal device performs first security authentication on the certificate flashing information based on the second message authentication code and the third message authentication code, and performs a flashing action based on the certificate flashing information when the first security authentication is passed, wherein the third message authentication code is generated by the terminal device based on the first shared key.
5. The data flashing method of claim 4, wherein, The method further comprises: deriving a first temporary key based on the first shared key; obtaining a fourth message authentication code based on the first temporary key and the certificate application information.
6. The data flashing method of claim 4, wherein, The certificate flashing information further comprises a first certificate; The certificate flashing information based on the certificate application information comprises: obtaining the first certificate based on the certificate application information; deriving a second temporary key based on the first shared key; obtaining a second message authentication code based on the second temporary key and the first certificate.
7. The data flashing method of claim 4, wherein, Before receiving the certificate application information sent by the flashing device, the method further comprises: receiving a key application request sent by the flashing device; verifying whether the key application request is complete based on a 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.
8. The data flashing method of claim 7, wherein, Before sending the certificate flashing information to the flashing device, the method further comprises: securely packaging the certificate flashing information based on the second shared key and sending it to the flashing device.
9. A computer device, comprising: comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory has stored therein a computer program, and the computer program is executed by the at least one processor to implement the data flashing method of any one of claims 1-3 or claims 4-8.
10. A computer readable storage medium having stored therein a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by the processor to execute the data flashing method of any one of claims 1-3 or claims 4-8.
Citation Information
Patent Citations
Vehicle flashing method, vehicle networking box, vehicle and storage medium
CN112883382A
Data flashing method and device, equipment and storage medium
CN116339770A
Digital certificate acquisition method, vehicle, storage medium and computer equipment
CN118487878A