Method for generating reproducible random number
By generating reproducible random numbers in the secure isolation area or outside the security chip, encrypting and exporting the secure data, the problem of limited internal storage space is solved, and flexible management and secure operation of secure data is achieved.
Patent Information
- Application Number
- CN202311404598.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-16
- Filing Date
- 2023-10-27
- Publication Date
- 2025-04-18
AI Technical Summary
The internal storage space of the secure isolation area or security chip is limited, and it is impossible to effectively save and use a large amount of security data, which limits the application of its security functions.
By generating reproducible random numbers in a secure isolation area or outside the security chip, the secure data that needs to be saved is encrypted and exported, and decrypted when needed with the reproducible random number decryptor and perform secure operations.
It solves the problem of limited storage space in the secure isolation area or security chip, realizes flexible management and secure operation of secure data, and avoids the impact of storage space limitations on security functions.
Smart Images

Figure CN119847475A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field related to a security isolation area or a security chip, and in particular to a method for generating reproducible random numbers for a security isolation area or a security chip. Background Art
[0002] The internal storage space of the Security Enclave (SE) and Security Chip (SC) is limited, and is generally used to store a limited amount of security data, such as private keys. In addition to limited security storage functions, a set of security processes must be provided to call security data to perform security functions, such as encryption or signing. Due to these limitations, when integrating the Security Enclave (SE) or Security Chip (SC) into a computer system, the security functions of the Security Enclave or Security Chip can only be limited to the platform level and cannot be opened to general users. Apple's Security Enclave (SE) and TPM2.0 (standard SC for PCs) are typical examples.
[0003] Based on the above-mentioned deficiencies, the present invention proposes a new method, which can encrypt the security data that originally needs to be stored in the secure isolation area (SE) or the security chip (SC) with a reproducible random number that can only be reproduced in the secure isolation area (SE) or the security chip (SC) to become encrypted data and store it externally, so that it is not limited by the internal storage space of the secure isolation area (SE) or the security chip (SC), while ensuring that the encrypted data can only be read back to the secure isolation area (SE) or the security chip (SC) to be correctly decrypted for specified security operations. Summary of the invention
[0004] According to one aspect of the present invention, a method for reproducible random number generation is proposed, which can be executed in a computer system with a security zone, the method comprising: generating security data required for a security operation within the security zone from within the security zone or importing it from the outside, and the security zone is integrated into the computer system; the security zone sets an encryption / decryption configuration and a derivative function configuration according to the security operation, encrypts the security data by a reproducible random number encryptor to obtain an encrypted data packet; exports the encrypted data packet to the external storage of the security isolation zone or the security chip by the computer system; when the security operation needs to be performed, imports the corresponding encrypted data packet into the security isolation zone or the security chip by the computer system, decrypts it with a reproducible random number decryptor to obtain the above-mentioned security data, and then performs the security operation.
[0005] According to one embodiment, the above-mentioned reproducible random number encryptor is composed of a reproducible random number generator and an encryptor, which are used to encrypt the security data into the encrypted data packet; the above-mentioned reproducible random number generator is composed of a random bit generator, a static random number and a key derivation function. Each time the reproducible random number generator is operated, the random bit generator generates a random number option, and then the random number option and the static random number are input into the key derivation function for key derivation function operation to generate a reproducible random number.
[0006] According to one embodiment, the reproducible random number decryptor is composed of a reproducible random number reproducer and a decryptor, which is used to decrypt the encrypted data packet into the security data; the reproducible random number reproducer can reproduce the random number generated by the reproducible random number generator. The derivation function configuration is to configure the control signal of the key derivation function according to the properties of the security data, and the derivation function configuration is the output length; the encryption / decryption configuration includes encryption length / decryption length and encryption type.
[0007] According to one embodiment, the static random number is a random number, which is set when the security isolation area or security chip is shipped out of the factory. Generally, the random number is output by the random bit generator in the chip and stored in the non-volatile memory in the chip, and remains unchanged during the life cycle of the device. The method for improving the randomness of the static random number includes providing a high-quality random number from the outside and then mixing the random number generated by the random bit generator in the security isolation area or security chip using a logical mutual exclusion operation, and writing it into the static random number storage for storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 Schematic diagram of a reproducible random number generator according to an embodiment of the present invention.
[0009] Figure 2 Schematic diagram of a reproducible random number reproducer according to an embodiment of the present invention.
[0010] Figure 3 It is a schematic diagram of a method for improving the randomness of a static random number (SRN) according to an embodiment of the present invention.
[0011] Figure 4 A schematic diagram of a reproducible random number encryptor formed by combining a reproducible random number generator and an encryptor according to an embodiment of the present invention.
[0012] Figure 5 A schematic diagram of a reproducible random number decryptor formed by combining a reproducible random number reproducer with a decryptor according to an embodiment of the present invention.
[0013] Figure 6 The following is a diagram showing a security operation performed within a security isolation area (SE) or a security chip (SC), and an operation flow implemented by an embodiment of the present invention.
[0014] Explanation of symbols:
[0015] 100: Reproducible random number generator
[0016] 101,301: Random bit generator
[0017] 103,303: static random number
[0018] 105:Key derivation function
[0019] 200: Reproducible random number reproducer
[0020] 310: High quality random numbers
[0021] 420: Encryptor
[0022] 430: Reproducible Random Number Encryptor
[0023] 520:Decryptor
[0024] 530: Reproducible random number decryptor
[0025] S601, S602, S603, S604: Steps DETAILED DESCRIPTION
[0026] The present invention will be described in detail herein with respect to specific embodiments of the invention and their viewpoints. Such description is for explaining the structure or step flow of the present invention, which is provided for illustrative purposes rather than for limiting the scope of the present invention. Therefore, in addition to the specific embodiments and preferred embodiments in the specification, the present invention can also be widely implemented in other different embodiments. The following describes the implementation of the present invention through specific specific embodiments, and those familiar with this technology can easily understand the effectiveness and advantages of the present invention through the contents disclosed in this specification. The present invention can also be applied and implemented through other specific embodiments, and the various details described in this specification can also be applied based on different needs, and various modifications or changes can be made without departing from the spirit of the present invention.
[0027] Different from the general reproducible random number (RRN) used for analog computing, the present invention proposes a reproducible random number generator (RRNG) that can be implemented in a secure isolation area (SE) or a secure chip (SC), and its related use method.
[0028] Please refer to Figure 1 and Figure 2 The above-mentioned reproducible random number generator (RRNG) is divided into the following Figure 1 The reproducible random number generator (RRNG Producer) 100 shown in FIG. Figure 2 A reproducible random number reproducer (RRNGReproducer) 200 is shown.
[0029] according to Figure 1 As shown, a reproducible random number generator (RRNG producer) 100 is composed of a random bit generator (RBG) 101, a static random number (SRN) 103 and a key derivation function (KDF) 105. Each time the reproducible random number generator (RRNG producer) 100 is operated, the random bit generator (RGB) 101 generates a random number option rrn_opt, and then performs a key derivation function (KDF) operation on the random number option rrn_opt and the static random number (SRN) 103 to generate a reproducible random number (rrn), wherein the key derivation function configuration (kdf_cfg) is a control signal for configuring the key derivation function (KDF) according to the properties of the security data (sec_data).
[0030] According to an embodiment of the present invention, the kdf_cfg is a configuration setting of a key derivation function, for example, it may be an output length.
[0031] According to an embodiment of the present invention, the security data (sec_data) may be generated inside or outside the security isolation area (SE) or the security chip (SC).
[0032] According to an embodiment of the present invention, the random number option rrn_opt is used to reproduce the reproducible random number (rrn), for example, the 128-bit random bit generated by the random bit generator 101 .
[0033] It should be emphasized here that the reproducible random number generator (RRNG producer) 100 and the reproducible random number reproducer (RRNG Reproducer) 200 of the same secure isolation area (SE) or secure chip (SC), their static random numbers (SRN) 103 and key derivation functions (KDF) 105 must be functionally exactly the same, so that the reproducible random number reproducer (RRNG Reproducer) 200 can reproduce the random numbers generated by the reproducible random number generator (RRNG producer) 100.
[0034] According to an embodiment of the present invention, the static random number (SRN) 103 is a random number, which is set when the secure isolation area (SE) or the secure chip (SC) leaves the factory. Generally, the random number is output by the random bit generator (RBG) 101 in the chip and stored in the non-volatile memory (NVM) in the chip. It remains unchanged during the life cycle of the device. Therefore, for different secure isolation areas (SE) or secure chips (SC), their static random numbers (SRN) are different.
[0035] The randomness of the reproducible random number generator (RRNG) is jointly determined by the randomness of the random bit generator (RBG) 101 and the static random number (SRN) 103. The randomness of the random bit generator (RBG) 101 is limited by the inherent limitations of the random number generator in the chip, and the same is true for the general security isolation area (SE) and security chip (SC). Because the present invention has a static random number (SRN) 103, the randomness of the overall reproducible random number generator (RRNG) can be improved by improving the randomness of the static random number (SRN) 103, thereby providing a better quality random number.
[0036] The present invention proposes a method for improving the randomness of a static random number (SRN), referring to Figure 3 When producing a security chip, a high-quality random number 310 is provided from the outside and mixed with the random number generated by the random bit generator (RBG) 301 in the security chip and written into the static random number storage (SRN storage) 303 for storage. This method can avoid the security concerns caused by only writing from the outside, and can also avoid the disadvantage of poor quality caused by only writing from the internal random bit generator (RBG) 301.
[0037] According to an embodiment of the present invention, reference Figure 3, the logical exclusive OR (XOR) operation is the simplest mixing method, because the randomness of the static random number (SRN) can be improved by this operation, so the reproducible random number (rrn) generated by the reproducible random number generator (RRNGproducer) 100 can also replace the random number generated by the random number generator (RNG), thereby generating a random number with better quality.
[0038] refer to Figure 4 According to an embodiment of the present invention, a reproducible random number generator (RRNG Producer) 100 is combined with an encryptor (Encryptor) 420 to form a reproducible random number encryptor (RRNG Encryptor) 430, which is used to encrypt security data (sec_data) into an encrypted data packet (enc_pack).
[0039] According to an embodiment of the present invention, the encryptor (Encryptor) 420 receives security data (sec_data) and a reproducible random number (rrn) output by a reproducible random number generator (RRNG Producer) 100, and generates encrypted data (enc_data) for output after encryption.
[0040] According to an embodiment of the present invention, the secure isolation area (SE) or the secure chip (SC) sets the encryptor / decryptor configuration (edc_cfg) and the derivative function configuration (kdf_cfg) according to the security operation, encrypts the above-mentioned encrypted data (enc_data) and generates an encrypted data packet (enc_pack).
[0041] According to an embodiment of the present invention, the encrypted data packet (enc_pack) is exported to a secure isolation area (SE) or a secure chip (SC) for external storage.
[0042] refer to Figure 5 According to an embodiment of the present invention, a reproducible random number reproducer (RRNG Reproducer) 200 is combined with a decryptor (Decryptor) 520 to form a reproducible random number decryptor (RRNG Decryptor) 530, which is used to decrypt the above-mentioned encrypted data packet (enc_pack) into the original secure full data (sec_data).
[0043] According to an embodiment of the present invention, the encryptor 420 and the decryptor 520 each operate according to the edc_cfg configuration. Wherein, edc_cfg is a configuration setting of the encryptor or the decryptor. For example, edc_cfg can be encryption length / decryption length, encryption type.
[0044] According to an embodiment of the present invention, the key derivation function (KDF) operates according to the kdf_cfg configuration. Wherein, kdf_cfg is a configuration setting of the key derivation function (KDF). For example, kdf_cfg can be an output length.
[0045] According to an embodiment of the present invention, the output length of the key derivation function (KDF) is consistent with the key length of the encryptor (ENC) / decryptor (DEC).
[0046] Figure 6 A security operation performed in a security isolation area (SE) or a security chip (SC) is shown, and the operation flow implemented by an embodiment of the present invention includes:
[0047] Step S601, by means of a computer system, security data (sec_data) required for a security operation performed inside a security isolation area (SE) or a security chip (SC) is generated from within the computer system or imported from outside;
[0048] Step S602, the security isolation area (SE) or the security chip (SC) sets the encryptor / decryptor (edc_cfg) configuration and the key derivation function (kdf_cfg) configuration according to the security operation, and encrypts the above security data (sec_data) through a reproducible random number encryptor (RRNGEncryptor) to obtain an encrypted data packet (enc_pack);
[0049] Step S603, exporting the encrypted data packet (enc_pack) to a secure isolation area (SE) or a secure chip (SC) external storage through the computer system;
[0050] Step S604, when the security operation is required, the corresponding encrypted data packet (enc_pack) is imported into the SE or SC using the above-mentioned computer system, and the security data (sec_data) is decrypted by a reproducible random number decryptor (RRNG Decryptor), and then the security operation is performed.
[0051] In an embodiment of the present invention, Figure 6 The described encryption process may be executed in a computer system and may be stored in an executable memory of a computer / computing device.
[0052] The above is a preferred embodiment of the present invention. Those skilled in the art should understand that it is used to illustrate the present invention, not to limit the scope of the patent right claimed by the present invention. The scope of patent protection shall be determined by the scope of the attached patent application and its equivalent field. Any changes or modifications made by those skilled in the art who are familiar with this field without departing from the spirit or scope of this patent shall be equivalent changes or designs completed under the spirit disclosed by the present invention and shall be included in the scope of the following patent application.
Claims
1. A method for reproducible random number generation, characterized in that: The method may be performed in a computer system having a security zone, the security zone including a security isolation zone or a security chip, and includes: The computer system generates safety data required for safe operation within the safety zone from within the computer system or imports safety data from outside the computer system; The security zone sets encryption / decryption configuration and derivative function configuration according to the security operation, and encrypts the security data by a reproducible random number encryptor to obtain an encrypted data packet; exporting the encrypted data packet to external storage of the secure zone by the computer system; When the security operation is required, the corresponding encrypted data packet is imported into the security zone using the computer system, and the above security data is decrypted by the reproducible random number decryptor to perform the security operation.
2. The method for reproducible random number generation according to claim 1, wherein: The above-mentioned reproducible random number encryptor includes a reproducible random number generator and an encryptor, which are used to encrypt the security data into the encrypted data packet.
3. The method for reproducible random number generation as claimed in claim 2, characterized in that: The above-mentioned reproducible random number generator includes a random bit generator, a static random number and a key derivation function. Each time the reproducible random number generator is operated, the random bit generator generates a random number option, and then the random number option and the static random number are input into the key derivation function to perform the key derivation function operation to generate a reproducible random number.
4. The method for reproducible random number generation according to claim 1, wherein: The above-mentioned reproducible random number decryptor includes a reproducible random number reproducer and a decryptor, which are used to decrypt the encrypted data packet into the security data.
5. The method for reproducible random number generator as claimed in claim 4, characterized in that: The above-mentioned reproducible random number reproducer can reproduce the random number generated by the above-mentioned reproducible random number generator.
6. The method for reproducible random number generation according to claim 1, wherein: The derivation function configuration is to configure the control signal of the key derivation function according to the property of the security data.
7. The method for reproducible random number generation as claimed in claim 6, characterized in that: The derivative function above is configured to output length.
8. The method for reproducible random number generation as claimed in claim 1, characterized in that: The above encryption / decryption configuration includes encryption length / decryption length and encryption type.
9. The method for reproducible random number generation as claimed in claim 3, characterized in that: The static random number mentioned above is a random number, which is set in the above-mentioned security isolation area or security chip when it leaves the factory. The random number is output by the random bit generator in the chip and stored in the non-volatile memory in the chip, and remains unchanged during the life cycle of the computer system.
10. The method for reproducible random number generation according to claim 3, characterized in that: The method for improving the randomness of the above-mentioned static random number includes providing a high-quality random number from the outside and then mixing the random number generated by the random bit generator in the above-mentioned security isolation area or security chip using a logical mutual exclusion operation, and writing it into a static random number storage for storage.
Citation Information
Cited By
Secure processing method and device capable of reproducing random number, electronic equipment and server
CN121881410A
Method and apparatus for secure processing of reproducible random numbers, and electronic device and server
CN121881410B