Software upgrading method and device and related equipment
By using unclonable functions and symmetric cryptographic algorithms in OTA software upgrades to generate unique responses for decryption and integrity verification, the security and resource usage issues of traditional OTA are resolved, achieving safer and more efficient software upgrades.
Patent Information
- Application Number
- CN202511061815.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-30
AI Technical Summary
Traditional OTA software upgrade methods rely on traditional public key cryptography algorithms, which are at risk of being cracked by quantum computing and occupy device storage space and computing resources.
Adopting unclonable functions and symmetric cryptographic algorithms, the unclonable functions generate unique responses for decryption and integrity verification of software upgrade packages. Symmetric cryptographic algorithms are used for encryption and hash operations, and message authentication code verification is performed to ensure the security and integrity of software upgrades.
It improves the security of software upgrades, avoids the risk of quantum computing cracking, reduces device storage space usage, and optimizes resource management and user experience.
Smart Images

Figure CN120751366A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a software upgrading method, apparatus, and related equipment. Background Art
[0002] Traditional Over-The-Air (OTA) updates typically rely on signature and verification mechanisms based on traditional public-key cryptography. With the development of quantum technology, the risk of this mechanism being cracked by quantum computing is increasing. Furthermore, this mechanism requires the OTA cloud's public key to be pre-installed on the device, and the OTA cloud to pre-install the device's public key. For resource-constrained devices, public key storage and signature verification consume valuable storage space and computing resources, impacting overall device performance. Summary of the Invention
[0003] The present disclosure provides a software upgrade method, apparatus, and related equipment, which improve the security of software upgrades at least to a certain extent.
[0004] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0005] According to one aspect of the present disclosure, a software upgrade method is provided, which is applied to a device side, including: receiving a first random number, a second random number, a software upgrade package ciphertext and a first hash operation message authentication code sent by the cloud; using an unclonable function to calculate a first response corresponding to the first random number and a second response corresponding to the second random number; based on the first response, using a symmetric encryption algorithm to decrypt the software upgrade package ciphertext to obtain a software upgrade package; based on the second response and the first hash operation message authentication code, performing an integrity check on the decrypted software upgrade package; after the integrity check passes, using the decrypted software upgrade package to perform a software upgrade.
[0006] In one embodiment of the present disclosure, an integrity check is performed on the decrypted software upgrade package based on the second response and the first hash operation message authentication code, including: calculating the second hash operation message authentication code based on the second response and the decrypted software upgrade package; when the first hash operation message authentication code and the second hash operation message authentication code are the same, the integrity check passes; otherwise, the integrity check fails.
[0007] In one embodiment of the present disclosure, software upgrade is performed using the decrypted software upgrade package, including: parsing the current firmware, the first version number and the current timestamp from the decrypted software upgrade package; performing version number verification based on the first version number, and performing timestamp verification based on the current timestamp; if both verifications pass, performing software upgrade using the current firmware.
[0008] In one embodiment of the present disclosure, before receiving the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code sent by the cloud, the method further includes: registering the device identification number and the unclonable identification number to the cloud.
[0009] In one embodiment of the present disclosure, before receiving the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code sent by the cloud, the method also includes: receiving an upgrade request for software upgrade sent by the cloud; and feeding back an upgrade response to the cloud agreeing to perform the software upgrade.
[0010] According to another aspect of the present disclosure, a software upgrade method is provided, which is applied to the cloud, including: determining an unclonable identification number of a device based on a device identification number of the device, and determining a first random number and its corresponding first response and a second random number and its corresponding second response based on the unclonable identification number; based on the first response, encrypting the software upgrade package using a symmetric encryption algorithm to obtain a ciphertext of the software upgrade package; based on the second response, calculating a first hash operation message authentication code of the software upgrade package; and sending the first random number, the second random number, the ciphertext of the software upgrade package and the first hash operation message authentication code to the device, so that the device performs a software upgrade.
[0011] In one embodiment of the present disclosure, based on the first response, the software upgrade package is encrypted using a symmetric encryption algorithm. Before obtaining the ciphertext of the software upgrade package, the method also includes: receiving a second version number reported by the device; judging whether the device needs a software upgrade based on the second version number and the first version number of the current firmware, wherein the software upgrade package includes the current firmware and the first version number; and if it is judged that the device needs a software upgrade, determining a first random number, a first response, a second random number, and a second response according to the device identification number.
[0012] In one embodiment of the present disclosure, based on the first response, the software upgrade package is encrypted using a symmetric encryption algorithm. Before obtaining the ciphertext of the software upgrade package, the method also includes: using the current firmware, the first version number of the current firmware and the current timestamp to form the software upgrade package.
[0013] In one embodiment of the present disclosure, after calculating the first hash operation message authentication code of the software upgrade package based on the second response, the method also includes: initiating an upgrade request for software upgrade to the device; after receiving the upgrade response of the device agreeing to perform the software upgrade, sending the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code to the device.
[0014] According to another aspect of the present disclosure, a software upgrade device is provided, which is applied to a device side, and includes: a receiving module, configured to receive a first random number, a second random number, a software upgrade package ciphertext and a first hash operation message authentication code sent by the cloud; a first calculation module, configured to use an unclonable function to calculate a first response corresponding to the first random number and a second response corresponding to the second random number; a decryption module, configured to decrypt the software upgrade package ciphertext based on the first response using a symmetric encryption algorithm to obtain a software upgrade package; a verification module, configured to perform integrity verification on the decrypted software upgrade package based on the second response and the first hash operation message authentication code; and an upgrade module, configured to perform a software upgrade using the decrypted software upgrade package after the integrity verification passes.
[0015] According to another aspect of the present disclosure, a software upgrade device is provided, which is applied to the cloud and includes: a determination module, configured to determine an unclonable identification number of a device based on the device identification number of the device, and determine a first random number and its corresponding first response and a second random number and its corresponding second response based on the unclonable identification number; an encryption module, configured to encrypt a software upgrade package using a symmetric encryption algorithm based on the first response to obtain a ciphertext of the software upgrade package; a second calculation module, configured to calculate a first hash operation message authentication code of the software upgrade package based on the second response; and a sending module, configured to send the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code to the device, so that the device performs a software upgrade.
[0016] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any of the above methods by executing the executable instructions.
[0017] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any of the above methods is implemented.
[0018] According to another aspect of the present disclosure, a computer program product is provided, including computer instructions stored in a computer-readable storage medium, and the computer instructions implement operating instructions of any of the above methods when executed by a processor.
[0019] In an embodiment of the present disclosure, an unclonable function is used to calculate a first response corresponding to a first random number and a second response corresponding to a second random number, the ciphertext of the software upgrade package is decrypted based on the first response, and the integrity of the decrypted software upgrade package is verified based on the second response and the first hash operation message authentication code. This solves the problems in the prior art of traditional OTA such as the risk of being cracked by quantum computing and occupying device storage space, thereby improving the security of OTA and avoiding occupying device storage space.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0022] Figure 1 A schematic diagram showing the software upgrade system architecture in an embodiment of the present disclosure.
[0023] Figure 2 A flowchart of a software upgrade method in an embodiment of the present disclosure is shown.
[0024] Figure 3 A flowchart illustrating another software upgrade method in an embodiment of the present disclosure is shown.
[0025] Figure 4 A flowchart of a software upgrade determination method in an embodiment of the present disclosure is shown.
[0026] Figure 5 A flowchart of a software upgrade package verification method in an embodiment of the present disclosure is shown.
[0027] Figure 6 A schematic diagram of a software upgrading device in an embodiment of the present disclosure is shown.
[0028] Figure 7 A schematic diagram showing another software upgrading device in an embodiment of the present disclosure is shown.
[0029] Figure 8 A schematic diagram of an electronic device provided in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0031] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0032] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0033] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0034] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0035] It should be pointed out that, in the absence of conflict, the embodiments of the present disclosure and the technical features therein may be combined with each other.
[0036] For ease of understanding, several terms involved in this disclosure are explained below: Over-the-Air (OTA): OTA refers to a technology that transmits data or updates functionality to remote devices over wireless networks. It is commonly used for software upgrades, firmware updates, and configuration parameter adjustments, and is particularly widespread in the Internet of Things (IoT), smartphones, and smart cars. OTA technology allows manufacturers to remotely upgrade devices without requiring manual user intervention or returning the device to the factory, improving maintenance efficiency, reducing operating costs, and enabling timely vulnerability fixes and feature additions. The core OTA process includes firmware package signing and distribution, device-side verification, and installation, ensuring the security and reliability of the upgrade process.
[0037] A PUF (Physical Unclonable Function) is a technology that generates a unique identifier based on the physical properties of hardware. It exploits microscopic variations in materials or manufacturing processes to generate a unique and unpredictable response for each device. These variations occur naturally during the production process and cannot be precisely replicated or cloned, thus providing a high level of security.
[0038] A PUF identifier is an identifier associated with a specific PUF. It is used to associate a device with a challenge-response pair generated by its PUF function. The challenge is a random number.
[0039] Symmetric cryptography is an encryption method in which the same key is used for both encryption and decryption. This means that the sender and receiver must share the same key and keep it secret to ensure secure communication. Due to their relatively high efficiency and speed, symmetric cryptography is widely used in data encryption, privacy protection, and various security protocols.
[0040] SHA-256 (Secure Hash Algorithm 256-bit), a member of the SHA-2 family, is a cryptographic hash function widely used in various security applications and protocols. It generates a 256-bit (32-byte) hash value, typically represented as 64 hexadecimal digits. SHA-256 is designed to provide data integrity verification and, due to its collision resistance (i.e., the difficulty of finding two different inputs that produce the same output), is also used in digital signatures, certificate authentication, and other fields.
[0041] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0042] Figure 1 The schematic diagram of the software upgrade system structure in the embodiment of the present disclosure is shown. The system can apply the software upgrade method or software upgrade device in each embodiment of the present disclosure. Figure 1 As shown, the system architecture may include a device 101 and an OTA cloud 102 .
[0043] Device 101 may be a mobile device such as a mobile phone, a game console, a tablet computer, an e-book reader, smart glasses, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a smart home device, an AR (Augmented Reality) device, a VR (Virtual Reality) device, or the like. Alternatively, device 101 may be a personal computer (PC), such as a laptop or desktop computer.
[0044] Among them, an application can be installed in the device 101 to perform the following: receiving a first random number, a second random number, a software upgrade package ciphertext and a first hash operation message authentication code sent by the cloud; using an unclonable function to calculate a first response corresponding to the first random number and a second response corresponding to the second random number; based on the first response, using a symmetric encryption algorithm to decrypt the software upgrade package ciphertext to obtain a software upgrade package; based on the second response and the first hash operation message authentication code, performing an integrity check on the decrypted software upgrade package; after the integrity check passes, using the decrypted software upgrade package to perform a software upgrade.
[0045] Optionally, the application clients installed on different devices 101 are the same, or the application clients installed on two devices 101 are clients of the same type of application on different control system platforms. Based on the different device platforms, the specific form of the application client may also be different. For example, the application client may be a mobile phone client, a PC client, or a World Wide Web (Web) client.
[0046] Those skilled in the art will appreciate that the number of the devices 101 may be greater or less. For example, there may be only one device, or there may be dozens, hundreds, or even more. The embodiments of this application do not limit the number and type of devices.
[0047] The OTA cloud 102 is composed of one or more servers. An application program may be installed in the OTA cloud 102 to perform the following operations: determining an unclonable identification number of the device based on the device identification number of the device, determining a first random number and its corresponding first response and a second random number and its corresponding second response based on the unclonable identification number; encrypting the software upgrade package using a symmetric cryptographic algorithm based on the first response to obtain a ciphertext of the software upgrade package; calculating a first hash operation message authentication code of the software upgrade package based on the second response; and sending the first random number, the second random number, the ciphertext of the software upgrade package, and the first hash operation message authentication code to the device to perform a software upgrade on the device.
[0048] The device 101 is connected to the OTA cloud 102 via a communication network. Optionally, the communication network is a wired network or a wireless network.
[0049] Optionally, the above-mentioned wireless network or wired network uses standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network). In some embodiments, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.
[0050] In the software upgrade system, the first response generated by the unclonable function is used in the symmetric cryptographic algorithm to encrypt the software upgrade package. This makes each software upgrade dependent on the unique identity of a specific device, adding an additional layer of security. This means that even if the ciphertext of the software upgrade package is intercepted, it cannot be correctly decrypted and used without the corresponding response generated by the unclonable function. The second response generated by the unclonable function is used to calculate the second hash operation message authentication code, which effectively verifies whether the received software upgrade package has been tampered with during transmission, thereby ensuring the integrity and authenticity of the data. In summary, the effective combination of the unclonable function and the software upgrade package not only strengthens security measures and prevents potential attack risks, but also optimizes resource management and user experience. This combination is highly innovative and provides important security and technical support for the Internet of Things and other fields that rely on remote software update technology.
[0051] Figure 2 A flowchart of a software upgrade method according to an embodiment of the present disclosure is shown, which is applied to the cloud. Figure 2 As shown, the following steps are included: S201 , determining an unclonable identification number of a device according to the device identification number of the device, and determining a first random number and a corresponding first response and a second random number and a corresponding second response based on the unclonable identification number.
[0052] The cloud includes the OTA cloud, which refers to the remote server that sends data related to software upgrades. Based on the device identification number of the device, the cloud can determine the unclonable identification number unique to the device from the identification comparison table. Based on the unclonable identification number, the first random number and its corresponding first response and the second random number and its corresponding second response can be determined from the mapping relationship table. Among them, the identification comparison table stores the correspondence between the device identification number and the unclonable identification number, and the mapping relationship table stores the correspondence between the unclonable identification number and multiple groups of challenge-response pairs, and a group of challenge-response pairs is a random number and its corresponding response. This technical means ensures that both the random number and the response are unique, greatly enhancing security and anti-attack capabilities.
[0053] Table 1 shows a mapping relationship table in an embodiment of the present disclosure, as follows:
[0054] Table 1 The cloud can generate multiple challenge-response pairs for a device by issuing a PUF challenge to it. PUF1 is the device's unclonable identification number (PUF ID), and each challenge is a random number. For example, the cloud randomly generates challenge C1 and sends it to the device. The device then uses an unclonable function to generate a response Res1 based on challenge C1. A mapping table is then used to store the unclonable identification number and multiple challenge-response pairs.
[0055] Table 2 shows an identification comparison table in an embodiment of the present disclosure, as follows:
[0056] Table 2 Device ID is a device identification number. Each device has a device identification number and an unclonable identification number.
[0057] S202: Based on the first response, encrypt the software upgrade package using a symmetric encryption algorithm to obtain a ciphertext of the software upgrade package.
[0058] The software upgrade package is the data required for device software upgrades. Using the first response as the secret key, a symmetric cryptographic algorithm is used to encrypt the software upgrade package to be sent to the device, resulting in a ciphertext version of the software upgrade package. This technical measure protects the software upgrade package from being read or tampered with by unauthorized parties during transmission.
[0059] In one embodiment, based on the first response, the software upgrade package is encrypted using a symmetric encryption algorithm. Before obtaining the ciphertext of the software upgrade package, the method also includes: using the current firmware, the first version number of the current firmware and the current timestamp to form the software upgrade package.
[0060] The current firmware refers to the new version of the firmware file contained in the software upgrade package, which is intended to replace the device's existing firmware. The first version number is an identifier specified within the decrypted software upgrade package, used to indicate the version information of the decrypted software upgrade package. The current timestamp is a timestamp within the software upgrade package that indicates the generation or approval time of the current firmware or software package and is used to verify the validity and timeliness of the software upgrade package. The software upgrade package can be generated by assembling the current firmware, the first version number of the current firmware, and the current timestamp in sequence.
[0061] In one embodiment, based on the first response, the software upgrade package is encrypted using a symmetric encryption algorithm. Before obtaining the ciphertext of the software upgrade package, the method also includes: using the plug-in corresponding to the current firmware, the first version number of the current firmware and the current timestamp to form the software upgrade package.
[0062] A plug-in is a new function or component that is assembled into the current firmware.
[0063] S203: Calculate a first hash operation message authentication code of the software upgrade package based on the second response.
[0064] The second response is used as the secret key to calculate the first hash operation message authentication code of the software upgrade package. This technical means provides the necessary verification basis for subsequent device-side integrity verification, ensuring that the software upgrade package has not been tampered with during transmission.
[0065] In one embodiment, based on the second response, a first hash operation message authentication code of the software upgrade package is calculated, including: performing an XOR operation on the second response and an internal fill value to obtain a first intermediate value; performing an XOR operation on the second response and an external fill value to obtain a second intermediate value; appending the software upgrade package to the first intermediate value to obtain first data, and calculating the hash value of the first data; appending the hash value of the first data to the second intermediate value to obtain second data, and calculating the hash value of the second data, and using the hash value of the second data as the first hash operation message authentication code.
[0066] The internal padding value and the external padding value are pre-set values. After the software upgrade package is concatenated with the first intermediate value, first data is obtained, and a hash value of the first data is calculated using a hash function. After the hash value of the first data is concatenated with the second intermediate value, second data is obtained, and a hash value of the second data is calculated using a hash function. The hash value of the second data is used as the first hash operation message authentication code.
[0067] In one embodiment, before performing an XOR operation on the second response and the internal padding value to obtain the first intermediate value, the method further includes: pre-processing the second response: if the length of the second response is shorter than the block size of the hash function (e.g., for SHA-256, the block size is 512 bits or 64 bytes), padding the second response with zeros until its length reaches the block size of the hash function. If the second response is longer than the block size of the hash function, first performing a hash operation on the second response, and then using the resulting hash value as a new second response.
[0068] S204: Send the first random number, the second random number, the ciphertext of the software upgrade package, and the first hash operation message authentication code to the device, so that the device performs software upgrade.
[0069] The first random number, the second random number, the ciphertext of the software upgrade package, and the first hash operation message authentication code are sent to the device, allowing the device to decrypt, verify, and ultimately complete the software upgrade according to the predetermined process. Through the above technical means, not only does it solve the quantum computing cracking risk that traditional OTA may face, but it also reduces the pressure on the device storage space caused by storing the entire software upgrade package, thereby improving the reliability and efficiency of the entire system.
[0070] In one embodiment, after calculating the first hash operation message authentication code of the software upgrade package based on the second response, the method also includes: initiating an upgrade request for software upgrade to the device; after receiving the upgrade response of the device agreeing to perform the software upgrade, sending the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code to the device.
[0071] If the device receives an upgrade response indicating that it does not agree to the software upgrade, the software upgrade will be abandoned. The above technical means can avoid unnecessary software upgrade operations.
[0072] An exemplary embodiment: In a smart city management system, to ensure that each sensor node (device) securely receives the latest firmware updates, the cloud uses the methods of the disclosed embodiments to generate and distribute software upgrade packages. For each sensor node, the cloud first determines a unique, unclonable identification number based on its device identification number, along with a corresponding random number and response. These parameters are then used to encrypt the firmware upgrade package and calculate a message authentication code. The resulting upgrade package is then sent to the sensor node, ensuring the security and reliability of the firmware update process while maintaining the efficient operation of the overall management system.
[0073] Figure 3 A flowchart of another software upgrade method according to an embodiment of the present disclosure is shown, which is applied to a device side, such as Figure 3 As shown, the following steps are included: S301, receiving a first random number, a second random number, a software upgrade package ciphertext and a first hash operation message authentication code sent by the cloud.
[0074] In one embodiment, according to the set communication protocol, the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code are first received and downloaded from the cloud.
[0075] S302: Calculate a first response corresponding to the first random number and a second response corresponding to the second random number using an unclonable function.
[0076] The unclonable function is the PUF function, which can also be called the PUF module.
[0077] In one embodiment, a first random number C1 is input as a challenge into the PUF module. This challenge can be transmitted to the PUF via digital signals, voltage changes, or optical signals. After receiving challenge C1, the PUF module generates a unique response Res1 (first response) based on its internal physical properties. The PUF response is typically of a fixed length (e.g., 64, 128, or 256 bits), depending on the PUF design. Because the PUF module is unique, its response is also unique once the random number is determined. These technical measures ensure that the response required for decryption and encryption is not leaked and cannot be calculated by other parties, thus ensuring the security of software upgrades.
[0078] S303: Based on the first response, decrypt the ciphertext of the software upgrade package using a symmetric encryption algorithm to obtain the software upgrade package.
[0079] The first response is used as the secret key and a symmetric encryption algorithm is used to decrypt the ciphertext of the software upgrade package to obtain the software upgrade package, which can avoid the risk of being copied and tampered with.
[0080] S304: Perform integrity verification on the decrypted software upgrade package based on the second response and the first hash operation message authentication code.
[0081] In one embodiment, an integrity check is performed on the decrypted software upgrade package based on the second response and the first hash operation message authentication code, including: calculating a second hash operation message authentication code based on the second response and the decrypted software upgrade package; when the first hash operation message authentication code and the second hash operation message authentication code are the same, the integrity check passes; otherwise, the integrity check fails.
[0082] In this embodiment, the second response is first used as a secret key to calculate a second hash message authentication code for the decrypted software upgrade package. This newly generated second hash message authentication code is then compared with the first hash message authentication code received from the cloud. If the two are identical, the software upgrade package has not been tampered with and the integrity check passes. Otherwise, the integrity check fails. This technical approach enhances the integrity and reliability of software upgrade package transmission.
[0083] In one embodiment, a second hash operation message authentication code is calculated based on the second response and the decrypted software upgrade package, including: performing an XOR operation on the second response and the internal filling value to obtain a first intermediate value; performing an XOR operation on the second response and the external filling value to obtain a second intermediate value; appending the decrypted software upgrade package to the first intermediate value to obtain third data, and calculating the hash value of the third data; appending the hash value of the third data to the second intermediate value to obtain fourth data, and calculating the hash value of the fourth data, and using the hash value of the fourth data as the second hash operation message authentication code.
[0084] The decrypted software upgrade package is concatenated with the first intermediate value to obtain third data, and a hash value of the third data is calculated using a hash function. The hash value of the third data is concatenated with the second intermediate value to obtain fourth data, and a hash value of the fourth data is calculated using a hash function. The hash value of the fourth data is used as the first hash operation message authentication code.
[0085] In one embodiment, before performing an XOR operation on the second response and the internal padding value to obtain the first intermediate value, the method further includes: pre-processing the second response: if the length of the second response is shorter than the block size of the hash function, padding the second response with zeros until its length reaches the block size of the hash function; if the second response is longer than the block size of the hash function, first performing a hash operation on the second response, and then using the resulting hash value as a new second response.
[0086] S305: After the integrity check passes, the software upgrade package obtained by decryption is used to perform software upgrade.
[0087] After the integrity check succeeds, the system will use the decrypted software upgrade package to perform the software upgrade. This technical approach addresses the risks of traditional OTA being hacked by quantum computing and occupying device storage space, enhancing the security of the software upgrade process and improving the confidentiality and integrity protection of the software upgrade package.
[0088] Figure 4 A flowchart of a software upgrade determination method according to an embodiment of the present disclosure is shown. The method is applied to the cloud. Figure 4 As shown, the following steps are included: S401, receiving a second version number reported by a device; S402, determining whether the device needs a software upgrade based on the second version number and the first version number of the current firmware, wherein the software upgrade package includes the current firmware and the first version number; S403: When it is determined that the device needs to perform a software upgrade, a first random number, a first response, a second random number, and a second response are determined according to the device identification number.
[0089] In this embodiment, first, the cloud needs to receive the second version number reported by the device. This is the version number of the firmware installed on the device, which is used to compare with the first version number of the current firmware that the cloud is ready to distribute. Next, based on the second version number and the first version number, it is determined whether the device needs a software upgrade. This technical means is to confirm whether the existing firmware version on the device is lower than the current firmware provided by the cloud, that is, to check whether the device really needs a software update to avoid unnecessary software upgrade operations. In the case where it is determined that the device does need a software upgrade, the first random number, the first response, the second random number and the second response are determined based on the device identification number. This technical means ensures that unique security parameters are generated for a specific device to enhance the security of the entire software upgrade process. Through the above technical means, the accuracy of software upgrade decisions is enhanced, the targetedness of the software upgrade process is improved, and the efficiency of system resource utilization is improved.
[0090] For example, in a smart home network environment, a smart thermostat periodically reports its installed firmware version number (i.e., the second version number) to the cloud. The cloud compares this version number with the latest available firmware version number (i.e., the first version number). If the smart thermostat is found to be using an earlier firmware version, the first random number, first response, second random number, and second response are determined based on the device identification number. This ensures that smart home devices receive the latest functional improvements and security patches promptly while also avoiding repeated or unnecessary push of the same updates to devices that don't need them, effectively conserving network bandwidth and device storage resources.
[0091] In one embodiment, when the device reports the second version number, it also uploads the functional description of the firmware version number installed on the device, compares the functional description of the firmware version number installed on the device with the functional description of the current firmware, determines the new functions added to the current firmware compared to the firmware version number installed on the device, determines the component in the current firmware that implements the new functions, generates a plug-in corresponding to the component, and uses the plug-in, the first version number of the current firmware, and the current timestamp to form a software upgrade package. The above technical means enable flexible device upgrades.
[0092] The functional description describes the functions of the firmware. For example, if the current firmware adds error detection and reporting compared to the firmware version installed on the device, the component that implements the error detection and reporting function is identified in the current firmware, and a corresponding plug-in is generated for this component. Generating a plug-in for this component actually separates it from the current firmware. The main method is to define a common plug-in interface for the component. Then, after the plug-in is installed on the device, the installed firmware version number calls the plug-in based on the plug-in interface.
[0093] Figure 5A flowchart of a software upgrade package verification method according to an embodiment of the present disclosure is shown. The method is applied to a device side, such as Figure 5 As shown, the following steps are included: S501, parse the decrypted software upgrade package to obtain the current firmware, the first version number, and the current timestamp; S502, performing version number verification based on the first version number and timestamp verification based on the current timestamp; S503: If both verifications are passed, perform software upgrade using the current firmware.
[0094] In the embodiment of the present disclosure, when performing a software upgrade using the decrypted software upgrade package, the current firmware, the first version number, and the current timestamp are first parsed from the decrypted software upgrade package. Then, the first version number is compared with the second version number of the firmware currently installed on the device to ensure that the new firmware version to be installed is indeed newer than the existing version. At the same time, a timestamp check is performed based on the current timestamp to confirm that the software upgrade package is the latest and has not expired. If both checks pass, the system will use the parsed current firmware to perform the software upgrade operation. Through the above technical means, it is guaranteed that the user device can obtain the latest functions and security patches in a timely manner, while also avoiding problems caused by wrong versions or outdated upgrade packages, thereby improving the security of the device and user experience.
[0095] In one embodiment of the present disclosure, before receiving the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code sent by the cloud, the method further includes: registering the device identification number and the unclonable identification number to the cloud.
[0096] The device registers the device identification number and the unclonable identification number to the cloud. The cloud can then determine the unclonable identification number based on the device identification number, and then select a first random number and its corresponding first response and a second random number and its corresponding second response, encrypt the software upgrade package according to the first response, and calculate the first hash operation message authentication code of the encrypted software upgrade package according to the second response.
[0097] In one embodiment of the present disclosure, before receiving the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code sent by the cloud, the method also includes: receiving an upgrade request for software upgrade sent by the cloud; and feeding back an upgrade response to the cloud agreeing to perform the software upgrade.
[0098] The upgrade request carries the first version number of the current firmware, compares the first version number with the second version number of the firmware currently installed on the device, and if it is determined that the first version number is newer than the second version number, an upgrade response is fed back to the cloud indicating that the software upgrade is agreed to. Otherwise, an upgrade response is fed back to the cloud indicating that the software upgrade is not agreed to.
[0099] This technology avoids invalid transmissions. If a device cannot upgrade for some reason (e.g., the current version is already the latest, the device is busy, or network conditions are poor), it can send a rejection response to prevent the cloud from transmitting unnecessary data (such as random numbers and ciphertext), thereby saving communication bandwidth and computing resources. It also optimizes resource allocation. The cloud can dynamically adjust the upgrade strategy based on the device's response, for example, prioritizing devices that agree to upgrade and delaying or canceling upgrades for other devices.
[0100] In some embodiments, the plug-in, the first version number and the current timestamp are parsed from the decrypted software upgrade package; the version number is verified based on the first version number, and the timestamp is verified based on the current timestamp; if both verifications pass, the software is upgraded using the plug-in.
[0101] The above technical means are used to verify version compatibility: by first checking the version number, confirm whether the target version of the upgrade package is compatible with the current device version, avoiding upgrade failure or abnormality caused by version mismatch; and perform timeliness verification: by checking the current timestamp, ensure that the upgrade package is generated within a reasonable time range, avoid using overly outdated or invalid upgrade packages, and further reduce the risk of upgrade failure.
[0102] For example, compare the device's current version number, 1.0.0, with the first version number, 1.1.0, in the software upgrade package. Since 1.1.0 is higher than 1.0.0, the version number verification passes. Timestamp verification: Assuming the current time is 1700050000 (corresponding to January 2, 2023), check whether the timestamp is within a reasonable range (for example, the maximum allowed time difference is 7 days). Since the time difference is less than 7 days, the timestamp verification passes. Execute the upgrade: If both verifications pass, load and execute the plugin in the upgrade package, completing the software upgrade to version 1.1.0.
[0103] Based on the same inventive concept, the present disclosure also provides a software upgrade device, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0104] Figure 6 A schematic diagram of a software upgrade device according to an embodiment of the present disclosure is shown, which is applied to a device side, such as Figure 6 As shown, the software upgrading device may include: The receiving module 601 is configured to receive a first random number, a second random number, a ciphertext of a software upgrade package, and a first hash operation message authentication code sent by the cloud; A first calculation module 602 is configured to calculate a first response corresponding to the first random number and a second response corresponding to the second random number using an unclonable function; The decryption module 603 is configured to decrypt the ciphertext of the software upgrade package using a symmetric encryption algorithm based on the first response to obtain the software upgrade package; A verification module 604 is configured to perform an integrity check on the decrypted software upgrade package based on the second response and the first hash operation message authentication code; The upgrade module 605 is configured to perform software upgrade using the decrypted software upgrade package after the integrity check passes.
[0105] According to the technical solution provided by the embodiment of the present disclosure, a first random number, a second random number, a software upgrade package ciphertext and a first hash operation message authentication code sent by the cloud are received; a first response corresponding to the first random number and a second response corresponding to the second random number are calculated using an unclonable function; based on the first response, the software upgrade package ciphertext is decrypted using a symmetric encryption algorithm to obtain a software upgrade package; an integrity check is performed on the decrypted software upgrade package based on the second response and the first hash operation message authentication code; after the integrity check passes, the software upgrade is performed using the decrypted software upgrade package. Through the above technical means, the problems of the risk of traditional OTA being cracked by quantum computing and occupying device storage space in the existing technology are solved, thereby improving the security of OTA and avoiding occupying device storage space.
[0106] In some embodiments, the verification module 604 is also configured to calculate a second hash operation message authentication code based on the second response and the decrypted software upgrade package; when the first hash operation message authentication code and the second hash operation message authentication code are the same, the integrity check passes; otherwise, the integrity check fails.
[0107] In some embodiments, the upgrade module 605 is also configured to parse the current firmware, the first version number and the current timestamp from the decrypted software upgrade package; perform version number verification based on the first version number, and perform timestamp verification based on the current timestamp; if both verifications pass, use the current firmware to perform software upgrade.
[0108] In some embodiments, the receiving module 601 is further configured to register the device identification number and the unclonable identification number in the cloud.
[0109] In some embodiments, the receiving module 601 is further configured to receive an upgrade request for performing a software upgrade sent by the cloud; and feed back an upgrade response to the cloud indicating that the software upgrade is agreed to be performed.
[0110] In some embodiments, the receiving module 601 is further configured to first receive and download the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code from the cloud according to the set communication protocol.
[0111] In some embodiments, the first computing module 602 is further configured to input the first random number C1 as a challenge into the PUF module, and the challenge may be transmitted to the PUF via a digital signal, a voltage change, or an optical signal; after receiving the challenge C1, the PUF module generates a unique response Res1 based on its internal physical properties.
[0112] In some embodiments, the verification module 604 is further configured to perform an XOR operation on the second response and the internal fill value to obtain a first intermediate value; perform an XOR operation on the second response and the external fill value to obtain a second intermediate value; append the decrypted software upgrade package to the first intermediate value to obtain third data, and calculate the hash value of the third data; append the hash value of the third data to the second intermediate value to obtain fourth data, calculate the hash value of the fourth data, and use the hash value of the fourth data as the second hash operation message authentication code.
[0113] In some embodiments, the verification module 604 is further configured to pre-process the second response: if the length of the second response is shorter than the block size of the hash function, the second response is padded with zeros until its length reaches the block size of the hash function. If the second response is longer than the block size of the hash function, a hash operation is first performed on the second response, and the resulting hash value is used as a new second response.
[0114] Figure 7 A schematic diagram of another software upgrade device according to an embodiment of the present disclosure is shown, which is applied to the cloud. Figure 7 As shown, the software upgrading device may include: A determination module 701 is configured to determine an unclonable identification number of the device according to the device identification number of the device, and determine a first random number and a corresponding first response and a second random number and a corresponding second response based on the unclonable identification number; The encryption module 702 is configured to encrypt the software upgrade package using a symmetric encryption algorithm based on the first response to obtain a ciphertext of the software upgrade package; A second calculation module 703 is configured to calculate a first hash operation message authentication code of the software upgrade package based on the second response; The sending module 704 is configured to send the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code to the device, so that the device performs software upgrade.
[0115] In an embodiment of the present disclosure, an unclonable identification number of a device is determined based on the device identification number of the device, and a first random number and its corresponding first response and a second random number and its corresponding second response are determined based on the unclonable identification number; based on the first response, a software upgrade package is encrypted using a symmetric cryptographic algorithm to obtain a ciphertext of the software upgrade package; based on the second response, a first hash operation message authentication code of the software upgrade package is calculated; and the first random number, the second random number, the ciphertext of the software upgrade package, and the first hash operation message authentication code are sent to the device, allowing the device to perform a software upgrade. Through the above technical means, the problems of traditional OTA in the prior art, such as the risk of being cracked by quantum computing and occupying device storage space, are solved, thereby improving the security of OTA and avoiding occupying device storage space.
[0116] In some embodiments, the encryption module 702 is further configured to receive a second version number reported by the device; determine whether the device needs a software upgrade based on the second version number and the first version number of the current firmware, wherein the software upgrade package includes the current firmware and the first version number; and if it is determined that the device needs a software upgrade, determine the first random number, the first response, the second random number, and the second response based on the device identification number.
[0117] In some embodiments, the encryption module 702 is further configured to compose a software upgrade package using the current firmware, the first version number of the current firmware, and the current timestamp.
[0118] In some embodiments, the sending module 704 is also configured to initiate an upgrade request for software upgrade to the device; after receiving an upgrade response from the device agreeing to perform the software upgrade, the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code are sent to the device.
[0119] In some embodiments, the second calculation module 703 is further configured to perform an XOR operation on the second response and the internal fill value to obtain a first intermediate value; perform an XOR operation on the second response and the external fill value to obtain a second intermediate value; append the software upgrade package to the first intermediate value to obtain the first data, and calculate the hash value of the first data; append the hash value of the first data to the second intermediate value to obtain the second data, and calculate the hash value of the second data, and use the hash value of the second data as the first hash operation message authentication code.
[0120] In some embodiments, the second calculation module 703 is further configured to pre-process the second response: if the length of the second response is shorter than the block size of the hash function, the second response is padded with zeros until its length reaches the block size of the hash function. If the second response is longer than the block size of the hash function, a hash operation is first performed on the second response, and the resulting hash value is then used as a new second response.
[0121] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as "circuits," "modules," or "systems."
[0122] Refer to the following Figure 8 800 according to this embodiment of the present disclosure will be described. Figure 8 The electronic device 800 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0123] like Figure 8 As shown, electronic device 800 is implemented as a general-purpose computing device. Components of electronic device 800 may include, but are not limited to, the aforementioned at least one processing unit 810, the aforementioned at least one storage unit 820, and a bus 830 connecting various system components (including storage unit 820 and processing unit 810).
[0124] The storage unit stores program code, and the program code can be executed by the processing unit 810, so that the processing unit 810 performs the steps described in the "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 810 can perform the following steps of the above-mentioned method embodiment: receiving a first random number, a second random number, a software upgrade package ciphertext, and a first hash operation message authentication code sent by the cloud; using an unclonable function to calculate a first response corresponding to the first random number and a second response corresponding to the second random number; based on the first response, using a symmetric encryption algorithm to decrypt the software upgrade package ciphertext to obtain a software upgrade package; based on the second response and the first hash operation message authentication code, performing an integrity check on the decrypted software upgrade package; after the integrity check passes, using the decrypted software upgrade package to perform a software upgrade.
[0125] The processing unit 810 can also perform the following steps of the above-mentioned method embodiment: determine the unclonable identification number of the device according to the device identification number of the device, and determine the first random number and its corresponding first response and the second random number and its corresponding second response based on the unclonable identification number; based on the first response, encrypt the software upgrade package using a symmetric encryption algorithm to obtain the software upgrade package ciphertext; based on the second response, calculate the first hash operation message authentication code of the software upgrade package; send the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code to the device, so that the device performs software upgrade.
[0126] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0127] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0128] Bus 830 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0129] The electronic device 800 may also communicate with one or more external devices 840 (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 800, and / or any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., a router, modem, etc.). This communication may occur via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0130] Through the description of the above embodiments, it will be readily understood by those skilled in the art that the example embodiments described herein can be implemented via software or via a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or mobile hard drive) or on a network and includes several instructions for enabling a computing device (such as a personal computer, server, terminal device, or network device) to execute the methods according to the embodiments of the present disclosure.
[0131] In the disclosed exemplary embodiments, a computer-readable storage medium is also provided. The computer-readable storage medium may be a readable signal medium or a readable storage medium.
[0132] In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present disclosure described in the above "Specific Implementation Methods" section of this specification.
[0133] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0134] In the present disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0135] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0136] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0137] The present disclosure provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the software upgrade method provided in any of the various optional embodiments of the present disclosure.
[0138] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0139] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0140] Through the description of the above embodiments, it will be readily understood by those skilled in the art that the example embodiments described herein can be implemented via software or via a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or mobile hard drive) or on a network and includes several instructions for enabling a computing device (such as a personal computer, server, mobile terminal, or network device) to execute the methods according to the embodiments of the present disclosure.
[0141] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope of the present disclosure being indicated by the appended claims.
Claims
1. A software upgrade method, applied to a device, characterized in that: include: Receive a first random number, a second random number, a software upgrade package ciphertext, and a first hash operation message authentication code sent by the cloud; Calculating a first response corresponding to the first random number and a second response corresponding to the second random number using an unclonable function; Based on the first response, decrypt the ciphertext of the software upgrade package using a symmetric encryption algorithm to obtain a software upgrade package; performing an integrity check on the decrypted software upgrade package based on the second response and the first hash operation message authentication code; After the integrity check passes, the software upgrade package obtained by decryption is used to perform software upgrade.
2. The method according to claim 1, characterized in that Performing an integrity check on the decrypted software upgrade package based on the second response and the first hash operation message authentication code, including: Calculating a second hash operation message authentication code based on the second response and the decrypted software upgrade package; When the first hash operation message authentication code and the second hash operation message authentication code are the same, the integrity check passes; Otherwise, the integrity check fails.
3. The method according to claim 1, characterized in that Use the decrypted software upgrade package to perform software upgrades, including: Parse the current firmware, the first version number, and the current timestamp from the decrypted software upgrade package; Perform version number verification based on the first version number, and perform timestamp verification based on the current timestamp; If both checks are passed, the software is upgraded using the current firmware.
4. The method according to claim 1, wherein Before receiving the first random number, the second random number, the software upgrade package ciphertext, and the first hash operation message authentication code sent by the cloud, the method further includes: Registering the device identification number and the unclonable identification number in the cloud.
5. The method according to claim 1, wherein Before receiving the first random number, the second random number, the software upgrade package ciphertext, and the first hash operation message authentication code sent by the cloud, the method further includes: receiving an upgrade request for performing the software upgrade sent by the cloud; Feedback an upgrade response to the cloud indicating approval for the software upgrade.
6. A software upgrade method, applied to the cloud, characterized in that: include: determining an unclonable identification number of the device according to the device identification number of the device, and determining a first random number and a corresponding first response and a second random number and a corresponding second response based on the unclonable identification number; Based on the first response, encrypt the software upgrade package using a symmetric encryption algorithm to obtain a ciphertext of the software upgrade package; Calculating a first hash operation message authentication code of the software upgrade package based on the second response; The first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code are sent to the device, so that the device performs software upgrade.
7. The method according to claim 6, characterized in that Based on the first response, before encrypting the software upgrade package using a symmetric encryption algorithm to obtain a ciphertext of the software upgrade package, the method further includes: Receiving a second version number reported by the device; determining whether the device needs to perform the software upgrade based on the second version number and a first version number of the current firmware, wherein the software upgrade package includes the current firmware and the first version number; When it is determined that the device needs to perform the software upgrade, the first random number, the first response, the second random number, and the second response are determined according to the device identification number.
8. The method according to claim 6, characterized in that Based on the first response, before encrypting the software upgrade package using a symmetric encryption algorithm to obtain a ciphertext of the software upgrade package, the method further includes: The software upgrade package is composed of the current firmware, the first version number of the current firmware, and the current timestamp.
9. The method according to claim 6, characterized in that After calculating a first hash operation message authentication code of the software upgrade package based on the second response, the method further includes: Initiating an upgrade request for performing the software upgrade on the device; After receiving an upgrade response from the device indicating that the device agrees to perform the software upgrade, the first random number, the second random number, the software upgrade package ciphertext, and the first hash operation message authentication code are sent to the device.
10. A software upgrade device, applied to a device, characterized in that: include: A receiving module is configured to receive a first random number, a second random number, a ciphertext of a software upgrade package, and a first hash operation message authentication code sent by the cloud; a first calculation module, configured to calculate a first response corresponding to the first random number and a second response corresponding to the second random number using an unclonable function; a decryption module configured to decrypt the ciphertext of the software upgrade package using a symmetric encryption algorithm based on the first response to obtain the software upgrade package; a verification module configured to perform an integrity check on the decrypted software upgrade package based on the second response and the first hash operation message authentication code; The upgrade module is configured to perform software upgrade using the decrypted software upgrade package after the integrity check passes.
11. A software upgrade device, applied to the cloud, characterized in that: include: a determination module configured to determine an unclonable identification number of the device according to the device identification number of the device, and determine a first random number and a first response corresponding thereto and a second random number and a second response corresponding thereto based on the unclonable identification number; an encryption module configured to encrypt the software upgrade package using a symmetric encryption algorithm based on the first response to obtain a ciphertext of the software upgrade package; a second calculation module, configured to calculate a first hash operation message authentication code of the software upgrade package based on the second response; The sending module is configured to send the first random number, the second random number, the software upgrade package ciphertext and the first hash operation message authentication code to the device, so that the device performs software upgrade.
12. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to perform the method of any one of claims 1-5 or 6-9 by executing the executable instructions.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 or 6 to 9 is implemented.
14. A computer program product, comprising computer instructions, wherein the computer instructions are stored in a computer-readable storage medium, and when the computer instructions are executed by a processor, the operating instructions of the method according to any one of claims 1 to 5 or 6 to 9 are implemented.
Citation Information
Patent Citations
PUF (Physical Unclonable Function)-based equipment authentication method and device, computer equipment and storage medium
CN113872769A
File encryption method, file decryption method, file encryption device, file decryption device and equipment
CN115795513A
Vehicle software upgrading method, system and equipment and computer readable storage medium
CN118672626A
Secure OTA upgrading method and system based on quantum random number
CN119814299A
Lightweight unmanned aerial vehicle identity authentication method based on PUF
CN120017281A