Firmware download method, device and computer readable storage medium

CN116662939BActive Publication Date: 2026-10-27NATIONZ TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210147883.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-17
Publication Date
2026-10-27
Estimated Expiration
2042-02-17

AI Technical Summary

Technical Problem

但是,目前的加密方法通常是在固件下载完成后生效,而且需要对MCU(Micro Control Unit,微控制单元)进行断电操作才能生效,在下载过程中,所有的固件数据都是以明文方式传输,因而在下载过程中还是可能会被恶意截取,也即固件还是存在泄漏的风险

Benefits of technology

[0014]本申请提供了一种固件下载方法、装置及计算机可读存储介质,其中,该方法通过下载器获取固件密文、固件密文对应的私有密钥、以及下载密钥,与MCU进行认证,并在认证成功后,将下载密钥发送至MCU,以及将固件密文通过私有密钥解密,再通过下载密钥加密,生成对应的下载密文,将下载密文下载到MCU,MCU通过下载密钥对下载密文进行解密,获得对应的固件明文,并对固件明文进行存储,因此,固件下载过程中的传输全部为密文,无法被截取,从而提高了固件的安全性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116662939B_ABST
    Figure CN116662939B_ABST
Patent Text Reader

Abstract

The application discloses a firmware downloading method and device and a computer readable storage medium, wherein the method comprises the following steps: obtaining firmware ciphertext and a private key corresponding to the firmware ciphertext; authenticating with an MCU, and after successful authentication, sending a preset downloading key to the MCU, and decrypting the firmware ciphertext through the private key, then encrypting the firmware ciphertext through the downloading key to generate corresponding downloading ciphertext, downloading the downloading ciphertext to the MCU, so that the MCU decrypts the downloading ciphertext through the downloading key to obtain corresponding firmware plaintext, and the firmware plaintext is stored, thereby improving the security of the firmware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data security technology, and in particular to a firmware download method, apparatus, and computer-readable storage medium. Background Technology

[0002] Currently, firmware is often provided in plaintext, which may pose a risk of leakage. To protect firmware from malicious theft, encryption can be used. However, current encryption methods typically take effect only after the firmware download is complete and require a power-off operation on the MCU (Micro Control Unit). During the download process, all firmware data is transmitted in plaintext, making it susceptible to malicious interception, thus maintaining the risk of firmware leakage.

[0003] Therefore, improving firmware security has become an urgent problem to be solved. Summary of the Invention

[0004] The main objective of this application is to provide a firmware download method, apparatus, and computer-readable storage medium, with the aim of improving firmware security.

[0005] To achieve the above objectives, this application provides a firmware download method, comprising:

[0006] Obtain the firmware ciphertext, the private key corresponding to the firmware ciphertext, and the download key;

[0007] The system authenticates with the MCU, and upon successful authentication, sends the download key to the MCU. It also decrypts the firmware ciphertext using the private key, encrypts it again using the download key to generate the corresponding download ciphertext, and downloads the download ciphertext to the MCU. The MCU then decrypts the download ciphertext using the download key to obtain the corresponding firmware plaintext, and stores the firmware plaintext.

[0008] To achieve the above objectives, this application also provides a firmware download method, comprising:

[0009] Authenticate with the downloader, and after successful authentication, receive the download key and the downloaded ciphertext sent by the downloader;

[0010] The downloaded ciphertext is decrypted using the download key to obtain the corresponding firmware plaintext;

[0011] The firmware is stored in plaintext.

[0012] To achieve the above objectives, this application also provides a firmware download device, including a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements the aforementioned firmware download method.

[0013] To achieve the above objectives, this application also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the aforementioned firmware download method.

[0014] This application provides a firmware download method, apparatus, and computer-readable storage medium. The method involves obtaining firmware ciphertext, a corresponding private key, and a download key via a downloader. It then authenticates with an MCU (Microcontroller Unit). Upon successful authentication, the download key is sent to the MCU. The firmware ciphertext is decrypted using the private key and then encrypted again using the download key to generate corresponding download ciphertext. This download ciphertext is downloaded to the MCU. The MCU decrypts the download ciphertext using the download key to obtain the corresponding plaintext firmware, which is then stored. Therefore, all transmissions during the firmware download process are ciphertext and cannot be intercepted, thus improving firmware security. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 A flowchart of a firmware download method provided in this application;

[0017] Figure 2 A schematic diagram of an application system for firmware download provided in this application;

[0018] Figure 3 The present application provides a flowchart of the steps for authenticating with an MCU, sending a preset download key to the MCU after successful authentication, and downloading ciphertext to the MCU;

[0019] Figure 4 A schematic diagram of a firmware download process provided in this application;

[0020] Figure 5 A flowchart illustrating the steps of another firmware download method provided in this application;

[0021] Figure 6This application provides a flowchart of steps for authenticating with a downloader and, upon successful authentication, receiving a download key and downloaded encrypted text from the downloader.

[0022] Figure 7 A flowchart illustrating the steps for decrypting downloaded ciphertext using the download key to obtain the corresponding firmware plaintext, as provided in this application.

[0023] Figure 8 This is a schematic block diagram of a firmware download device provided in an embodiment of this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0025] It should be noted that the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features.

[0026] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in some embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0027] Furthermore, the technical solutions of the various embodiments can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0028] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0029] Currently, firmware is often provided in plaintext, which may pose a risk of leakage. To protect firmware from malicious theft, encryption can be used. However, current encryption methods typically take effect only after the firmware download is complete and require a power-off operation on the MCU (Micro Control Unit). During the download process, all firmware data is transmitted in plaintext, making it susceptible to malicious interception, thus maintaining the risk of firmware leakage.

[0030] To address the aforementioned issues, embodiments of this application provide a firmware download method, apparatus, and computer-readable storage medium to enhance firmware security.

[0031] Please see Figure 1 , Figure 1 This is a schematic flowchart of the firmware download method provided in this application embodiment. This method can be applied to a downloader, and also to other download tools besides a downloader. The following description uses the application of this method to a downloader as an example to illustrate the firmware download method.

[0032] like Figure 1 As shown, the firmware download method provided in this application embodiment includes steps S101 and S102.

[0033] Step S101: Obtain the firmware ciphertext and the private key corresponding to the firmware ciphertext.

[0034] In some embodiments, obtaining the firmware ciphertext, the private key corresponding to the firmware ciphertext, and the download key may include:

[0035] The system receives the firmware ciphertext and the private key sent by the host computer; wherein the private key is set by the user through the host computer, and the host computer uses the private key to encrypt the firmware plaintext to generate the firmware ciphertext.

[0036] like Figure 2 As shown, Figure 2 The application system for firmware download includes a host computer, a downloader, and an MCU. The host computer includes, but is not limited to, a PC (Personal Computer). Project development is performed on the PC to generate the original firmware program, which is in plaintext.

[0037] For example, a download software is installed on the host computer. A private key is set through the download software, and the original plaintext firmware is encrypted to generate ciphertext firmware corresponding to the plaintext firmware.

[0038] For example, the AES-128 encryption algorithm is used to encrypt the plaintext firmware based on a private key to generate the corresponding ciphertext firmware.

[0039] It should be noted that, in addition to the AE-128 encryption algorithm listed above, other encryption algorithms can also be used to encrypt the plaintext firmware, and no specific restrictions are imposed in this application.

[0040] For example, the download key is set up through the downloader.

[0041] It should be noted that the private key and the download key are two unrelated keys, completely controlled by the user. They can be set independently and updated at any time, making them convenient to use.

[0042] The host computer sends the private key to the downloader through the download software, and also sends the firmware ciphertext to the downloader through the download software.

[0043] The downloader receives and stores the firmware ciphertext and private key sent by the host computer. At this point, the downloader can directly download the firmware offline, meaning it can do so without intervention from the host computer or download software.

[0044] Step S102: Authenticate with the MCU, and after successful authentication, send the preset download key to the MCU, decrypt the firmware ciphertext with the private key, encrypt it again with the download key to generate the corresponding download ciphertext, download the download ciphertext to the MCU, so that the MCU can decrypt the download ciphertext with the download key to obtain the corresponding firmware plaintext, and store the firmware plaintext.

[0045] For example, before firmware download, the MCU enters BOOT mode. In BOOT mode, the downloader authenticates with the MCU. After successful authentication, the downloader sends the download key to the MCU, decrypts the firmware ciphertext using a private key, and then encrypts it again using the download key to generate the corresponding download ciphertext. After that, the downloader downloads the download ciphertext to the MCU.

[0046] Conversely, if authentication fails, the process continues until successful, at which point the generated ciphertext is executed and downloaded to the MCU. Alternatively, if authentication fails after a preset number of attempts, the operation ends, and the firmware download is terminated.

[0047] In some embodiments, such as Figure 3 As shown, step S102 may include sub-steps S1021 to S1024.

[0048] S1021. Perform the first authentication with the MCU using the default key, and after successful authentication, send the download key to the MCU after encrypting it with the default key;

[0049] S1022. Perform a second authentication with the MCU using the default encrypted key, and after successful authentication, decrypt the firmware ciphertext using the private key to obtain the firmware plaintext;

[0050] S1023. Encrypt the plaintext firmware using the download key to generate the ciphertext download;

[0051] S1024. Download the encrypted download to the MCU.

[0052] For example, during the firmware download process, the downloader and the MCU need to successfully perform two authentication operations. First, the downloader and the MCU perform an initial authentication using a default key. After successful authentication, the download key is encrypted using the default key and sent to the MCU. For example, the download key is encrypted using the AES-128 encryption algorithm with the default key.

[0053] It should be noted that other keys besides the default key can also be used to encrypt the download key, and this application does not impose specific restrictions.

[0054] After the MCU receives the encrypted default key, the downloader and the MCU perform a second authentication using the encrypted default key. After successful authentication, the firmware ciphertext is decrypted using the private key to obtain the firmware plaintext.

[0055] The downloader then encrypts the plaintext firmware using the download key, generating ciphertext corresponding to the plaintext firmware.

[0056] For example, the AES-128 encryption algorithm is used to encrypt the plaintext firmware based on the download key to generate the corresponding ciphertext for download.

[0057] It should be noted that, in addition to the AES-128 encryption algorithm listed above, other encryption algorithms can also be used to encrypt the plaintext firmware, and no specific restrictions are imposed in this application.

[0058] The downloader then downloads the encrypted text to the MCU.

[0059] For example, to further enhance firmware security, the downloader downloads encrypted blocks to the MCU.

[0060] The MCU decrypts the downloaded ciphertext to obtain the corresponding plaintext firmware, and then stores the plaintext firmware. For example, the plaintext firmware can be stored in internal memory.

[0061] For example, the MCU first decrypts the encrypted download key using the default key to obtain the download key, and then uses the obtained download key to decrypt the downloaded ciphertext to obtain the corresponding firmware plaintext.

[0062] Authentication is required before firmware download, and the download key is transmitted in encrypted form to maximize the security of the download key and prevent it from being maliciously intercepted during the firmware download process, thus improving firmware security.

[0063] For example, to further improve firmware security, the MCU stores the firmware plaintext and simultaneously enables read protection to prevent external interfaces from reading the firmware plaintext.

[0064] During the firmware download process, all data storage and transmission are performed in encrypted form, with plaintext existing only within the downloader and MCU, thus preventing data leakage.

[0065] In some embodiments, such as Figure 4 As shown, the firmware download process is as follows: The host computer (PC) generates the original plaintext firmware. The user sets a private key through the host computer. The host computer uses the download software to encrypt the plaintext firmware based on the private key, generating ciphertext firmware. The host computer then sends the private key and ciphertext firmware to the downloader.

[0066] Users customize the download key through the downloader. After receiving the private key and firmware ciphertext, the downloader authenticates with the MCU. If authentication fails, it returns to continue the authentication process. Upon successful authentication, the download key is encrypted with the default key and sent to the MCU. Simultaneously, the firmware ciphertext is decrypted using the private key to obtain the plaintext firmware, and then encrypted again using the download key to generate the download ciphertext, which is then downloaded to the MCU.

[0067] The MCU decrypts the encrypted download key using the default key to obtain the download key. Then, it uses this download key to decrypt the downloaded ciphertext, obtaining the corresponding plaintext firmware. After storing the plaintext firmware, the MCU enables read protection to prevent external interfaces from reading it. Firmware download complete.

[0068] The above embodiment obtains the firmware ciphertext, the corresponding private key, and the download key through a downloader, authenticates with the MCU, and after successful authentication, sends the download key to the MCU, decrypts the firmware ciphertext using the private key, encrypts it again using the download key to generate the corresponding download ciphertext, and downloads the download ciphertext to the MCU. The MCU decrypts the download ciphertext using the download key to obtain the corresponding firmware plaintext, and stores the firmware plaintext. Therefore, all transmissions during the firmware download process are ciphertext and cannot be intercepted, thereby improving firmware security.

[0069] Please see Figure 5 , Figure 5 This is a schematic flowchart of the firmware download method provided in this application embodiment. This method can be applied to MCUs, as well as devices other than MCUs. The following description uses the application of this method to an MCU as an example to illustrate the firmware download method.

[0070] like Figure 5 As shown, the firmware download method provided in this application embodiment includes steps S201 to S203.

[0071] S201. Authenticate with the downloader, and after successful authentication, receive the download key and the downloaded ciphertext sent by the downloader.

[0072] The host computer performs project development and generates the original plaintext firmware. For example, the host computer has download software installed. The download software sets a private key and encrypts the original plaintext firmware to generate the corresponding ciphertext firmware.

[0073] For example, the AES-128 encryption algorithm is used to encrypt the plaintext firmware based on a private key to generate the corresponding ciphertext firmware.

[0074] It should be noted that, in addition to the AE-128 encryption algorithm listed above, other encryption algorithms can also be used to encrypt the plaintext firmware, and no specific restrictions are imposed in this application.

[0075] For example, the download key is set up through the downloader.

[0076] It should be noted that the private key and the download key are two unrelated keys, completely controlled by the user. They can be set independently and updated at any time, making them convenient to use.

[0077] The host computer sends the private key to the downloader through the download software, and also sends the firmware ciphertext to the downloader through the download software.

[0078] The downloader receives and stores the firmware ciphertext and private key sent by the host computer. At this point, the downloader can directly download the firmware offline, meaning it can do so without intervention from the host computer or download software.

[0079] For example, before firmware download, the MCU enters BOOT mode. In BOOT mode, the downloader authenticates with the MCU. After successful authentication, the downloader sends the download key to the MCU, decrypts the firmware ciphertext using a private key, and then encrypts it again using the download key to generate the corresponding download ciphertext. After that, the downloader downloads the download ciphertext to the MCU.

[0080] Conversely, if authentication fails, the process continues until successful, at which point the generated ciphertext is executed and downloaded to the MCU. Alternatively, if authentication fails after a preset number of attempts, the operation ends, and the firmware download is terminated.

[0081] In some embodiments, such as Figure 6 As shown, step S201 may include sub-step S2011 and sub-step S2012.

[0082] S2011. Perform the first authentication with the downloader using the default key, and after successful authentication, receive the encrypted download key sent by the downloader. The encrypted download key is generated by the downloader by encrypting the download key using the default key.

[0083] S2012. Perform a second authentication with the downloader using the default encrypted key, and after successful authentication, receive the ciphertext sent by the downloader.

[0084] For example, during the firmware download process, the downloader and the MCU need to successfully perform two authentication operations. First, the downloader and the MCU perform an initial authentication using a default key. After successful authentication, the download key is encrypted using the default key and sent to the MCU. For example, the download key is encrypted using the AES-128 encryption algorithm with the default key.

[0085] It should be noted that other keys besides the default key can also be used to encrypt the download key, and this application does not impose specific restrictions.

[0086] After the MCU receives the encrypted default key, the downloader and the MCU perform a second authentication using the encrypted default key. After successful authentication, the firmware ciphertext is decrypted using the private key to obtain the firmware plaintext.

[0087] The downloader then encrypts the plaintext firmware using the download key, generating ciphertext corresponding to the plaintext firmware.

[0088] For example, the AES-128 encryption algorithm is used to encrypt the plaintext firmware based on the download key to generate the corresponding ciphertext for download.

[0089] It should be noted that, in addition to the AES-128 encryption algorithm listed above, other encryption algorithms can also be used to encrypt the plaintext firmware, and no specific restrictions are imposed in this application.

[0090] The downloader then downloads the encrypted text to the MCU.

[0091] For example, to further enhance firmware security, the downloader downloads encrypted blocks to the MCU.

[0092] S202. Decrypt the downloaded ciphertext using the download key to obtain the corresponding firmware plaintext.

[0093] In some embodiments, such as Figure 7 As shown, step S202 may include sub-step S2021 and sub-step S2022.

[0094] S2021. Decrypt the encrypted download key using the default key to obtain the download key;

[0095] S2022. Decrypt the downloaded ciphertext using the download key to obtain the firmware plaintext.

[0096] For example, the MCU first decrypts the encrypted download key using the default key to obtain the download key, and then uses the obtained download key to decrypt the downloaded ciphertext to obtain the corresponding firmware plaintext.

[0097] Authentication is required before firmware download, and the download key is transmitted in encrypted form to maximize the security of the download key and prevent it from being maliciously intercepted during the firmware download process, thus improving firmware security.

[0098] S203. Store the firmware plaintext.

[0099] After obtaining the plaintext firmware, the MCU stores it. For example, it stores the plaintext firmware in its internal memory.

[0100] In some embodiments, after storing the firmware plaintext, the following may be included:

[0101] Enable read protection to prevent external interfaces from reading the firmware plaintext.

[0102] For example, to further improve firmware security, the MCU stores the firmware plaintext and simultaneously enables read protection to prevent external interfaces from reading the firmware plaintext.

[0103] During the firmware download process, all data storage and transmission are performed in encrypted form, with plaintext existing only within the downloader and MCU, thus preventing data leakage.

[0104] The above embodiment authenticates the MCU with the downloader. After successful authentication, the MCU receives the download key and the downloaded ciphertext sent by the downloader. The ciphertext is decrypted using the download key to obtain the corresponding firmware plaintext, which is then stored. Therefore, all transmissions during the firmware download process are ciphertext and cannot be intercepted, thereby improving firmware security.

[0105] Please see Figure 8 , Figure 8 This is a schematic block diagram of a firmware download device provided in an embodiment of this application. Figure 8 As shown, the firmware download device 800 may include a processor 810 and a memory 820. The processor 810 and the memory 820 are connected via a bus, such as an I2C (Inter-integrated Circuit) bus.

[0106] Specifically, the processor 810 can be a microcontroller unit (MCU), a central processing unit (CPU), or a digital signal processor (DSP), etc.

[0107] Specifically, the memory 820 can be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a portable hard drive, etc.

[0108] The processor 810 is configured to run a computer program stored in the memory, and to perform the following steps when executing the computer program:

[0109] Obtain the firmware ciphertext and the private key corresponding to the firmware ciphertext;

[0110] The system authenticates with the MCU, and upon successful authentication, sends a preset download key to the MCU. It also decrypts the firmware ciphertext using the private key, encrypts it again using the download key to generate corresponding download ciphertext, and downloads the download ciphertext to the MCU. The MCU then decrypts the download ciphertext using the download key to obtain the corresponding firmware plaintext, and stores the firmware plaintext.

[0111] In some embodiments, when the processor 810 performs authentication with the MCU, sends a preset download key to the MCU after successful authentication, decrypts the firmware ciphertext using the private key, encrypts it again using the download key to generate corresponding download ciphertext, and downloads the download ciphertext to the MCU, it is used to achieve the following:

[0112] The system performs an initial authentication with the MCU using a default key, and after successful authentication, the download key is encrypted using the default key and sent to the MCU.

[0113] The firmware is then authenticated a second time with the MCU using a default encrypted key. After successful authentication, the firmware ciphertext is decrypted using the private key to obtain the firmware plaintext.

[0114] The firmware plaintext is encrypted using the download key to generate the download ciphertext;

[0115] The encrypted download text is downloaded to the MCU.

[0116] In some embodiments, when the processor 810 implements the downloading of the ciphertext to the MCU, it is configured to:

[0117] The encrypted download is divided into blocks and downloaded to the MCU.

[0118] In some embodiments, when the processor 810 implements the acquisition of firmware ciphertext, the private key corresponding to the firmware ciphertext, and the download key, it is configured to:

[0119] The system receives the firmware ciphertext and the private key sent by the host computer; wherein the private key is set by the user through the host computer, and the host computer uses the private key to encrypt the firmware plaintext to generate the firmware ciphertext.

[0120] In some embodiments, the processor 810 is configured to run a computer program stored in memory, and when executing the computer program, perform the following steps:

[0121] Authenticate with the downloader, and after successful authentication, receive the download key and the downloaded ciphertext sent by the downloader;

[0122] The downloaded ciphertext is decrypted using the download key to obtain the corresponding firmware plaintext;

[0123] The firmware is stored in plaintext.

[0124] In some embodiments, when the processor 810 performs authentication with the downloader and, upon successful authentication, receives the download key and the downloaded ciphertext sent by the downloader, it is configured to:

[0125] The system performs an initial authentication with the downloader using a default key. After successful authentication, the system receives an encrypted download key sent by the downloader. The encrypted download key is generated by the downloader by encrypting the download key using the default key.

[0126] The system performs a second authentication with the downloader using an encrypted default key, and receives the downloaded ciphertext sent by the downloader after successful authentication.

[0127] In some embodiments, when the processor 810 decrypts the downloaded ciphertext using the download key to obtain the corresponding firmware plaintext, it is configured to:

[0128] The encrypted download key is decrypted using the default key to obtain the download key;

[0129] The downloaded ciphertext is decrypted using the download key to obtain the firmware plaintext.

[0130] In some embodiments, after storing the firmware plaintext, the processor 810 is configured to:

[0131] Enable read protection to prevent external interfaces from reading the firmware plaintext.

[0132] The embodiments of this application also provide a computer-readable storage medium (storage medium) that stores one or more programs that can be executed by one or more processors to implement the steps of the firmware download method described in the above embodiments.

[0133] For example, when the computer program is loaded by the processor, it can perform the following steps:

[0134] Obtain the firmware ciphertext and the private key corresponding to the firmware ciphertext;

[0135] The system authenticates with the MCU, and upon successful authentication, sends a preset download key to the MCU. It also decrypts the firmware ciphertext using the private key, encrypts it again using the download key to generate corresponding download ciphertext, and downloads the download ciphertext to the MCU. The MCU then decrypts the download ciphertext using the download key to obtain the corresponding firmware plaintext, and stores the firmware plaintext.

[0136] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0137] The computer-readable storage medium can be an internal storage unit of the firmware download device described in the foregoing embodiments, such as the hard disk or memory of the firmware download device. Alternatively, the computer-readable storage medium can be an external storage device of the firmware download device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the firmware download device.

[0138] Since the computer program stored in the computer-readable storage medium can execute any of the firmware download methods provided in the embodiments of this application, the beneficial effects that any of the firmware download methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0139] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A firmware download method, characterized in that, The firmware download method includes: Obtain the firmware ciphertext and the private key corresponding to the firmware ciphertext; The system authenticates with the MCU, and after successful authentication, sends a preset download key to the MCU. It also decrypts the firmware ciphertext using the private key, encrypts it again using the download key to generate the corresponding download ciphertext, and downloads the download ciphertext to the MCU. The MCU then decrypts the download ciphertext using the download key to obtain the corresponding firmware plaintext and stores the firmware plaintext. The steps include: authenticating with the MCU, sending a preset download key to the MCU after successful authentication, decrypting the firmware ciphertext using the private key, encrypting it again using the download key to generate corresponding download ciphertext, and downloading the download ciphertext to the MCU. The system performs an initial authentication with the MCU using a default key, and after successful authentication, the download key is encrypted using the default key and sent to the MCU. The firmware is then authenticated a second time with the MCU using a default encrypted key. After successful authentication, the firmware ciphertext is decrypted using the private key to obtain the firmware plaintext. The firmware plaintext is encrypted using the download key to generate the download ciphertext; The encrypted download text is downloaded to the MCU.

2. The method according to claim 1, characterized in that, The step of downloading the encrypted text to the MCU includes: The encrypted download is divided into blocks and downloaded to the MCU.

3. The method according to any one of claims 1 to 2, characterized in that, The process of obtaining the firmware ciphertext, the private key corresponding to the firmware ciphertext, and the download key includes: The system receives the firmware ciphertext and the private key sent by the host computer; wherein the private key is set by the user through the host computer, and the host computer uses the private key to encrypt the firmware plaintext to generate the firmware ciphertext.

4. A firmware download method, characterized in that, The firmware download method includes: Authenticate with the downloader, and after successful authentication, receive the download key and the downloaded ciphertext sent by the downloader; The downloaded ciphertext is decrypted using the download key to obtain the corresponding firmware plaintext; The firmware is stored in plaintext; The step of authenticating with the downloader and, upon successful authentication, receiving the download key and the downloaded ciphertext sent by the downloader includes: The system performs an initial authentication with the downloader using a default key. After successful authentication, the system receives an encrypted download key sent by the downloader. The encrypted download key is generated by the downloader by encrypting the download key using the default key. The system performs a second authentication with the downloader using an encrypted default key, and receives the downloaded ciphertext sent by the downloader after successful authentication.

5. The method according to claim 4, characterized in that, The step of decrypting the downloaded ciphertext using the download key to obtain the corresponding firmware plaintext includes: The encrypted download key is decrypted using the default key to obtain the download key; The downloaded ciphertext is decrypted using the download key to obtain the firmware plaintext.

6. The method according to any one of claims 4 to 5, characterized in that, After storing the firmware plaintext, the process includes: Enable read protection to prevent external interfaces from reading the firmware plaintext.

7. A firmware download device, characterized in that, The firmware download device includes a processor and a memory. The memory stores a computer program that can be executed by the processor. When the computer program is executed by the processor, it implements the firmware download method as described in any one of claims 1 to 3, or implements the firmware download method as described in any one of claims 4 to 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the firmware download method according to any one of claims 1 to 3, or to implement the steps of the firmware download method according to any one of claims 4 to 6.

Citation Information

Patent Citations

  • Vehicle-mounted equipment, program upgrading method thereof and server

    CN110621014A

  • Upgrading software package configuration method, software upgrading method, equipment and storage device

    CN111382397A