A method and system for encrypting and decrypting burned files based on address remapping
Through the burned file encryption and decryption method based on address remapping, the encryption key is generated using custom code and chip identifier code to remap and decrypt the chip address, solving the encryption complexity and operation of burned file encryption in the prior art in the art The problem of large quantities improves the operating efficiency and safety of the chip.
Patent Information
- Application Number
- CN202011236427.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-09
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-11-09
AI Technical Summary
The encryption method of burning files in the prior art is too complex, with large computing volume, which affects the chip operation efficiency and is difficult to effectively protect the security of key data and code in the chip.
The burned file encryption and decryption method based on address remapping is adopted, and the encryption key is generated through custom code and chip identifier code. The encryption algorithm is used to remap the conventional sequential addresses, which reduces the amount of encryption and decryption operations. Improves the chip's operating efficiency and safety.
On the premise of ensuring security performance, the computing volume of encryption and decryption is reduced, the chip operation efficiency is improved, and the address remapping encryption and decryption is realized through the same encryption method and key, avoiding complex encryption and decryption of instruction data operate.
Smart Images

Figure CN112231739B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a burning file encryption and decryption method based on address remapping and a system thereof. Background Art
[0002] With the improvement of chip performance, embedded chips are rapidly popularized in various industries and fields. However, the high cost and long R&D cycle of chip development make the encryption of key technologies and the confidentiality of important data extremely important. Infringers illegally copy and plagiarize important data or key codes in chips, which will cause serious economic losses to chip owners and developers. Therefore, the confidentiality of key data or codes in chips has become one of the main issues of concern to chip R&D engineers. In the prior art, the key data or codes in chips are mainly encrypted by encryption storage chips for hardware circuits or by encryption of chip data based on encryption algorithms and encryption keys. The current encryption method for burning file data is too complicated and requires a large amount of calculation, which affects the chip operation efficiency. Summary of the invention
[0003] To solve the above problems, the present invention provides a method for encrypting and decrypting burning files based on address remapping to improve chip operation efficiency and security. The specific technical solution of the present invention is as follows:
[0004] A method for encrypting and decrypting a burning file based on address remapping, the method comprising a burning file encryption method based on address remapping; the method comprising the following steps:
[0005] Step S11: The PC obtains the custom code X input by the user and proceeds to step S12;
[0006] Step S12: The PC obtains the identifier UID of the chip being burned, and proceeds to step S13;
[0007] Step S13: The PC uses the identifier code UID of the burned chip and the user-entered custom code X as seeds to generate an encryption key KEY through calculation, wherein the XOR result of the identifier code UID and the custom code X is the encryption key KEY, and then proceeds to step S14;
[0008] Step S14: The PC remaps and encrypts the regular sequential address ADD based on the encryption algorithm and the encryption key KEY, obtains the ciphertext stored corresponding to the remapped encrypted regular sequential address ADD, and proceeds to step S15;
[0009] Step S15: The PC writes the remapped encrypted ciphertext and encryption key KEY into the memory ROM of the chip being burned through the burning tool, and then proceeds to step S16;
[0010] Step S16: The chip being burned feeds back a signal of burning success to the PC, and the burning is finished.
[0011] The burning file encryption method based on address remapping performs encryption through address remapping so that the instruction data stored corresponding to the address changes the storage address according to the address remapping. The amount of calculation for encrypting the address is much smaller than the amount of calculation for encrypting the data. This encryption method reduces the amount of encryption and decryption calculations while ensuring security performance, thereby improving chip operation efficiency.
[0012] Furthermore, the specific steps of the PC remapping and encrypting the regular sequential address ADD based on the encryption algorithm and the encryption key KEY include: the PC performs operations based on the encryption key KEY and the regular sequential address ADD to obtain the first address ADD1; the PC runs the encryption algorithm of the first preset number of rounds based on the first address ADD1 to obtain the remapped encrypted second address ADD2 and the ciphertext stored corresponding to the remapped encrypted address; wherein the sum of the encryption key KEY and the regular sequential address ADD is the first address ADD1. The encryption method remaps the regular sequential address based on the encryption key KEY and the encryption algorithm so that the instruction data stored in the regular sequential address is stored in the second address after the address is remapped and encrypted. The encryption method reduces the amount of operations by performing encryption operations on the address compared to performing encryption operations on the instruction data.
[0013] Furthermore, the burning file encryption and decryption method based on address remapping includes a burning file decryption method based on address remapping; the burning file encryption and decryption method based on address remapping also includes the following steps:
[0014] Step S21: After the chip being programmed is powered on, the central processing unit CPU calls the encryption key KEY stored in the memory ROM of the chip being programmed, and enters step S22;
[0015] Step S22: The central processing unit CPU performs calculation based on the conventional sequential address ADD and the encryption key KEY to obtain the first address ADD1, and then proceeds to step S23;
[0016] Step S23: the central processing unit CPU runs a first preset number of rounds of encryption algorithm based on the first address ADD1, obtains the remapped encrypted second address ADD2, and proceeds to step S24;
[0017] Step S24: After the ciphertext decryption of the burned chip is completed, the central processing unit CPU calls the required instruction data from the corresponding second address ADD2 based on the remapped encrypted second address ADD2 and the required instruction data; wherein the encryption algorithm used in the burning file encryption and decryption method based on address remapping is a symmetric encryption algorithm. The decryption method is to obtain the second address after the remapping encryption of the regular sequential address ADD as the decryption key by performing the same encryption process as the encryption method on the regular sequential address ADD. The decryption method does not need to decrypt the data instructions stored in the chip, reduces the amount of chip decryption calculations, and ensures the security of the chip ciphertext based on address remapping encryption.
[0018] Furthermore, a set of instruction data is stored at one address, and the encryption key and the first preset number of rounds of encryption algorithm in the address remapping burning file encryption method and the address remapping-based burning file decryption method are to perform operation encryption on the conventional sequential address ADD, and the instruction data stored corresponding to the conventional sequential address ADD is stored to the corresponding mapping position as the conventional sequential address ADD is remapped and encrypted, so that the instruction data stored corresponding to the conventional sequential address ADD is stored at the remapped encrypted address after the conventional sequential address ADD is remapped and encrypted. In this technical solution, the encryption method and the decryption method use the same encryption method and encryption key to remap the address for encryption and decryption, and there is no need to perform complex encryption and decryption operations on the instruction data. It is only necessary to use the same encryption method and encryption key to call and run the required instruction data from the corresponding address.
[0019] Furthermore, before the PC remaps and encrypts the conventional sequential address ADD based on the encryption algorithm and the encryption key KEY, it is determined whether the number of rows of instruction data stored corresponding to the conventional sequential address ADD is n times the number of rows corresponding to the preset minimum encryption unit; if the number of rows of instruction data stored corresponding to the conventional sequential address ADD is n times the number of rows corresponding to the preset minimum encryption unit, then the step S14 is entered; if the number of rows of instruction data stored corresponding to the conventional sequential address ADD is not n times the number of rows corresponding to the preset minimum encryption unit, then the instruction data stored corresponding to the conventional sequential address ADD is padded; wherein n is an integer greater than or equal to 1. The padded processing disclosed in the technical solution enables the number of rows of instruction data stored to meet n times the number of rows corresponding to the preset minimum encryption unit of the encryption method, thereby achieving the purpose of remapping and encrypting the address.
[0020] Furthermore, the padding process refers to padding the instruction data stored corresponding to the conventional sequential address ADD with a minimum number of zeros so that the number of rows of the instruction data reaches n times the number of rows corresponding to the minimum preset encryption unit; wherein the padding of the minimum number of rows refers to padding the instruction data with zeros until the number of rows of the instruction data first meets the number of rows corresponding to the preset minimum encryption unit, and then stopping the padding of zeros. The padding process disclosed in the technical solution does not affect the calling and running of the original data instruction by padding the instruction data that does not meet the number of rows corresponding to the preset minimum encryption unit with zeros.
[0021] The present invention also discloses a burning file encryption and decryption system based on address remapping, the encryption system comprising: an encryption module, comprising a PC and a burner, for encrypting instruction data to be burned based on the aforementioned encryption method for burning files based on address remapping and burning the encrypted instruction data and encryption key into a chip; a chip, comprising a memory ROM, for decrypting instruction data stored in a chip memory based on the aforementioned burning file decryption method based on address remapping and calling the instruction data required for operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 The figure is a flow chart of a method for encrypting a burning file based on address remapping according to an embodiment of the present invention.
[0023] Figure 2 The figure is a flow chart of a method for decrypting a burning file based on address remapping according to an embodiment of the present invention.
[0024] Figure 3 A schematic diagram of the process of an encryption algorithm described in an embodiment of the present invention.
[0025] Figure 4 The present invention is a schematic diagram of the structure of an encryption and decryption system for burning files based on address remapping according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention. It should be understood that the specific embodiments described below are only used to explain the present invention and are not used to limit the present invention.
[0027] The burning file encryption and decryption method based on address remapping includes a burning file encryption method based on address remapping and a burning file decryption method based on address remapping; an embodiment of the present invention provides a burning file encryption method based on address remapping, referring to Figure 1 As shown, the burning file encryption method based on address remapping specifically includes the following steps:
[0028] Step S101: The PC obtains a custom code X input by a user and proceeds to step S102; wherein the custom code X has the same bit width as the conventional sequential address ADD.
[0029] Step S102: The PC obtains the identifier code UID of the burned chip and proceeds to step S103; specifically, the order of step S101 and step S102 can be interchanged; the PC obtains the identifier code UID of the burned chip in a manner that may be, but is not limited to, the PC obtains it according to the chip manual or the chip is sent to the PC via the ISP driver; the chip identifier code UID refers to the unique identification code of the chip, and each chip has a unique identification code.
[0030] Step S103: The PC uses the custom code X and the identifier code UID of the chip being burned as seeds SEED to obtain the encryption key KEY, and enters step S104; specifically, the encryption key is the XOR operation result of the custom code X and the identifier code UID of the chip being burned; wherein, when performing the XOR operation on the custom code X and the identifier code UID, starting from the low bit of the identifier code UID, the data with the same binary bit as the custom code is taken for XOR operation, and if the bit width of the identifier code UID is smaller than the bit width of the custom code X, zero padding is performed starting from the high bit of the identifier code UID until the bit width of the identifier code UID is equal to the bit width of the custom code X.
[0031] Step 104: Determine whether the number of rows of instruction data stored corresponding to the conventional sequential address ADD is n times the number of rows corresponding to the preset minimum encryption unit. If the number of rows of instruction data stored corresponding to the conventional sequential address ADD is n times the number of rows corresponding to the preset minimum encryption unit, then enter step S106. Conversely, if the number of rows of instruction data stored corresponding to the conventional sequential address ADD is n times the number of rows corresponding to the preset minimum encryption unit, then enter step S105; wherein the preset minimum encryption unit may be, but is not limited to, 4K as the minimum encryption unit corresponding to 1024 rows, and 8K as the minimum encryption unit corresponding to 2048 rows. Specifically, the data length of each row of instruction data stored corresponding to the conventional sequential address ADD is the same, and the specific length of instruction data of each row is determined according to the type of chip actually burned. For example, most of the chips of the ARMA series adopt the ARMv7 (32-bit) instruction set architecture, that is, 32 bits are used as the length of each instruction data.
[0032] Step S105: padding the instruction data stored corresponding to the conventional sequential address ADD until the number of rows of the instruction data stored corresponding to the conventional sequential address ADD meets n times the number of rows corresponding to the preset minimum encryption unit, and then proceed to step S106; specifically, the padding process refers to padding the instruction data stored corresponding to the conventional sequential address ADD with 0 from the high position with the minimum number of rows, and the minimum number of rows of 0 padding refers to padding the instruction data stored corresponding to the conventional sequential address ADD with 0 from the high position until the number of rows of the instruction data stored corresponding to the conventional sequential address ADD meets n times the number of rows corresponding to the preset minimum encryption unit for the first time, then stop padding. By setting the minimum encryption unit, when the space occupied by the burning file is less than the preset minimum encryption unit, that is, the number of rows of the instruction data stored corresponding to the conventional sequential address ADD does not meet n times the number of rows corresponding to the preset minimum encryption unit, the padding process is used to make the space occupied by the burning file equal to the preset minimum encryption unit, so as to achieve the purpose of unique correspondence and non-overlap of input and output addresses in the process of encrypting the burning file.
[0033] Step S106: The PC obtains the first address ADD1 based on the encryption key KEY and the conventional sequential address ADD, and enters step S107; specifically, the instruction data stored corresponding to the conventional sequential address ADD can be divided into n minimum processing modules according to the preset minimum encryption unit, and the corresponding n groups of encryption keys KEY are input according to the number of minimum processing modules, where n is an integer greater than or equal to 1; the n groups of encryption keys KEY are used to perform an XOR operation with the conventional sequential address ADD divided into n minimum processing modules, and the encryption keys input into each minimum processing module can be the same or different, and the n minimum processing modules use the conventional order as a fixed arrangement, such as 16K instruction data with 4K as the minimum encryption unit, there are 4 minimum processing modules, and the first of the 4 minimum processing modules is the instruction data of 0 to 1024 rows, The second minimum processing module is the instruction data of rows 1025 to 2048, the third minimum processing module is the instruction data of rows 2029 to 3072, and the fourth minimum processing module is the instruction data of rows 3072 to 4096. After the encryption operation of the four minimum processing modules, the instruction data storage addresses in the minimum processing modules are remapped and disrupted, but the four minimum processing modules are still arranged in the normal order, that is, the first minimum processing module is the instruction data of rows 0 to 1024, the second minimum processing module is the instruction data of rows 1025 to 2048, the third minimum processing module is the instruction data of rows 2029 to 3072, and the fourth minimum processing module is the instruction data of rows 3072 to 4096; the first address ADD1 is the XOR operation result of the normal sequence address ADD and the encryption key KEY.
[0034] Step S107: The PC runs the encryption algorithm of the first preset number of rounds based on the first address ADD1, obtains the second address ADD2 and the ciphertext, and enters step S108; specifically, the first preset number of rounds refers to the number of rounds pre-set in the PC, so that the first address ADD1 is subjected to the encryption algorithm operation of the preset number of rounds, and then the second address ADD2 is obtained; the encryption algorithm is a symmetric encryption algorithm, which has the advantages of fast encryption speed and high decryption difficulty. The encryption algorithm can be but is not limited to the DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm or IOEA algorithm. The encryption algorithm actually used can be It is adjusted according to the requirements of security performance, transmission speed and other aspects; the instruction data stored corresponding to the first address ADD1 is divided into n minimum processing modules to run the first preset number of rounds of encryption algorithm to obtain n minimum processing modules corresponding to the instruction data stored at the second address ADD2, and the n minimum processing modules are still arranged in a regular order, and the instruction data in the n minimum processing modules are correspondingly stored at the second address ADD2 to generate the ciphertext; the ciphertext refers to the instruction data stored at the regular sequence address ADD and is stored at the second address ADD2 after being remapped and encrypted, and the instruction data is disrupted in the original order after being remapped and encrypted, and is in a disordered state.
[0035] Step S108: The PC writes the corresponding stored ciphertext and encryption key KEY after the remapped encrypted regular sequential address ADD into the memory ROM of the burned chip through the burning tool, and enters step S109; specifically, the memory ROM is configured to store encryption keys and various types of data to support the execution of the burned chip, and the various types of data include instructions for executing various methods or programs on the central processing unit CPU. The memory ROM can be a non-volatile storage device, such as: read-only memory ROM, programmable read-only memory PROM, electrically erasable programmable read-only memory EEPROM, etc.; only the program space in the memory ROM needs to be encrypted, and the data space does not need to be encrypted.
[0036] Step S109: the chip being programmed feeds back a signal of programming success to the PC, and programming ends.
[0037] Specifically, the burning file refers to a file to be called and executed which is written into the memory of the burned chip, and the burning file contains corresponding instruction data to be called and executed; the PC is a personal computer composed of a hardware system and a software system, and the PC stores the file to be burned, burning software, encryption algorithm, user-defined code, the first preset number of rounds of the encryption algorithm, the preset minimum encryption unit, etc.; the burning software is used to write the file to be burned into the memory ROM of the burned chip through the burner; the encryption method only encrypts the address, that is, the instruction data is stored from the conventional sequential address ADD to the second address ADD2, and the instruction data is in a callable state without decryption. If the central processing unit CPU wants to call the instruction data, the address needs to be decrypted.
[0038] In one embodiment of the present invention, a method for decrypting a burning file based on address remapping is provided. The decryption method is used to decrypt the ciphertext of the above embodiment. The decryption method specifically comprises the following steps:
[0039] Step S201: After the chip being programmed is powered on, the central processing unit CPU calls the encryption key stored in the chip being programmed and enters step S202;
[0040] Step S202: The central processing unit CPU performs an XOR operation on the regular sequential address ADD and the encryption key stored corresponding to the required instruction data to obtain the first address ADD1, and enters step S203; wherein the first address ADD1 is the XOR operation result of the regular sequential address ADD and the encryption key; the regular sequential address ADD stored corresponding to the required instruction data is the nth minimum processing module divided according to the preset minimum encryption unit, and the encryption key is the encryption key of the nth minimum processing module input in the encryption method of the burning file based on address remapping, and n is an integer greater than or equal to 1.
[0041] Step S204: the central processing unit CPU runs the encryption algorithm of the first preset number of rounds based on the first address ADD1, obtains the second address ADD2, and enters step S205; wherein the first preset number of rounds is the number of encryption algorithm operation rounds of the burned chip during the encryption process.
[0042] Step S205: the central processing unit CPU calls and executes the required instruction data based on the second address ADD2.
[0043] Specifically, the decryption method of the burning file based on address remapping and the encryption method of the burning file based on address remapping use the same encryption key and the same encryption algorithm, the encryption key is the XOR operation result of the user-defined code X and the chip identifier code UID, the encryption algorithm is a symmetric encryption algorithm, which can be but not limited to the DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm or IOEA algorithm, and the encryption algorithm actually used can be adjusted according to the requirements of security performance and transmission speed. The encryption key and encryption algorithm only encrypt the address, and the input regular sequence address ADD is uniquely corresponding to the output second address ADD2; the length of the instruction data can be adjusted according to actual needs, and the length of each instruction data is the same, and the address of the instruction data is incremented in the manner of 0 / 4 / 8 / c.
[0044] An embodiment of the present invention provides an encryption algorithm, see Figure 3 As shown, the specific steps of running one round of the encryption algorithm include: S-BOX replacement, cyclic shift, IP replacement and encryption key.
[0045] Specifically, the S-BOX replacement is composed of m parallel S-BOXs with q inputs and q outputs, and the S-BOX is used to perform nonlinear substitution on the aforementioned first address ADD1; the nonlinear substitution can be but is not limited to substitution according to a preset substitution table or substitution after calculation according to a substitution algorithm; the replacement algorithm refers to the calculation of a preset algorithm based on the aforementioned first address ADD1, and the calculation result is used as the replacement of the first address ADD1; the parallel number m of the S-BOX and the number q of encrypted data inputs of an S-BOX and the number q of encrypted data outputs of an S-BOX can be adaptively adjusted according to the size of the actual encrypted data.
[0046] Specifically, the cyclic shift is to shift the encrypted data left or right as a whole according to a preset shift number without losing the bits in the original range before the shift, but using them as the padding bits at the other end; the preset shift number refers to the number of movement bits pre-configured in the encryption algorithm, which can be adjusted according to the actual encryption requirements of the data.
[0047] Specifically, the IP replacement refers to the bit-by-bit recombining of the encrypted data block and then outputting it, and the bit-by-bit recombining is performed according to a preset replacement rule, such as: presetting the data at the 4th bit to be replaced by the 7th bit, and the data at the 7th bit to be replaced by the 3rd bit; the replacement rule can be adjusted according to the actual number of bits of the encrypted data block and the actual encryption requirements.
[0048] Specifically, the encryption key refers to the XOR operation of the encryption key and the encrypted data, and the XOR operation result is used as the output of one round of encryption algorithm, ending the operation of one round of encryption algorithm; the encryption key is the same as the encryption key in the burning file encryption method based on address remapping in the aforementioned embodiment.
[0049] Furthermore, when the encrypted data completes the first round of encryption algorithm operations, the XOR operation result of the key encryption step is used as the output of the first round of encryption algorithm to enter the second round of encryption algorithm operations, and so on, until the encrypted data completes the first preset number of rounds of encryption algorithm operations, and the XOR operation result of the key encryption step of the last round of encryption algorithm operations is used as the final encrypted data; the first preset number of rounds can be adjusted according to actual encryption requirements, and the first preset number of rounds is positively correlated with the encryption effect.
[0050] See also Figure 4 As shown, in one embodiment of the present invention, there is provided an encryption and decryption system for a burning file based on address remapping, the encryption and decryption system comprising: an encryption module, comprising a PC and a burner, for encrypting instruction data to be burned based on the encryption method for burning files based on address remapping described in the aforementioned embodiment and burning the encrypted instruction data and encryption key into a chip; a chip, comprising a memory ROM, for storing the encrypted instruction data and encryption key; a decryption module, comprising a central processing unit CPU, for decrypting instruction data stored in the chip based on the decryption method for burning files based on address remapping described in the aforementioned embodiment and calling the instruction data required for operation.
[0051] Specifically, the PC is a personal computer composed of a hardware system and a software system. The PC stores files to be burned, burning software, encryption algorithm, user-defined code, the first preset number of rounds of the encryption algorithm, a preset minimum encryption unit, a preset minimum processing module, etc. The burning software can be but is not limited to ISP software; the burner can be but is not limited to a J-LINK burner; the memory ROM of the chip is a non-volatile storage device, such as: read-only memory ROM, programmable read-only memory PROM, electrically erasable programmable read-only memory EEPROM, etc.
[0052] Obviously, the above embodiments are only a part of the embodiments of the present invention, rather than all the embodiments, and the technical solutions between the various embodiments can be combined with each other. In addition, the terms "first", "second", "third", etc. that appear in the embodiments are for the convenience of distinguishing related features and cannot be understood as indicating or implying their relative importance.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein, and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the present invention.
Claims
1. A method for encrypting and decrypting burning files based on address remapping, characterized in that: The burning file encryption and decryption method based on address remapping includes a burning file encryption method based on address remapping; The burning file encryption method based on address remapping specifically includes the following steps: Step S11: The PC obtains the custom code (X) input by the user and proceeds to step S12; Step S12: The PC obtains the identifier code (UID) of the chip being burned, and then proceeds to step S13; Step S13: The PC uses the identifier code (UID) of the burned chip and the user-entered custom code (X) as seeds to generate an encryption key (KEY) through an XOR operation, wherein the XOR operation result of the identifier code (UID) and the custom code (X) is the encryption key (KEY), and then proceeds to step S14; Step S14: The PC remaps and encrypts the regular sequential address (ADD) based on the encryption algorithm and the encryption key (KEY), obtains the ciphertext stored corresponding to the remapped encrypted regular sequential address, and enters step S15; Step S15: The PC writes the ciphertext and encryption key (KEY) stored after the remapped encrypted regular sequence address into the memory (ROM) of the chip being burned through the burning tool, and then enters step S16; Step S16: The chip being burned sends back a burning success signal to the PC, and the burning ends; The specific steps of the PC remapping and encrypting the conventional sequential address (ADD) based on the encryption algorithm and the encryption key (KEY) include: The PC performs an XOR operation based on the encryption key (KEY) and the regular sequential address (ADD) to obtain the first address (ADD1); The PC runs a first preset number of rounds of encryption algorithm based on the first address (ADD1) to obtain the remapped encrypted second address (ADD2) and the ciphertext stored corresponding to the remapped encrypted regular sequence address; The XOR operation result of the encryption key (KEY) and the regular sequential address (ADD) is the first address (ADD1); Among them, the specific steps of running a round of encryption algorithm based on the first address (ADD1) include: S-BOX replacement, cyclic shift, IP replacement and encryption key; S-BOX replacement step: It consists of m parallel S-BOXs with q encrypted data inputs and q encrypted data outputs. S-BOX refers to nonlinear replacement of the first address (ADD1); Circular shift step: without losing the bits in the original range before the shift, the encrypted data is shifted left or right as a whole according to the preset shift number, using them as the padding bits at the other end; IP replacement step: The encrypted data block is reassembled bit by bit according to the preset replacement rules and then output; Key encryption step: perform an XOR operation on the encryption key and the encrypted data, and use the XOR operation result as the output of one round of encryption algorithm, thus ending the operation of one round of encryption algorithm.
2. The method for encrypting and decrypting burning files based on address remapping according to claim 1, characterized in that: The burning file encryption and decryption method based on address remapping includes a burning file decryption method based on address remapping; The burning file decryption method based on address remapping specifically comprises the following steps: Step S21: After the chip being programmed is powered on, the central processing unit (CPU) calls the encryption key (KEY) stored in the memory of the chip being programmed, and enters step S22; Step S22: The central processing unit (CPU) performs remapping encryption based on the conventional sequential address (ADD) stored corresponding to the required instruction data, the encryption key (KEY) and the encryption algorithm of the first preset number of rounds, and obtains the second address (ADD2) stored corresponding to the required instruction data after remapping encryption; Step S23: the central processing unit (CPU) calls and executes the required instruction data from the second address (ADD2); The encryption algorithm used in the burning file encryption and decryption method based on address remapping is a symmetric encryption algorithm.
3. The method for encrypting and decrypting burning files based on address remapping according to claim 2, characterized in that: A group of instruction data is stored at one address. The encryption key and the encryption algorithm of the first preset number of rounds in the encryption method and decryption method of the address remapping burning file are to perform operation encryption on the normal sequential address (ADD). The instruction data corresponding to the normal sequential address (ADD) are stored in the corresponding mapping position as the normal sequential address (ADD) is remapped and encrypted, so that the instruction data corresponding to the normal sequential address (ADD) is stored in the remapped encrypted address after the normal sequential address (ADD) is remapped and encrypted.
4. The method for encrypting and decrypting burning files based on address remapping according to claim 3, characterized in that: Before the PC remaps and encrypts the conventional sequential address (ADD) based on the encryption algorithm and the encryption key (KEY), it is determined whether the number of rows of instruction data stored corresponding to the conventional sequential address (ADD) is n times the number of rows corresponding to the preset minimum encryption unit; if the number of rows of instruction data stored corresponding to the conventional sequential address (ADD) is n times the number of rows corresponding to the preset minimum encryption unit, the process proceeds to step S14; If the number of rows of instruction data stored corresponding to the normal sequential address (ADD) is not n times the number of rows corresponding to the preset minimum encryption unit, the instruction data stored corresponding to the normal sequential address (ADD) is padded; where n is an integer greater than or equal to 1.
5. The method for encrypting and decrypting burning files based on address remapping according to claim 4, characterized in that: The padding process refers to padding the instruction data corresponding to the conventional sequential address (ADD) with a minimum number of rows of zeros so that the number of rows of the instruction data reaches n times the number of rows corresponding to the preset minimum encryption unit; wherein, the padding of the minimum number of rows with zeros refers to padding the instruction data with zeros until the number of rows of the instruction data first meets n times the number of rows corresponding to the preset minimum encryption unit and then stopping padding with zeros.
6. A burning file encryption and decryption system based on address remapping, characterized in that: The burning file encryption and decryption system based on address remapping includes: An encryption module, comprising a PC and a burner, for encrypting the instruction data to be burned based on the address remapping-based burning file encryption and decryption method according to any one of claims 1 to 5 and burning the encrypted instruction data and encryption key into the chip; A chip including a memory (ROM) for storing the remapped encrypted ciphertext and an encryption key; The decryption module includes a central processing unit (CPU), which is used to decrypt the instruction data stored in the chip memory and call the instruction data required for operation based on the address remapping-based burning file encryption and decryption method described in any one of claims 2 to 5.
