Distributed computing storage key distribution method and device based on trusted execution environment
By using prime and random value encryption and decryption algorithms in a distributed trusted execution environment, the security and efficiency issues of key distribution and decryption between nodes are solved, efficient key distribution and decryption are achieved, and the stability of the system is ensured. sex and data security.
Patent Information
- Application Number
- CN202411069969.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-11
AI Technical Summary
When securely sharing data among multiple trusted execution environment nodes, existing technologies have performance limitations and data domain issues, making it difficult to achieve efficient key distribution and decryption.
An encryption and decryption algorithm based on prime numbers and random values is used to generate public keys and private keys through the head node, and use random values for encryption and decryption processing to ensure that the work nodes can collaboratively recover the storage keys and realize key distribution between nodes. and decryption.
It achieves efficient and secure key distribution and decryption in a distributed trusted execution environment, avoiding the impact of a single node going offline and affecting system operation, while retaining data security.
Smart Images

Figure CN118764191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for distributing computing storage keys based on a trusted execution environment. Background Art
[0002] In current applications, most TEE (Trusted Execution Environment) computing is done on a single machine, which has performance limits and data domain restrictions. After the introduction of distributed computing, parallel computing can be used to improve system performance and meet technical indicators such as high availability.
[0003] Introducing distributed computing in TEE requires solving many technical difficulties, one of which is how to securely share data among multiple TEE nodes. To this end, the present invention designs a set of secure and efficient storage key algorithms to solve this problem.
[0004] In response to the above technical problems, the present invention proposes a method and device for distributing computing storage keys based on a trusted execution environment. Summary of the invention
[0005] The purpose of the present invention is to address the defects of the prior art and provide a method and device for distributing computing storage keys based on a trusted execution environment.
[0006] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0007] A distributed computing storage key distribution method based on a trusted execution environment includes:
[0008] S1. The head node randomly selects a prime number and makes it public to all worker nodes. The distributed trusted execution environment includes a head node and several worker nodes.
[0009] S2. The head node randomly selects the first random value and the second random value, and each worker node randomly selects the third random value and the fourth random value;
[0010] S3. The head node generates a public key and a private key. The head node publishes the public key to all worker nodes and stores the private key.
[0011] S4. The head node encrypts and calculates the first random value according to the private key to obtain a first encryption result, and sends the first encryption result to all worker nodes;
[0012] S5. The head node receives the second encryption result of each worker node encrypting the third random value according to the first encryption result;
[0013] S6. The head node decrypts the second encryption result according to the second random value to obtain a decrypted result, and sends the decrypted result to all worker nodes;
[0014] S7. Each worker node calculates a private key based on the decryption result and the fourth random value to obtain the private key stored by the head node.
[0015] Furthermore, in step S2, the head node randomly selects the first random value and the second random value to satisfy gcd(a,p -1 )=1,ab=1mod p -1 , where p represents a prime number, a represents the first random value, b represents the second random value, and gcd represents the greatest common factor.
[0016] Furthermore, in step S2, each worker node randomly selects a third random value and a fourth random value that satisfies gcd(a i ,p -1 )=1,a i b i =1mod p -1 , where a i represents the third random value, b i Represents the fourth random value.
[0017] Furthermore, in step S4, the head node encrypts and calculates the first random value according to the private key, which is expressed as:
[0018] c=(sk) a ;
[0019] Wherein, c represents the first encryption result, and sk represents the private key.
[0020] Furthermore, in step S5, each worker node encrypts the third random value according to the first encryption result, which is expressed as:
[0021] d i =c ai ;
[0022] Among them, d i Indicates the second encryption result.
[0023] Furthermore, in step S6, the head node decrypts the second encryption result according to the second random value, which is expressed as:
[0024] e i =d i b ;
[0025] Among them, e i Indicates the decryption result.
[0026] Furthermore, in step S7, each worker node calculates a private key according to the decryption result and the fourth random value, which is expressed as:
[0027] sk=e i bi ;
[0028] Among them, sk represents the private key.
[0029] Accordingly, a computing storage key distribution device based on a trusted execution environment is also provided, which is used to execute the computing storage key distribution method based on a trusted execution environment. The distribution device includes a processor, and the processor is provided with:
[0030] The first selection module is used for the head node to randomly select a prime number and disclose the prime number to all worker nodes; wherein the distributed trusted execution environment includes a head node and several worker nodes;
[0031] The second selection module is used for the head node to randomly select the first random value and the second random value, and each worker node to randomly select the third random value and the fourth random value;
[0032] The generation module is used by the head node to generate public and private keys. The head node publishes the public key to all worker nodes and stores the private key.
[0033] A first calculation module is used for the head node to perform encryption calculation on the first random value according to the private key to obtain a first encryption result, and send the first encryption result to all worker nodes;
[0034] A second computing module is used for the head node to receive a second encryption result obtained by each worker node encrypting the third random value according to the first encryption result;
[0035] The third computing module is used for the head node to decrypt the second encryption result according to the second random value to obtain a decrypted result, and send the decrypted result to all the worker nodes;
[0036] The fourth calculation module is used for each work node to calculate the private key according to the decryption result and the fourth random value to obtain the private key stored in the head node.
[0037] Furthermore, the processor is connected to a memory for storing data or instructions.
[0038] Furthermore, the processor is connected to a transmission device for transmitting data with an external device.
[0039] Compared with the prior art, the present invention designs a secure and efficient storage key algorithm. The nodes collaborate to recover the storage key and decrypt the transmitted ciphertext data in the TEE. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of a distributed computing storage key distribution method based on a trusted execution environment provided in Example 1. DETAILED DESCRIPTION
[0041] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0042] The purpose of the present invention is to address the defects of the prior art and provide a method and device for distributing computing storage keys based on a trusted execution environment.
[0043] Embodiment 1
[0044] This embodiment provides a distributed computing storage key distribution method based on a trusted execution environment, such as Figure 1 As shown, including:
[0045] S1. The head node randomly selects a prime number and makes it public to all worker nodes. The distributed trusted execution environment includes a head node and several worker nodes.
[0046] S2. The head node randomly selects the first random value and the second random value, and each worker node randomly selects the third random value and the fourth random value;
[0047] S3. The head node generates a public key and a private key. The head node publishes the public key to all worker nodes and stores the private key.
[0048] S4. The head node encrypts and calculates the first random value according to the private key to obtain a first encryption result, and sends the first encryption result to all worker nodes;
[0049] S5. The head node receives the second encryption result of each worker node encrypting the third random value according to the first encryption result;
[0050] S6. The head node decrypts the second encryption result according to the second random value to obtain a decrypted result, and sends the decrypted result to all worker nodes;
[0051] S7. Each worker node calculates a private key based on the decryption result and the fourth random value to obtain the private key stored by the head node.
[0052] A distributed trusted execution environment is composed of a head node and several worker nodes, where the head node and the worker node are both a trusted execution environment, and the trusted execution environment has computing capabilities.
[0053] This embodiment includes a preprocessing stage and a key distribution stage, wherein steps S1-S3 are the preprocessing stage, and steps S4-S7 are the key distribution stage.
[0054] In step S1, the head node randomly selects a prime number and makes the prime number public to all worker nodes; wherein the distributed trusted execution environment includes a head node and several worker nodes.
[0055] The head node randomly selects a prime number p and makes it public to n worker nodes.
[0056] In step S2, the head node randomly selects a first random value and a second random value, and each worker node randomly selects a third random value and a fourth random value.
[0057] The head node randomly selects the first random value a and the second random value b, a, b∈Z p , and a and b satisfy gcd(a,p -1 )=1,ab=1mod p -1 , where Z p represents a set, Z p ={0,1,2,...,p -1}, gcd stands for greatest common factor, also known as the greatest common divisor (English: greatest common divisor, gcd).
[0058] The i-th worker node randomly selects the third random value a i , the fourth random value b i , a i , b i ∈Z p , and a i , b i Satisfy gcd(a i ,p -1 )=1,a i b i=1mod p -1 , i represents any trusted execution environment, i∈1,2,...,n.
[0059] In step S3, the head node generates a public key and a private key, where the head node publishes the public key to all worker nodes and stores the private key.
[0060] The head node generates the public key pk and private key sk of the national secret SM2 encryption algorithm through the key algorithm. The head node makes the public key pk public to all work nodes and stores the private key sk.
[0061] In this embodiment, after the head node generates the public key pk and private key sk, the public key pk is made public to all worker nodes, so that each worker node uses the public key pk to encrypt data. However, the private key sk cannot be made public, otherwise the private key sk can be obtained outside the distributed TEE system to decrypt the data. Therefore, steps S4-S7 are required to distribute the private key sk, thereby ensuring that only the worker node obtains the private key sk.
[0062] In step S4, the head node encrypts the first random value according to the private key to obtain a first encryption result, and sends the first encryption result to all work nodes.
[0063] The head node encrypts the first random value a according to the private key sk, which is expressed as:
[0064] c=(sk) a ;
[0065] Among them, c represents the first encryption result, sk represents the private key, and a represents the first random value.
[0066] This embodiment sends the first encryption result c to all worker nodes.
[0067] In step S5, the head node receives the second encryption result of each worker node encrypting the third random value according to the first encryption result.
[0068] The i-th worker node encrypts the third random value a according to the first encryption result c. i Encryption is performed, expressed as:
[0069] d i =c ai ;
[0070] Among them, d i represents the second encryption result; a i Represents the third random value.
[0071] In this embodiment, the second encryption result d i Sent to the head node.
[0072] In step S6, the head node decrypts the second encryption result according to the second random value to obtain a decrypted result, and sends the decrypted result to all work nodes.
[0073] The head node performs encryption on the second encryption result d according to the second random value b. i Decryption processing is performed, expressed as:
[0074] e i =d i b ;
[0075] Among them, e i represents the decryption result; b represents the second random value.
[0076] In this embodiment, the decryption result e i Sent to the i-th worker node.
[0077] In step S7, each worker node calculates a private key according to the decryption result and the fourth random value to obtain the private key stored in the head node.
[0078] The i-th worker node calculates the decryption result e i and the fourth random value b i Calculate the private key, expressed as:
[0079] sk=e i bi ;
[0080] Among them, sk represents the calculated private key, that is, the private key stored in the head node; b i Represents the fourth random value.
[0081] After the i-th work node obtains the private key sk, it can use the storage key to encrypt and decrypt the data, thereby decoupling the single TEE node from the hardware-related keys used for the original TEE encryption storage. The online and offline of a single node does not affect the overall operation of the system, and the data security of the single TEE service is retained.
[0082] It should be noted that the encryption and decryption algorithms involved in this embodiment can all be implemented using existing technologies, such as homomorphic encryption and decryption algorithms.
[0083] Embodiment 2
[0084] The difference between the distributed computing storage key distribution method based on a trusted execution environment provided in this embodiment and the first embodiment is that:
[0085] This embodiment is described by taking n=3 working nodes as an example.
[0086] In the preprocessing stage:
[0087] 1. The head node randomly selects a prime number p=907;
[0088] 2. Set a=149, b=377 at the head node;
[0089] 3. The head node sets a1=59, b1=215, a2=511, b2=289, a3=365, b3=767;
[0090] 4. The head node generates sk=725.
[0091] During the key distribution phase:
[0092] 5. The head node calculates c = (sk) a mod p = 725 149 mod 907 = 445
[0093] 6. The first node calculates d1=c a1 mod p = 445 59 mod 907 = 72
[0094] The second node calculates d2=c a2 mod p = 445 511 mod 907 = 542
[0095] The third node calculates d3=c a3 mod p = 445 365 mod 907 = 634
[0096] 7. The head node calculates e1=d1 b mod p = 72 377 mod 907 = 813
[0097] The head node calculates e2=d2 b mod p = 542 377 mod 907 = 448
[0098] The head node calculates e3=d3 b mod p = 634 377 mod 907 = 489
[0099] 8. The first node calculates sk = e1 b1 mod p = 813 215mod 907 = 725
[0100] The second node calculates sk=e2 b2 mod p = 448 289 mod 907 = 725
[0101] The third node calculates sk=e3 b3 mod p = 489 767 mod 907 = 725
[0102] Obviously, the three worker nodes can correctly extract the storage key sk=725 through this algorithm.
[0103] Embodiment 3
[0104] This embodiment provides a computing storage key distribution device based on a trusted execution environment, which is used to execute a computing storage key distribution method based on a trusted execution environment in embodiment 1. The distribution device includes a processor, and the processor is provided with:
[0105] The first selection module is used for the head node to randomly select a prime number and disclose the prime number to all worker nodes; wherein the distributed trusted execution environment includes a head node and several worker nodes;
[0106] The second selection module is used for the head node to randomly select the first random value and the second random value, and each worker node to randomly select the third random value and the fourth random value;
[0107] The generation module is used by the head node to generate public and private keys. The head node publishes the public key to all worker nodes and stores the private key.
[0108] A first calculation module is used for the head node to perform encryption calculation on the first random value according to the private key to obtain a first encryption result, and send the first encryption result to all worker nodes;
[0109] A second computing module is used for the head node to receive a second encryption result obtained by each worker node encrypting the third random value according to the first encryption result;
[0110] The third computing module is used for the head node to decrypt the second encryption result according to the second random value to obtain a decrypted result, and send the decrypted result to all the worker nodes;
[0111] The fourth calculation module is used for each work node to calculate the private key according to the decryption result and the fourth random value to obtain the private key stored in the head node.
[0112] The processor described in this embodiment may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0113] The processor described in the present embodiment is connected with a memory for storing data or instructions. The memory may include a large capacity memory for data or instructions. For example, but not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory may be inside or outside the data processing device. In a specific embodiment, the memory is a non-volatile memory. In a specific embodiment, the memory includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable Programmable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0114] The memory can be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor. The processor reads and executes the computer program instructions stored in the memory.
[0115] The processor described in this embodiment is connected to a transmission device for transmitting data with an external device. The transmission device can be used to receive or send data via a network. The above-mentioned specific examples of the network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0116] The processor of this embodiment is connected with an input / output device for inputting or outputting information. The input / output device is used for inputting or outputting information. In this embodiment, the input information is the data selected by the node, and the output information is the private key information.
[0117] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A distributed computing storage key distribution method based on a trusted execution environment, characterized in that: include: S1. The head node randomly selects a prime number and makes it public to all worker nodes. The distributed trusted execution environment includes a head node and several worker nodes. S2. The head node randomly selects the first random value and the second random value, and each worker node randomly selects the third random value and the fourth random value; S3. The head node generates a public key and a private key. The head node publishes the public key to all worker nodes and stores the private key. S4. The head node encrypts and calculates the first random value according to the private key to obtain a first encryption result, and sends the first encryption result to all worker nodes; S5. The head node receives the second encryption result of each worker node encrypting the third random value according to the first encryption result; S6. The head node decrypts the second encryption result according to the second random value to obtain a decrypted result, and sends the decrypted result to all worker nodes; S7. Each worker node calculates a private key based on the decryption result and the fourth random value to obtain the private key stored by the head node.
2. According to claim 1, a distributed computing storage key distribution method based on a trusted execution environment is characterized in that: In step S2, the head node randomly selects the first random value and the second random value to satisfy gcd(a,p -1 )=1,ab=1mod p -1 , where p represents a prime number, a represents the first random value, b represents the second random value, and gcd represents the greatest common factor.
3. A method for distributing computing storage keys based on a trusted execution environment according to claim 2, characterized in that: In step S2, each worker node randomly selects a third random value and a fourth random value to satisfy gcd(a i ,p -1 )=1,a i b i =1mod p -1 , where a i represents the third random value, b i Represents the fourth random value.
4. A method for distributing computing storage keys based on a trusted execution environment according to claim 3, characterized in that: In step S4, the head node encrypts and calculates the first random value according to the private key, which is expressed as: c=(en) a ; Wherein, c represents the first encryption result, and sk represents the private key.
5. A method for distributing computing storage keys based on a trusted execution environment according to claim 4, characterized in that: In step S5, each worker node encrypts the third random value according to the first encryption result, which is expressed as: d i =c ai ; Among them, d i Indicates the second encryption result.
6. A method for distributing computing storage keys based on a trusted execution environment according to claim 5, characterized in that: In step S6, the head node decrypts the second encryption result according to the second random value, which is expressed as: e i =d i b ; Among them, e i Indicates the decryption result.
7. A method for distributing computing storage keys based on a trusted execution environment according to claim 6, characterized in that: In step S7, each worker node calculates a private key according to the decryption result and the fourth random value, which is expressed as: sk=e i bi ; Among them, sk represents the private key.
8. A computing storage key distribution device based on a trusted execution environment, used to execute a computing storage key distribution method based on a trusted execution environment as described in any one of claims 1 to 7, wherein the distribution device comprises a processor, characterized in that: The processor is provided with: The first selection module is used for the head node to randomly select a prime number and disclose the prime number to all worker nodes; wherein the distributed trusted execution environment includes a head node and several worker nodes; The second selection module is used for the head node to randomly select the first random value and the second random value, and each worker node to randomly select the third random value and the fourth random value; The generation module is used by the head node to generate public and private keys. The head node publishes the public key to all worker nodes and stores the private key. A first calculation module is used for the head node to perform encryption calculation on the first random value according to the private key to obtain a first encryption result, and send the first encryption result to all worker nodes; A second computing module is used for the head node to receive a second encryption result obtained by each worker node encrypting the third random value according to the first encryption result; The third computing module is used for the head node to decrypt the second encryption result according to the second random value to obtain a decrypted result, and send the decrypted result to all the worker nodes; The fourth calculation module is used for each work node to calculate the private key according to the decryption result and the fourth random value to obtain the private key stored in the head node.
9. The computing storage key distribution device based on a trusted execution environment distributed according to claim 8, characterized in that: The processor is connected to a memory for storing data or instructions.
10. The device for distributing computing storage keys based on a trusted execution environment according to claim 8, characterized in that: The processor is connected with a transmission device for transmitting data with an external device.
