A data encryption storage method and decryption method based on PUF hardware

By dividing the response value in the PUF hardware for encryption and generating an authentication code, and using the PIN code to encrypt the random number, the problem of easy data leakage and tampering in the existing technology is solved, and high data security and integrity are achieved.

CN119378027BActive Publication Date: 2025-10-17ZHEJIANG HUAYUN INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411246681.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-10-17
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

In the existing technology, the data encryption storage method based on PUF hardware lacks a protection mechanism for input data, and the authentication code is easy to obtain, resulting in easy leakage and tampering of data.

Method used

Taking advantage of the uniqueness and non-cloning properties of PUF devices, a random number is input into the PUF hardware to obtain a response value, which is then divided and encrypted to generate data ciphertext and authentication code. The random number is then encrypted using a PIN code to ensure that only legitimate users can decrypt it.

Benefits of technology

It achieves double protection of data, improves data security and integrity, prevents data leakage and tampering, and enhances data confidentiality and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378027B_ABST
    Figure CN119378027B_ABST
Patent Text Reader

Abstract

The application discloses a data encryption storage method and decryption method based on PUF hardware, and belongs to the technical field of information security, and comprises 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 bit positions corresponding to the response value; S2, inputting the first response value into a data encryption model to encrypt first to-be-encrypted data and generate first data ciphertext, and inputting the second response value into the data encryption model to perform one-time digest calculation on the first data ciphertext and generate a first authentication code; and S3, encrypting the first random number based on a set PIN code, and then obtaining first challenge value ciphertext, and constructing data for encrypted storage based on the first data ciphertext, the first authentication code and the first challenge value ciphertext. The problems that data is prone to leakage and tampering due to the lack of a protection mechanism for data input into PUF hardware and the fact that an authentication code is relatively easy to obtain are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of information security, in particular to a data encryption storage method and decryption method based on PUF hardware. BACKGROUND

[0002] With the rapid development of information technology, the importance of data security is increasingly prominent. Traditional encryption storage methods usually rely on software algorithms, but such methods have problems such as vulnerability to attacks and complex key management. PUF is a kind of physical unclonable function based on hardware. Its essence is to use the tiny differences generated in the hardware manufacturing process to generate unique and difficult-to-copy keys. Therefore, PUF technology has broad application prospects in the field of data encryption storage. For example, a digital encryption and decryption method and system of a portable PUF with patent number CN117914491B, the method comprises: generating original data; generating first excitation information according to the original data and sending it to the portable SRAM PUF device, receiving the first response information returned by the portable SRAM PUF device for the first excitation information; the encryption device is connected with the portable SRAM PUF device through an electronic interface; generating a first key according to a preset encryption algorithm and the first response information; obtaining encrypted data, generating a check code of the encrypted data; generating encryption information according to the first key, the encrypted data, the check code of the encrypted data, the preset encryption algorithm and the original data; sending the encryption information to the decryption device to make the decryption device use the portable SRAM PUF device to decrypt the encryption information. The above scheme can reduce the risk hidden danger in the key distribution process and improve the security of data storage and transmission. However, the above scheme does not protect the data input into the PUF device, and the check code in the above scheme is only set according to the encrypted data, so it is relatively easy to obtain the data input into the PUF device or the check code, which may lead to data leakage and tampering. SUMMARY

[0003] The prior art lacks a protection mechanism for data input into PUF hardware, and authentication codes are easy to obtain, resulting in easy data leakage and tampering. The present application provides a data encryption storage method and decryption method based on PUF hardware, which fully utilizes the uniqueness and unclonability of PUF devices, inputs the first random number into the PUF device to obtain a unique response value, and then inputs the first response value into a data encryption model to generate a first data ciphertext, 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 encrypting the first random number using the PIN code. This encryption method allows only users with the correct PIN code to decrypt the first random number, ensuring the security of data input into PUF hardware and significantly preventing data leakage and tampering. The lack of a protection mechanism for data input into PUF hardware and the ease of obtaining authentication codes result in easy data leakage and tampering. The security of individual data is improved, and the security of the data to be encrypted is improved through the correlation and constraints between the links.

[0004] To solve the above technical problems, the present application provides a data encryption storage method based on PUF hardware, comprising the following steps:

[0005] S1: input the first random number into the PUF hardware to obtain the response value, and divide the response value into the first response value and the second response value based on the number of bits corresponding to the response value;

[0006] 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 one-time digest calculation on the first data ciphertext to generate a first authentication code;

[0007] S3: encrypt the first random number based on the set PIN code to obtain a first challenge value ciphertext, and based on the first data ciphertext, the first authentication code and the first challenge value ciphertext to form the encrypted storage data.

[0008] After adopting the above technical solution, the present application has the following advantages:

[0009] Since the PUF device has uniqueness and unclonability, a unique and difficult-to-copy response value will be generated after the first random number is input into the PUF device, so 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 first response value is divided, and then the first to be encrypted data is encrypted based on the first response value, and the first authentication code is generated based on the second response value, realizing the double protection of the data, and the first random number is encrypted, avoiding 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 that the data is easy to leak and tamper due to the lack of protection mechanism for the data input into the PUF hardware and the authentication code is easy to obtain.

[0010] Preferably, the S1 comprises:

[0011] S11: randomly generate a first random number of a preset bit, sequentially traverse each bit of the first random number, regard the continuous bits with the same value as a run, judge whether the total number of runs of the first random number meets a preset condition, if yes, continue to execute S12, if not, execute S11;

[0012] S12: judge whether the PUF hardware meets the use requirement based on a plurality of reference response values, if yes, execute S13, if not, replace the PUF hardware and continue to execute S12;

[0013] 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 condition, it is prevented that the first random number with low randomness is input into the PUF hardware, the randomness and unpredictability of the first random number are ensured, and the data security is enhanced.

[0014] Preferably, in S12, the judging whether the PUF hardware meets the use requirement based on a 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 first reference response values and second reference response values based on the number of bits of the plurality of reference response values.

[0015] The frequency of the different values of the corresponding positions between each first reference response value is calculated, the minimum entropy of each position is calculated based on the frequency of the different values of the corresponding positions between each first reference response value, the total entropy is obtained 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 requirement, 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 requirement. Entropy is a measure of randomness or uncertainty, and the total entropy reflects the overall randomness and uniqueness of the response values generated by the PUF hardware. If the total entropy is greater than the preset entropy, it is considered that the response values generated by the PUF hardware have sufficient randomness and uniqueness. By comparing the total entropy with the preset entropy, PUF hardware with insufficient randomness can be excluded, which can reduce the security risk 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.

[0016] Preferably, the S2 comprises:

[0017] S21: constructing a data encryption model, and training the constructed data encryption model based on historical response data values;

[0018] S22: taking the first response value as an encryption key, inputting the encryption key into the trained data encryption model, and encrypting the first to-be-encrypted data to generate a first data ciphertext;

[0019] S23: taking the second response value as a digest key, inputting the digest key into the trained data encryption model, and performing a digest calculation on the first data ciphertext to generate a first authentication code.

[0020] Due to the unclonability of PUF response, the encryption key used for each encryption is unique. Through this method, even if an attacker obtains the encrypted data, it is difficult to find the encryption key through guessing or brute force cracking, thereby ensuring the confidentiality of the data. Using the second response value as the digest key increases the unpredictability and uniqueness of the authentication code. At the same time, the authentication code is generated through digest calculation, which can verify the integrity and authenticity of the data during data transmission or storage, prevent data tampering, and greatly enhance the security of the data.

[0021] Preferably, in S21, the training of the constructed data encryption model based on historical response data values comprises: inputting a second random number into the PUF hardware to obtain historical response data values, dividing the historical response data values into first historical response data values and second historical response data values based on the number of bits corresponding to the historical response data values;

[0022] inputting the first historical response data value into the built data encryption model, encrypting the second to-be-encrypted data based on a symmetric encryption algorithm to generate second data ciphertext, inputting the second historical response data value into the built data encryption model, and performing digest calculation on the second data ciphertext based on an HMAC algorithm to generate a second authentication code;

[0023] randomly generating a plurality of decryption data, performing first processing on the plurality of decryption data based on a symmetric encryption algorithm to obtain a plurality of first processing results, comparing the plurality of first processing results with the second data ciphertext respectively, recording the number of first processing results that pass the comparison, and if the number of first processing results that pass the comparison does not exceed a first preset number, indicating that the built data encryption model meets the first training requirement;

[0024] randomly generating a plurality of authentication data, performing second processing on the plurality of authentication data based on an HMAC algorithm to obtain a plurality of second processing results, matching the plurality of second processing results with the second authentication code respectively, recording the number of second processing results that pass the matching, and if the number of second processing results that pass the matching does not exceed a second preset number, indicating that the built data encryption model meets the second training requirement;

[0025] if the built data encryption model meets the first training requirement and the second training requirement, indicating that the built data encryption model is preliminarily trained successfully, and if the preliminarily trained data encryption model meets a third training requirement, indicating that the preliminarily trained data encryption model is trained successfully. By strictly controlling the performance of the built data encryption model, it is ensured that the data encryption model can maintain stable encryption effect in various complex environments, thereby effectively protecting the confidentiality, integrity and availability of data.

[0026] Preferably, if the preliminarily trained data encryption model meets the third training requirement, indicating that the preliminarily trained data encryption model is trained successfully, the preliminarily trained data encryption model meeting the third training requirement comprises:

[0027] inputting a preset PIN code into the preliminarily trained data encryption model, and encrypting the second random number based on a hash function to obtain second challenge value ciphertext;

[0028] randomly generating a plurality of challenge data, performing third processing on the plurality of challenge data based on a hash function to obtain a plurality of third processing results, comparing the plurality of third processing results with the second challenge value ciphertext respectively, recording the number of third processing results that pass the comparison, and if the number of third processing results that pass the comparison does not exceed a third preset number, indicating that the preliminarily trained data encryption model meets the third training requirement.

[0029] Preferably, the S3 comprises:

[0030] S31: Extending the PIN code to be extended 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;

[0031] 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 S33; if not, use the second hash result as the first hash result and continue to S32;

[0032] S33: The first random number is encrypted using the second hash result as the set PIN, thereby obtaining the first challenge value ciphertext. By expanding the PIN to be expanded based on the randomly generated salt value, pre-computation attacks such as rainbow table attacks can be effectively prevented, thereby significantly improving the security of the PIN. The iterative process ensures that the generated hash result meets specific security requirements. This nested use and iterative calculation method further increases the difficulty of cracking the PIN and improves the security of the first random number and encrypted data.

[0033] Beneficial effects of this program:

[0034] Since PUF devices are unique and unclonable, a unique and difficult-to-copy response value is 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 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. This achieves dual 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.

[0035] 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;

[0036] This solves the problem of data leakage and tampering caused by the lack of a protection mechanism for data input into PUF hardware and the ease of obtaining authentication codes.

[0037] The present invention also provides a data decryption method based on PUF hardware, comprising the following steps:

[0038] A1: Obtain a decrypted random number based on the set PIN code and the first challenge value ciphertext;

[0039] A2: input the decryption random number into the PUF hardware to obtain a decryption response value, divide the decryption response value into a first decryption response value and a second decryption response value based on the number of bit positions corresponding to the response value;

[0040] A3: perform a second digest calculation on the first data ciphertext by taking the second decryption response value as a first decryption key, judge whether the data to be encrypted is damaged based on the second digest calculation result, if damaged, report an error, if not damaged, perform A4;

[0041] A4: take the first decryption response value as a second decryption key, process the first data ciphertext based on a symmetric encryption algorithm, and then obtain the data to be encrypted.

[0042] The A1 further comprises: comparing the decryption random number with the first random number, if the comparison is successful, performing A2, if the comparison is not successful, reporting an error.

[0043] In A3, the judging whether the data to be encrypted is damaged based on the second digest calculation result comprises:

[0044] Comparing the second digest calculation result with the first authentication code, if the comparison is successful, indicating that the data to be encrypted is not damaged, if the comparison is not successful, indicating that the data to be encrypted is damaged.

[0045] The beneficial effects of the present scheme are:

[0046] Since the decryption process directly depends on the decryption random number, once the decryption random number is correctly obtained, the decryption process can be quickly performed without additional verification or calculation steps, therefore the way of obtaining the decryption random number first improves the decryption efficiency, through two comparisons, if the comparison is not successful, it indicates that the obtained data cannot correctly perform the subsequent decryption work, thereby avoiding resource waste. BRIEF DESCRIPTION OF DRAWINGS

[0047] Other features, objects, and advantages of the application will become more apparent from the following detailed description of non-limiting embodiments, read in conjunction with the accompanying drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the application. Moreover, the same reference numerals are used in different drawings to denote the same components.

[0048] Figure 1 A flowchart of a data encryption storage method based on PUF hardware of the present application;

[0049] Figure 2 A flowchart of a data decryption method based on PUF hardware of the present application. DETAILED DESCRIPTION

[0050] In order to make the objects, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the drawings and examples. It should be understood that the specific implementation described herein is only one of the best embodiments of the present application, which is used to explain the present application and does not limit the protection scope of the present application. All other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.

[0051] Before the example embodiments are discussed in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted as flow diagrams. While the flow diagrams depict the operations (or steps) as a sequential process, many of the operations (or steps) can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations can be re-arranged. The processes can be terminated when their operations are completed, but can also have additional steps not included in the figure, which can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0052] Embodiment 1:

[0053] As shown in Figure 1 A data encryption storage method based on PUF hardware includes the following steps:

[0054] 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 bit positions corresponding to the response value.

[0055] The S1 includes:

[0056] S11: randomly generating a first random number of a preset bit position, sequentially traversing each bit position of the first random number, regarding the continuous bit positions with the same numerical value corresponding to the bit positions in the bit positions as a run, judging whether the total number of runs of the first random number satisfies a preset condition, if yes, continuing to perform S12, and if not, performing S11;

[0057] S12: judging whether the PUF hardware satisfies a use requirement based on a plurality of reference response values, if yes, performing S13, and if not, replacing the PUF hardware and then continuing to perform S12;

[0058] S13: inputting the first random number into the 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 bit positions corresponding to the response value.

[0059] In the S12, the judging whether the PUF hardware satisfies the use requirement based on the plurality of reference response values includes:

[0060] The several reference response values are obtained by inputting several reference random numbers into the PUF hardware, and the corresponding reference response values are divided into first reference response values and second reference response values based on the number of bits of the several reference response values;

[0061] The frequency of the different values at the corresponding positions between each first reference response value is calculated, the minimum entropy of each position is calculated based on the frequency of the different values at the corresponding positions between each first reference response value, the total entropy is obtained based on the minimum entropy of each position, if the total entropy is greater than a preset entropy, it is judged that the PUF hardware meets the use requirement, and 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 requirement.

[0062] The application program generates a first random number of 256 bits, sequentially traverses each bit of the first random number, and regards continuous bits with the same value as a run, for example, if the first random number is 01011111, the runs of the first random number are 4 (0, 1, 0, 11111). The preset condition is set according to the bits 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, and the application program 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 verified. The application program generates a plurality of benchmark random numbers, inputs the plurality of benchmark random numbers into the PUF hardware to obtain a plurality of benchmark response values, and divides each benchmark response value into a first benchmark response value and a second benchmark response value. If the plurality of first benchmark response values are 00112121, 11010100 and 10101110 respectively, the frequency of the different values appearing at the corresponding positions between each first benchmark response value is: 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 the frequencies of 0 and 1 at the remaining positions are calculated in turn. Using the formula H(i) = -log2(max(p0(i), p1(i))), 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). The minimum entropy of the remaining positions is calculated in turn. 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 requirement. If the total entropy is greater than the preset entropy, it is judged that the PUF hardware meets the use requirement. The first random number is input into the PUF hardware that meets the use requirement to obtain a response value. The response value is divided into a first response value and a second response value, 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 condition, 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 ensured, and the 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, it is considered that the response value generated by the PUF hardware has sufficient randomness and uniqueness. By comparing the size of the total entropy and the preset entropy, the PUF hardware with insufficient randomness is excluded, which can reduce the security risk caused by hardware defects. At the same time, the calculation of entropy provides a quantitative method to evaluate the performance of the PUF hardware, making the evaluation process more objective and reliable.

[0063] S2: input the first response value into the data encryption model to encrypt the first data to be encrypted to generate first data ciphertext, and input the second response value into the data encryption model to perform one-time digest calculation on the first data ciphertext to generate a first authentication code.

[0064] The S2 includes:

[0065] S21: constructing a data encryption model, and training the constructed data encryption model based on historical response data values;

[0066] S22: inputting 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 first data ciphertext;

[0067] S23: inputting the second response value as a digest key, inputting the digest key into the trained data encryption model to perform one-time digest calculation on the first data ciphertext to generate a first authentication code.

[0068] In the S21, the training of the constructed data encryption model based on historical response data values includes:

[0069] inputting the second random number into the PUF hardware to obtain historical response data values, and dividing the historical response data values into first historical response data values and second historical response data values based on the number of bits corresponding to the historical response data values;

[0070] inputting the first historical response data values into the constructed data encryption model, encrypting the second data to be encrypted based on a symmetric encryption algorithm to generate second data ciphertext, and inputting the second historical response data values into the constructed data encryption model, performing digest calculation on the second data ciphertext based on an HMAC algorithm to generate a second authentication code;

[0071] randomly generating a plurality of decryption data, performing first processing on the plurality of decryption data based on a symmetric encryption algorithm to obtain a plurality of first processing results, comparing the plurality of first processing results with the second data ciphertext respectively, recording the number of first processing results that are successfully compared, and 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;

[0072] randomly generating a plurality of authentication data, performing second processing on the plurality of authentication data based on an HMAC algorithm to obtain a plurality of second processing results, matching the plurality of second processing results with the second authentication code respectively, recording the number of second processing results that are successfully matched, and if the number of second processing results that are successfully matched does not exceed a second preset number, it indicates that the constructed data encryption model meets the second training requirement;

[0073] If the constructed data encryption model meets the first training requirement and the second training requirement, it means that the constructed data encryption model is preliminarily trained successfully, and if the preliminarily trained data encryption model meets the third training requirement, it means that the preliminarily trained data encryption model is trained successfully.

[0074] If the preliminarily trained data encryption model meets the third training requirement, it means that the preliminarily trained data encryption model is trained successfully, which includes:

[0075] The preset PIN code is input into the preliminarily trained data encryption model, and the second random number is encrypted based on a hash function to obtain a second challenge value ciphertext;

[0076] A plurality of challenge data are randomly generated, the plurality of challenge data are respectively processed based on a hash function to obtain a plurality of third processing results, the plurality of third processing results are respectively compared with the second challenge value ciphertext, the number of third processing results that pass the comparison is recorded, and if the number of third processing results that pass the comparison does not exceed a third preset number, it means that the preliminarily trained data encryption model meets the third training requirement.

[0077] The second random number generated by the application program is input into the PUF hardware to obtain historical response data values, and the historical response data values are divided into first historical response data values and second historical response data values, i.e., if the historical response data values are 256 bits, the first 128 bits are the first historical response data values and the last 128 bits are the second historical response data values, the first historical response data values are used as encryption keys to encrypt the second data to be encrypted in combination with the SM4 algorithm, and the second historical response data values are used as digest keys to calculate the digest of the encrypted data to generate a second authentication code.

[0078] The process of using the first historical response data values as encryption keys to encrypt the second data to be encrypted in combination with the SM4 algorithm is as follows: the 128-bit encryption key is divided into four 32-bit parts, and each part is XORed with the system parameters FK and MK to obtain the initial K[0], K[1], K[2], and K[3]. Through 32 rounds of nonlinear iteration, a series of transformations and fixed parameters are used to generate 32 32-bit round keys RK[0] to RK

[31] . The data to be encrypted is divided into four 32-bit parts, and 32 rounds of iteration calculation are performed on the four parts. Each round uses a round key. After 32 rounds of iteration, four 32-bit states X

[32] , X

[33] , X

[34] , and X

[35] are obtained. Since the encryption process of SM4 includes a reverse transformation, the final output ciphertext is the reverse order arrangement of the four states, i.e., (X

[35] , X

[34] , X

[33] , X

[32] ).

[0079] The process of combining the second historical response data value as a digest key with the HMAC algorithm to perform digest calculation on the encrypted data obtained after encryption to generate a second authentication code is as follows: a hash function is selected to be used in combination with the HMAC algorithm to obtain the second authentication code, if the length of the digest key is less than the packet length of the hash function, O is padded at the end of the digest key until its length reaches the packet length, if the length of the digest key is greater than the packet length, the digest key is hashed using the hash function to obtain a new fixed-length hash value, which is used as a new digest key, a sequence is created, all bytes of the sequence are set, the padded digest key is XORed with the sequence to obtain an internal key, similarly, an external key is obtained, the internal key is appended to the beginning of the encrypted data to form a new data stream, the selected hash function is used to hash the data stream to obtain a first hash value, the first hash value is appended to the beginning of the external key to form a new data stream, the selected hash function is used again to hash the new data stream, and the obtained hash value is the final second authentication code.

[0080] Due to the unclonability of the PUF response, the encryption key used each time is unique, and through this method, even if the attacker obtains the encrypted data, it is difficult to find the encryption key through guessing or brute force cracking, thereby ensuring the confidentiality of the data, using the second response value as the digest key increases the unpredictability and uniqueness of the authentication code, and at the same time, the authentication code is generated through digest calculation, which can verify the integrity and authenticity of the data during data transmission or storage, prevent data tampering, and greatly enhance the security of the data.

[0081] The same operation is performed on the plurality of decrypted data, the plurality of authentication data, and the plurality of challenge data using the corresponding algorithm, and the operation results are matched with the second data ciphertext, the second authentication code, and the second challenge ciphertext respectively, and then the training result of the model is judged, thereby enhancing the reliability of the model.

[0082] S3: encrypting the first random number based on the set PIN code to obtain a first challenge value ciphertext, and constructing the data for encrypted storage based on the first data ciphertext, the first authentication code, and the first challenge value ciphertext.

[0083] The S3 includes:

[0084] S31: expanding the PIN code to be expanded based on the randomly generated expansion data to obtain an expanded PIN code, inputting the expanded PIN code into the data encryption model, and performing hash calculation on the expanded PIN code based on a hash function to obtain a first hash result;

[0085] S32: input the first hash result and the extended PIN code into a hash function to obtain a second hash result, determine whether the second hash result meets a preset requirement, if yes, continue to perform S33, if not, take the second hash result as the first hash result, and continue to perform S32;

[0086] S33: encrypt the first random number with the second hash result as a set PIN code to obtain a first challenge value ciphertext.

[0087] The randomly generated salt value is combined with the PIN code to be extended to obtain an 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, the rainbow table attack and other pre-computation attack means can be effectively prevented, thereby greatly improving the security of the PIN code. Through the iteration process, it is ensured that the generated hash result meets the specific security requirements. 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 the encrypted data.

[0088] Embodiment 2:

[0089] As shown in the following figure, a data decryption method based on PUF hardware includes the following steps: Figure 2

[0090] A1: obtaining a decryption random number based on a set PIN code and a first challenge value ciphertext.

[0091] The A1 further includes: comparing the decryption random number with the first random number, if the comparison is successful, performing A2, if the comparison is not successful, reporting an error.

[0092] In this embodiment, if the first random number is 10101000, a set PIN code and a first challenge value ciphertext are obtained, and inverse operations are performed on the set PIN code and the first challenge value ciphertext. For example, a hash function is used in the encryption process, and in the decryption process, the inverse operation of the hash function is used to obtain the decryption random number. If the decryption random number is 10111010, it indicates that the comparison is not successful and an error is reported. If the decryption random number is 10101000, it indicates that the comparison is successful, and the following steps are continued. Since the decryption process directly depends on the decryption random number, once the decryption random number is correctly obtained, the decryption process can be quickly performed without additional verification or calculation steps. Therefore, the way of first obtaining the decryption random number improves the decryption efficiency,

[0093] A2: inputting the decryption random number into the PUF hardware to obtain a decryption response value, and dividing the decryption response value into a first decryption response value and a second decryption response value based on the number of bits corresponding to the response value.

[0094] ​The decrypted response value is divided into a first decrypted response value and a second decrypted response value, that is, if the decrypted response value is 256 bits, the first 128 bits are the first decrypted response value, and the last 128 bits are the second decrypted response value. The data is divided to facilitate subsequent targeted decryption operations and improve decryption efficiency.

[0095] A3: The second decrypted response value is used as a first decryption key to perform a second digest calculation on the first data ciphertext, and whether the data to be encrypted is damaged is determined based on the second digest calculation result. If damaged, an error is reported, and if not damaged, A4 is performed.

[0096] In A3, the determination of whether the data to be encrypted is damaged based on the second digest calculation result comprises:

[0097] The second digest calculation result is compared with the first authentication code. If the comparison is successful, it indicates that the data to be encrypted is not damaged, and if the comparison is not successful, it indicates that the data to be encrypted is damaged.

[0098] The second decrypted response value is calculated in the same way as the encryption process, and then compared with the first authentication code to determine whether the data to be encrypted is damaged. If damaged, the decryption process is ended, avoiding waste of resources and improving resource utilization.

[0099] A4: The first decrypted response value is used as a second decryption key to process the first data ciphertext based on a symmetric encryption algorithm, and then the data to be encrypted is obtained.

[0100] The first data ciphertext is subjected to an inverse operation. For example, a symmetric encryption algorithm is used in the encryption process, and in the decryption process, the inverse operation of the symmetric decryption algorithm is used to obtain the data to be encrypted. The same key is used for symmetric encryption and decryption, ensuring that only legitimate users with the key can decrypt the data, thereby effectively preventing unauthorized users from accessing the data during transmission or storage. This improves the security of the data and improves the decryption efficiency.

[0101] The above-described specific embodiments are preferred embodiments of the data encryption storage method and decryption method based on PUF hardware, and do not limit the specific implementation range of the present application. The scope of the present application includes but is not limited to the specific embodiments. Any equivalent changes made in accordance with the shape and structure of the present application are within the scope of protection of the present application.

Claims

1. A data encryption storage method based on PUF hardware, characterized in that: The following steps are involved: S1: Input a 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; 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: Said S1 comprises: S11: randomly generate a first random number with preset bits, traverse each bit of the first random number in turn, regard consecutive bits with the same value corresponding to the bits in the bit sequence 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: Determine whether the PUF hardware meets the usage requirements based on several benchmark response values. If so, execute S13. If not, replace the PUF hardware and continue executing 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. The 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 the plurality of benchmark response values ​​includes: 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, and obtain the total entropy based on the minimum entropy of each position. If the total entropy is greater than the preset entropy, it is determined that the PUF hardware meets the usage requirements; if the total entropy is less than or equal to the preset entropy, it is determined that the PUF hardware does not meet the usage requirements.

4. The data encryption storage method based on PUF hardware according to claim 1, characterized in that: The S2 includes: S21: Build a data encryption model and train the built 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. The 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 a first processing on each of the decrypted data based on a symmetric encryption algorithm to obtain a number of first processing results, compare each of the first processing results with the second data ciphertext, and record the number of first processing results that successfully compare. If the number of first processing results that successfully compare 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 a second processing on each of the authentication data based on the HMAC algorithm to obtain a number of second processing results, match each of the 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 a second preset number, it indicates 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 preliminarily trained successfully. If the preliminarily trained data encryption model meets the third training requirement, it means that the preliminarily trained data encryption model has been trained successfully.

6. The data encryption storage method based on PUF hardware according to claim 5, characterized in that: If the preliminarily trained data encryption model satisfies the third training requirement, the preliminarily trained data encryption model training is successful. The preliminarily trained data encryption model training includes: inputting a preset PIN code into the preliminarily trained data encryption model, and encrypting the second random number based on a hash function to obtain a second challenge value ciphertext; Randomly generate a number of challenge data, perform third processing on the several challenge data based on the hash function to obtain a number of third processing results, compare the several third processing results with the second challenge value ciphertext respectively, and record the number of third processing results that are successfully compared. If the number of third processing results that are successfully compared does not exceed the third preset number, it means 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: Extending the PIN code to be extended 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 S33; if not, use the second hash result as the first hash result and continue to S32; S33: Encrypt the first random number using the second hash result as the set PIN code to obtain a first challenge value ciphertext.

8. A data decryption method based on PUF hardware, applicable to the data encryption storage method based on PUF hardware according to 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: Using the second decryption response value as the first decryption key, perform a secondary digest calculation on the first data ciphertext. Based on the secondary digest calculation result, determine whether the encrypted data is damaged. If damaged, report an error. If not, 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. The data decryption method based on PUF hardware according to claim 8, characterized in that: The A1 further 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. The data decryption method based on PUF hardware according to claim 8, characterized in that: In A3, judging whether the encrypted data 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

  • Enrollment of Physically Unclonable Functions

    US20120131340A1

  • Cryptographic device having physical unclonable function

    US20180241557A1