Distributed power transaction scheme and system based on anti-quantum multi-party security computing

Through the anti-quantum multi-party security calculation and linear secret sharing solution, the private key is divided into multiple shares, solving the risk of excessive permissions and leakage caused by single point private key management, improving the data privacy and security of power transactions, and enhancing the Quantum defense resistance reduces transaction costs.

CN118916928APending Publication Date: 2024-11-08BEIHANG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311506855.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

In the application scenario of power blockchain, single node manages private keys, resulting in excessive permissions and risk of leakage. Traditional multi-party security threshold decryption is unsafe under quantum computing attacks, resulting in privacy data leakage problems.

Method used

Adopt a distributed power trading scheme based on anti-quantum multi-party security calculations. The private key is divided into multiple shares through a linear secret sharing scheme, and the key managers jointly decrypt it to ensure that only when the threshold value is reached can the plain text data be restored and a single point is reduced. Private key leakage risk.

Benefits of technology

It improves data privacy and security during power transactions, reduces network communication overhead, ensures that data is available in an invisible state, enhances anti-quantum defense capabilities, and reduces data information transaction costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916928A_ABST
    Figure CN118916928A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed power transaction scheme and system based on anti-quantum multi-party security computing, comprising a plurality of subjects such as a data owner, a data user, a system manager, a key manager and the like, the scheme comprises the following steps: 1) an initialization stage; 2) a threshold determination stage; 3) a secret key generation stage; 4) an encryption stage; 5) a decryption request stage; 6) a partial decryption stage; and 7) a final decryption stage. In order to solve the problems of overlarge node permission and private key leakage caused by management of a private key for decryption on a single node in a distributed power transaction process, the key permission is segmented, the risk of single-point private key leakage is reduced, the security, correctness and anonymity of the power transaction process are ensured, and the security, correctness and anonymity of the power transaction process are improved. And the sensitive data privacy protection capability and the anti-quantum defense capability in the distributed power transaction process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to technical fields such as blockchain, multi-party secure computing and distributed energy trading, and specifically to a distributed power trading solution and system based on quantum-resistant multi-party secure computing. Background Art

[0002] In the application scenario of power blockchain, distributed energy users often need to store a large amount of private data during the transaction process. In order to protect the privacy of the data, the data is often stored in an encrypted form. However, if the private key used for decryption is managed on a single node, it will cause excessive node permissions and the risk of private key leakage. As a general cryptographic primitive that provides privacy protection, secure multi-party computing has been widely used in the application scenario of distributed energy transactions. Different distributed energy users encrypt their own private data with public keys, which are then stored in the power blockchain network database. The data management center decrypts the ciphertext and returns the target output to the user after collaborative calculation. In this process, multiple participants who do not trust each other collaborate in the calculation without a trusted third party to ensure the privacy of the input and the correctness of the calculation. Mathematical theory is used to ensure that the input information of all parties involved in the calculation is not exposed, and accurate calculation results can be obtained at the same time. It can make the data available under the premise of being invisible, break the data barriers, and give full play to the application value of sensitive data sets, which is of great significance for promoting the rapid development of new power trading models.

[0003] The construction of traditional multi-party secure threshold decryption relies on difficult problems such as large integer decomposition and discrete logarithm solution. However, under the attack of quantum computers, these difficult problems will no longer be safe. Quantum-resistant multi-party threshold decryption allows private keys to be managed by multiple nodes. When encrypted data needs to be decrypted, decryption requests are initiated to multiple private key management nodes. The private key management nodes use their own private key shares to decrypt the data, obtain decrypted shards, and send the decrypted shards to the decryption requester. After the decryption requester collects a certain number of decrypted shards, it recovers the private data. However, due to the need to communicate with multiple private key management nodes, the decryption requester needs to send decryption requests and receive decrypted shards. In large-scale distributed systems, the network communication overhead will increase. At the same time, the sharding and recovery process of private keys requires a high degree of security. If the private key share of the private key management node is leaked, the entire system will face security threats. Summary of the invention

[0004] The purpose of the present invention is to address the privacy leakage problem caused by attackers in the power system because the keys are managed on a single node. When the key keeper has too much authority or is attacked, the attacker can obtain the user's key information and thus obtain the user's transaction dynamics and address group in the entire blockchain network.

[0005] To achieve the above objectives, the present invention provides a distributed power trading solution and system based on quantum-resistant multi-party secure computing, which is used to solve the identity privacy security issues of power trading users in a decentralized environment, and provide a safe and reliable distributed power trading and data sharing environment for participants such as data owners, data users, system managers, and key custodians without a trusted third party.

[0006] In a first aspect, an embodiment of the present invention provides a distributed power trading solution based on quantum-resistant multi-party secure computing, the solution comprising:

[0007] In response to a blockchain system initialization signal, determining a threshold setting of the scheme, and then generating a key keeper in the system;

[0008] Execute the key generation algorithm to generate the public key and private key required for encryption, make the public key public in the system, and divide the private key according to the threshold setting of the scheme and distribute it to each key holder for management;

[0009] Business data parties use public keys to encrypt and store private data according to their own needs;

[0010] In response to the data user's request for decryption of ciphertext data initiated by the smart contract, the key custodian first performs partial decryption to obtain the decrypted fragments of the data, and then sends the decrypted fragments to the data user. Finally, after collecting a certain number of decrypted fragments, the data user performs the final decryption to obtain the plaintext of the private data.

[0011] Preferably, the data owner, data user, system manager, key keeper and other participant types, the data owner, in distributed energy transactions, can be a power producer or a power consumer, responsible for uploading privacy-sensitive data to the power blockchain network through encryption. Data users, similar to data owners, are power producers or power consumers, and can initiate joint computing tasks to the power blockchain network under anonymous conditions, collect a certain number of decrypted shards after decryption by the key keeper, and perform final decryption. When the system manager receives the computing request and data acquisition request initiated by the data user, he checks the ciphertext data address in the database and initiates a decryption request to the corresponding key keeper. The key keeper performs partial decryption to obtain the decrypted shards based on the private key shards he has, and different key keepers send partial decrypted shards to the data user.

[0012] Preferably, the threshold setting is determined, and the encryption party uses the quantum-resistant multi-party threshold decryption capability to encrypt the data using the public key, and multiple private key holders jointly decrypt the data. The system threshold setting is determined according to the linear secret sharing scheme, n represents the total number of key shares, t represents the threshold value, and when the number of key shares held exceeds the threshold value, the key holder can restore the plaintext data.

[0013] Preferably, the linear secret sharing scheme is as follows:

[0014] a. For the t / u threshold solution, the corresponding Boolean expression is the disjunctive normal form ∧(∧P i ), where P i is the node that controls the key of the ith key. This special form of Boolean expression contains only "and" and "or", so it is a monotonic Boolean expression. We can construct a binary tree structure based on this Boolean expression, whose leaf nodes are all P in the expression. i , non-leaf nodes are "and" or "or" between the corresponding expressions of the two subtrees, and finally the entire Boolean expression can be restored starting from the root node of the tree;

[0015] b. Use Folklore algorithm on the binary tree obtained above;

[0016] (1) Assign m1=(1) to the root node and set count=1;

[0017] (2) Perform the following operations on each node n on the tree formed by the expression: if node n corresponds to "or", assign the value m of node n to the left and right branches; if node n corresponds to "and", add 0 to the end of m so that the length of m is equal to count, then add a 1 after m and assign it to the left branch; finally, assign a vector (0,0,…,0,-1) of length count+1 to the right branch, and set count=count+1;

[0018] (3) Take out the values ​​of all leaf nodes of the binary tree and add 0 after these values ​​so that their lengths are the same.

[0019] c. Arrange the values ​​of all leaf nodes of the binary tree in order to form a The matrix is ​​used as the secret sharing matrix M;

[0020] d. Z p is a finite field, in which p The random numbers r2, r3, ..., r are obtained by sampling according to the discrete Gaussian distribution. n , then define the vector w = M (k, r2, r3, ..., r n ) T , this time is Each number in the column vector w of the corresponding key is the node P i A share of a secret when performing secret sharing.

[0021] Preferably, the key generation algorithm comprises the following specific steps:

[0022] S1. Take any polynomial F, G, and satisfy that the coefficients of F and G are -1, 0, and 1; let f = 1 + pF. If f is in the polynomial ring R q If it is not reversible, then reselect the polynomial; let g = pG, define h = f -1 g mod q.

[0023] S2. For the (tn) threshold, construct a secret sharing matrix shareMatrix according to the linear secret sharing scheme. Initially, a vector k with a length equal to the number of columns of shareMatrix is ​​set. k[0]=f is set. The remaining components are generated according to steps s1 and s2 to generate f1, f2, ..., and k[1]=f1, k[2]=f2, ... are set.

[0024] S3. Let keys = shareMatrix·k, and distribute the components of keys to each participant;

[0025] S4, output the public key h, private key share keys;

[0026] Preferably, the private data is encrypted and stored using a public key, and the encryption process is as follows:

[0027] (1) Choose any random polynomial r;

[0028] (2) For the plaintext message m, calculate the ciphertext y = r*h+m (mod q).

[0029] Preferably, in the decryption request stage, after receiving the decryption request for ciphertext data from the data user (data user), the system administrator checks the database, determines the ciphertext number and address, and requests the key keeper to decrypt the data through the smart contract.

[0030] Preferably, the execution part decrypts to obtain the decrypted fragments of the data, including:

[0031] In response to the decryption request of the ciphertext data y initiated by the data user through the smart contract, the key management node calculates the decryption shard a i =f i *y(mod q), and the decrypted fragment a calculated by itself i Sent to data users, where a i Indicates that the i-th key holder node P i The calculated decrypted fragment, fi Indicates that the i-th key holder node P i The private key you have, q is the large modulus;

[0032] For the t / u threshold scheme, at least t key management nodes are required to participate in the partial decryption process.

[0033] Preferably, the performing final decryption comprises:

[0034] The data user calculates the decrypted slice aggregation result a=∑a based on the decrypted slices obtained from at least t key management nodes. i (mod q), where a i Indicates that the i-th key holder node P i The calculated decrypted fragment, q is the large modulus;

[0035] Then the required plaintext m=a(mod p) is calculated, where a is the decrypted fragment aggregation result and p is the small modulus.

[0036] In a second aspect, an embodiment of the present invention provides a distributed power trading system based on quantum-resistant multi-party secure computing, the system comprising:

[0037] A threshold determination module, for responding to a blockchain system initialization signal, determining a threshold setting t / u of the scheme according to a linear secret sharing scheme, and then generating a key management node in the system;

[0038] The key generation module is used to generate the public key and private key required by the encryption algorithm according to the determined threshold setting t / u, publish the public key in the system, and divide the private key according to the threshold setting of the scheme and distribute it to each key management node for management;

[0039] The encryption module is used to encrypt and store private data using a public key according to the data encryption request of the business data party;

[0040] Partial decryption module, used to respond to the data user's request for decryption of ciphertext data through the smart contract. The key management node first performs partial decryption to obtain the decrypted fragments of the data, and then sends the decrypted fragments to the data user;

[0041] The final decryption module is used to wait for the data user to collect a certain number of decrypted fragments and then perform the final decryption to obtain the plaintext of the private data.

[0042] Preferably, the threshold determination module includes:

[0043] The threshold setting loading unit is used to set the Boolean expression V(∧P i ) constructs a binary tree structure whose leaf nodes are all P in the expressioni , non-leaf nodes are "and" or "or" between the corresponding expressions of the two subtrees, and the entire Boolean expression is restored from the root node of the tree; the Folklore algorithm is used on the obtained binary tree structure to obtain the values ​​of all leaf nodes of the binary tree,

[0044] Arrange the values ​​of all leaf nodes of the binary tree in order to form a , where u represents the total number of key shares and t represents the threshold value. This matrix is ​​used as the secret sharing matrix M over the finite field Z p According to the discrete Gaussian distribution, random numbers r2, r3, ..., r are obtained by sampling. n , then define the vector w = M·(k, r2, r3, …, r n ) T , this time is Each number in the column vector w of the corresponding key is the node P i A secret share in secret sharing, where u represents the total number of key shares, t represents the threshold value, and P i is the i-th key management node.

[0045] Preferably, the key generation module comprises the following specific steps:

[0046] The key generation and distribution unit is used to perform the following steps:

[0047] S1. Select a positive integer N, corresponding to the polynomial ring Select a large modulus q and a small modulus p, such that the greatest common divisor of q and p is 1, and q>>p;

[0048] S2. Take any polynomial F, G, such that the coefficients of F and G are -1, 0, 1; let f = 1 + pF, if f is in the polynomial ring R q If it is not reversible, then reselect the polynomial; let g = pG, define h = f -1 gmod q;

[0049] S3. For the t / u threshold, construct a secret sharing matrix shareMatrix according to the linear secret sharing scheme. Initially, a vector k with a length equal to the number of columns of shareMatrix is ​​used. Set k[0]=f. The remaining components are generated according to step S2, f1, f2, ..., and set k[1]=f1, k[2]=f2, ...;

[0050] S4. Let keys = shareMatrix·k, and distribute the components of keys to each participant;

[0051] S5. Output the public key h, which is published in the system, and output u private key shares keys, which are managed by each key management node.

[0052] Preferably, the partial decryption module includes:

[0053] The decryption request unit is used by the system administrator to check the database, determine the ciphertext number and address, and request decryption data from the key management node through the smart contract after receiving the decryption request for ciphertext data from the data user.

[0054] Preferably, the final decryption module includes: a threshold checking module, which is used to check whether the decrypted fragments received by the user reach a certain threshold t. If so, the data user further executes the final decryption algorithm, and calculates the decrypted fragment aggregation result a=∑a based on the decrypted fragments obtained from at least t key management nodes. i (mod q), where a i Indicates that the i-th key holder node P i The decrypted fragments are calculated, q is the large modulus, and then the required plaintext m=a(mod p) is calculated, where a is the aggregation result of the decrypted fragments and p is the small modulus; if not, a result that cannot be decrypted normally is returned.

[0055] The advantages and positive effects of a distributed power trading scheme and system based on quantum-resistant multi-party secure computing described in the present invention are:

[0056] 1. In the present invention, the key authority is divided through multi-party threshold decryption. The private key of the data owner is managed by multiple key managers. When the data user needs to make collaborative computing requests for encrypted data, the system administrator checks the ciphertext number and address and initiates decryption requests to multiple key managers. The key manager uses his own private key share to decrypt the data, obtains the decrypted slices, and sends the decrypted slices to the decryption requester. After the decryption requester collects a certain number of decrypted slices, the private data is restored. This process solves the problem of single-point private key leakage caused by excessive individual authority due to the single private key decryption mode, and at the same time ensures that the data user only obtains the query results, but is unaware of other record information in the database, thereby ensuring that the data query and use process is safe and reliable.

[0057] 2. The present invention constructs a quantum-resistant multi-party secure computing algorithm in the power blockchain network, improves the compatibility of the quantum-resistant algorithm with the blockchain, improves the security and privacy of sensitive data in the power trading process, ensures the trusted interconnection between the two parties to the transaction, greatly reduces the transaction cost of data information, provides an effective docking channel for data owners and users, and enriches the application scenarios of blockchain in distributed power.

[0058] 3. The power blockchain system in the present invention automatically runs the quantum-resistant multi-party secure computing algorithm through smart contracts. The parties involved in the multi-party computing perform collaborative computing on a certain agreed computing task through the agreed multi-party secure computing protocol. After the calculation is completed, all parties obtain the correct data results. All participants have equal status, and nodes between different power users such as distributed photovoltaic power generation, distributed natural gas power generation and distributed wind power generation can be freely and randomly combined, which provides flexibility and is easy to adjust and expand according to specific distributed power needs, thereby meeting the application requirements in complex distributed power trading scenarios.

[0059] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A flow chart of an embodiment of a distributed power trading solution based on quantum-resistant multi-party secure computing according to the present invention;

[0061] Figure 2 This is a flow chart of a key generation algorithm for an embodiment of a distributed power trading solution based on quantum-resistant multi-party secure computing according to the present invention;

[0062] Figure 3 This is a flow chart of an encryption algorithm for an embodiment of a distributed power trading solution based on quantum-resistant multi-party secure computing according to the present invention;

[0063] Figure 4 This is a flow chart of a decryption algorithm for an embodiment of a distributed power trading solution based on quantum-resistant multi-party secure computing according to the present invention; DETAILED DESCRIPTION

[0065] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0066] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.

[0067] Example

[0068] Assume that there is an electric power blockchain network, and each distributed energy user can freely trade electricity on this platform. For example, distributed photovoltaic power generation nodes, distributed wind power generation nodes and other clean energy power generation users, as power generators, sell the excess electricity they produce to other users. Therefore, it is necessary to upload detailed transaction information such as electricity volume, pricing, and energy type on the electric power blockchain platform. Different electricity buyers will also upload corresponding bidding information, and then transactions will be matched between different participants. In this process, a large amount of collaborative calculation of private data is involved. If the private key for decryption is managed on a single node, it will cause problems such as excessive node authority and private key leakage. In order to solve the above problems and challenges, the electric power blockchain platform can use the present invention to ensure the security and reliability of the electric power transaction process.

[0069] A distributed power trading scheme based on quantum-resistant multi-party secure computing includes data owners, data users, system managers, key managers and other types of participants. Data owners can be power producers or power consumers in distributed energy transactions, and upload privacy-sensitive data to the power blockchain network through encryption. Data users, similar to data owners, are power producers or power consumers. Joint computing tasks can be initiated to the power blockchain network under anonymous conditions. The key manager obtains decrypted shards after running the quantum-resistant multi-party secure computing algorithm and completes the final decrypted file. When the system manager receives the computing request and data acquisition request initiated by the data user, he checks the ciphertext data address in the database and initiates a decryption request to the corresponding key manager. The key manager performs partial decryption based on the private key shards he has, and obtains decrypted shards. Different key managers send partial decrypted shards to the data user.

[0070] A flow chart of a distributed power trading solution based on quantum-resistant multi-party secure computing is as follows: Figure 1 As shown, specifically, the scheme includes:

[0071] In response to a blockchain system initialization signal, determining a threshold setting of the scheme, and then generating a key keeper in the system;

[0072] Execute the key generation algorithm to generate the public key and private key required for encryption, make the public key public in the system, and divide the private key according to the threshold setting of the scheme and distribute it to each key holder for management;

[0073] Business data parties use public keys to encrypt and store private data according to their own needs;

[0074] In response to the data user's request for decryption of ciphertext data initiated by the smart contract, the key custodian first performs partial decryption to obtain the decrypted fragments of the data, and then sends the decrypted fragments to the data user. Finally, after collecting a certain number of decrypted fragments, the data user performs the final decryption to obtain the plaintext of the private data.

[0075] Preferably, the data owner, data user, system manager, key keeper and other participant types, the data owner, in distributed energy transactions, can be a power producer or a power consumer, responsible for uploading privacy-sensitive data to the power blockchain network through encryption. Data users, similar to data owners, are power producers or power consumers, and can initiate joint computing tasks to the power blockchain network under anonymous conditions, collect a certain number of decrypted shards after decryption by the key keeper, and perform final decryption. When the system manager receives the computing request and data acquisition request initiated by the data user, he checks the ciphertext data address in the database and initiates a decryption request to the corresponding key keeper. The key keeper performs partial decryption to obtain the decrypted shards based on the private key shards he has, and different key keepers send partial decrypted shards to the data user.

[0076] Preferably, the threshold setting is determined, and the encryption party uses the quantum-resistant multi-party threshold decryption capability to encrypt the data using the public key, and multiple private key holders jointly decrypt the data. The system threshold setting is determined according to the linear secret sharing scheme, n represents the total number of key shares, t represents the threshold value, and when the number of key shares held exceeds the threshold value, the key holder can restore the plaintext data.

[0077] Preferably, the linear secret sharing scheme is as follows:

[0078] a. For the t / u threshold solution, the corresponding Boolean expression is the disjunctive normal form ∨(∧P i ), where P i is the node that controls the key of the ith key. This special form of Boolean expression contains only "and" and "or", so it is a monotonic Boolean expression. We can construct a binary tree structure based on this Boolean expression, whose leaf nodes are all P in the expression. i , non-leaf nodes are "and" or "or" between the corresponding expressions of the two subtrees, and finally the entire Boolean expression can be restored starting from the root node of the tree;

[0079] b. Use Folklore algorithm on the binary tree obtained above;

[0080] (1) Assign m1=(1) to the root node and set count=1;

[0081] (2) Perform the following operations on each node n on the tree formed by the expression: if node n corresponds to "or", assign the value m of node n to the left and right branches; if node n corresponds to "and", add 0 to the end of m so that the length of m is equal to count, then add a 1 after m and assign it to the left branch; finally, assign a vector (0,0,…,0,-1) of length count+1 to the right branch, and set count=count+1;

[0082] (3) Take out the values ​​of all leaf nodes of the binary tree and add 0 after these values ​​so that their lengths are the same.

[0083] c. Arrange the values ​​of all leaf nodes of the binary tree in order to form a The matrix is ​​used as the secret sharing matrix M;

[0084] d. Z p is a finite field, in which p The random numbers r2, r3, ..., r are obtained by sampling according to the discrete Gaussian distribution. n , then define the vector w = M (k, r2, r3, ..., r n ) T , this time is Each number in the column vector w of the corresponding key is the node P i A share of a secret when performing secret sharing.

[0085] Preferably, the key generation algorithm comprises the following specific steps:

[0086] S1. Take any polynomial F, G, and satisfy that the coefficients of F, G are -1, 0, 1; let f = 1 + pF, if f is in the polynomial ring R q If it is not reversible, then reselect the polynomial; let g = pG, define h = f -1 gmod q.

[0087] S2. For the (tn) threshold, construct a secret sharing matrix shareMatrix according to the linear secret sharing scheme. Initially, a vector k with a length equal to the number of columns of shareMatrix is ​​set. k[0]=f is set. The remaining components are generated according to steps S1 and S2 to generate f1, f2, ..., and k[1]=f1, k[2]=f2, ... are set.

[0088] S3. Let keys = shareMatrix·k, and distribute the components of keys to each participant;

[0089] S4, output the public key h, private key share keys;

[0090] Preferably, the private data is encrypted and stored using a public key, and the encryption process is as follows:

[0091] (1) Choose any random polynomial r;

[0092] (2) For the plaintext message m, calculate the ciphertext y = r*h+m (mod q).

[0093] Preferably, in the decryption request stage, after receiving the decryption request for ciphertext data from the data user (data user), the system administrator checks the database, determines the ciphertext number and address, and requests the key keeper to decrypt the data through the smart contract.

[0094] Preferably, the execution part decrypts to obtain the decrypted fragments of the data, including:

[0095] In response to the decryption request of the ciphertext data y initiated by the data user through the smart contract, the key management node calculates the decryption shard a i =f i *y(mod q), and the decrypted fragment a calculated by itself i Sent to data users, where a i Indicates that the i-th key holder node P i The calculated decrypted fragment, f i Indicates that the i-th key holder node P i The private key you have, q is the large modulus;

[0096] For the t / u threshold scheme, at least t key management nodes are required to participate in the partial decryption process.

[0097] Preferably, the performing final decryption comprises:

[0098] The data user calculates the decrypted slice aggregation result a=∑a based on the decrypted slices obtained from at least t key management nodes. i (mod q), where a i Indicates that the i-th key holder node P i The calculated decrypted fragment, q is the large modulus;

[0099] Then the required plaintext m=a(mod p) is calculated, where a is the decrypted fragment aggregation result and p is the small modulus.

[0100] Therefore, the present invention adopts the above-mentioned distributed power trading scheme based on quantum-resistant multi-party secure computing, fully considering that the private key used for decryption in the distributed power trading process is managed on a single node, resulting in excessive node authority and private key leakage problems, and divides the key authority to reduce the risk of single-point private key leakage, thereby ensuring the security, correctness and anonymity of the power trading process, and improving the privacy protection capability of sensitive data and the quantum defense capability of the distributed power trading process.

[0101] A distributed power trading system based on quantum-resistant multi-party secure computing, comprising:

[0102] A threshold determination module, for responding to a blockchain system initialization signal, determining a threshold setting t / u of the scheme according to a linear secret sharing scheme, and then generating a key management node in the system;

[0103] The key generation module is used to generate the public key and private key required by the encryption algorithm according to the determined threshold setting t / u, publish the public key in the system, and divide the private key according to the threshold setting of the scheme and distribute it to each key management node for management;

[0104] The encryption module is used to encrypt and store private data using a public key according to the data encryption request of the business data party;

[0105] Partial decryption module, used to respond to the data user's request for decryption of ciphertext data through the smart contract. The key management node first performs partial decryption to obtain the decrypted fragments of the data, and then sends the decrypted fragments to the data user;

[0106] The final decryption module is used to wait for the data user to collect a certain number of decrypted fragments and then perform the final decryption to obtain the plaintext of the private data.

[0107] Preferably, the threshold determination module includes:

[0108] The threshold setting loading unit is used to set the Boolean expression V(∧P i ) constructs a binary tree structure whose leaf nodes are all P in the expression i , non-leaf nodes are "and" or "or" between the corresponding expressions of the two subtrees, and the entire Boolean expression is restored from the root node of the tree; the Folklore algorithm is used on the obtained binary tree structure to obtain the values ​​of all leaf nodes of the binary tree,

[0109] Arrange the values ​​of all leaf nodes of the binary tree in order to form a , where u represents the total number of key shares and t represents the threshold value. This matrix is ​​used as the secret sharing matrix M over the finite field Z pAccording to the discrete Gaussian distribution, random numbers r2, r3, ..., r are obtained by sampling. n , then define the vector w = M (k, r2, r3, ..., r n ) T , this time is Each number in the column vector w of the corresponding key is the node P i A secret share in secret sharing, where u represents the total number of key shares, t represents the threshold value, and P i is the i-th key management node.

[0110] Preferably, the key generation module comprises the following specific steps:

[0111] The key generation and distribution unit is used to perform the following steps:

[0112] S1. Select a positive integer N, corresponding to the polynomial ring Select a large modulus q and a small modulus p, such that the greatest common divisor of q and p is 1, and q>>p;

[0113] S2. Take any polynomial F, G, such that the coefficients of F and G are -1, 0, 1; let f = 1 + pF, if f is in the polynomial ring R q If it is not reversible, then reselect the polynomial; let g = pG, define h = f -1 gmod q;

[0114] S3. For the t / u threshold, construct a secret sharing matrix shareMatrix according to the linear secret sharing scheme. Initially, a vector k with a length equal to the number of columns of shareMatrix is ​​used. Set k[0]=f. The remaining components are generated according to step s2, f1, f2, ..., and set k[1]=f1, k[2]=f2, ...;

[0115] S4. Let keys = shareMatrix·k, and distribute the components of keys to each participant;

[0116] S5. Output the public key h, which is published in the system, and output u private key shares keys, which are managed by each key management node.

[0117] Preferably, the partial decryption module includes:

[0118] The decryption request unit is used by the system administrator to check the database, determine the ciphertext number and address, and request decryption data from the key management node through the smart contract after receiving the decryption request for ciphertext data from the data user.

[0119] Preferably, the final decryption module includes: a threshold checking module, which is used to check whether the decrypted fragments received by the user reach a certain threshold t. If so, the data user further executes the final decryption algorithm, and calculates the decrypted fragment aggregation result a=∑a based on the decrypted fragments obtained from at least t key management nodes. i (mod q), where a i Indicates that the i-th key holder node P i The decrypted fragments are calculated, q is the large modulus, and then the required plaintext m=a(mod p) is calculated, where a is the aggregation result of the decrypted fragments and p is the small modulus; if not, a result that cannot be decrypted normally is returned.

[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The solutions in the embodiments of the present invention can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0121] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0122] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0124] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0125] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A distributed power trading solution, characterized in that: The scheme includes: In response to a blockchain system initialization signal, determining a threshold setting of the scheme, and then generating a key management node in the system; Execute the key generation algorithm to generate the public key and private key required for encryption, make the public key public in the system, and divide the private key according to the threshold setting of the scheme and distribute it to each key management node for management; Business data parties use public keys to encrypt and store private data according to their own needs; In response to the data user's request for decryption of ciphertext data initiated by the smart contract, the key management node first performs partial decryption to obtain the decrypted slices of the data, and then sends the decrypted slices to the data user. Finally, after collecting a certain number of decrypted slices, the data user performs the final decryption to obtain the plaintext of the private data.

2. The solution according to claim 1, characterized in that The threshold setting of the determination scheme includes: The system threshold setting t / u is determined according to the linear secret sharing scheme, where u represents the total number of key shares and t represents the threshold value. Data users encrypt data using public keys, and multiple key management nodes jointly decrypt the data using their respective private keys. When the total number of key shares held exceeds the threshold value, the key management node can restore the plaintext data.

3. The method according to claim 2, characterized in that The determining of the system threshold setting according to the linear secret sharing scheme includes: For the t / u threshold scheme, the corresponding Boolean expression is the disjunctive normal form V(∧P i ), where u represents the total number of key shares, t represents the threshold value, and P i For the i-th key management node, a binary tree structure is constructed according to the Boolean expression, and its leaf nodes are all P in the expression i , non-leaf nodes are "and" or "or" between the corresponding expressions of the two subtrees, and the entire Boolean expression is restored from the root node of the tree; Using the Folklore algorithm on the obtained binary tree structure, obtain the values ​​of all leaf nodes of the binary tree; Arrange the values ​​of all leaf nodes of the binary tree in order to form a , where u represents the total number of key shares and t represents the threshold value, and the matrix is ​​used as the secret sharing matrix M; Over a finite field Z p According to the discrete Gaussian distribution, random numbers r2, r3, ..., r are obtained by sampling. n , then define the vector w = M (k, r2, r3, ..., r n ) T , this time is Each number in the column vector w of the corresponding key is the node P i A share of a secret when performing secret sharing.

4. The solution according to claim 3, characterized in that: The Folklore algorithm is used for the binary tree, including: Assign m1=(1) to the root node and set count=1; For each node n on the tree formed by the expression, if node n corresponds to "or", assign the value m of node n to the left and right branches; if node n corresponds to "and", add 0 to the end of m so that the length of m is equal to count, then add a 1 after m and assign it to the left branch, and finally assign the vector (0, 0, 0..., 0, -1) with a length of count+1 to the right branch, and set count=count+1; Take out the values ​​of all leaf nodes of the binary tree and add 0 after these values ​​to make their lengths the same.

5. The solution according to claim 1, characterized in that: The key generation algorithm comprises: S1. Select a positive integer N, corresponding to the polynomial ring Select a large modulus q and a small modulus p, such that the greatest common divisor of q and p is 1, and q>>p; S2. Take any polynomial F, G, such that the coefficients of F and G are -1, 0, 1; let f = 1 + pF, if f is in the polynomial ring R q If it is not reversible, then reselect the polynomial; let g = pG, define h = f -1 g mod q; S3. For the t / u threshold, construct a secret sharing matrix shareMatrix according to the linear secret sharing scheme. Initially, a vector k with a length equal to the number of columns of shareMatrix is ​​used. Set k[0]=f. The remaining components are generated according to step S2, f1, f2, ..., and set k[1]=f1, k[2]=f2, ...; S4. Let keys = shareMatrix·k, and distribute the components of keys to each participant; S5. Output the public key h, which is published in the system, and output u private key shares keys, which are managed by each key management node.

6. The solution according to claim 1, characterized in that: The method of encrypting and storing the private data with a public key includes: The business data party selects the plaintext message m to be stored according to its own privacy requirements, and can take any polynomial Calculate the corresponding ciphertext y=r*h+m(mod q), where h is the public key and q is the large modulus.

7. The solution according to claim 1, characterized in that The execution part decrypts to obtain the decrypted fragments of the data, including: In response to the decryption request of the ciphertext data y initiated by the data user through the smart contract, the key management node calculates the decryption shard a i =f i *y(mod q), and the decrypted fragment a calculated by itself i Sent to data users, where a i Indicates that the i-th key holder node P i The calculated decrypted fragment, f i Indicates that the i-th key holder node P i The private key you have, q is the large modulus; For the t / u threshold scheme, at least t key management nodes are required to participate in the partial decryption process.

8. The solution according to claim 1, characterized in that: The execution of the final decryption comprises: The data user calculates the decrypted slice aggregation result a=∑a based on the decrypted slices obtained from at least t key management nodes. i (mod q), where a i Indicates that the i-th key holder node P i The calculated decrypted fragment, q is the large modulus; Then the required plaintext m=a(mod p) is calculated, where a is the decrypted fragment aggregation result and p is the small modulus.

9. A distributed power trading system, characterized in that: The system includes the following modules: A threshold determination module, for responding to a blockchain system initialization signal, determining a threshold setting t / u of the scheme according to a linear secret sharing scheme, and then generating a key management node in the system; The key generation module is used to generate the public key and private key required by the encryption algorithm according to the determined threshold setting t / u, publish the public key in the system, and divide the private key according to the threshold setting of the scheme and distribute it to each key management node for management; The encryption module is used to encrypt and store private data using a public key according to the data encryption request of the business data party; Partial decryption module, used to respond to the data user's request for decryption of ciphertext data through the smart contract. The key management node first performs partial decryption to obtain the decrypted fragments of the data, and then sends the decrypted fragments to the data user; The final decryption module is used to wait for the data user to collect a certain number of decrypted fragments and then perform the final decryption to obtain the plaintext of the private data.

10. The distributed power trading system according to claim 9, characterized in that: The threshold determination module comprises: The threshold setting loading unit is used to set the Boolean expression V(∧P i ) constructs a binary tree structure whose leaf nodes are all P in the expression i , non-leaf nodes are "and" or "or" between the corresponding expressions of the two subtrees, and the entire Boolean expression is restored from the root node of the tree; the Folklore algorithm is used on the obtained binary tree structure to obtain the values ​​of all leaf nodes of the binary tree, and the values ​​of all leaf nodes of the binary tree are arranged in order to form a , where u represents the total number of key shares and t represents the threshold value. This matrix is ​​used as the secret sharing matrix M over the finite field Z p According to the discrete Gaussian distribution, random numbers r2, r3, ..., r are obtained by sampling. n , then define the vector w = M (k, r2, r3, ..., r n ) T , this time is Each number in the column vector w of the corresponding key is the node P i A secret share in secret sharing, where u represents the total number of key shares, t represents the threshold value, and P i is the i-th key management node.

11. The distributed power trading system according to claim 9, characterized in that: Also includes: The leaf node generation unit is used to generate the values ​​of all leaf nodes of the binary tree structure, assign m1=(1) to the root node, and set count=1; for each node n on the tree formed by the expression, if the node n corresponds to "or", the value m of the node n is assigned to the left and right branches; if the node n corresponds to "and", 0 is added to the end of m so that the length of m is equal to count, and then a 1 is added after m and assigned to the left branch, and finally a vector (0, 0, 0..., 0, -1) with a length of count+1 is assigned to the right branch, and count=count+1 is set; the values ​​of all leaf nodes of the binary tree are taken out, and 0 is added after these values ​​so that their lengths are the same.

12. The distributed power trading system according to claim 9, characterized in that: The key generation module comprises: The key generation and distribution unit is used to perform the following steps: S1. Select a positive integer N, corresponding to the polynomial ring Select a large modulus q and a small modulus p, such that the greatest common divisor of q and p is 1, and q>>p; S2. Take any polynomial F, G, such that the coefficients of F and G are -1, 0, 1; let f = 1 + pF, if f is in the polynomial ring R q If it is not reversible, then reselect the polynomial; let g = pG, define h = f -1 g mod q; S3. For the t / u threshold, construct a secret sharing matrix shareMatrix according to the linear secret sharing scheme. Initially, a vector k with a length equal to the number of columns of shareMatrix is ​​used. Set k[0]=f. The remaining components are generated according to step S2, f1, f2, ..., and set k[1]=f1, k[2]=f2, ...; S4. Let keys = shareMatrix·k, and distribute the components of keys to each participant; S5. Output the public key h, which is published in the system, and output u private key shares keys, which are managed by each key management node.

13. The distributed power trading system according to claim 9, characterized in that: The partial decryption module includes: The decryption request unit is used by the system administrator to check the database, determine the ciphertext number and address, and request decryption data from the key management node through the smart contract after receiving the decryption request for ciphertext data from the data user.

14. The distributed power trading system according to claim 9, characterized in that: The final decryption module comprises: The threshold check module is used to check whether the decrypted fragments received by the user have reached a certain threshold t. If so, the data user further executes the final decryption algorithm and calculates the decrypted fragment aggregation result a=∑a based on the decrypted fragments obtained from at least t key management nodes. i (mod q), where a i Indicates that the i-th key holder node P i The decrypted fragments are calculated, q is the large modulus, and then the required plaintext m=a(mod p) is calculated, where a is the aggregation result of the decrypted fragments and p is the small modulus; if not, a result that cannot be decrypted normally is returned.