A method for identifying illegal replacement of a single-chip microcomputer in a PUF chain recognition system
By establishing a PUF chain between microcontrollers, generating auxiliary data and public and private keys, and registering them with the main processor, and re-authenticating after disconnection, the problem of identifying and preventing unauthorized replacement of chips or memory in the system is solved, thus achieving the security and identification accuracy of the PUF chain.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING PAFU INFORMATION TECH CO LTD
- Filing Date
- 2022-08-24
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies cannot effectively identify and prevent the illegal replacement of chips or memory in a system. Traditional MAC addresses are easily forged by attackers and lack naturally unique and unclonable physical characteristics as a basis for identification.
By establishing a PUF chain, microcontroller A and microcontroller B establish a PUF chain, generate auxiliary data, public key and private key, and register with the approval of the main processor. After disconnection, the PUF chain is re-authenticated, and the PUF value and topology are used to identify whether it has been replaced.
It effectively prevents the microcontroller or dynamic memory in the system from being illegally replaced, ensuring the security and identification accuracy of the PUF chain. It identifies whether the microcontroller and RAM in the system have been illegally replaced through the PUF chain topology.
Smart Images

Figure CN116418512B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of PUF and encoding / decoding encryption technology, and more specifically to a method for identifying the illegal replacement of a microcontroller in a system by establishing a PUF chain. Background Technology
[0002] Electronic systems consist of chips and connected electronic components. Traditional chips lack unique, uncopyable, and unclonable physical characteristics for identification. The so-called physical address, or MAC address, is actually assigned by the manufacturer and is not strongly correlated with the unique characteristics of each chip, making it easy for hackers to steal.
[0003] In recent years, due to the increasing security demands of the Internet of Things (IoT), PUF (Physical Unclonable Function) technology, which is strongly correlated with the unique physical characteristics of each chip, has been widely applied. PUF refers to physical characteristics generated during the chip manufacturing process. It primarily reflects changes in physical properties caused by deviations in the chip's microstructure during manufacturing. These factors are unpredictable and uncontrollable, making it impossible for hackers to copy or clone the chip's PUF characteristics. Because PUF is a naturally occurring physical characteristic during chip manufacturing, resulting from subtle variations in process parameters, it can be viewed as a chip fingerprint, serving as a basis for chip identification.
[0004] RAM PUF refers to the PUF characteristics of RAM (Random Access Memory), which reflects the bit distribution of the chip's initial state upon power-up. The initial state means that after power-up, due to random differences in the threshold voltage, each bit cell in the RAM has its own initial state before any data is written. This initial state of each bit is reflected across the entire RAM chip; the distribution of "0" and "1" bits is random. Each RAM memory has a specific and unique bit distribution, which serves as the basis for identifying the chip. This random distribution can be used as an encryption method for data encryption and identity verification.
[0005] Because traditional chips lack inherently unique and unclonable physical characteristics for identification, if electronic components in existing electronic systems are illegally replaced—for example, after the system is powered off—if an attacker replaces an electronic component and reconnects it to the same interface, and the component exhibits the same electrical performance upon power-up, traditional systems lack effective means to identify whether the electronic component has been replaced.
[0006] Even using MAC addresses as the basis for identifying whether a chip has been replaced has its problems. MAC addresses are actually manually assigned and are not strongly correlated with the chip itself, making them easy for attackers to steal. Attackers can forge MAC addresses. More often than not, underlying chips do not perform mutual MAC address authentication.
[0007] How to effectively identify and prevent the unauthorized replacement of chips or memory in a system is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0008] The purpose of this invention is to provide a method for identifying the illegal replacement of a microcontroller in a system by establishing a PUF chain, which can solve and effectively identify and prevent the illegal replacement of chips or memory in the system.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0010] This invention provides a method for identifying unauthorized replacement of a microcontroller in a system by establishing a PUF chain, comprising:
[0011] A preliminary PUF chain between microcontroller A and microcontroller B is established;
[0012] Microcontroller A or microcontroller B reports the PUF chain to the system's main processor for registration. Once the main processor approves the registration, the PUF chain is officially established.
[0013] The main processor records all PUF chains in the system, draws and stores the PUF chain topology of the entire system; wherein, the microcontroller and dynamic memory are nodes; and the main processor is the master node;
[0014] After the system is powered off or the connection is lost, microcontroller A and microcontroller B re-authenticate the PUF chain; once the authentication is successful, the PUF chain connection is restored.
[0015] Furthermore, a preliminary PUF chain is established between microcontroller A and microcontroller B, including:
[0016] In the system, microcontroller A and microcontroller B have a communication connection. Microcontroller A reads the PUF value of its RAM and generates auxiliary data A, private key A and public key A. It then sends auxiliary data A and public key A to microcontroller B for storage. Private key A is deleted after use.
[0017] Microcontroller B reads the PUF value in its RAM, generates auxiliary data B, private key B, and public key B. Private key B is deleted after use, and auxiliary data B and public key B are sent to microcontroller A for storage.
[0018] Furthermore, after the system is powered off or the connection is broken, microcontroller A and microcontroller B re-authenticate the PUF chain, including:
[0019] After the system is powered off or the connection is disconnected, microcontroller A reads the PUF value of microcontroller B and combines it with auxiliary data B to generate a private key B', which is then matched and authenticated with the public key B previously generated by microcontroller B.
[0020] Microcontroller B generates a private key A' based on the PUF value of microcontroller A and auxiliary data A, and performs authentication by matching it with the public key A previously generated by microcontroller A.
[0021] Furthermore, it also includes:
[0022] If microcontroller A needs to go through microcontroller B before connecting to the main processor, then microcontroller B needs to report the PUF chain to the main processor of the system for registration.
[0023] Furthermore, it also includes:
[0024] However, if authentication fails, it is determined that the microcontroller connected to the other party has been replaced, and the PUF chain establishment has failed; communication between microcontrollers A and B is prohibited, and the processor is reported that the PUF chain establishment has failed.
[0025] Furthermore, the matching and authentication process includes:
[0026] When using the ECDSA signature algorithm, the system calculates whether the public key is the elliptic curve dot product of the private key and the base point; if so, the electronic signature authentication is successful, and the private key matches the public key.
[0027] Furthermore, it also includes:
[0028] The main processor performs a full system-wide PUF chain test.
[0029] The locations of all PUF links, microcontrollers, and RAM nodes were tested and compared with the storage PUF chain topology.
[0030] If the position or number of nodes is changed in the comparison results, it is determined that the microcontroller and / or dynamic memory in the system has been illegally replaced.
[0031] Further, read the RAM PUF value, including:
[0032] The RAM PUF values are read and grouped. The stable bytes within each group are counted, and the group with the most stable bytes is the most stable group.
[0033] The bit values of the most stable group are determined as the PUF values of the RAM.
[0034] Furthermore, auxiliary data, private keys, and public keys are generated, including:
[0035] A private key is generated based on the PUF value from RAM, a public key is generated based on the encryption algorithm, and the PUF value is encoded using an error correction code to form auxiliary data.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] This invention provides a method for identifying unauthorized replacement of microcontrollers in a system by establishing a PUF chain. The method establishes a PUF chain between microcontrollers in the system. The addition of a link requires the approval of the main processor. If the link is broken, it needs to be re-authenticated. Only after successful authentication can the connection between the two microcontrollers be restored and communication be allowed, thereby effectively preventing the unauthorized replacement of microcontrollers or dynamic memory in the system.
[0038] Specifically:
[0039] 1. It pioneered the concept of PUF chain, which establishes a new logical connection between microcontrollers with existing communication connections based on PUF values.
[0040] The method for establishing a PUF chain involves microcontrollers exchanging private keys, public keys, and auxiliary data generated based on PUF values. This requires two parts:
[0041] Microcontroller A reads the PUF value in its RAM, generates auxiliary data A, private key A, and public key A based on the PUF value, and sends auxiliary data A and public key A to microcontroller B for storage. Private key A is deleted after use.
[0042] Microcontroller B reads the PUF value of its dynamic memory, generates auxiliary data A, private key A, and public key A based on the PUF value, and sends auxiliary data A and public key A to microcontroller A for storage. Private key B is deleted after use.
[0043] 2. An approval mechanism for PUF chains was invented. The first PUF chain needs to be registered with the main processor of the system and approved by the main processor.
[0044] A PUF chain-based topology was invented. The main processor records the position of the corresponding PUF chain in the system, records all established PUF chains, draws the PUF chain topology of the entire system with the microcontroller and RAM as nodes and the PUF chains as connections, and stores the topology, where the main processor is the master node and the microcontroller or RAM is the node.
[0045] 3. By establishing a PUF chain, a method for identifying illegal replacement of the microcontroller and RAM in the system was invented.
[0046] After a link is broken, the PUF chain needs to be re-established. There are two situations where the PUF chain is broken:
[0047] The system is powered off and the communication connection is lost.
[0048] If the PUF chain is disconnected, re-authentication is required. Only after successful authentication can the PUF chain connection between the two nodes be restored.
[0049] Assume microcontroller A is the disconnected party requiring authentication. The authentication process involves microcontroller B reading microcontroller A's current PUF value and combining it with the original auxiliary data A to generate a private key A'. If private key A' matches the original public key A, it means the PUF value is the original microcontroller's PUF value, and microcontroller A and its corresponding memory have not been replaced. Authentication is successful, and the PUF connection is restored. Otherwise, if the PUF value is not the original, it can be determined that microcontroller A has been replaced, and microcontroller B reports this situation to the main processor.
[0050] 4. It pioneered the concept of PUF chain topology, using PUF chain topology to dually identify whether the microcontroller and RAM in the system have been illegally replaced.
[0051] The main processor records all established PUF chains in the system, draws and stores the PUF chain topology of the entire system, with the main processor as the master node and the microcontroller and RAM as nodes. The main processor can comprehensively test the communication connections of the PUF chains, test the communication connections of all PUF links, and determine the node positions of the microcontroller and RAM. This information is then compared with the stored PUF chain topology, providing another means of identifying whether the microcontroller and dynamic memory in the system have been illegally replaced.
[0052] The so-called test involves the main processor sending a signal to a processor, and the processor responding accordingly. This indicates that the communication connection between the main processor and the processor is normal, and thus the PUF chain has a communication connection. The main processor sends an instruction to a processor A, requesting processor A to send a signal to processor B, and processor B responding accordingly. This indicates that the communication connection between processor A and processor B is normal, and thus the PUF chain has a normal communication connection.
[0053] 5. This method innovatively establishes a robust mechanism for detecting unauthorized chip replacement based on the PUF (Programmable Array Function). The PUF value is hashed to generate a private key, which is not stored and is deleted after use. An attacker's only point of attack is to clone the PUF; however, the PUF is inherently uncopyable and unclonable, fundamentally guaranteeing the security of this identification method.
[0054] 6. The difference between a PUF chain and a traditional communication connection is that a PUF chain in normal working condition is always a communication connection in normal working condition; however, conversely, a communication connection in normal working condition is not necessarily a normal PUF chain, because the connected party may not be the original microcontroller or dynamic memory.
[0055] PUF chains can effectively identify and prevent unauthorized replacement of chips or memory in a system. In traditional communication connections, if an attacker replaces a microcontroller or dynamic memory, as long as the chip or memory exhibits the same electrical performance on the interface, traditional communication connections do not have an effective means to identify whether the chip or memory has been replaced. Attached Figure Description
[0056] Figure 1 This is a schematic diagram of a typical electronic system structure;
[0057] Figure 2 A schematic diagram of the circuit structure of a six-transistor memory cell;
[0058] Figure 3 This is a schematic diagram illustrating the process of generating auxiliary data.
[0059] Figure 4 A schematic diagram of establishing a PUF chain in the structure of an electronic system;
[0060] Figure 5 A schematic diagram of the PUF chain topology stored in the structure of an electronic system;
[0061] Figure 6 A diagram illustrating the process of restoring the original private key. Detailed Implementation
[0062] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0063] In the description of this invention, it should be noted that the terms "upper," "lower," "inner," "outer," "front end," "rear end," "both ends," "one end," and "the other end," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0064] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0065] This invention provides a method for identifying unauthorized replacement of a microcontroller in a system by establishing a PUF chain, applicable to a typical electronic system. This typical electronic system includes, in terms of hardware, a main processor, power supply, static memory, dynamic memory, microcontroller, sensors, and a clock, such as... Figure 1 As shown, the memory can be built into the microcontroller or external to the microcontroller.
[0066] In practical implementation, one method for identifying unauthorized replacement of microcontrollers in a system by establishing a PUF chain is to integrate the PUF chain into the microcontroller program through embedded software, IP-based cores, or hard cores. By establishing the PUF chain, it can identify whether chips and memory in the system have been illegally replaced. The function of the PUF chain is to allow microcontrollers to mutually verify changes in each other's PUF values, thereby confirming the legitimacy of the connection between microcontrollers. If the change in the PUF value of the other microcontroller exceeds the acceptable range, making it impossible to recover the original PUF value, then it is determined that the microcontroller has been replaced.
[0067] Specifically, the method includes the following steps:
[0068] S1. Microcontroller A reads the PUF value from its dynamic memory, generates auxiliary data A, private key A, and public key A based on the PUF value, and sends auxiliary data A and public key A to microcontroller B for storage. Private key A is deleted after use.
[0069] S1.1. Microcontroller A reads the PUF value of its dynamic memory. Taking SRAM as an example, SRAM can be built into the microcontroller or external. To obtain the PUF value of the SRAM, it is first necessary to distinguish between stable and unstable bits in the SRAM PUF value.
[0070] A typical SRAM bit consists of a six-transistor storage cell, such as Figure 2 As shown, the drawback of SRAM PUF value is that it is very sensitive and affected by environmental factors such as operating voltage, temperature, and aging. Due to these subtle influences, the original state of the same SRAM is different each time it is powered on, which means that the SRAM PUF value is different each time it is powered on.
[0071] However, SRAM six-transistor memory cells exhibit "skewness." Skewness means that the same bit value is likely to appear multiple times after power-on. Neutral skew means that the probability of a bit value being 0 or 1 is similar across multiple power-on cycles. This is because subtle differences in the manufacturing process can affect the original state of each bit (memory cell) in the SRAM. Although these differences are minute, they are still objectively present. Therefore, bits with a clear skew of 0 or 1 are defined as stable bits, while bits with neutral skew are unstable bits.
[0072] In order to distinguish between stable and unstable bits, the SRAM PUF read program reads the value of each bit of the SRAM after power-on and its corresponding address, records and stores it. The value and address of each bit of the SRAM are recorded, forming the bit distribution of the original state of the SRAM.
[0073] After the SRAM is powered off and then powered on again, the SRAM PUF read program reads the bit distribution of the SRAM in its original state using the same method as above. The value and address of each bit in the SRAM are recorded and stored. For each identical address, the SRAMPUF read program compares the value bit by bit with the bit distribution stored after multiple power-ups.
[0074] To simplify, let's take the second power-on as an example: The SRAM PUF read program reads the bit distribution of 128K bytes of SRAM, with an address range of 00001 to 1F400. We will take the address range of 00001-00080 as an example.
[0075] Upon first power-on, 128 bytes of data in the address range of 00001-00080 are read, as follows:
[0076] 38 F0 50 F3 28 A9 D9 0F ED A5 37 45 AE 55 B5 D7 D1 7A 07 92 B8 6E 82 B3 FA 32 B0 77 B6 63 31 ED D8 1A D7 B8 98 3E 57 25 A0 AB FE E1 42 30 47 20 A8A8 32 14 8C D4 B6 53 E1 D2 9B 90 A4 0A B2 twenty one FC AB A2 1F 5D F1 E2 96 BB 44 F18A C9 64 EB 52 78 0A 2AD4 76 9A CD 24 47 63 C5 AA F4 0A EC A6 BC E3 38 12 D42B 71 B4 53 BE 78 84 DA 2E B0 54 96 3F A2 95 2A 3E FA 66 93 B5 A8 15 4A 64 9C6F
[0077] Read 128 bytes from the same address range after the second power-on.
[0078] 38 F0 50 F3 28 A9 D9 1F AD A5 37 45 AE 55 B5 D7 D1 7A 07 8A B8 6E 83 B3 FA 33 F0 77 B6 61 31 ED 50 1A D7 B8 18 3A 5F A5 A0 8B 76 E1 42 30 C5 24 A8A8 BA 34 8C D4 16 D1 E1 DA DB 90 A4 0A 90 twenty one 74 AA A2 1F 5D 91 E2 16 BA 44 F18A C9 64 EB 72 68 0A 1A D4 76 9A CD 24 47 63 C5 AA D4 0A EC A6 BC E3 2930 D42B 51 B4 53 3E 70 94 CB 2E B0 54 96 3E A2 84 EA 3E EA 67 93 B5 AC 1D 4B 24 9C6F FF
[0079] For each identical address, the SRAM PUF read program compares the bit distribution stored after the second power-on with its values bit by bit. For the same address, the bit values are the same after both power-ons; these are stable bits, marked with underscores as shown above. Bit values that differ after the second power-on are unstable bits.
[0080] The bits of SRAM are grouped. Taking a 128K bytes SRAM as an example, 128 bytes is the basic unit. Thus, 128K bytes is divided into 1000*128 bytes, which is 1000 groups.
[0081] Within each group, the most stable bytes are identified, and the group with the highest number of stable bytes is the most stable group. For example, in 1000 groups, group 70, consisting of 128 bytes, has 71 stable bytes. Since 71 is the highest number of stable bytes among the 1000 groups, group 70 is determined to be the most stable byte group. After determining the most stable group, its bit value becomes the PUF (Programmable Memory Function) value of the dynamic memory. Since the most stable group is 128 bytes, the PUF value is the bit value of these 128 bytes, which is 1024 bits. Simultaneously, after determining the most stable group, characteristic values are found and determined for that group. The rule for determining characteristic values is that a consecutive number of stable bits or bytes constitute a characteristic value. All characteristic values in the most stable group are recorded.
[0082] S1.2. Generate private key A and public key A based on PUF value. Process the above PUF value using an algorithm, such as SHA-256 algorithm, and output a private key A with a length of, for example, 256 bits.
[0083] According to asymmetric encryption algorithms, a public key can be generated from a private key. For example, a 256-bit private key A can be used as the private key for ECDSA (Elliptic Function Signature Algorithm), and the public key comes from the elliptic curve doubling product of the private key and the base point.
[0084] S1.3, Generate auxiliary data A based on PUF values. Encode the digital sequence using error correction codes to form auxiliary data A, such as... Figure 3 ;
[0085] First, use a random number w1 to encode it with an error correction code such as BCH to obtain a random code u1. Then, XOR u1 with the PUF value generated above to obtain Helper Data1, which is the auxiliary data A.
[0086] S1.4 Microcontroller A sends the feature value, auxiliary data A and public key A to microcontroller B for storage. Private key A is deleted after use.
[0087] S2. At the same time, the microcontroller B reads the PUF value of the dynamic memory it is in, generates auxiliary data B, private key B and public key B based on the PUF value, deletes the private key B after use, and sends the auxiliary data B and public key B to the microcontroller A for storage.
[0088] The process by which microcontroller B reads the PUF value and generates auxiliary data B, private key B, and public key B is exactly the same as S1 above, and will not be repeated here.
[0089] S3. The above two steps, S1 and S2, initially establish the PUF link between microcontroller A and microcontroller B;
[0090] As can be seen from steps S1 and S2, the initial conditions for establishing a PUF link include two parts:
[0091] Microcontroller A sends auxiliary data A, feature value A, and public key A to microcontroller B for storage, and microcontroller B confirms receipt to microcontroller A;
[0092] Microcontroller B sends auxiliary data B, feature value B, and public key B to microcontroller A for storage, and microcontroller A confirms receipt to microcontroller B;
[0093] Once both parties have confirmed their agreement, a preliminary PUF link has been established.
[0094] S4. After the PUF link is initially established, microcontroller A or B reports to the main processor of the system for registration.
[0095] Reporting is allowed whether it is microcontroller A or microcontroller B. If microcontroller A needs to go through microcontroller B before connecting to the main processor, it means that microcontroller A is not directly connected to the main processor, and in this case, microcontroller B should report.
[0096] Microcontroller A or B reports this PUF link to the system's main processor for registration. After the main processor approves the registration of the PUF chain, the PUF chain is officially established.
[0097] The principle for determining the system's main processor is administrative authority. This processor must be directly managed by the system administrator or be authorized by them. "Control" means that when a PUF chain is reported, the administrator can issue instructions through this processor to approve the PUF chain application. "Authorization" means that the processor is authorized to approve or reject PUF chain requests and to handle PUF chain establishment failure messages.
[0098] After the request to establish a PUF chain is sent to the main processor, the main processor processes it according to the user's instructions or authorization principles. After the request is approved, the main processor records the time and linker of the PUF link and sends the feedback to the reporting microcontroller A or B. Thus, the PUF chain of microcontrollers A and B is registered and the PUF chain is officially established.
[0099] S5. Based on the above steps, the main processor records all established PUF chains in the system, with the microcontroller and RAM as nodes. According to all the links between microcontrollers, the main processor draws the PUF chain topology of the entire system and stores the topology, where the main processor is the master node and the microcontroller and RAM are nodes.
[0100] like Figure 4 As shown, the system includes three microcontrollers, one main processor, and four memory modules. Microcontroller A and microcontroller B form PUF chain 1, microcontroller B and the main processor form PUF chain 2, and microcontroller B and the main processor form PUF chain 3.
[0101] In this topology, the master node is the main processor, the microcontroller nodes are microcontroller A, microcontroller B, and microcontroller C, and the memory nodes are memory A, memory B, and memory C. The nodes in the topology are divided into two types: microcontroller nodes and memory nodes. The topology structure is as follows: Figure 5 As shown.
[0102] S6. After the link is broken, the PUF chain needs to be authenticated to be re-established. That is, the two nodes need to re-authenticate each other. Only after the authentication is successful can the PUF chain link between the two nodes be restored.
[0103] The authentication method is to read the other party's current PUF value, combine it with auxiliary data, and generate a private key. If the private key matches the original public key, it means that the PUF value is the original PUF value of the microcontroller, the microcontroller and the corresponding memory have not been replaced, the authentication is successful, and the PUF link is restored.
[0104] Preferably, in S6, the most stable group is found by using the feature value to find the matching group. The current PUF value of the most stable group is read, and the original PUF value is recovered by using the auxiliary data and the current PUF value. The PUF value is processed by the algorithm to generate a private key. The feature value and auxiliary data used by microcontroller A are sent by microcontroller B before. Similarly, the feature value and auxiliary data used by microcontroller B are sent by microcontroller A before.
[0105] In this embodiment, after the link is broken, re-authentication is required to establish a PUF chain. That is, the two nodes need to re-authenticate each other, and the PUF chain link between the two nodes can only be restored after successful authentication.
[0106] The authentication method is to read the other party's current PUF value, combine it with auxiliary data, and generate a private key. If the private key matches the original public key, it means that the PUF value is the original PUF value of the microcontroller, the microcontroller and the corresponding memory have not been replaced, the authentication is successful, and the PUF link is restored.
[0107] If there is a mismatch and authentication fails, it indicates that the microcontroller being linked has been replaced, and the PUF chain establishment has failed. In the event of a PUF chain failure, communication between microcontrollers A and B is prohibited, preventing the transmission of information or data. Simultaneously, the failure is reported to the main processor, thus preventing damage caused by unauthorized microcontroller replacement.
[0108] S6.1 How does the MCU determine if the connection is broken?
[0109] After the system is powered off, or if the microcontroller detects that the connection has been broken while the system is still powered on, or that the microcontrollers cannot communicate with each other and cannot transmit information or data, it is determined that the link has been broken and the PUF chain needs to be re-authenticated.
[0110] The PUF chain has already been registered with the main processor and passed the registration process, so it does not need to be registered again. The microcontrollers can authenticate each other, and the PUF chain can be restored after the authentication is passed.
[0111] S6.2 Generate a private key based on the PUF value and auxiliary data.
[0112] The most stable group is identified by finding matching feature values. The current PUF value of the most stable group is then read. The original PUF value is recovered using auxiliary data and the current PUF value. The PUF value is then processed by an algorithm to generate a private key.
[0113] The feature values and auxiliary data used by microcontroller A were previously sent by microcontroller B. Similarly,
[0114] The feature values and auxiliary data used by microcontroller B were previously sent by microcontroller A.
[0115] When re-authenticating the PUF chain, the microcontroller reads the RAM PUF value of the microcontroller at the other end of the PUF chain. This is different from when the PUF chain is first established, when the microcontroller reads the RAM PUF value.
[0116] The specific process is as follows:
[0117] The process of restoring the original private key is as follows: Figure 6 As shown, the auxiliary data is first XORed with the current PUF to obtain the encoded u1'. Compared with the encoded u1, u1' has some different bits. The encoded u1 is recovered by decoding algorithm such as BCH, i.e., error correction. Then, the original PUF value can be recovered by XORing the encoded u1 with the auxiliary data.
[0118] Taking the 128-byte most stable group as an example, the current PUF value is read as follows:
[0119] 34 F0 50 F3 28 39 D9 1F AB A5 37 45 A7 55 B5 DF D1 F6 07 8A B8 6E 83 B3 FA 33 F0 77 B6 61 32 ED 50 1A D7 B8 18 7A 5F A5 A0 8B 76 E1 42 30 B5 24 A8A8 BA 34 8C D4 16 D1 E1 DA DB 90 A4 0A 90 twenty one 74AA A2 1F 7D 91 E2 16 BA 44 F18B C9 64 EB 72 68 0A 1A D4 76 9A CD 24 47 63 C5 AA D4 0A EB A6 BC E3 29 30 D42B 51 B4 57 3E 7092 CA 2E B0 54 96 3E A2 84 EA 3E EA 67 93 B5 AC 1D 4B 24 9C6F F7
[0120] The current PUF value is processed by BCH error correction code to recover the original most stable PUF value, which is 128 bytes, or 1024 bits:
[0121] 38 F0 50 F3 28 A9 D9 1F AD A5 37 45 AE 55 B5 D7 D1 7A 07 8A B8 6E 83 B3 FA 33 F0 77 B6 61 31 ED 50 1A D7 B8 18 3A 5F A5 A0 8B 76 E1 42 30 C5 24 A8A8 BA 34 8C D4 16 D1 E1 DA DB 90 A4 0A 90 twenty one 74 AA A2 1F 5D 91 E2 16 BA 44 F18A C9 64 EB 72 68 0A 1A D4 76 9A CD 24 47 63 C5 AA D4 0A EC A6 BC E3 29 30 D42B 51 B4 53 3E 70 94 CB 2E B0 54 963E A2 84 EA 3E EA 67 93 B5 AC 1D 4B 24 9C6F FF
[0122] The above PUF value is processed by an algorithm, such as the SHA-256 algorithm, to output a private key A' with a length of, for example, 256 bits.
[0123] S6.3. Match and authenticate with the public key previously generated by the microcontroller. If the authentication is successful, the two nodes will restore the PUF connection.
[0124] Assuming microcontroller A is the disconnected party requiring authentication, the authentication process of matching the private key with the public key takes ECDSA (Elliptic Curve Signature Algorithm) as an example. The public key is the product of the original private key and the elliptic curve points, Q_{A} = dA × G, where dA is the private key. Microcontroller B uses the current private key A' and the file's hash value to construct a mathematical equation; this mathematical equation is the electronic signature. The signature itself will be divided into two parts, called r and s.
[0125] The signing process is as follows:
[0126] The public key Q_{A} = A*G, where G is the base point in the elliptic curve, and the public key is the elliptic curve dot product of the original private key and the base point.
[0127] The above step S6.2 generates the current private key A';
[0128] Calculate the number r = xQ mod n, where xQ is the x-coordinate of the dot product Q_{A};
[0129] Calculate s = k-1(z+rA')mod n, where A' is the current private key and k-1 is the multiplicative inverse of k modulo n;
[0130] Finally, (r, s) is the digital signature pair.
[0131] Microcontroller B verifies the correctness of the signature to determine whether the private key A' is the original private key A. This requires substituting the original public key and part of the signature S into another equation. If the signature is a digital signature signed with the correct private key, it will provide another part of the signature R1. If R1 is equal to the original R, the signature verification is successful, which also proves that the private key and public key match, just like the original pair of public and private keys.
[0132] The digital signature verification process is as follows:
[0133] To verify a digital signature, the public key Q_{A}, the truncated hash z, and of course, the signature pair (r, s) need to be calculated. This mainly involves the following:
[0134] Calculate u1 = s⁻¹z mod n;
[0135] Calculate u2 = s-1r mod n;
[0136] Calculate point R1 = u1*G + u2*Q_{A} = (XR, YR), and let v = XR mod n;
[0137] If r = v, then the signature is valid;
[0138] This shows that R1 is equal to the original R, thus proving that the current private key A' is equal to the original private key A;
[0139] The fact that the current private key A' is equal to the original private key A indicates that the PUF value of the currently generated private key is the same as the original PUF value, thus proving that the other party has not been replaced.
[0140] The specific ECDSA signing and verification process conforms to international standards, including ANSI X9.62, FIPS186-2, IEEE 1363-2000, ISO / IEC 14888-3, etc. These detailed processes are clearly defined in the corresponding international standards and need not be elaborated here.
[0141] The SRAM of this invention can also be other dynamic memory, including DRAM, MRAM, STT-MRAM, ReRAMFeRAM and PCRAM, etc.
[0142] This invention is not only suitable for microcontrollers, but also for identifying the illegal replacement of other processors such as CPU, GPU, and NPU in a system by establishing a PUF chain. It is also suitable for identifying the illegal replacement of various dynamic random access memories, because the identification is based on the PUF value.
[0143] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for identifying illegal replacement of a single-chip microcomputer in an identification system by establishing a PUF chain, characterized by, The system includes multiple nodes and a master node; the method includes: A preliminary PUF chain is established between microcontroller A and microcontroller B, including: microcontroller A and microcontroller B have a communication connection in the system; microcontroller A reads the PUF value of its dynamic memory and generates auxiliary data A, private key A, and public key A, and sends auxiliary data A and public key A to microcontroller B for storage; private key A is deleted after use; microcontroller B reads the PUF value of its dynamic memory and generates auxiliary data B, private key B, and public key B; private key B is deleted after use, and sends auxiliary data B and public key B to microcontroller A for storage. Microcontroller A or microcontroller B reports the PUF chain to the system's main processor for registration. Once the main processor approves the registration, the PUF chain is officially established. The main processor records all PUF chains in the system, draws and stores the PUF chain topology of the entire system; wherein, the microcontroller and dynamic memory are nodes; and the main processor is the master node; After the system is powered down or the connection is broken, microcontroller A and microcontroller B re-authenticate the PUF chain. Once authentication is successful, the PUF chain connection is restored. The process of microcontroller A and microcontroller B re-authenticating the PUF chain after the system is powered down or the connection is broken includes: after the system is powered down or the connection is broken, microcontroller A reads the PUF value of microcontroller B and combines it with auxiliary data B to generate a private key B', which is then matched and authenticated with the public key B previously generated by microcontroller B; microcontroller B generates a private key A' based on the PUF value of microcontroller A and combines it with auxiliary data A, which is then matched and authenticated with the public key A previously generated by microcontroller A. If authentication fails, it is determined that the microcontroller connected to the other party has been replaced, and the PUF chain establishment has failed; communication between microcontrollers A and B is prohibited, and the processor is reported that the PUF chain establishment has failed. This involves generating auxiliary data, private keys, and public keys, including: A private key is generated based on the PUF value of the dynamic memory, a public key is generated based on the encryption algorithm, and the PUF value is encoded using an error correction code to form auxiliary data.
2. The method for identifying the illegal replacement of a microcontroller in a system by establishing a PUF chain according to claim 1, characterized in that, Also includes: If microcontroller A needs to go through microcontroller B before connecting to the main processor, then microcontroller B needs to report the PUF chain to the main processor of the system for registration.
3. The method for identifying unauthorized replacement of a microcontroller in a system by establishing a PUF chain according to claim 1, characterized in that, The matching and authentication process includes: When using the ECDSA signature algorithm, the system calculates whether the public key is the elliptic curve dot product of the private key and the base point; if so, the electronic signature authentication is successful, and the private key matches the public key.
4. The method for identifying the illegal replacement of a microcontroller in a system by establishing a PUF chain according to claim 1, characterized in that, Also includes: The main processor performs a full system-wide PUF chain test. The node positions of all PUF chains, microcontrollers, and dynamic memory were tested and compared with the stored PUF chain topology. If the position or number of nodes is changed in the comparison results, it is determined that the microcontroller and / or dynamic memory in the system has been illegally replaced.
5. The method for identifying the illegal replacement of a microcontroller in a system by establishing a PUF chain according to claim 1, characterized in that, Read the PUF value of the dynamic memory, including: The PUF values of the read dynamic memory are grouped, and the stable bytes within each group are counted. The group with the most stable bytes is the most stable group. The bit values of the most stable group are determined as the PUF values of the dynamic memory.