OTA upgrade package acquisition method, electronic device and storage medium
The terminal obtains the decryption key directly from the OTA platform and performs signature verification, which solves the problem of verification failure caused by network instability, reduces equipment requirements, and enhances the security of the OTA upgrade package.
Patent Information
- Application Number
- CN201911233659.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-05
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2039-12-05
AI Technical Summary
The existing technology has the problem of verification failure due to network instability during network verification, and the process of decrypting encrypted packets relies too much on hardware facilities, which increases the requirements for terminal equipment.
The terminal directly obtains the second secret key for decryption from the OTA platform, uses this secret key to decrypt the first encryption key to decrypt the encrypted package, avoiding the need for the Internet to obtain the decryption secret key from the PKI, and performs signature verification before decryption. Key verification to ensure security.
It avoids verification failures caused by network instability, reduces the requirements for terminal equipment, and enhances the security and integrity of the OTA upgrade package through signature verification and key verification.
Smart Images

Figure CN112929871B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of Internet of Vehicles, and in particular to a method for obtaining an OTA upgrade package, an electronic device, and a storage medium. Background Art
[0002] At present, Over-The-Air (OTA) technology is widely used in various fields. Protecting the security of OTA upgrade packages is a very important part of the upgrade protection process using OTA technology. We need to authenticate the security, integrity, authenticity and other aspects of the OTA upgrade packages obtained, so as to reduce the risk of the company leaking important assets. In the existing technology, the terminal side for upgrading generally needs to connect to the Internet to obtain the secret key from the Public Key Infrastructure (PKI) to decrypt the encrypted package obtained from the OTA platform, thereby obtaining the OTA upgrade package.
[0003] The inventors have found that there are at least the following problems in the prior art: the prior art often encounters the problem of verification failure due to network instability during online verification. Moreover, since the secret key for decrypting the encrypted package needs to be obtained with the help of PKI, the decryption process is too dependent on hardware facilities, and accordingly, the requirements for the terminal side equipment will be higher. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a method for obtaining an OTA upgrade package, an electronic device, and a storage medium, which can avoid the problem of verification failure due to network instability during network verification and reduce the requirements for terminal devices in the process of decrypting encrypted packages.
[0005] To solve the above technical problems, an embodiment of the present invention provides a method for obtaining an OTA upgrade package, which is applied to a terminal, including: obtaining an encrypted package, a first encryption key and a second key from an air-downloaded OTA platform; the first encryption key is the encrypted first key, the first key is the hash value of the OTA upgrade package, and the encrypted package is an encrypted OTA upgrade package; using the second key to decrypt the first encryption key to obtain the first key; using the first key to decrypt the encrypted package to obtain the OTA upgrade package.
[0006] An embodiment of the present invention also provides a method for obtaining an OTA upgrade package, which is applied to an OTA platform, including: obtaining a first key; the first key is a hash value of the OTA upgrade package; encrypting the OTA upgrade package using the first key to obtain an encrypted package; encrypting the first key using a third key to obtain a first encryption key; sending the encrypted package, the first encryption key and the second key to a terminal, wherein the second key and the third key are a pair of keys.
[0007] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for obtaining the OTA upgrade package.
[0008] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned method for obtaining an OTA upgrade package when the computer program is executed by a processor.
[0009] Compared with the prior art, in the implementation manner of the present invention, the terminal directly obtains the second key for decrypting the first encryption key from the OTA platform, and uses the second key to decrypt the first encryption key to obtain the first key that can decrypt the encrypted package, without the need to connect to the Internet to obtain the key for decrypting the encrypted package from PKI. This can avoid the problem of verification failure due to network instability during online verification. Since the process of decrypting the encrypted package does not rely on PKI, the requirements for the terminal device are reduced.
[0010] In addition, after obtaining the encrypted package, the first encryption key and the second key from the OTA platform, before using the second key to decrypt the first encryption key to obtain the first key, it also includes: verifying the signature of the encrypted package obtained from the OTA platform; if the encrypted package obtained from the OTA platform passes the signature verification, then using the second key to decrypt the first encryption key to obtain the first key. In this embodiment, before the terminal decrypts and obtains the first key, it first verifies the identity of the encrypted package, and only if the signature verification passes will it continue to decrypt the first encryption key. This embodiment can confirm the identity of the encrypted package, ensure the reliability and integrity of its source, and enhance the security of the upgrade process.
[0011] In addition, the process of obtaining the encrypted package, the first encryption key and the second encryption key from the OTA platform also includes: obtaining the first encrypted hash value from the OTA platform; the first encrypted hash value is obtained by signing the hash value of the encrypted package through the OTA platform; verifying the encrypted package obtained from the OTA platform, specifically including: signing the hash value of the encrypted package obtained from the OTA platform to obtain the second encrypted hash value; comparing the first encrypted hash value and the second encrypted hash value; if the first encrypted hash value is the same as the second encrypted hash value, it is determined that the encrypted package obtained from the OTA platform has passed the signature verification. This embodiment provides a specific method for signature verification, comparing the hash values of the encrypted package after signing obtained by the two methods, and only when they are the same does it indicate that the signature verification has passed, thereby enhancing security.
[0012] In addition, after obtaining the encrypted package, the first encryption key and the second encryption key from the OTA platform, the hash value of the encrypted package obtained from the OTA platform is calculated, and before the first encrypted hash value is decrypted using the second encryption key to obtain the hash value of the encrypted package, it also includes: using the pre-stored root certificate to verify the second encryption key; if the second encryption key is verified, the first encrypted hash value is decrypted using the second encryption key to obtain the hash value of the encrypted package. In this embodiment, the verification indicates that the second encryption key is legal, and then the first encrypted hash value is decrypted using the second encryption key to ensure that the second encryption key is complete and reliable, avoiding security issues caused by using an illegal second encryption key for decryption.
[0013] In addition, after decrypting the encrypted package using the first secret key to obtain the OTA upgrade package, the method further includes: calculating the hash value of the decrypted OTA upgrade package, and comparing the calculated hash value of the OTA upgrade package with the first secret key; if the calculated hash value of the OTA upgrade package is the same as the first secret key, the decrypted OTA upgrade package is used. In this embodiment, the calculated hash value of the OTA upgrade package is compared with the first secret key obtained by decrypting the first encryption key to determine whether the final upgrade package is complete, avoid obtaining a tampered upgrade package, and check whether the company's assets have been leaked.
[0014] In addition, the method for obtaining the OTA upgrade package is applied to the vehicle-mounted terminal. This embodiment provides an application scenario of the method for obtaining the OTA upgrade package. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] One or more embodiments are exemplarily described by the pictures in the corresponding drawings, and these exemplary descriptions do not constitute limitations on the embodiments.
[0016] Figure 1 is a flowchart of a method for obtaining an OTA upgrade package in a first embodiment of the present invention;
[0017] Figure 2 is a flow chart of a method for obtaining an OTA upgrade package in a second embodiment of the present invention;
[0018] Figure 3 is a flow chart of a method for obtaining an OTA upgrade package in a third embodiment of the present invention;
[0019] Figure 4 is a flowchart of a method for obtaining an OTA upgrade package in a fourth embodiment of the present invention;
[0020] Figure 5 is a flowchart of a method for obtaining an OTA upgrade package in a fifth embodiment of the present invention;
[0021] Figure 64 is a schematic structural diagram of an electronic device in a sixth embodiment of the present invention. DETAILED DESCRIPTION
[0022] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0023] The first embodiment of the present invention relates to a method for obtaining an OTA upgrade package, which is applied to a terminal. The terminal can be a computer, a mobile phone, etc. In practical applications, it can be applied to a vehicle-mounted terminal, which is not limited here. In this embodiment, after the terminal obtains an encrypted package, a first encryption key and a second key from the OTA platform, it uses the second key to decrypt the first encryption key to obtain the first key, and uses the first key to decrypt the encrypted package to finally obtain the OTA upgrade package. During the whole process, the terminal does not need to connect to the Internet to obtain the key used to decrypt the encrypted package from PKI. Instead, the OTA platform is used to issue the first encryption key and the second key. After a series of operations, the encrypted package can be decrypted to obtain the OTA upgrade package, which can avoid the problem of verification failure due to network instability during online verification, and reduce the requirements of the decryption process on the terminal device. The details of the method for obtaining the OTA upgrade package of this embodiment are described in detail below. The following content is only the implementation details provided for easy understanding and is not necessary for the implementation of this solution. Figure 1 As shown, the method includes:
[0024] Step 101, obtaining an encrypted package, a first encryption key, and a second encryption key from the OTA platform.
[0025] Specifically, the first encryption key is the encrypted first key, the first key is the hash value of the OTA upgrade package, and the encrypted package is the encrypted OTA upgrade package. The terminal obtains the encrypted OTA upgrade package, the hash value of the encrypted OTA upgrade package, and the second key from the OTA platform.
[0026] In a specific example, the OTA platform calculates the hash value of the OTA upgrade package, and uses the hash value of the OTA to encrypt the OTA upgrade package to obtain an encrypted package. The encryption method can be the Advanced Encryption Standard (AES) algorithm, such as the AES256 algorithm, which is not limited here. In addition, the OTA platform will obtain a pair of public and private keys from the PKI through the docking platform, and use the private key as the second key to encrypt the hash value of the OTA upgrade package, thereby obtaining the first encryption key. Therefore, if the OTA platform receives an OTA upgrade request sent by the terminal, the encrypted package, the hash value of the encrypted OTA upgrade package, and the public key in the key pair can be sent to the terminal. The sending method can be sent through the Hyper Text Transfer Protocol over Secure Socket Layer (HTTPS) channel, where the HTTPS channel can use the Transport Layer Security (TLS), such as TLS 1.2, which is not limited here. The terminal may obtain the encrypted package, the hash value of the encrypted OTA upgrade package, and the public key in the key pair by using HTTPS to access the download address of the OTA upgrade package, which is not limited here.
[0027] Step 102: Use the second key to decrypt the first encrypted key to obtain the first key.
[0028] In a specific example, the terminal may receive a file package from the OTA platform. The terminal can then disassemble the file package according to pre-agreed rules to obtain an encrypted package, a public key in a key pair, and a hash value of the encrypted OTA upgrade package, and then use the public key as the second key to decrypt the hash value of the encrypted OTA upgrade package to obtain the hash value of the OTA upgrade package.
[0029] Step 103: Decrypt the encrypted package using the first secret key to obtain an OTA upgrade package.
[0030] In a specific example, after the terminal decrypts the hash value of the encrypted OTA upgrade package to obtain the hash value of the OTA upgrade package, the hash value of the OTA upgrade package can be used as the first secret key to decrypt the encrypted package obtained from the OTA platform, and finally obtain the OTA upgrade package, so as to further use the OTA upgrade package to complete the upgrade, wherein the decryption method can be to use the AES algorithm corresponding to the OTA platform encryption OTA upgrade package process, such as: AES256 algorithm, which is not limited here.
[0031] In this embodiment, the terminal does not need to connect to the Internet to obtain the key used to decrypt the encrypted package from PKI. Instead, it uses the OTA platform to issue the first encryption key and the second key. After a series of operations, the encrypted package can be decrypted to obtain the OTA upgrade package. This can avoid the problem of verification failure due to network instability during online verification and reduce the requirements of the decryption process on the terminal device.
[0032] The second embodiment of the present invention relates to a method for obtaining an OTA upgrade package. The second embodiment is substantially the same as the first embodiment, with the main difference being that in the second embodiment, after the terminal obtains an encrypted package, a first encryption key, and a second key from the OTA platform, before using the second key to decrypt the first encryption key to obtain the first key, the terminal may also verify the signature of the encrypted package obtained from the OTA platform. If the encrypted package obtained from the OTA platform passes the signature verification, the first encryption key is decrypted using the second key to obtain the first key. The method for obtaining an OTA upgrade package in this embodiment is as follows: Figure 2 As shown, including:
[0033] Step 201, obtaining an encrypted package, a first encryption key and a second encryption key from the OTA platform. Similar to step 101, no further details are given here.
[0034] Step 202: Verify the signature of the encrypted package obtained from the OTA platform.
[0035] Specifically, after the terminal receives the encrypted package, the first encryption key and the second encryption key sent by the OTA platform, it will verify the signature of the encrypted package.
[0036] In a specific example, in the process of obtaining an encrypted package, a first encryption key, and a second encryption key from the OTA platform, the terminal can also obtain a first encrypted hash value, that is, a signature string obtained by signing the hash value of the encrypted package by the OTA platform, wherein the signing method can be: the OTA platform uses a secure hash algorithm (Secure Hash Algorithm, referred to as SHA) to sign the hash value of the encrypted package, which is not limited here. After the terminal obtains the hash value of the encrypted package, it can use the SHA algorithm to sign the hash value of the obtained encrypted package to obtain a second encrypted hash value, and then compare the first encrypted hash value and the second encrypted hash value. If the first encrypted hash value and the second encrypted hash value are the same, it is determined that the encrypted package obtained from the OTA platform has passed the signature verification. It should be noted that the method for the terminal to obtain the hash value of the encrypted package can be: receiving the hash value of the encrypted package sent by the OTA platform, or calculating the hash value of the encrypted package after receiving the encrypted package sent by the OTA platform, which is not limited here.
[0037] More preferably, the OTA platform signs the hash value of the encrypted package in a manner as follows: using SHA to sign the hash value of the encrypted package to obtain a first encrypted hash value, and then using the RSA algorithm and the private key in the key pair to encrypt the first encrypted hash value to obtain the encrypted first encrypted hash value, that is, the terminal uses the SHA256withRSA algorithm to sign and encrypt the hash value of the encrypted package. Compared with only signing the hash value of the encrypted package, due to the addition of the encryption operation, the hash value of the encrypted package is less likely to be decrypted, which can reduce the possibility of tampering during the OTA platform issuance process, and enhance the security of OTA upgrade package acquisition. For the terminal side, the terminal can use the RSA algorithm and the public key in the key pair to decrypt the encrypted first encrypted hash value to obtain the first encrypted hash value. In addition, the terminal uses the SHA algorithm to sign the hash value of the encrypted package issued by the OTA platform to obtain a second encrypted hash value, and then compares the first encrypted hash value and the second encrypted hash value. If the first encrypted hash value and the second encrypted hash value are the same, it is determined that the encrypted package obtained from the OTA platform has passed the signature verification. It should be noted that the public key in the above key pair can be issued by the OTA platform.
[0038] Step 203: If the encrypted package obtained from the OTA platform passes the signature verification, the first encryption key is decrypted using the second key to obtain the first key.
[0039] In a specific example, if the calculated hash value of the encrypted package and the decrypted hash value of the encrypted package are the same, indicating that the signature verification is successful, the terminal can then use the public key issued by the OTA platform to decrypt the first encryption key to obtain the first key, that is, obtain the hash value of the OTA upgrade package.
[0040] Step 204: decrypt the encrypted package using the first secret key to obtain an OTA upgrade package. This is similar to step 103 and will not be described in detail here.
[0041] In this embodiment, the terminal verifies the signature of the encrypted package obtained from the OTA platform. If the encrypted package obtained from the OTA platform passes the signature verification, the terminal will then use the second key to decrypt the first encryption key to obtain the first key. That is, the first encryption key will only be decrypted if the encrypted package obtained from the OTA platform passes the signature verification. This embodiment can confirm the identity of the encrypted package, ensure the reliability and integrity of the source of the encrypted package, and enhance the security of the process of obtaining the upgrade package.
[0042] The third embodiment of the present invention relates to a method for obtaining an OTA upgrade package. The third embodiment is substantially the same as the first embodiment, with the main difference being that after the terminal obtains an encrypted package, a first encryption key, and a second key from the OTA platform, before using the second key to decrypt the first encryption key to obtain the first key, the second key will be verified. If the second key verification passes, the terminal uses the second key to decrypt the first encryption key to obtain the first key. The method for obtaining an OTA upgrade package in this embodiment is as follows: Figure 3 As shown, including:
[0043] Step 301, obtaining an encrypted package, a first encryption key and a second encryption key from the OTA platform. This is similar to step 101 and will not be described in detail here.
[0044] Step 302: Verify the second secret key using the pre-stored root certificate.
[0045] In a specific example, after the terminal obtains the public key issued by the OTA platform, the root certificate can be used to verify the legitimacy of the public key.
[0046] Step 303: If the second key verification is successful, the first encryption key is decrypted using the second key to obtain the first key.
[0047] In a specific example, if the public key obtained from the OTA platform passes verification, indicating that the public key is legal, the terminal can use the public key to decrypt the first encrypted key to obtain the first key, that is, obtain the hash value of the OTA upgrade package.
[0048] Step 304: decrypt the encrypted package using the first secret key to obtain an OTA upgrade package. This is similar to step 103 and will not be described in detail here.
[0049] In this embodiment, after the terminal obtains the encrypted package, the first encryption key and the second key from the OTA platform, the second key will be verified before using the second key to decrypt the first encryption key to obtain the first key. The verification indicates that the second key is legal. This embodiment uses this method to ensure the integrity and reliability of the second key and avoid security issues caused by using an illegal second key for decryption.
[0050] The fourth embodiment of the present invention relates to a method for obtaining an OTA upgrade package. The fourth embodiment is substantially the same as the first embodiment, with the main difference being that after the terminal decrypts the encrypted package using the first secret key to obtain the OTA upgrade package, it calculates the hash value of the decrypted OTA upgrade package and compares the calculated hash value of the OTA upgrade package with the first secret key. If the calculated hash value of the OTA upgrade package is the same as the first secret key, the decrypted OTA upgrade package is used. The method for obtaining the OTA upgrade package in this embodiment is as follows: Figure 4As shown, including:
[0051] Step 401, obtaining an encrypted package, a first encryption key and a second encryption key from the OTA platform. This is similar to step 101 and will not be described in detail here.
[0052] Step 402: Decrypt the first encrypted key using the second key to obtain the first key. This is similar to step 102 and will not be described in detail here.
[0053] Step 403, decrypt the encrypted package using the first secret key to obtain an OTA upgrade package. This is similar to step 103 and will not be described in detail here.
[0054] Step 404, calculate the hash value of the decrypted OTA upgrade package, and compare the calculated hash value of the OTA upgrade package with the first secret key.
[0055] Specifically, the terminal calculates the hash value of the decrypted OTA upgrade package and compares the calculated hash value of the OTA upgrade package with the first secret key, that is, compares the calculated hash value of the OTA upgrade package with the hash value of the OTA upgrade package obtained from the OTA platform.
[0056] Step 405: If the calculated hash value of the OTA upgrade package is the same as the first secret key, the decrypted OTA upgrade package is used.
[0057] Specifically, if the hash value of the OTA upgrade package calculated by the terminal is the same as the first secret key, that is, the hash value of the calculated OTA upgrade package is the same as the hash value of the OTA upgrade package, it indicates that the OTA upgrade package of the OTA platform and the OTA upgrade package obtained by the terminal are consistent, then the terminal can use the decrypted OTA upgrade package.
[0058] In this embodiment, the terminal compares the calculated hash value of the OTA upgrade package with the first key obtained by decrypting the first encryption key to determine whether the final upgrade package is complete. This embodiment adopts this method to avoid the problem of obtaining a tampered OTA upgrade package and causing the upgrade to fail, and prevent the situation where the terminal system is damaged due to the upgrade of an unofficial OTA upgrade package.
[0059] The fifth embodiment of the present invention relates to a method for obtaining an OTA upgrade package, which is applied to an OTA platform. In this embodiment, the OTA platform obtains a first key, that is, a hash value of the OTA upgrade package, encrypts the OTA upgrade package using the first key to obtain an encrypted package, encrypts the first key using the third key to obtain a first encryption key, and sends the encrypted package, the first encryption key, and the second key to the terminal, wherein the second key and the third key are a pair of keys. In other words, the OTA platform directly sends the second key used to decrypt the first encryption key to the terminal, so that the terminal can use the second key to decrypt the first encryption key to obtain the hash value of the OTA upgrade package, and use the hash value of the OTA upgrade package to decrypt the encrypted package to obtain the OTA upgrade package. Therefore, for the terminal, the decryption process does not require the Internet to obtain the key, which can avoid the problem of verification failure caused by network instability. Moreover, since the decryption process does not require the use of PKI, the terminal will not rely on hardware settings, which reduces the requirements of the decryption process on the terminal device. The following is a specific description of the details of the method for obtaining the OTA upgrade package of this embodiment. The following content is only the implementation details provided for the convenience of understanding, and is not necessary for the implementation of this solution. Figure 5 As shown, the method includes:
[0060] Step 501, obtain a first secret key.
[0061] Specifically, the OTA platform will calculate the hash value of the OTA upgrade package and use it as the first secret key.
[0062] Step 502: Use the first secret key to encrypt the OTA upgrade package to obtain an encrypted package.
[0063] Specifically, the OTA platform can use the hash value of the OTA upgrade package as a secret key to encrypt the OTA upgrade package to obtain an encrypted package. The encryption method can be an AES algorithm, such as: AES256 algorithm, which is not limited here.
[0064] Step 503: Use the third key to encrypt the first key to obtain a first encrypted key.
[0065] Specifically, the OTA platform uses the acquired third key to encrypt the hash value of the OTA upgrade package to obtain the encrypted hash value of the OTA upgrade package, and uses it as the first encryption key.
[0066] In a specific example, the OTA platform obtains a pair of keys from PKI, and uses the private key as the third key to encrypt the hash value of the OTA upgrade package, that is, encrypts the first key to obtain the first encryption key.
[0067] Step 504: Send the encrypted package, the first encryption key, and the second encryption key to the terminal.
[0068] In a specific example, the OTA platform obtains a pair of keys from PKI, uses the public key as the second key, and the private key as the third key, that is, the second key and the third key are a pair of keys. After a series of operations, the OTA platform obtains the encrypted OTA upgrade package, the hash value of the encrypted OTA upgrade package, and the public key, and sends them to the terminal for the terminal to decrypt and obtain the OTA upgrade package.
[0069] In a specific example, after the OTA platform uses the first secret key to encrypt the OTA upgrade package to obtain an encrypted package, before sending the encrypted package, the first encryption key and the second secret key to the terminal, it will also calculate the hash value of the encrypted package and sign the hash value of the encrypted package to obtain the first encrypted hash value. The signature method can be the SHA256withRSA algorithm, which is not limited here. In the process of sending the encrypted package, the first encryption key and the second secret key to the terminal, the OTA platform will also send the first encrypted hash value to the terminal so that the terminal can verify the hash value of the encrypted package obtained from the OTA platform, thereby enhancing the security of the upgrade process.
[0070] In this embodiment, the OTA platform directly sends the second key for decrypting the first encryption key to the terminal, so that the terminal uses the second key to decrypt the first encryption key to obtain the hash value of the OTA upgrade package, and uses the hash value of the OTA upgrade package to decrypt the encrypted package to obtain the OTA upgrade package. Therefore, for the terminal, the decryption process does not need to obtain the key through the Internet, which can avoid the problem of verification failure caused by network instability. Moreover, since the decryption process does not require the use of PKI, the terminal will not rely on hardware settings, reducing the requirements of the decryption process on the terminal device.
[0071] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0072] A sixth embodiment of the present invention relates to an electronic device, such as Figure 6 As shown, it includes: at least one processor 601; and a memory 602 that is communicatively connected to the at least one processor 601; wherein the memory 602 stores instructions that can be executed by the at least one processor 601, and the instructions are executed by the at least one processor 601 so that the at least one processor 601 can execute the above-mentioned method for obtaining the OTA upgrade package.
[0073] The memory 602 and the processor 601 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 601 and the memory 602 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 601 is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor 601.
[0074] The processor 601 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 602 can be used to store data used by the processor 601 when performing operations.
[0075] The seventh embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0076] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0077] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A method for obtaining an OTA upgrade package, characterized in that: Applied to terminals, including: Obtain an encrypted package, a first encryption key, and a second key from an air download OTA platform; the first encryption key is the encrypted first key, the first key is a hash value of the OTA upgrade package, and the encrypted package is obtained by encrypting the OTA upgrade package using the first key; decrypting the first encrypted key using the second key to obtain the first key; Decrypting the encrypted package using the first secret key to obtain the OTA upgrade package; The second key and the third key are a pair of keys, the third key is a private key, the second key is a public key, and the first encryption key is encrypted using the third key.
2. The method for obtaining an OTA upgrade package according to claim 1, characterized in that: After obtaining the encrypted package, the first encryption key and the second key from the OTA platform, and before using the second key to decrypt the first encryption key to obtain the first key, the method further includes: Verifying the signature of the encrypted package obtained from the OTA platform; If the encrypted package obtained from the OTA platform passes the signature verification, the step of using the second key to decrypt the first encryption key to obtain the first key is performed.
3. The method for obtaining an OTA upgrade package according to claim 2, characterized in that: The process of obtaining the encrypted package, the first encryption key and the second encryption key from the OTA platform also includes: Obtaining a first encrypted hash value from the OTA platform; the first encrypted hash value is obtained by signing the hash value of the encrypted package by the OTA platform; The verifying the signature of the encrypted package obtained from the OTA platform specifically includes: Signing the hash value of the encrypted package obtained from the OTA platform to obtain a second encrypted hash value; comparing the first encrypted hash value and the second encrypted hash value; If the first encrypted hash value is the same as the second encrypted hash value, it is determined that the encrypted package obtained from the OTA platform passes the signature verification.
4. The method for obtaining an OTA upgrade package according to claim 1, characterized in that: After obtaining the encrypted package, the first encryption key and the second key from the OTA platform, and before decrypting the first encryption key using the second key to obtain the first key, the method further includes: Verifying the second secret key using a pre-stored root certificate; If the second key verification is passed, the method of using the second key to decrypt the first encrypted key to obtain the first key is executed.
5. The method for obtaining an OTA upgrade package according to any one of claims 1 to 4, characterized in that: After decrypting the encrypted package using the first secret key to obtain the OTA upgrade package, the method further includes: Calculate the hash value of the decrypted OTA upgrade package, and compare the calculated hash value of the OTA upgrade package with the first secret key; If the calculated hash value of the OTA upgrade package is the same as the first secret key, the decrypted OTA upgrade package is used.
6. The method for obtaining an OTA upgrade package according to any one of claims 1 to 4, characterized in that: The method for obtaining the OTA upgrade package is applied to a vehicle-mounted terminal.
7. A method for obtaining an OTA upgrade package, characterized in that: Applied to OTA platforms, including: Obtain a first secret key; the first secret key is a hash value of the OTA upgrade package; Encrypting the OTA upgrade package using the first secret key to obtain an encrypted package; Encrypting the first key with a third key to obtain a first encrypted key; The encrypted package, the first encryption key and the second key are sent to a terminal; wherein the second key and the third key are a pair of keys, the third key is a private key, and the second key is a public key.
8. The method for obtaining an OTA upgrade package according to claim 7, characterized in that: After the OTA upgrade package is encrypted by using the first key to obtain an encrypted package, before the encrypted package, the first encryption key and the second key are sent to the terminal, the method further includes: Calculating a hash value of the encrypted package, and signing the hash value of the encrypted package to obtain a first encrypted hash value; The process of sending the encrypted package, the first encryption key and the second encryption key to the terminal further includes: The first encrypted hash value is sent to the terminal.
9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for obtaining the OTA upgrade package as described in any one of claims 1 to 6; or, so that the at least one processor can execute the method for obtaining the OTA upgrade package as described in any one of claims 7 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: The computer program implements the method for obtaining the OTA upgrade package described in any one of claims 1 to 6 when executed by the processor; or, implements the method for obtaining the OTA upgrade package described in any one of claims 7 to 8 when executed by the processor.
Citation Information
Patent Citations
Firmware protection method and firmware protection device
CN104506515A
Security processing method, device and system for application installation
CN110362990A
