Software security protection method, clothing processing equipment and readable storage medium

By encrypting and decrypting the identification code of the embedded chip, judging the chip identity, the problem that embedded chip software is easy to be cracked is solved, and higher security and unique identification protection are achieved to prevent theft.

CN113946841BActive Publication Date: 2024-11-22SHENZHEN SPIRAL GALAXY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111079715.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2024-11-22
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

Software in embedded chips is easy to obtain and crack, threatening the legitimate rights and interests of software development companies. Existing security protection methods such as chip polishing and physical copy prevention are expensive and cannot support software code upgrades.

Method used

By obtaining the identification code of the embedded chip for encryption, generating pre-stored identification summary and key data, using the system driver to decrypt and compare in another chip, judging the identity of the chip, and deleting the system function program to prevent theft if it is different.

Benefits of technology

It improves the security of embedded chip software, prevents unauthorized copying and use of software, avoids the risk of identification code being copied, and enhances the unique identification protection of the chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113946841B_ABST
    Figure CN113946841B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for software security protection, a clothing processing device and a readable storage medium. When judging whether two embedded chips are the same chip, the identification codes are not directly compared, but the identification codes are encrypted to generate identification digests before the comparison is performed. In this way, the identification code used to uniquely identify the first embedded chip can be prevented from being obtained by the copier, so that the identification code of the first embedded chip can be encrypted and protected, so as to further improve the software security of the first embedded chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of embedded systems, and in particular to a software security protection method, a clothing processing device, and a readable storage medium. Background Art

[0002] For embedded chips such as ARM, DSP, and single-chip microcomputers, if the embedded software written into the chip (hereinafter referred to as "embedded software") is not encrypted, it can be easily obtained and cracked, resulting in the theft of core designs and key technologies, threatening the legitimate rights and interests of software development companies.

[0003] In order to prevent unauthorized access or copying of software in embedded chips, the security protection methods generally used for embedded chips include: chip polishing to hide the chip model information; this encryption method is too simple and does not work for decryption personnel familiar with the chip; physical copy protection, using mask ROM to store embedded software code, this encryption method is relatively expensive and cannot support subsequent software code upgrades. Summary of the Invention

[0004] The main purpose of the present invention is to propose a method for software security protection in an embedded chip, aiming to solve the technical problem of how to improve the security of software in an embedded chip.

[0005] To achieve the above objectives, the method for software security protection in an embedded chip proposed by the present invention includes:

[0006] Obtaining a first identification code of a first embedded chip burned with a system program, where the first identification code is used to uniquely identify the first embedded chip, wherein the system program includes a system driver program and a system function program;

[0007] Performing a first encryption operation on the first identification code to obtain a pre-stored identification digest and pre-stored key data;

[0008] Performing a secondary encryption operation on the pre-stored identification digest and pre-stored key data to obtain encrypted data;

[0009] Obtain product registration information, and package the pre-stored key data, encrypted data, and product registration information through a communication protocol to obtain a data packet;

[0010] Send the data packet to the system driver;

[0011] running a system driver in the second embedded chip;

[0012] Extracting the encrypted data and pre-stored key data from the data packet through the system driver, performing a decryption operation on the encrypted data and the pre-stored key data to obtain the pre-stored identification summary;

[0013] obtaining a second identification code of the second embedded chip through a system driver, and performing an operation on the second identification code to obtain a first current identification summary;

[0014] comparing the first current recognition digest with the pre-stored recognition digest;

[0015] It is determined that the first current identification digest is different from the pre-stored identification digest, the first embedded chip and the second embedded chip are judged to be different chips, and the system function program of the second embedded chip is deleted.

[0016] Optionally, the step of performing a first encryption operation on the first identification code to obtain a pre-stored identification digest and pre-stored key data includes:

[0017] Calculating the first identification code using the MD5 message digest algorithm to obtain a pre-stored identification digest;

[0018] Utilize the HASH algorithm to operate the first identification code to obtain the pre-stored identification key;

[0019] The pre-stored identification key is calculated using the MD5 message digest algorithm to obtain the pre-stored key data.

[0020] Optionally, the step of performing a secondary encryption operation on the pre-stored identification digest and the pre-stored key data to obtain encrypted data includes:

[0021] The AES encryption algorithm is used to operate the pre-stored identification summary and the pre-stored key data to obtain encrypted data.

[0022] Optionally, the step of sending the data packet to the system driver includes:

[0023] Use the CRC algorithm to run the data packet to obtain the check code, and send the data packet and the check code to the system driver;

[0024] Before the step of extracting the encrypted data and pre-stored key data from the data packet through the system driver and performing decryption operation on the encrypted data and pre-stored key data to obtain the pre-stored identification summary, the method further includes: verifying the integrity of the data packet using a check code.

[0025] Optionally, after the step of extracting the encrypted data and the pre-stored key data from the data packet by the system driver, performing a decryption operation on the encrypted data and the pre-stored key data, and obtaining the pre-stored identification digest, the method further includes:

[0026] running a system function program in the second embedded chip;

[0027] Performing a decryption operation on the encrypted data and the pre-stored key data to obtain the pre-stored identification digest;

[0028] obtaining a second identification code of the second embedded chip through the system function program, and performing an operation on the second identification code to obtain a second current identification summary;

[0029] comparing the second current recognition digest with the pre-stored recognition digest;

[0030] It is determined that the second current identification digest is different from the pre-stored identification digest, the second embedded chip is determined to be a different chip from the first embedded chip, and the system function program is deleted.

[0031] Optionally, before the step of extracting the encrypted data and the pre-stored key data from the data packet by the system driver and performing a decryption operation on the encrypted data and the pre-stored key data to obtain the pre-stored identification digest, the method further includes:

[0032] The data packets are stored in different address units of a FLASH area using a random algorithm.

[0033] Optionally, the step of storing the data packets in different address units of a FLASH area by using a random algorithm includes:

[0034] According to the last two digits of the pre-stored hexadecimal string of the identification code, a random algorithm is used to store the data packet in different address units of a 2KB FLASH area.

[0035] Optionally, after the step of comparing the first current recognition digest with the pre-stored recognition digest, the method further includes:

[0036] It is determined that the second current identification digest is the same as the pre-stored identification digest, and the second embedded chip is determined to be the same as the first embedded chip, and the system function program is executed.

[0037] Optionally, the step of determining that the first current identification digest is different from the pre-stored identification digest, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip includes:

[0038] Calculating the similarity between the first current recognition summary and the pre-stored recognition summary;

[0039] Determining that the similarity between the first current identification summary and the pre-stored identification summary is less than a preset value, and determining that the first embedded chip and the second embedded chip are different chips;

[0040] Determine that the similarity between the first current identification digest and the pre-stored identification digest is greater than a preset value, perform calculations on the second identification code again to obtain a third current identification digest, compare the third current identification digest with the pre-stored identification digest, determine that the third current identification digest is different from the pre-stored identification digest, and determine that the first embedded chip and the second embedded chip are different chips.

[0041] Optionally, after the step of determining that the first current identification digest is different from the pre-stored identification digest, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip, the method further includes:

[0042] Deletes data packets, encrypted data, pre-stored key data, and pre-stored identification digests in the system driver.

[0043] Optionally, after the step of determining that the first current identification digest is different from the pre-stored identification digest, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip, the method further includes:

[0044] storing the pre-stored identification digest as an invalid identification digest in a storage unit of the second embedded chip;

[0045] Running the latest system driver in the second embedded chip, extracting the latest encrypted data and the latest pre-stored key data in the latest data packet through the latest system driver, performing a decryption operation on the latest encrypted data and the latest pre-stored key data, and obtaining a latest identification summary;

[0046] Compare the latest identification summary with the invalid identification summary in the storage unit one by one;

[0047] Determine that the latest identification summary is the same as one of the invalid identification summaries, and delete the latest system function program.

[0048] The present invention also proposes a clothing processing device, comprising: a device body, a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for software security protection in the embedded chip as described above.

[0049] The present invention also provides a readable storage medium, which stores a control program for a clothing processing device. When the control program for the clothing processing device is executed by a processor, the various steps of the method for software security protection in an embedded chip as described above are implemented.

[0050] The method for protecting software security in an embedded chip of the present invention performs an encryption operation on a first identification code of a first embedded chip to obtain a pre-stored identification digest, and sends the pre-stored identification digest to a system driver of the first embedded chip. When a second embedded chip runs the system driver, the system driver automatically obtains a second identification code of the second embedded chip and then automatically performs an encryption operation to obtain a first current identification digest. If the pre-stored identification digest is different from the first current identification digest, it indicates that the second identification code is different from the first identification code. Since the identification code is used to uniquely identify the embedded chip, it can be determined that the second embedded chip and the first embedded chip are different chips. At this time, it can be determined that the program of the second embedded chip was copied from the first embedded chip. Therefore, the system driver automatically deletes the system function program in the second embedded chip to prevent the system function program from being stolen, thereby achieving security protection for the software in the embedded chip. When determining whether the two embedded chips are the same chip, instead of directly comparing the identification codes, the identification codes are encrypted to generate an identification digest before the comparison is performed. In this way, the identification code used to uniquely identify the first embedded chip can be prevented from being obtained by the copycat, thereby playing an encryption protection role for the identification code of the first embedded chip, further improving the software security of the first embedded chip. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0052] Figure 1 This is a flow chart of an embodiment of a method for software security protection in an embedded chip according to the present invention;

[0053] Figure 2 A flowchart of another embodiment of the method for software security protection in an embedded chip according to the present invention;

[0054] Figure 3 This is a flow chart of another embodiment of the method for software security protection in an embedded chip of the present invention;

[0055] Figure 4 This is a flow chart of another embodiment of the method for software security protection in an embedded chip of the present invention;

[0056] Figure 5 The figure is a flow chart of another embodiment of the method for software security protection in an embedded chip according to the present invention.

[0057] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0059] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.

[0060] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the meaning of "and / or" appearing in the full text is to include three parallel solutions. Taking "A and / or B as an example", it includes solution A, or solution B, or solutions that satisfy both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0061] The present invention provides a method for software security protection in an embedded chip. The embedded chip is applied to an embedded product, such as a clothing processing device. That is, by embedding the chip, the clothing processing device can run according to a program stored in the chip.

[0062] In the embodiment of the present invention, Figures 1 to 5 As shown, the method for software security protection in the embedded chip includes:

[0063] S1. Obtain a first identification code of a first embedded chip burned with a system program, where the first identification code is used to uniquely identify the first embedded chip, wherein the system program includes a system driver and a system function program;

[0064] S2. Performing a first encryption operation on the first identification code to obtain a pre-stored identification digest and pre-stored key data;

[0065] S3, performing a secondary encryption operation on the pre-stored identification digest and the pre-stored key data to obtain encrypted data;

[0066] S4. Obtain product registration information, and package the pre-stored key data, encrypted data, and product registration information through a communication protocol to obtain a data packet;

[0067] S5. Send the data packet to the system driver;

[0068] S6. Running a system driver in the second embedded chip;

[0069] S7, extracting the encrypted data and pre-stored key data in the data packet through the system driver, performing a decryption operation on the encrypted data and the pre-stored key data to obtain the pre-stored identification digest;

[0070] S8. Obtain a second identification code of the second embedded chip through the system driver, and perform calculations on the second identification code to obtain a first current identification summary;

[0071] S9, comparing the first current recognition summary with the pre-stored recognition summary;

[0072] S10: Determine that the first current identification digest is different from the pre-stored identification digest, judge that the first embedded chip and the second embedded chip are different chips, and delete the system function program of the second embedded chip.

[0073] It should be noted that the programs within an embedded chip are divided into two parts: the system driver (bootloader) and the system function program. During the production phase of an embedded product, a chip burning device is used to write the system driver into the chip (bare die). After the embedded product is manufactured, a program upgrade tool on the host computer communicates with the embedded chip's system driver. The program upgrade tool then transfers the system function program to the system driver, which then writes the system function program into the embedded chip. When the embedded chip restarts, the system driver first runs. The system driver verifies the system function program. If the verification passes, the system function program is executed, enabling the embedded product's functional systems to operate normally, such as heating and air conditioning. If the verification fails, the system function program cannot be executed, meaning that the embedded product will not function properly.

[0074] Embedded products typically have internal ROM for storing system programs, and some also include EEPROM memory. When the embedded product system is running, the embedded chip directly reads and executes the system program from the ROM, or first loads the system program from the ROM into memory (RAM) before executing it.

[0075] It is understood that the system function program is the core program in the chip used to control the operation of the embedded product. If the system function program is directly copied to another chip and can be effectively driven, the other chip can directly control another embedded product without the program developer's authorization. The purpose of this embodiment is to prevent the system function program in the original chip from being copied to another chip and then directly executed.

[0076] In this embodiment, the host computer can communicate with the first embedded chip via a serial port to encrypt or update the program of the first embedded chip. In other words, steps S1 to S5 are implemented via serial port communication. The first embedded chip refers to an original chip that stores the authorized system function program.

[0077] The first identification code is a unique identification code for the first embedded chip, i.e., there is no other chip with the same identification code as the first. The specific algorithm for the initial encryption operation is not restricted, as long as it can generate a pre-stored identification digest and pre-stored key data. For example, the pre-stored identification digest can be a 128-bit digest parameter. Encrypting the first identification code to generate a pre-stored identification digest can prevent the first identification code from being directly obtained by a pirate; and performing a secondary encryption operation on the pre-stored identification digest and pre-stored key data can further increase the difficulty for pirates to crack the first identification code, thereby improving the confidentiality of the first identification code.

[0078] The product registration information is embedded with the parameter information of the product of the first embedded chip, such as registration time, temperature unit, software version, etc. The product registration information is packaged with the pre-stored key data and encryption data into a data packet and sent to the system driver, which can conveniently mark the one-to-one correspondence between the chip and the specific product.

[0079] After the data packet is sent to the system driver, a verification program needs to be written into the first embedded chip. The verification program is used to be executed before the system function program is executed, namely steps S6 to S10.

[0080] It should be noted that the second embedded chip and the first embedded chip may be the same chip or different chips, depending on whether the first identification code of the second embedded chip is the same as the second identification code of the second embedded chip. The second embedded chip includes the above-mentioned driver. When the second embedded chip is embedded in the product and is running, the system driver will first load and start the verification program of steps S6 to S10.

[0081] During the verification process, since the first identification code used as the comparison standard is in the form of an encrypted identification digest, the system driver must first perform the same encryption algorithm on the second identification code of the second embedded chip to obtain a first current identification digest. If the first current identification digest is the same as the pre-stored identification digest, it means that the second identification code is the same as the first identification code, that is, the second embedded chip is determined to be the same chip as the first embedded chip. At this time, it can be considered that the system function program has not been stolen, but is being executed on the original authorized chip, so that the system function program can be run to enable the embedded product to work normally.

[0082] If the first current identification digest is different from the pre-stored identification digest, it means that the second identification code is different from the first identification code, that is, the second embedded chip is judged to be a different chip from the first embedded chip. At this time, it can be considered that the software of the authorized first embedded chip has been stolen and recorded into another unauthorized chip, thereby deleting the system function program, so that the system function program can neither be executed nor stored in the unauthorized chip, thereby improving the encryption effect of the system function program.

[0083] The method for protecting software security in an embedded chip of the present invention performs an encryption operation on a first identification code of a first embedded chip to obtain a pre-stored identification digest, and sends the pre-stored identification digest to a system driver of the first embedded chip. When a second embedded chip runs the system driver, the system driver automatically obtains a second identification code of the second embedded chip and then automatically performs an encryption operation to obtain a first current identification digest. If the pre-stored identification digest is different from the first current identification digest, it indicates that the second identification code is different from the first identification code. Since the identification code is used to uniquely identify the embedded chip, it can be determined that the second embedded chip and the first embedded chip are different chips. At this time, it can be determined that the program of the second embedded chip was copied from the first embedded chip. Therefore, the system driver automatically deletes the system function program in the second embedded chip to prevent the system function program from being stolen, thereby achieving security protection for the software in the embedded chip. When determining whether the two embedded chips are the same chip, instead of directly comparing the identification codes, the identification codes are encrypted to generate an identification digest before the comparison is performed. In this way, the identification code used to uniquely identify the first embedded chip can be prevented from being obtained by the copycat, thereby playing an encryption protection role for the identification code of the first embedded chip, further improving the software security of the first embedded chip.

[0084] Specifically, if Figure 2 As shown, the step of performing a first encryption operation on the first identification code to obtain the pre-stored identification digest and pre-stored key data includes:

[0085] S21. Calculate the first identification code using the MD5 message digest algorithm to obtain a pre-stored identification digest;

[0086] S22. Calculate the first identification code using a HASH algorithm to obtain a pre-stored identification key;

[0087] S23. Utilize the MD5 message digest algorithm to operate the pre-stored identification key to obtain pre-stored key data.

[0088] The MD5 message digest algorithm can calculate a fixed-length pre-stored identification digest from a first identification code of any length. This algorithm can only produce the same identification digest if the first identification code is the same. Furthermore, this algorithm is irreversible; even if the encrypted pre-stored identification digest is obtained, it is impossible to decrypt the first identification code. This allows the first identification code to be stored as an MD5 value, preventing it from being known by a hacker and increasing the difficulty of cracking it.

[0089] The HASH algorithm transforms the first identification code into a fixed-length pre-stored identification key, which corresponds to the pre-stored identification digest. The HASH algorithm's independence further increases the difficulty of generating the pre-stored identification key. Using the MD5 message digest algorithm to calculate the pre-stored identification key ensures its irreversibility, preventing a pirate from reversing the calculation to obtain the first identification code.

[0090] In practical applications, the step of performing a secondary encryption operation on the pre-stored identification digest and the pre-stored key data to obtain encrypted data includes:

[0091] The AES encryption algorithm is used to operate the pre-stored identification summary and the pre-stored key data to obtain encrypted data.

[0092] AES can encrypt and decrypt quickly in both software and hardware, is relatively easy to implement, and requires very little memory.

[0093] In one embodiment, the step of sending the data packet to the system driver includes:

[0094] Use the CRC algorithm to run the data packet to obtain the check code, and send the data packet and the check code to the system driver;

[0095] Before the step of extracting the encrypted data and pre-stored key data from the data packet through the system driver and performing decryption operation on the encrypted data and pre-stored key data to obtain the pre-stored identification summary, the method further includes: verifying the integrity of the data packet using a check code.

[0096] The CRC algorithm (Cyclic Redundancy Check, CRC) is a channel coding technique that generates a short, fixed-number checksum based on data such as network packets or computer files. It is primarily used to detect or verify errors that may occur during data transmission or storage. It has strong error detection capabilities and low detection costs. Using the CRC algorithm to transmit data packets ensures the accuracy of the transmitted data.

[0097] In one embodiment, if Figure 3 As shown, after the steps of extracting the encrypted data and pre-stored key data from the data packet by the system driver, performing a decryption operation on the encrypted data and the pre-stored key data, and obtaining the pre-stored identification digest, the method further includes:

[0098] S20, running the system function program in the second embedded chip;

[0099] S30, performing a decryption operation on the encrypted data and the pre-stored key data to obtain the pre-stored identification digest;

[0100] S40, obtaining a second identification code of the second embedded chip through the system function program, and performing an operation on the second identification code to obtain a second current identification summary;

[0101] S50, comparing the second current recognition summary with the pre-stored recognition summary;

[0102] S60: Determine that the second current identification digest is different from the pre-stored identification digest, judge that the second embedded chip is different from the first embedded chip, and delete the system function program.

[0103] Steps S20 to S60 are the second verification procedure. Even if a software pirate illegally skips steps S6 to S10, the second verification procedure will be executed before the system function program is executed. The second verification procedure follows the same verification process as the first verification procedure. If the second embedded chip is ultimately determined to be different from the first embedded chip, the system function program will be directly deleted. This further improves the confidentiality and reliability of the system function program.

[0104] In one embodiment, before the step of extracting the encrypted data and the pre-stored key data from the data packet by the system driver and performing a decryption operation on the encrypted data and the pre-stored key data to obtain the pre-stored identification digest, the method further includes:

[0105] The data packets are stored in different address units of a FLASH area using a random algorithm.

[0106] Specifically, the step of storing the data packets in different address units of a FLASH area using a random algorithm includes:

[0107] Based on the last two digits of the pre-stored identification code hexadecimal string, a random algorithm is used to store the data packet in different address units of a 2KB FLASH area; for example, the FLASH area is divided into different address units labeled 0-100. Assuming that the last two digits of the pre-stored identification code hexadecimal string are 21, the random algorithm is combined with the last two digits of the pre-stored identification code hexadecimal string to generate a value of 0-100. If the value generated after the combination is 63, the data packet is stored in the address unit labeled 63.

[0108] In this way, the difficulty of directly extracting the pre-stored key data and the encrypted data from the first embedded chip can be increased, thereby further preventing the first identification code from being cracked.

[0109] In one embodiment, if Figure 4 As shown, the steps of determining that the first current identification digest is different from the pre-stored identification digest, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip include:

[0110] S11, calculating the similarity between the first current recognition summary and the pre-stored recognition summary;

[0111] S12: Determine that the similarity between the first current identification summary and the pre-stored identification summary is less than a preset value, and determine that the first embedded chip and the second embedded chip are different chips;

[0112] S13. Determine whether the similarity between the first current identification digest and the pre-stored identification digest is greater than a preset value, perform calculations on the second identification code again to obtain a third current identification digest, compare the third current identification digest with the pre-stored identification digest, determine that the third current identification digest is different from the pre-stored identification digest, and determine that the first embedded chip and the second embedded chip are different chips.

[0113] After the system driver obtains the second identification code of the second embedded chip, an operation error may occur when calculating the second identification code, resulting in an incorrect first current identification digest. In other words, the second identification code may be the same as the first identification code, but an error in the encryption operation may cause the obtained first current identification digest to differ from the pre-stored identification digest, thereby mistakenly identifying the second embedded chip as a different chip from the first embedded chip.

[0114] To avoid the above-mentioned misjudgment process, after determining for the first time that the first current identification summary is different from the pre-stored identification summary, the similarity between the first current identification summary and the pre-stored identification summary can be calculated. If the similarity is small, it means that the second identification code is indeed different from the first identification code. If the similarity is large, it means that the second identification code may be the same as the first identification code. At this time, it is necessary to calculate the second identification code again to obtain the third current identification summary. The third current identification summary is compared. If the third current identification summary is still different from the pre-stored identification summary, it means that the second identification code is indeed different from the first identification code. If the third current identification summary is the same as the pre-stored identification summary, it means that the second identification code is the same as the first identification code, but there is a misalignment in the first calculation. In this way, it is possible to prevent the system function program from being accidentally deleted due to errors in the calculation process, thereby effectively protecting the system function program.

[0115] In one embodiment, after the steps of determining that the first current identification digest is different from the pre-stored identification digest, determining that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip, the method further includes:

[0116] Deletes data packets, encrypted data, pre-stored key data, and pre-stored identification digests in the system driver.

[0117] When it is determined that the first embedded chip and the second embedded chip are different chips, it can be considered that the program in the second embedded chip is stolen from the first embedded chip. At this time, the system driver can delete the data packet, encrypted data, pre-stored key data and pre-stored identification digest in the second embedded chip to prevent further decryption attempts. In this way, the encryption protection effect of the software in the embedded chip can be further improved.

[0118] In one embodiment, if Figure 5 As shown, after the steps of determining that the first current identification digest is different from the pre-stored identification digest, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip, the method further includes:

[0119] S110, storing the pre-stored identification digest as an invalid identification digest in a storage unit of the second embedded chip;

[0120] S120, running the latest system driver in the second embedded chip, extracting the latest encrypted data and the latest pre-stored key data in the latest data packet through the latest system driver, performing a decryption operation on the latest encrypted data and the latest pre-stored key data, and obtaining a latest identification summary;

[0121] S130, comparing the latest identification summary with the invalid identification summary in the storage unit one by one;

[0122] S140: Determine that the latest identification summary is the same as one of the invalid identification summaries, and delete the latest system function program.

[0123] After the system function program copied to the second embedded chip is deleted, the thief may copy the software of the first embedded chip to the second embedded chip again and continue to try to crack it. At this time, the pre-stored identification digest calculated by the first embedded chip has been stored as an invalid identification digest in the storage unit of the second embedded chip. After the software of the first embedded chip is copied to the second embedded chip again, before running its verification program, the latest identification digest of the first embedded chip can be compared one by one with the invalid identification digests stored in the second embedded chip. As long as the latest identification digest is the same as one of the invalid identification digests, it is determined that the current software belongs to software that has been copied before, so that the system driver can directly delete the system function program of the software without executing the verification process. In other words, if the same software is copied to the same unauthorized chip multiple times, before the unauthorized chip runs the software for the second time, the system function program can be directly deleted, thereby eliminating the subsequent verification steps and simplifying the verification process.

[0124] The present invention also proposes a clothing processing device, which includes a device body, a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the computer program is executed by the processor, the steps of the method for software security protection in the embedded chip as described above are implemented; the specific steps of the method for software security protection in the embedded chip refer to the above-mentioned embodiments. Since the present clothing processing device adopts all the technical solutions of all the above-mentioned embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above-mentioned embodiments, which will not be repeated here.

[0125] The present invention also proposes a readable storage medium, which stores a control program for a clothing processing device. When the control program for the clothing processing device is executed by a processor, the various steps of the method for software security protection in an embedded chip as described above are implemented; the specific steps of the method for software security protection in an embedded chip refer to the above-mentioned embodiments. Since this readable storage medium adopts all the technical solutions of all the above-mentioned embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above-mentioned embodiments, which will not be repeated here one by one.

[0126] The above descriptions are merely optional embodiments of the present invention and do not limit the patent scope of the present invention. All equivalent structural transformations made using the contents of the present description and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included in the patent protection scope of the present invention.

Claims

1. A method for software security protection in an embedded chip, It is characterized in that include: Acquire a first identification code of a first embedded chip burned with a system program, wherein the first identification code is used to uniquely identify the first embedded chip, wherein the system program includes a system driver program and a system function program; Performing a primary encryption operation on the first identification code to obtain a pre-stored identification summary and pre-stored key data; performing a secondary encryption operation on the pre-stored identification summary and the pre-stored key data to obtain encrypted data; Obtain product registration information, and package the pre-stored key data, encrypted data, and product registration information through a communication protocol to obtain a data packet; Send the data packet to the system driver; running a system driver in the second embedded chip; Extract the encrypted data and pre-stored key data in the data packet through the system driver, perform decryption operation on the encrypted data and the pre-stored key data, and obtain the pre-stored identification summary; Acquire a second identification code of the second embedded chip through the system driver, and perform calculation on the second identification code to obtain a first current identification summary; comparing the first current recognition digest with the pre-stored recognition digest; Determining that the first current identification summary is different from the pre-stored identification summary, determining that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip; The step of performing a first encryption operation on the first identification code to obtain a pre-stored identification summary and pre-stored key data includes: Using the MD5 message digest algorithm to calculate the first identification code, to obtain a pre-stored identification digest; using the HASH algorithm to calculate the first identification code, to obtain a pre-stored identification key; The pre-stored identification key is calculated using the MD5 message digest algorithm to obtain the pre-stored key data.

2. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that The step of performing a secondary encryption operation on the pre-stored identification summary and the pre-stored key data to obtain encrypted data comprises: The AES encryption algorithm is used to operate the pre-stored identification summary and the pre-stored key data to obtain encrypted data.

3. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that The step of sending the data packet to the system driver comprises: Run the data packet using the CRC algorithm to obtain the check code, and send the data packet and the check code to the system driver; The method further includes: using a verification code to verify the integrity of the data packet before extracting the encrypted data and pre-stored key data in the data packet through the system driver, performing a decryption operation on the encrypted data and the pre-stored key data, and obtaining the pre-stored identification summary.

4. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that After the step of extracting the encrypted data and the pre-stored key data in the data packet through the system driver, performing a decryption operation on the encrypted data and the pre-stored key data, and obtaining the pre-stored identification summary, the method further includes: Running the system function program in the second embedded chip; Performing a decryption operation on the encrypted data and the pre-stored key data to obtain the pre-stored identification summary; Acquire a second identification code of the second embedded chip through the system function program, and perform calculation on the second identification code to obtain a second current identification summary; comparing the second current recognition digest with the pre-stored recognition digest; It is determined that the second current identification summary is different from the pre-stored identification summary, the second embedded chip is judged to be a different chip from the first embedded chip, and the system function program is deleted.

5. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that Before the step of extracting the encrypted data and the pre-stored key data in the data packet through the system driver, performing a decryption operation on the encrypted data and the pre-stored key data, and obtaining the pre-stored identification summary, the method further includes: The data packets are stored in different address units of a FLASH area using a random algorithm.

6. The method for software security protection in an embedded chip as claimed in claim 5, It is characterized in that The step of storing the data packets in different address units of a FLASH area by using a random algorithm comprises: According to the last two digits of the pre-stored identification code hexadecimal string, the data packet is stored in different address units of a 2KB FLASH area using a random algorithm.

7. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that After the step of comparing the first current recognition summary with the pre-stored recognition summary, the method further includes: It is determined that the second current identification digest is the same as the pre-stored identification digest, the second embedded chip is judged to be the same chip as the first embedded chip, and the system function program is run.

8. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that The step of determining that the first current identification summary is different from the pre-stored identification summary, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip includes: Calculating the similarity between the first current recognition summary and the pre-stored recognition summary; Determining that the similarity between the first current identification summary and the pre-stored identification summary is less than a preset value, and determining that the first embedded chip and the second embedded chip are different chips; Determine that the similarity between the first current identification summary and the pre-stored identification summary is greater than a preset value, perform operation on the second identification code again to obtain a third current identification summary, compare the third current identification summary with the pre-stored identification summary, determine that the third current identification summary is different from the pre-stored identification summary, and judge that the first embedded chip and the second embedded chip are different chips.

9. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that After the step of determining that the first current identification summary is different from the pre-stored identification summary, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip, the method further includes: Deletes data packets, encrypted data, pre-stored key data, and pre-stored identification digests in the system driver.

10. The method for software security protection in an embedded chip as claimed in claim 1, It is characterized in that After the step of determining that the first current identification summary is different from the pre-stored identification summary, judging that the first embedded chip and the second embedded chip are different chips, and deleting the system function program of the second embedded chip, the method further includes: storing the pre-stored identification digest as an invalid identification digest in a storage unit of the second embedded chip; Running the latest system driver in the second embedded chip, extracting the latest encrypted data and the latest pre-stored key data in the latest data packet through the latest system driver, performing a decryption operation on the latest encrypted data and the latest pre-stored key data, and obtaining the latest identification summary; Compare the latest identification summary with the invalid identification summary in the storage unit one by one; Determine that the latest identification summary is the same as one of the invalid identification summaries, and delete the latest system function program.

11. A clothes processing device, It is characterized in that include: A device body, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the method for software security protection in an embedded chip as described in any one of claims 1 to 10 are implemented.

12. A readable storage medium, It is characterized in that The readable storage medium stores a control program of a clothes processing device, and when the control program of the clothes processing device is executed by a processor, each step of the method for software security protection in an embedded chip as described in any one of claims 1 to 10 is implemented.