Data encryption storage method and decryption method based on PUF (Physical Unclonable Function) hardware
By dividing the response value in the PUF hardware and the production of encryption and authentication code, the problem of insufficient protection of the input PUF device data in the existing technology has significantly improved the security and integrity of the data.
Patent Information
- Application Number
- CN202411246681.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-06
AI Technical Summary
When using PUF hardware for data encryption, the prior art lacks a protection mechanism for data input to the PUF device, and the authentication code is easier to obtain, resulting in data leakage and tampering.
By entering the PUF device to obtain the unique response value, and divide it into the first response value and the second response value, use the first response value to encrypt, use the second response value to generate the authentication code, and at the same time, right? The first random number is encrypted by PIN code to improve the difficulty of certification code.
The dual protection of data is achieved, the difficulty of certification code is improved, the data leakage and tampering are significantly prevented, and the security and integrity of the data is significantly improved.
Smart Images

Figure CN119378027A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a data encryption storage method and a decryption method based on PUF hardware. Background Art
[0002] With the rapid development of information technology, the importance of data security has become increasingly prominent. Traditional encryption storage methods usually rely on software algorithm implementation. However, such methods are vulnerable to attacks and have complex key management. PUF is a type of hardware-based physical unclonable function. Its essence is to use the tiny differences generated during the hardware manufacturing process to generate a unique and difficult-to-copy key. Therefore, PUF technology has broad application prospects in the field of data encryption storage. For example, a portable PUF digital encryption and decryption method and system with patent number CN117914491B includes: generating original data; generating first stimulus information based on the original data and sending it to a portable SRAM PUF device, receiving a first response information returned by the portable SRAM PUF device for the first stimulus information; the encryption device communicates with the portable SRAM PUF device through an electronic interface; generating a first key based on a preset encryption algorithm and the first response information; obtaining the data to be encrypted and generating a check code for the data to be encrypted; generating encrypted information based on the first key, the data to be encrypted, the check code for the data to be encrypted, the preset encryption algorithm and the original data; sending the encrypted information to a decryption device so that the decryption device uses the portable SRAM PUF device to decrypt the encrypted information. The above scheme can reduce the risks in the key distribution process and improve the security of data storage and transmission. However, the above scheme does not protect the data input to the PUF device, and the verification code in the above scheme is only set according to the data to be encrypted, so it is easy to obtain the data or verification code input to the PUF device, which will lead to data leakage and tampering. Summary of the invention
[0003] When encrypting data with the prior art, there is a lack of protection mechanism for data input into PUF hardware and the authentication code is easy to obtain, resulting in the problem that data is easily leaked and tampered. The present invention provides a data encryption storage method and decryption method based on PUF hardware, which makes full use of the uniqueness and non-cloning of PUF devices, inputs a first random number into the PUF device to obtain a unique response value, and then inputs the first response value into the data encryption model for encryption to generate a first data ciphertext, and inputs the second response value into the data encryption model to process the first data ciphertext to obtain a first authentication code, thereby increasing the difficulty of obtaining the authentication code, and encrypts the first random number using a PIN code. This encryption method allows only users who have the correct PIN code to decrypt and obtain the first random number, ensuring the security of data input into PUF hardware, significantly preventing data leakage and tampering, and solving the problem that data is easily leaked and tampered due to the lack of protection mechanism for data input into PUF hardware and the authentication code is easy to obtain. The security of data in a single link is improved, and at the same time, the security of the data to be encrypted is improved through the correlation and constraints between each link.
[0004] In order to solve the above technical problems, the present invention provides a data encryption storage method based on PUF hardware, comprising the following steps: S1: Inputting a first random number into PUF hardware to obtain a response value, and dividing the response value into a first response value and a second response value based on the number of bits corresponding to the response value; S2: Input the first response value into the data encryption model to encrypt the first data to be encrypted to generate a first data ciphertext, and input the second response value into the data encryption model to perform a digest calculation on the first data ciphertext to generate a first authentication code; S3: Encrypt the first random number based on the set PIN code to obtain a first challenge value ciphertext, and compose encrypted and stored data based on the first data ciphertext, the first authentication code and the first challenge value ciphertext.
[0005] After adopting the above technical solution, the present invention has the following advantages: Since PUF devices are unique and non-cloneable, a unique and difficult-to-copy response value will be generated after the first random number is input into the PUF device. Therefore, the first random number is input into the PUF hardware to obtain the response value. Since the response value is unique and difficult to copy, the response value is divided, and then the first data to be encrypted is encrypted based on the first response value, and the first authentication code is generated based on the second response value, thereby achieving double protection of the data. At the same time, the first random number is encrypted to avoid predicting the response value by obtaining the random number, thereby effectively preventing data leakage and tampering, significantly improving the security and integrity of the data, and solving the problem of easy data leakage and tampering due to the lack of protection mechanism for data input into PUF hardware and the easy acquisition of authentication codes.
[0006] Preferably, the S1 comprises: S11: randomly generate a first random number with preset bits, traverse each bit of the first random number in turn, regard the consecutive bits with the same value corresponding to the bits in the bit as a run, and determine whether the total number of runs of the first random number meets a preset condition, if so, continue to execute S12, if not, execute S11; S12: judging whether the PUF hardware meets the use requirements based on a number of reference response values, and if so, executing S13; if not, replacing the PUF hardware and continuing to execute S12; S13: Input the first random number into the PUF hardware to obtain a response value, and divide the response value into a first response value and a second response value based on the number of bits corresponding to the response value. By judging whether the total number of runs meets the preset conditions, the first random number with low randomness is prevented from being input into the PUF hardware, thereby ensuring the randomness and unpredictability of the first random number and enhancing data security.
[0007] Preferably, in S12, judging whether the PUF hardware meets the use requirements based on the plurality of reference response values comprises: inputting a plurality of reference random numbers into the PUF hardware to obtain a plurality of reference response values, and dividing the corresponding reference response values into a first reference response value and a second reference response value based on the number of bits of the plurality of reference response values; Calculate the frequency of occurrence of different values at corresponding positions between each first reference response value, calculate the minimum entropy of each position based on the frequency of occurrence of different values at corresponding positions between each first reference response value, obtain the total entropy based on the minimum entropy of each position, if the total entropy is greater than the preset entropy, it is judged that the PUF hardware meets the use requirements, if the total entropy is less than or equal to the preset entropy, it is judged that the PUF hardware does not meet the use requirements. Entropy is a measure of randomness or uncertainty, the total entropy reflects the overall randomness and uniqueness of the response value generated by the PUF hardware, if the total entropy is greater than the preset entropy, it is considered that the response value generated by the PUF hardware has sufficient randomness and uniqueness, by comparing the total entropy with the preset entropy, PUF hardware with insufficient randomness is excluded, which can reduce the security risks caused by hardware defects, and the calculation of entropy provides a quantitative method to evaluate the performance of PUF hardware, making the evaluation process more objective and reliable.
[0008] Preferably, S2 includes: S21: construct a data encryption model, and train the constructed data encryption model based on historical response data values; S22: using the first response value as an encryption key, inputting the encryption key into the trained data encryption model to encrypt the first data to be encrypted to generate a first data ciphertext; S23: Use the second response value as a digest key, input the digest key into the trained data encryption model, perform a digest calculation on the first data ciphertext, and generate a first authentication code.
[0009] Due to the non-clonability of PUF response, the encryption key used for each encryption is unique. Through this method, even if the attacker obtains the encrypted data, it is difficult to find the encryption key by guessing or brute force, thereby ensuring the confidentiality of the data. Using the second response value as the summary key increases the unpredictability and uniqueness of the authentication code. At the same time, the authentication code is generated by summary calculation, which can verify the integrity and authenticity of the data during data transmission or storage, prevent data from being tampered with, and greatly enhance data security.
[0010] Preferably, in S21, the training of the constructed data encryption model based on the historical response data value includes: inputting the second random number into the PUF hardware to obtain the historical response data value, and dividing the historical response data value into a first historical response data value and a second historical response data value based on the number of bits corresponding to the historical response data value; Input the first historical response data value into the constructed data encryption model, encrypt the second data to be encrypted based on the symmetric encryption algorithm to generate a second data ciphertext, input the second historical response data value into the constructed data encryption model, and perform a digest calculation on the second data ciphertext based on the HMAC algorithm to generate a second authentication code; Randomly generate a number of decrypted data, perform first processing on the number of decrypted data based on the symmetric encryption algorithm to obtain a number of first processing results, compare the number of first processing results with the second data ciphertext respectively, and record the number of first processing results that are successfully compared. If the number of first processing results that are successfully compared does not exceed a first preset number, it indicates that the constructed data encryption model meets the first training requirement; Randomly generate a number of authentication data, perform second processing on the number of authentication data based on the HMAC algorithm to obtain a number of second processing results, match the number of second processing results with the second authentication code, and record the number of successfully matched second processing results. If the number of successfully matched second processing results does not exceed the second preset number, it means that the constructed data encryption model meets the second training requirement; If the constructed data encryption model meets the first training requirement and the second training requirement, it means that the constructed data encryption model has been initially trained successfully. If the initially trained data encryption model meets the third training requirement, it means that the initially trained data encryption model has been trained successfully. By strictly checking the performance of the constructed data encryption model, it is ensured that the data encryption model can maintain a stable encryption effect in various complex environments, thereby effectively protecting the confidentiality, integrity and availability of data.
[0011] Preferably, if the data encryption model that has been preliminarily successfully trained meets the third training requirement, then the data encryption model that has been preliminarily successfully trained is successfully trained, including: Input the preset PIN code into the data encryption model that has been preliminarily trained successfully, and encrypt the second random number based on the hash function to obtain a second challenge value ciphertext; A number of challenge data are randomly generated, and a third processing is performed on the number of challenge data based on a hash function to obtain a number of third processing results. The number of third processing results are compared with the second challenge value ciphertext respectively, and the number of third processing results that are successfully compared is recorded. If the number of third processing results that are successfully compared does not exceed a third preset number, it indicates that the data encryption model that has been successfully preliminarily trained meets the third training requirement.
[0012] Preferably, S3 includes: S31: Expanding the PIN code to be expanded based on the randomly generated extended data to obtain an extended PIN code, inputting the extended PIN code into a data encryption model, and performing a hash calculation on the extended PIN code based on a hash function to obtain a first hash result; S32: Input the first hash result and the extended PIN code into a hash function to obtain a second hash result, and determine whether the second hash result meets the preset requirements. If so, continue to execute S33; if not, use the second hash result as the first hash result and continue to execute S32; S33: Encrypt the first random number using the second hash result as the set PIN code, and then obtain the first challenge value ciphertext. By expanding the PIN code to be expanded based on the randomly generated salt value, pre-calculation attack methods such as rainbow table attacks can be effectively prevented, thereby greatly improving the security of the PIN code. The generated hash result is ensured to meet specific security requirements through an iterative process. This nested use and iterative calculation method further increases the difficulty of cracking the PIN code and improves the security of the first random number and encrypted data.
[0013] Beneficial effects of this program: Since the PUF device is unique and cannot be cloned, a unique and difficult-to-copy response value will be generated after the first random number is input into the PUF device. Therefore, the first random number is input into the PUF hardware to obtain the response value. Since the response value is unique and difficult to copy, the response value is divided, and then the first data to be encrypted is encrypted based on the first response value, and the first authentication code is generated based on the second response value, thereby achieving double protection of the data. At the same time, the first random number is encrypted to avoid predicting the response value by obtaining the random number, thereby effectively preventing data leakage and tampering, and significantly improving the security and integrity of the data; By training the constructed data encryption model and strictly checking the training results, we ensure that the data encryption model can maintain a stable encryption effect in various complex environments, thereby improving the reliability of the model; The problem of data leakage and tampering due to the lack of protection mechanism for data input into PUF hardware and the easy acquisition of authentication codes is solved.
[0014] The present invention also provides a data decryption method based on PUF hardware, comprising the following steps: A1: Obtain a decrypted random number based on the set PIN code and the first challenge value ciphertext; A2: inputting the decrypted random number into the PUF hardware to obtain a decrypted response value, and dividing the decrypted response value into a first decrypted response value and a second decrypted response value based on the number of bits corresponding to the response value; A3: Use the second decryption response value as the first decryption key to perform a secondary digest calculation on the first data ciphertext, and determine whether the data to be encrypted is damaged based on the secondary digest calculation result. If damaged, an error is reported; if not damaged, execute A4; A4: Use the first decryption response value as the second decryption key, process the first data ciphertext based on the symmetric encryption algorithm, and then obtain the data to be encrypted.
[0015] A1 also includes: comparing the decrypted random number with the first random number, executing A2 if the comparison is successful, and reporting an error if the comparison is unsuccessful.
[0016] In A3, judging whether the data to be encrypted is damaged based on the secondary digest calculation result includes: The secondary digest calculation result is compared with the first authentication code. If the comparison is successful, it means that the data to be encrypted is not damaged. If the comparison is unsuccessful, it means that the data to be encrypted is damaged.
[0017] Beneficial effects of this program: Since the decryption process directly depends on the decryption random number, once the decryption random number is correctly obtained, the decryption process can be carried out quickly without the need for additional verification or calculation steps. Therefore, the method of obtaining the decryption random number first improves the decryption efficiency. Through two comparisons, if the comparison is unsuccessful, it means that the subsequent decryption work cannot be performed correctly through the obtained data, thereby avoiding waste of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts.
[0019] Figure 1 A schematic diagram of a data encryption storage method based on PUF hardware according to the present invention; Figure 2 The figure is a flow chart of a data decryption method based on PUF hardware according to the present invention. DETAILED DESCRIPTION
[0020] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation method described herein is only an optimal embodiment of the present invention, which is only used to explain the present invention and does not limit the scope of protection of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0021] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the drawings; the process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0022] Embodiment 1: like Figure 1 As shown, a data encryption storage method based on PUF hardware includes the following steps: S1: Input a first random number into PUF hardware to obtain a response value, and divide the response value into a first response value and a second response value based on the number of bits corresponding to the response value.
[0023] The S1 includes: S11: randomly generate a first random number with preset bits, traverse each bit of the first random number in turn, regard the consecutive bits with the same value corresponding to the bits in the bit as a run, and determine whether the total number of runs of the first random number meets a preset condition, if so, continue to execute S12, if not, execute S11; S12: judging whether the PUF hardware meets the use requirements based on a number of reference response values, and if so, executing S13; if not, replacing the PUF hardware and continuing to execute S12; S13: Input the first random number into the PUF hardware to obtain a response value, and divide the response value into a first response value and a second response value based on the number of bits corresponding to the response value.
[0024] In S12, judging whether the PUF hardware meets the usage requirements based on a number of benchmark response values includes: Inputting a number of reference random numbers into the PUF hardware to obtain a number of reference response values, and dividing the corresponding reference response values into a first reference response value and a second reference response value based on the number of bits of the number of reference response values; Calculate the frequency of occurrence of different values at corresponding positions between each first reference response value, calculate the minimum entropy of each position based on the frequency of occurrence of different values at corresponding positions between each first reference response value, obtain the total entropy based on the minimum entropy of each position, and if the total entropy is greater than the preset entropy, determine that the PUF hardware meets the use requirements; if the total entropy is less than or equal to the preset entropy, determine that the PUF hardware does not meet the use requirements.
[0025] The application generates a 256-bit first random number, traverses each bit of the first random number in turn, and regards the consecutive bits with the same value corresponding to the bits in the bit as a run. For example, if the first random number is 01011111, the run of the first random number is 4 (0, 1, 0, 11111). The preset condition is set according to the bit of the first random number. If the preset condition is that the run is greater than 5, the preset condition is not met at this time. The application continues to generate the first random number until the first random number meets the preset condition. Before the first random number is input into the PUF hardware, the performance of the PUF hardware needs to be tested. The application generates several benchmark random numbers, inputs the several benchmark random numbers into the PUF hardware to obtain several benchmark response values, and divides each of the several benchmark response values into a first benchmark response value and a second benchmark response value. If the several first benchmark response values are 00112121, 11010100, and 10101110, respectively, each first benchmark response value corresponds to The frequencies of occurrence of different values at different positions are: the frequencies of 0 and 1 at the first position are 1 / 3 and 2 / 3 respectively, the frequencies of 0 and 1 at the second position are 2 / 3 and 1 / 3 respectively, and so on. The frequencies of 0 and 1 at the remaining positions are deduced in the same way. The formula H(i) = -log2(max(p0(i), p1(i))) is used, where p0(i) and p1(i) are the frequencies of 0 and 1 at the i-th position respectively. The minimum entropy of each position is calculated. For position 1, the minimum entropy is -log2(2 / 3), and for position 2, the minimum entropy is -log2(2 / 3). The minimum entropy is -log2(2 / 3), and the minimum entropy of the remaining positions is calculated in turn, and the total entropy is calculated. If the total entropy is less than or equal to the preset entropy, it is judged that the PUF hardware does not meet the use requirements. If the total entropy is greater than the preset entropy, it is judged that the PUF hardware meets the use requirements. The first random number is input into the PUF hardware that meets the use requirements to obtain the response value, and the response value is divided into the first response value and the second response value in half, that is, if the response value is 256 bits, the first 128 bits are the first response value, and the last 128 bits are the second response value. By judging whether the total number of runs meets the preset conditions, the first random number with low randomness is prevented from being input into the PUF hardware, the randomness and unpredictability of the first random number are guaranteed, and data security is enhanced. Entropy is a measure of randomness or uncertainty. The total entropy reflects the overall randomness and uniqueness of the response value generated by the PUF hardware. If the total entropy is greater than the preset entropy, the response value generated by the PUF hardware is considered to have sufficient randomness and uniqueness. By comparing the total entropy with the preset entropy, PUF hardware with insufficient randomness is excluded, which can reduce the security risks caused by hardware defects. At the same time, the calculation of entropy provides a quantitative method to evaluate the performance of PUF hardware, making the evaluation process more objective and reliable.
[0026] S2: Input the first response value into the data encryption model to encrypt the first data to be encrypted to generate a first data ciphertext, and input the second response value into the data encryption model to perform a digest calculation on the first data ciphertext to generate a first authentication code.
[0027] The S2 includes: S21: construct a data encryption model, and train the constructed data encryption model based on historical response data values; S22: using the first response value as an encryption key, inputting the encryption key into the trained data encryption model to encrypt the first data to be encrypted to generate a first data ciphertext; S23: Use the second response value as a digest key, input the digest key into the trained data encryption model, perform a digest calculation on the first data ciphertext, and generate a first authentication code.
[0028] In S21, the training of the constructed data encryption model based on the historical response data value includes: Inputting the second random number into the PUF hardware to obtain a historical response data value, and dividing the historical response data value into a first historical response data value and a second historical response data value based on the number of bits corresponding to the historical response data value; Input the first historical response data value into the constructed data encryption model, encrypt the second data to be encrypted based on the symmetric encryption algorithm to generate a second data ciphertext, input the second historical response data value into the constructed data encryption model, and perform a digest calculation on the second data ciphertext based on the HMAC algorithm to generate a second authentication code; Randomly generate a number of decrypted data, perform first processing on the number of decrypted data based on the symmetric encryption algorithm to obtain a number of first processing results, compare the number of first processing results with the second data ciphertext respectively, and record the number of first processing results that are successfully compared. If the number of first processing results that are successfully compared does not exceed a first preset number, it indicates that the constructed data encryption model meets the first training requirement; Randomly generate a number of authentication data, perform second processing on the number of authentication data based on the HMAC algorithm to obtain a number of second processing results, match the number of second processing results with the second authentication code, and record the number of successfully matched second processing results. If the number of successfully matched second processing results does not exceed the second preset number, it means that the constructed data encryption model meets the second training requirement; If the constructed data encryption model meets the first training requirement and the second training requirement, it means that the constructed data encryption model has been initially trained successfully. If the initially trained data encryption model meets the third training requirement, it means that the initially trained data encryption model has been initially trained successfully.
[0029] If the data encryption model that has been initially trained successfully meets the third training requirement, it means that the training of the data encryption model that has been initially trained successfully is successful, including: Input the preset PIN code into the data encryption model that has been preliminarily trained successfully, and encrypt the second random number based on the hash function to obtain a second challenge value ciphertext; A number of challenge data are randomly generated, and a third processing is performed on the number of challenge data based on a hash function to obtain a number of third processing results. The number of third processing results are compared with the second challenge value ciphertext respectively, and the number of third processing results that are successfully compared is recorded. If the number of third processing results that are successfully compared does not exceed a third preset number, it indicates that the data encryption model that has been successfully preliminarily trained meets the third training requirement.
[0030] Input the second random number generated by the application into the PUF hardware to obtain the historical response data value, divide the historical response data value in half into a first historical response data value and a second historical response data value, that is, if the historical response data value is 256 bits, the first 128 bits are the first historical response data value, and the last 128 bits are the second historical response data value, use the first historical response data value as the encryption key in combination with the SM4 algorithm to encrypt the second data to be encrypted, use the second historical response data value as the summary key in combination with the HMAC algorithm to perform summary calculation on the encrypted data obtained after encryption to generate a second authentication code.
[0031] The process of using the first historical response data value as the encryption key and combining it with the SM4 algorithm to encrypt the second data to be encrypted is as follows: divide the 128-bit encryption key into four 32-bit parts, use the system parameter FK to perform an XOR operation with each part of MK to obtain the initial K[0], K[1], K[2], K[3], and generate 32 32-bit round keys RK[0] to RK
[31] through 32 rounds of nonlinear iterations, using fixed parameters and a series of transformations. Divide the data to be encrypted into four 32-bit parts, perform 32 rounds of iterative calculations on these four parts, and use one round key for each round. After 32 rounds of iterations, four 32-bit states X
[32] , X
[33] , X
[34] , and X
[35] are obtained. Since the encryption process of SM4 includes a reverse order transformation, the final output ciphertext is the reverse order of these four states, that is, (X
[35] , X
[34] , X
[33] , X
[32] ).
[0032] The process of using the second historical response data value as a digest key and combining it with the HMAC algorithm to perform digest calculation on the encrypted data obtained after encryption to generate a second authentication code is as follows: select a hash function and use it in combination with the HMAC algorithm to obtain the second authentication code. If the length of the digest key is less than the block length of the hash function, fill O at the end of the digest key until its length reaches the block length. If the length of the digest key is greater than the block length, use the hash function to perform hash calculation on the digest key to obtain a new fixed-length hash value, use the hash value as the new digest key, create a sequence, set all bytes of the sequence, perform an XOR operation on the padded digest key and the sequence to obtain an internal key, similarly obtain an external key, attach the internal key to the beginning of the encrypted data to form a new data stream, use the selected hash function to perform hash calculation on the data stream to obtain a first hash value, attach the first hash value to the beginning of the external key to form a new data stream, use the selected hash function to perform hash calculation on the new data stream again, and the obtained hash value is the final second authentication code.
[0033] Due to the non-clonability of PUF response, the encryption key used for each encryption is unique. Through this method, even if the attacker obtains the encrypted data, it is difficult to find the encryption key by guessing or brute force, thereby ensuring the confidentiality of the data. Using the second response value as the summary key increases the unpredictability and uniqueness of the authentication code. At the same time, the authentication code is generated by summary calculation, which can verify the integrity and authenticity of the data during data transmission or storage, prevent data from being tampered with, and greatly enhance data security.
[0034] Use the corresponding algorithm to perform the same operation on several decrypted data, several authentication data, and several challenge data, and match the operation results with the second data ciphertext, the second authentication code, and the second challenge ciphertext respectively, and then judge the training results of the model, thereby enhancing the reliability of the model.
[0035] S3: Encrypt the first random number based on the set PIN code to obtain a first challenge value ciphertext, and compose encrypted and stored data based on the first data ciphertext, the first authentication code and the first challenge value ciphertext.
[0036] The S3 includes: S31: Expanding the PIN code to be expanded based on the randomly generated extended data to obtain an extended PIN code, inputting the extended PIN code into a data encryption model, and performing a hash calculation on the extended PIN code based on a hash function to obtain a first hash result; S32: Input the first hash result and the extended PIN code into a hash function to obtain a second hash result, and determine whether the second hash result meets the preset requirements. If so, continue to execute S33; if not, use the second hash result as the first hash result and continue to execute S32; S33: Use the second hash result as the set PIN code to encrypt the first random number, thereby obtaining a first challenge value ciphertext.
[0037] The randomly generated salt value is combined with the PIN code to be extended to obtain the extended PIN code, and the extended PIN code is input into the model for calculation. By extending the PIN code to be extended based on the randomly generated salt value, pre-calculation attack methods such as rainbow table attacks can be effectively prevented, thereby greatly improving the security of the PIN code. The generated hash result is ensured to meet specific security requirements through an iterative process. This nested use and iterative calculation method further increases the difficulty of cracking the PIN code and improves the security of the first random number and encrypted data.
[0038] Embodiment 2: like Figure 2 As shown, a data decryption method based on PUF hardware includes the following steps: A1: Obtain a decrypted random number based on the set PIN code and the first challenge value ciphertext.
[0039] A1 also includes: comparing the decrypted random number with the first random number, executing A2 if the comparison is successful, and reporting an error if the comparison is unsuccessful.
[0040] In this embodiment, if the first random number is 10101000, the set PIN code and the first challenge value ciphertext are obtained, and the set PIN code and the first challenge value ciphertext are inversely operated. For example, a hash function is used in the encryption process, and the inverse operation of the hash function is used in the decryption process to obtain the decrypted random number. If the decrypted random number is 10111010, it means that the comparison is unsuccessful and an error is reported. If the decrypted random number is 10101000, it means that the comparison is successful, and then continue with the following steps. Since the decryption process directly depends on the decryption random number, once the decryption random number is correctly obtained, the decryption process can be carried out quickly without the need for additional verification or calculation steps. Therefore, the method of obtaining the decryption random number first improves the decryption efficiency. A2: Input the decrypted random number into the PUF hardware to obtain a decrypted response value, and divide the decrypted response value into a first decrypted response value and a second decrypted response value based on the number of bits corresponding to the response value.
[0041] The decryption response value is divided into the first decryption response value and the second decryption response value in half, that is, if the decryption response value is 256 bits, the first 128 bits are the first decryption response value, and the last 128 bits are the second decryption response value. By dividing the data, it is convenient to perform targeted decryption operations later, thereby improving the decryption efficiency.
[0042] A3: Use the second decryption response value as the first decryption key to perform a secondary digest calculation on the first data ciphertext, and determine whether the data to be encrypted is damaged based on the secondary digest calculation result. If damaged, an error is reported; if not damaged, execute A4.
[0043] In A3, judging whether the data to be encrypted is damaged based on the secondary digest calculation result includes: The secondary digest calculation result is compared with the first authentication code. If the comparison is successful, it means that the data to be encrypted is not damaged. If the comparison is unsuccessful, it means that the data to be encrypted is damaged.
[0044] The second decryption response value is calculated in the same way as the encryption process, and then compared with the first authentication code to determine whether the encrypted data is damaged. If damaged, the decryption process is terminated, thereby avoiding waste of resources and improving resource utilization.
[0045] A4: Use the first decryption response value as the second decryption key, process the first data ciphertext based on the symmetric encryption algorithm, and then obtain the data to be encrypted.
[0046] Perform an inverse operation on the first data ciphertext. For example, if a symmetric encryption algorithm is used in the encryption process, the inverse operation of the symmetric decryption algorithm can be used in the decryption process to obtain the encrypted data. Symmetric encryption and decryption use the same key, ensuring that only legitimate users holding the key can decrypt the data, thereby effectively preventing the data from being accessed by unauthorized users during transmission or storage. This improves data security and decryption efficiency.
[0047] The specific implementation described above is a preferred implementation of a data encryption storage method and a decryption method based on PUF hardware of the present invention, and is not intended to limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to this specific implementation. Any equivalent changes made in accordance with the shape and structure of the present invention are within the protection scope of the present invention.
Claims
1. A data encryption storage method based on PUF hardware, characterized in that: The following steps are involved: S1: Inputting a first random number into PUF hardware to obtain a response value, and dividing the response value into a first response value and a second response value based on the number of bits corresponding to the response value; S2: Input the first response value into the data encryption model to encrypt the first data to be encrypted to generate a first data ciphertext, and input the second response value into the data encryption model to perform a digest calculation on the first data ciphertext to generate a first authentication code; S3: Encrypt the first random number based on the set PIN code to obtain a first challenge value ciphertext, and compose encrypted and stored data based on the first data ciphertext, the first authentication code and the first challenge value ciphertext.
2. A data encryption storage method based on PUF hardware according to claim 1, characterized in that: The S1 includes: S11: randomly generate a first random number with preset bits, traverse each bit of the first random number in turn, regard the consecutive bits with the same value corresponding to the bits in the bit as a run, and determine whether the total number of runs of the first random number meets a preset condition, if so, continue to execute S12, if not, execute S11; S12: judging whether the PUF hardware meets the use requirements based on a number of reference response values, and if so, executing S13; if not, replacing the PUF hardware and continuing to execute S12; S13: Input the first random number into the PUF hardware to obtain a response value, and divide the response value into a first response value and a second response value based on the number of bits corresponding to the response value.
3. A data encryption storage method based on PUF hardware according to claim 2, characterized in that: In S12, judging whether the PUF hardware meets the usage requirements based on a number of benchmark response values includes: Inputting a number of reference random numbers into the PUF hardware to obtain a number of reference response values, and dividing the corresponding reference response values into a first reference response value and a second reference response value based on the number of bits of the number of reference response values; Calculate the frequency of occurrence of different values at corresponding positions between each first reference response value, calculate the minimum entropy of each position based on the frequency of occurrence of different values at corresponding positions between each first reference response value, obtain the total entropy based on the minimum entropy of each position, and if the total entropy is greater than the preset entropy, determine that the PUF hardware meets the use requirements; if the total entropy is less than or equal to the preset entropy, determine that the PUF hardware does not meet the use requirements.
4. The data encryption storage method based on PUF hardware according to claim 1, characterized in that: The S2 includes: S21: construct a data encryption model, and train the constructed data encryption model based on historical response data values; S22: using the first response value as an encryption key, inputting the encryption key into the trained data encryption model to encrypt the first data to be encrypted to generate a first data ciphertext; S23: Use the second response value as a digest key, input the digest key into the trained data encryption model, perform a digest calculation on the first data ciphertext, and generate a first authentication code.
5. A data encryption storage method based on PUF hardware according to claim 4, characterized in that: In S21, the training of the constructed data encryption model based on the historical response data value includes: Inputting the second random number into the PUF hardware to obtain a historical response data value, and dividing the historical response data value into a first historical response data value and a second historical response data value based on the number of bits corresponding to the historical response data value; Input the first historical response data value into the constructed data encryption model, encrypt the second data to be encrypted based on the symmetric encryption algorithm to generate a second data ciphertext, input the second historical response data value into the constructed data encryption model, and perform a digest calculation on the second data ciphertext based on the HMAC algorithm to generate a second authentication code; Randomly generate a number of decrypted data, perform first processing on the number of decrypted data based on the symmetric encryption algorithm to obtain a number of first processing results, compare the number of first processing results with the second data ciphertext respectively, and record the number of first processing results that are successfully compared. If the number of first processing results that are successfully compared does not exceed a first preset number, it indicates that the constructed data encryption model meets the first training requirement; Randomly generate a number of authentication data, perform second processing on the number of authentication data based on the HMAC algorithm to obtain a number of second processing results, match the number of second processing results with the second authentication code, and record the number of successfully matched second processing results. If the number of successfully matched second processing results does not exceed the second preset number, it means that the constructed data encryption model meets the second training requirement; If the constructed data encryption model meets the first training requirement and the second training requirement, it means that the constructed data encryption model has been initially trained successfully. If the initially trained data encryption model meets the third training requirement, it means that the initially trained data encryption model has been initially trained successfully.
6. A data encryption storage method based on PUF hardware according to claim 5, characterized in that: If the data encryption model that has been preliminarily trained successfully meets the third training requirement, it means that the training of the data encryption model that has been preliminarily trained successfully is successful. The training includes: inputting a preset PIN code into the data encryption model that has been preliminarily trained successfully, and encrypting the second random number based on a hash function to obtain a second challenge value ciphertext; A number of challenge data are randomly generated, and a third processing is performed on the number of challenge data based on a hash function to obtain a number of third processing results. The number of third processing results are compared with the second challenge value ciphertext respectively, and the number of third processing results that are successfully compared is recorded. If the number of third processing results that are successfully compared does not exceed a third preset number, it indicates that the data encryption model that has been successfully preliminarily trained meets the third training requirement.
7. The data encryption storage method based on PUF hardware according to claim 1, characterized in that: The S3 includes: S31: Expanding the PIN code to be expanded based on the randomly generated extended data to obtain an extended PIN code, inputting the extended PIN code into a data encryption model, and performing a hash calculation on the extended PIN code based on a hash function to obtain a first hash result; S32: Input the first hash result and the extended PIN code into a hash function to obtain a second hash result, and determine whether the second hash result meets the preset requirements. If so, continue to execute S33; if not, use the second hash result as the first hash result and continue to execute S32; S33: Use the second hash result as the set PIN code to encrypt the first random number, thereby obtaining a first challenge value ciphertext.
8. A data decryption method based on PUF hardware, applicable to a data encryption storage method based on PUF hardware as claimed in any one of claims 1 to 7, characterized in that: The following steps are involved: A1: Obtain a decrypted random number based on the set PIN code and the first challenge value ciphertext; A2: inputting the decrypted random number into the PUF hardware to obtain a decrypted response value, and dividing the decrypted response value into a first decrypted response value and a second decrypted response value based on the number of bits corresponding to the response value; A3: Use the second decryption response value as the first decryption key to perform a secondary digest calculation on the first data ciphertext, and determine whether the data to be encrypted is damaged based on the secondary digest calculation result. If damaged, an error is reported; if not damaged, execute A4; A4: Use the first decryption response value as the second decryption key, process the first data ciphertext based on the symmetric encryption algorithm, and then obtain the data to be encrypted.
9. A data decryption method based on PUF hardware according to claim 8, characterized in that: A1 also includes: comparing the decrypted random number with the first random number, executing A2 if the comparison is successful, and reporting an error if the comparison is unsuccessful.
10. A data decryption method based on PUF hardware according to claim 8, characterized in that: In A3, judging whether the data to be encrypted is damaged based on the secondary digest calculation result includes: The secondary digest calculation result is compared with the first authentication code. If the comparison is successful, it means that the data to be encrypted is not damaged. If the comparison is unsuccessful, it means that the data to be encrypted is damaged.
Citation Information
Patent Citations
A portable SRAM PUF digital encryption and decryption method and system
CN117914491B
Integrated circuit, encryption communication apparatus, encryption communication system, information processing method and encryption communication method
CN101847296A
Excitation response pair generation device and method based on PUF
CN113810194A
High-entropy random number generation method in physical unclonable function hardware
CN116527238A
Enrollment of Physically Unclonable Functions
US20120131340A1