Data encryption method, device, equipment, medium and product

By combining a binary addition gate computational unit combined tree structure with a Merkle tree, the data encryption and credential generation process of the distributed storage system is optimized, solving the problem of high computational resource consumption in traditional deep robust graph algorithms and achieving efficient data storage proof.

CN121907480APending Publication Date: 2026-04-21中移信息技术有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
中移信息技术有限公司
Filing Date
2025-11-05
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing distributed storage systems' replication proof protocols consume enormous computational resources and have low computing power utilization, resulting in inefficient and costly storage proof processes.

Method used

A binary addition gate computation unit combination tree structure is adopted, which replaces the multi-layer computation of the traditional depth robust graph algorithm with layer-by-layer addition operation. Merkle tree is combined for data encryption and certificate generation, and the computation structure is optimized to reduce resource consumption.

Benefits of technology

It significantly reduces computing resource consumption, lowers the computing power consumption and time cost of hardware clusters, improves the execution efficiency of data storage proof, adapts to storage proof needs of different scales, and enhances applicability in large-scale data scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907480A_ABST
    Figure CN121907480A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption method and device, equipment, a medium and a product, and the method comprises the steps: obtaining to-be-encrypted data uploaded by a user, generating an initial data node set according to the to-be-encrypted data, and building a Merkel tree; performing serial encryption on the initial data node set, determining an encrypted data node set, and storing the encrypted data node set; according to the encrypted data node set, constructing a binary addition gate calculation unit combination tree, and based on the Merkel tree and the binary addition gate calculation unit combination tree, generating an encryption voucher of the to-be-encrypted data, the binary addition gate calculation unit combination tree taking encrypted data nodes as operands, and taking the operands as operands. And a tree structure is constructed through layer-by-layer addition operation. According to the technical scheme, the calculation structure is optimized, resource consumption is reduced, and the encryption certification efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security technology, and in particular to a data encryption method, apparatus, device, medium, and product. Background Technology

[0002] The development of distributed storage technology has driven the application of decentralized storage systems, such as systems built on blockchain and the InterPlanetary File System (IPFS) protocol. These systems ensure the security, integrity, and durability of data storage through cryptographic proofs and economic incentive mechanisms. Among these, mechanisms such as proof of replication are the core technologies that ensure the unique storage of data.

[0003] In existing technologies, traditional distributed storage system replication proof protocols often use deep robust graph algorithms to perform multi-layer computation on data (such as 11-layer processing). This process relies on proof units composed of billions of SHA256 computation unit gates. Even with a cluster of graphics card computers, it takes several hours to complete the computation, resulting in huge consumption of computing resources and low computing power utilization. This leads to inefficient and costly storage proof processes. Summary of the Invention

[0004] This invention provides a data encryption method, apparatus, device, medium, and product that optimizes the computing structure, reduces resource consumption, and improves encryption proof efficiency.

[0005] In a first aspect, embodiments of this disclosure provide a data encryption method, including:

[0006] Obtain the user-uploaded data to be encrypted, generate an initial set of data nodes based on the data to be encrypted, and establish a Merkle tree;

[0007] The initial set of data nodes is serially encrypted to determine the set of encrypted data nodes, and the set of encrypted data nodes is stored.

[0008] A binary addition gate computation unit combination tree is constructed based on the encrypted data node set, and an encryption credential for the data to be encrypted is generated based on the Merkle tree and the binary addition gate computation unit combination tree. The binary addition gate computation unit combination tree is a tree structure constructed by performing layer-by-layer addition operations with encrypted data nodes as operands.

[0009] Secondly, embodiments of this disclosure provide a data encryption device, comprising:

[0010] The Merkle tree building module is used to obtain the data to be encrypted uploaded by the user, generate an initial set of data nodes based on the data to be encrypted, and build a Merkle tree.

[0011] A data encryption module is used to serially encrypt the initial set of data nodes, determine the encrypted set of data nodes, and store the encrypted set of data nodes.

[0012] The encryption credential generation module is used to construct a binary addition gate computation unit combination tree based on the encrypted data node set, and generate an encryption credential for the data to be encrypted based on the Merkle tree and the binary addition gate computation unit combination tree. The binary addition gate computation unit combination tree is a tree structure constructed by performing layer-by-layer addition operations with encrypted data nodes as operands.

[0013] Thirdly, embodiments of this disclosure provide an electronic device, including:

[0014] At least one processor; and

[0015] A memory that is communicatively connected to at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor can execute a data encryption method provided in the first aspect embodiment described above.

[0017] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer instructions that, when executed by a processor, implement a data encryption method provided in the first aspect of the embodiments described above.

[0018] Fifthly, this disclosure provides a computer program product, which includes a computer program that, when executed by a processor, implements a data encryption method provided in the first aspect of the embodiment.

[0019] An embodiment of the present invention provides a data encryption method, apparatus, device, medium, and product, comprising: acquiring user-uploaded data to be encrypted; generating an initial data node set based on the data to be encrypted and establishing a Merkle tree; serially encrypting the initial data node set to determine an encrypted data node set and storing the encrypted data node set; constructing a binary addition gate computation unit combination tree based on the encrypted data node set; and generating an encryption credential for the data to be encrypted based on the Merkle tree and the binary addition gate computation unit combination tree, wherein the binary addition gate computation unit combination tree is a tree structure constructed by performing layer-by-layer addition operations using encrypted data nodes as operands. The above technical solution optimizes the multi-level computation of traditional deep robust graph algorithms into recursive addition gate operations by constructing a binary addition gate computation unit combination tree. This avoids intensive computation of a large number of computation unit gates, significantly reducing computational resource consumption and lowering the computing power consumption and time cost of hardware clusters. Replacing traditional complex coding operations with layer-by-layer recursive addition operations eliminates the need for long-term computations relying on high-performance graphics card clusters, shortening the time for generating encrypted credentials and improving the execution efficiency of data storage proofs. The hierarchical computation structure of the binary addition gate combination tree supports dynamic adjustment of node size. Compared with fixed-level deep robust graph algorithms, it can flexibly expand the computation level according to the amount of data, adapting to storage proof needs of different scales and improving applicability in large-scale data scenarios. Combining the collaborative verification mode of Merkle trees and binary addition gate computation units, it provides a more efficient encrypted credential generation solution by simplifying the computational logic and reducing the complexity of the proof process while ensuring the reliability of data integrity verification.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of a data encryption method provided in Embodiment 1 of the present invention;

[0023] Figure 2 This is a flowchart of a data encryption method provided in Embodiment 2 of the present invention;

[0024] Figure 3This is a system execution flowchart of a data encryption method provided in Embodiment 2 of the present invention;

[0025] Figure 4 This is a schematic diagram of a binary addition gate calculation unit combination tree provided in Embodiment 2 of the present invention;

[0026] Figure 5 This is a schematic diagram of the structure of a data encryption device provided in Embodiment 3 of the present invention;

[0027] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first," "second," and "target," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Filecoin is a decentralized encrypted storage system built on blockchain technology and the IPFS protocol. It aims to provide secure, reliable, and efficient data storage services and ensures data integrity and durability through cryptographic proofs and economic incentive mechanisms.

[0031] In the Filecoin cryptographic storage system, Proof of Replication (PoRep) ensures that storage nodes encrypt and uniquely replicate data to an independent physical location, preventing data forgery or duplicate storage. PoRep, combined with content addressing technology, makes data verifiable and tamper-resistant in the distributed network.

[0032] In the Filecoin cryptographic storage system, Proof of SpaceTime (PoSt) ensures that regularly verified nodes continuously store data without tampering within a specified time, and guarantees the long-term integrity of the data through automatic blockchain auditing.

[0033] In the Filecoin cryptographic storage network, the Proof-of-Replication (PoRep) protocol uses a deep robust graph algorithm for encoding operations, then uses the Poseidon hash algorithm to generate a Merkle tree, and finally uses a zero-knowledge proof algorithm to prove the Merkle tree. Filecoin's deep robust graph algorithm divides the original data into several data nodes, and then performs 11 layers of computation on each data node. These 11 layers of computation consume a significant amount of computing resources. The deep robust graph algorithm is a proof computation unit, which consists of billions of SHA256 computation unit gates. It requires a computer cluster equipped with graphics cards to compute for approximately four hours, resulting in a large computational load and wasted computing power.

[0034] Example 1

[0035] Figure 1 This is a flowchart of a data encryption method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of data encryption and credential generation. The method can be executed by a data encryption device, which can be implemented in hardware and / or software.

[0036] like Figure 1 As shown, the method includes:

[0037] S101. Obtain the data to be encrypted uploaded by the user, generate an initial set of data nodes based on the data to be encrypted, and establish a Merkle tree.

[0038] In this embodiment, the data to be encrypted can be understood as data uploaded by the user that needs to be encrypted. The initial data node set can be understood as the set of data nodes formed by dividing and filling the data to be encrypted according to certain rules. A Merkle tree is a hash binary tree used to verify data integrity and existence.

[0039] Specifically, after a user uploads data to be encrypted, the data is first processed by filling and splitting it according to factors such as data size, generating initial data nodes of a fixed byte size, and then constructing an initial data node set. Based on this, a Merkle tree is built using these initial data nodes to provide a basis for data integrity verification.

[0040] S102. Perform serial encryption on the initial data node set, determine the encrypted data node set, and store the encrypted data node set.

[0041] In this embodiment, the encrypted data node set is the result of the initial data node set after encryption processing, and each encrypted data node in the encrypted data node set is the encrypted initial data node.

[0042] Specifically, after determining the initial set of data nodes, a virtual random node serial encryption algorithm is used, combined with DRAND random numbers and user private keys. First, the first initial data node in the initial data node set is encrypted, forming an encrypted data node. Then, based on the first encrypted data node, the second initial data node in the initial data node set is encrypted, and this process is repeated serially to complete the encryption of each initial data node, generating the encrypted data node set. This encrypted data node set is then stored under an IPFS path to ensure the security and reliability of encrypted data storage.

[0043] S103. Construct a binary addition gate computation unit combination tree based on the set of encrypted data nodes, and generate an encryption credential for the data to be encrypted based on the Merkle tree and the binary addition gate computation unit combination tree. The binary addition gate computation unit combination tree is a tree structure constructed by performing layer-by-layer addition operations with encrypted data nodes as operands.

[0044] In this embodiment, the binary addition gate computation unit combination tree is a tree structure constructed by using encrypted data nodes as operands through layer-by-layer addition operations. The encryption credential is a certificate proving that the data to be encrypted has been completely encrypted; it records key information and is stored on the blockchain for third-party verification.

[0045] Specifically, based on a set of encrypted data nodes, every two encrypted data nodes are used as a pair of operands for addition operations, recursively constructing a binary addition gate computation unit combination tree. Simultaneously, combined with the previously established Merkle tree, related calculations are used to generate encrypted credentials containing various key information, which are then recorded on the blockchain. This completes the entire data encryption and credential generation process, ensuring the verifiability and integrity of encrypted data.

[0046] The present invention provides a data encryption method comprising: acquiring user-uploaded data to be encrypted; generating an initial data node set based on the data to be encrypted and establishing a Merkle tree; serially encrypting the initial data node set to determine an encrypted data node set and storing the encrypted data node set; constructing a binary addition gate computation unit combination tree based on the encrypted data node set; and generating an encryption credential for the data to be encrypted based on the Merkle tree and the binary addition gate computation unit combination tree. The above technical solution optimizes the multi-level computation of traditional deep robust graph algorithms into recursive addition gate operations by constructing a binary addition gate computation unit combination tree. This avoids intensive computation of a large number of computation unit gates, significantly reducing computational resource consumption and lowering the computing power consumption and time cost of hardware clusters. Replacing traditional complex coding operations with layer-by-layer recursive addition operations eliminates the need for long-term computations relying on high-performance graphics card clusters, shortening the time for generating encrypted credentials and improving the execution efficiency of data storage proofs. The hierarchical computation structure of the binary addition gate combination tree supports dynamic adjustment of node size. Compared with fixed-level deep robust graph algorithms, it can flexibly expand the computation level according to the amount of data, adapting to storage proof needs of different scales and improving applicability in large-scale data scenarios. Combining the collaborative verification mode of Merkle trees and binary addition gate computation units, it provides a more efficient encrypted credential generation solution by simplifying the computational logic and reducing the complexity of the proof process while ensuring the reliability of data integrity verification.

[0047] Example 2

[0048] Figure 2 This is a flowchart of a data encryption method provided in Embodiment 2 of the present invention. This embodiment is a further optimization of any of the above embodiments and can be applied to the case of data encryption and credential generation. The method can be executed by a data encryption device, which can be implemented in hardware and / or software.

[0049] Figure 3 This is a system execution flowchart of a data encryption method provided in Embodiment 2 of the present invention.

[0050] like Figure 2 and Figure 3 As shown, the method includes:

[0051] S201. Obtain the data to be encrypted, and fill the data to be encrypted so that the filled data to be encrypted meets the byte conditions.

[0052] In this embodiment, the byte condition can be understood as the total number of bytes of the data to be encrypted after padding being 2. N ×32 bytes, where N is calculated and determined by the formula N=mod(log2(Length(dataD) / 32))+1, where Length(dataD) is the size of the data to be encrypted in bytes.

[0053] Specifically, user R uploads data D to be encrypted from the client to the encrypted storage node on the blockchain via Transmission Control Protocol / Internet Protocol (TCP / IP). After obtaining the data D uploaded by user R, the byte length of the data D is padded to 2 bytes by adding 0s to the end of the data. N ×32 bytes. Complete padding to ensure the padded data can be evenly divided into fixed-size data nodes, laying the foundation for subsequent data processing.

[0054] S202. Based on the filled data to be encrypted, multiple initial data nodes are obtained, forming an initial data node set.

[0055] In this embodiment, the initial data node can be understood as a basic data unit obtained by dividing the padded data to be encrypted D into a fixed number of bytes (e.g., 32 bytes), with each node being 32 bytes in size. Each data node is denoted as a Node. The initial data node set is a complete set composed of all the initial data nodes generated by the division, denoted as {Node1, Node2, ..., Node3}. N}, of which 2 N This represents the total number of data nodes.

[0056] Specifically, for those that have been filled and meet the requirement of 2 N The data D to be encrypted, given a 32-byte condition, is divided into segments of 32 bytes each, resulting in 2... N There are 1 independent initial data node, which are named Node1, Node2, ..., Node3 in sequence. N All nodes together form the initial data node set, providing the basic data units for subsequent construction of the Merkle tree and execution of encryption operations.

[0057] S203. Construct a Merkle tree based on the initial set of data nodes and determine the corresponding Merkle root.

[0058] In this embodiment, a Merkle tree is a binary tree structure built by performing hash calculations on adjacent nodes layer by layer, with the initial data node as the leaf node. The Merkle root is the unique hash value at the top level of the Merkle tree, denoted as CommD, which can be used as the core verification identifier for data integrity and will also serve as a key factor in the encryption process.

[0059] Specifically, the initial data node set {Node1, Node2, ..., Node3} NAll initial data nodes in the} are used as leaf nodes of the Merkle tree. Each pair of nodes is hashed to generate the parent node of the next level. Then, the parent node is used as the new processing object, and hashing is performed again in pairs to generate the node of the next level. This process is recursively executed layer by layer until a unique top-level hash value is obtained. This value is the Merkle root CommD, and the construction of the Merkle tree is completed.

[0060] S204. Obtain the DRAND random number and the user's private key.

[0061] In this embodiment, the DRAND random number is a time-sensitive and random value obtained from a trusted node on the Internet, used to provide a reliable random factor for the encryption process. The user's private key (SecretKey, SK) is a user-exclusive private key used for identity authentication and data signing, ensuring the uniqueness of data ownership.

[0062] Specifically, the system connects to the internet through a pre-defined trusted channel to obtain the current DRAND random number, ensuring the real-time nature and randomness of the random number; at the same time, it obtains the private key SK used by user R for this encryption operation.

[0063] S205. Sign the DRAND random number according to the user's private key to obtain an encrypted random number.

[0064] In this embodiment, the encrypted random number (RNG) is a value generated by signing the hash value of the DRAND random number with the user's private key. It is used to uniquely identify the ownership of the encrypted data, and the random factor of each encrypted data is different.

[0065] Specifically, firstly, the obtained DRAND random number is hashed using Secure Hash Algorithm 256 (SHA256) to obtain the hash value of DRAND; then, using user R's private key SK, the hash value is signed using the signature function Sig in the Elliptic Curve Cryptography (ECC) encryption algorithm to generate a random number generator (RNG), calculated as RNG = Sig. SK (SHA256(DRAND)).

[0066] If a third party needs to verify whether RNG was generated by user R's signature, they can use the Verfy verification function of the ECC encryption algorithm, combined with user R's public key (PK), for verification. The verification formula is VerfyPK(RNG,SHA256(DRAND))=(TRUE,FALSE). The verification result will return TRUE or FALSE. TRUE indicates that RNG was generated by user R's signature, and FALSE indicates that RNG was not generated by user R's signature.

[0067] S206. Generate a virtual random node based on the encrypted random number and the Merkle root of the Merkle tree. Encrypt the first initial data node in the initial data node set based on the virtual random node to obtain the first encrypted data node.

[0068] In this embodiment, the virtual random node (SimNode) is a random input value used to encrypt the first initial data node. It is a data node generated by hashing an encrypted random number and a Merkle root. The encrypted data node is the result of encrypting the initial data nodes in the initial data node set.

[0069] Specifically, the CreateSimNode function calculates virtual random nodes. This function takes an encrypted random number RNG and a Merkle number CommD as input, concatenates them as strings, and then performs a SHA256 hash calculation to obtain the virtual random node SimNode. The calculation formula is SimNode = SHA256(RNG + CommD). Subsequently, the ChaCha20 encryption function is used, taking the first initial data node Node1 in the initial data node set as data input and SimNode as a random input value, to encrypt Node1, obtaining the first encrypted data node ENode1. The calculation formula is ENode1 = ChaCha20(Node1, SimNode).

[0070] S207. Based on the first encrypted data node, iteratively encrypt the next initial data node in the initial data node set to obtain the corresponding encrypted data node, until the encryption of the entire initial data node set is completed, forming an encrypted data node set.

[0071] In this embodiment, an encrypted data node set is formed based on a serial iterative encryption method. Serial iterative encryption refers to encrypting the current initial data node by sequentially using the previous encrypted data node as the random input value for the current encryption operation, following the order of the initial data nodes. The encrypted data node set is a collection of nodes generated after serial iterative encryption of all initial data nodes, denoted as {ENode1, ENode2, ..., ENode3}. N}

[0072] Specifically, following the logic of the virtual random node serial encryption algorithm, after obtaining the first encrypted data node ENode1, the second initial data node Node2 in the initial data node set is encrypted using the ChaCha20 encryption function with ENode1 as the random input value, resulting in the second encrypted data node ENode2, calculated as ENode2 = ChaCha20(Node2, ENode1). Then, the third initial data node Node3 is encrypted using ENode2 as the random input value, resulting in the third encrypted data node ENode3 = ChaCha20(Node3, ENode2). This process is repeated sequentially layer by layer until the last initial data node Node2 is encrypted. N Encryption is complete, resulting in the last encrypted data node, ENode2. N =ChaCha20(Node2 N ENode2 N -1). Ultimately, all encrypted data nodes together constitute an encrypted data node set.

[0073] S208. Store the encrypted data node set in the corresponding file path.

[0074] In this embodiment, the corresponding file path refers to a specific storage path in IPFS, denoted as the ipfs-e path, which is used to locate and access the stored encrypted data.

[0075] Specifically, the set of encrypted data nodes is denoted as encrypted data P. After encrypted data P is generated, it is uploaded and stored in the ipfs-e path of the IPFS network according to the preset storage rules. By leveraging the distributed storage characteristics of IPFS, reliable storage and efficient access to encrypted data are ensured.

[0076] S209. Using the encrypted data nodes in the encrypted data node set as the underlying operands, add every two encrypted data nodes as a group of operands to obtain the output number of each group of operands, forming an addition gate.

[0077] In this embodiment, the bottom-level operands refer to the input data at the lowest level of the binary addition gate computation unit combination tree, that is, all encrypted data nodes in the encrypted data node set. The addition gate is a basic computation unit composed of a left operand v, a right operand c, and an output number m. The left and right operands are a set of encrypted data nodes to be computed, and the output number is the result of adding the left and right operands, that is, output number = left operand + right operand (v + c = m).

[0078] Specifically, Figure 4This is a schematic diagram of a binary addition gate computation unit combination tree provided in Embodiment 2 of the present invention, as shown below. Figure 4 As shown, the encrypted data node set {ENode1, ENode2, ..., ENode3} will be... N All encrypted data nodes in the binary addition gate computation unit combination tree are used as the bottom-level operands. Following the node order, ENode1 and ENode2 are grouped together, ENode3 and ENode4 are grouped together, and so on. In each group, the first encrypted data node is used as the left operand, and the second encrypted data node is used as the right operand. Addition is performed on the left and right operands of each group to obtain the corresponding output number. Each group containing the left operand, right operand, and output number forms an addition gate, generating a total of 2... N -1 output number.

[0079] S210. Take the output number of each addition gate as the operand of the current layer. Every two operands are added to form a new addition gate and obtain the corresponding output number. The operation is recursively performed layer by layer until a unique top-level output number is obtained. The top-level output number is taken as the binary addition root to form a binary addition gate computation unit combination tree.

[0080] In this embodiment, the binary addition root (SomD) is the unique output number at the top level of the binary addition gate computation unit combination tree. The binary addition gate computation unit combination tree (SomTree) is a tree structure built from the bottom operands through layer-by-layer addition gate operations.

[0081] Specifically, such as Figure 4 As shown, the 2 generated in step S209 N -1 output numbers are used as new operands for the next level. Addition is performed again in pairs to generate output numbers, forming new addition gates. Then, using the newly generated output numbers as operands for the next level, the process continues, adding pairs of numbers and iterating recursively layer by layer. As the number of iterations increases, the number of operands gradually decreases until a unique top-level output number is obtained. This value is the binary addition root SomD, and the entire layer-by-layer computational structure forms a binary addition gate computational unit combinatorial tree.

[0082] S211. For each addition gate in the binary addition gate computation unit combination tree, determine the corresponding polynomial, and obtain the polynomial of the binary addition gate computation unit combination tree based on the polynomial of each addition gate.

[0083] In this embodiment, the polynomial of the addition gate is a univariate polynomial constructed based on the left operand, right operand, and output of the addition gate. The polynomial of the binary addition gate computation unit combination tree is the overall polynomial obtained by recursively integrating the polynomials of all addition gates, denoted as PS(X)=LS(X)RS(X)-OS(X)=TS(x)HS(x), where TS(x)=(x-1)(x-2)(x-3), and HS(x) is the polynomial of x.

[0084] Specifically, for each addition gate in the binary addition gate computation unit combinatorial tree, if its left operand is v, its right operand is c, and its output is m (i.e., v + c = m), then according to the polynomial property, the polynomial P1(x) = L1(x)・R1(x) - O1(x) = T(x)・H1(x) is generated for this addition gate, where the left operand polynomial L1(x), the right operand polynomial R1(x), and the output polynomial O1(x) correspond to the polynomial expressions of the left operand v, the right operand c, and the output m, respectively. T(x) is the verification basis polynomial, T(x) = (x-1)(x-2)(x-3); H1(x) is the cofactor polynomial, obtained through polynomial transformation; x is the polynomial variable. Subsequently, following the hierarchical structure of the binary addition gate computation unit combination tree, the polynomials of all addition gates are recursively calculated, and finally integrated to obtain the overall polynomial PS(X) of the combination tree.

[0085] S212. Generate a random integer based on the DRAND random number, substitute the random integer into the polynomial of the binary addition gate calculation unit combination tree to obtain the integer verification value, and combine the encryption generation point of the elliptic encryption curve to generate the first encryption point and the second encryption point.

[0086] In this embodiment, the random integer (s) is the integer obtained by performing SHA256 calculation on the DRAND random number. The integer verification value (TS(s)) is the value obtained by substituting the random integer s as a polynomial variable into TS(x) in the binary addition gate computation unit combinatorial tree polynomial, and is used to verify the storage proof of the binary addition gate computation unit. The encryption generation point (G0) of the elliptic encryption curve is the reference point in the BLS231 elliptic encryption curve. The first encryption point (GSP(s)) and the second encryption point (GSH(s)) are encryption identifiers generated based on the polynomial calculation result and G0.

[0087] Specifically, firstly, a SHA256 hash is performed on the DRAND random number, and the resulting hash value is converted into a random integer s. Then, the random integer s is substituted into TS(x) to obtain the integer verification value TS(s). Simultaneously, s is substituted into the polynomials PS(X) and HS(x) of the combinatorial tree to obtain PS(s) = LS(s)・RS(s)-OS(s) and HS(s) = PS(s) / TS(x), respectively. Then, using the encryption generation point G0 of the BLS231 elliptic encryption curve as the reference, the first encryption point GSP(s) = G0×PS(s) and the second encryption point GSH(s) = G0×HS(s) are calculated through elliptic curve multiplication.

[0088] S213. Generate an encryption credential for the data to be encrypted based on the name of each encrypted data node in the encrypted data node set, the file path storing the encrypted data node set, the user's decentralized identifier, DRAND random number, encrypted random number, Merkle root, binary addition root, integer verification value, first encryption point and second encryption point.

[0089] In this embodiment, the names of the encrypted data nodes are ENode1 to ENode2 in the encrypted data node set. N The unique identifier. The file path storing the encrypted data node set is the IPFS-E path used to store encrypted data P in step S208. The user's decentralized identifier (DID) is the user's unique identity identifier in the blockchain system. The encrypted credential (Π) is a credential that records key information throughout the data encryption process and is used to prove that the data to be encrypted has been completely encrypted. It needs to be stored on the blockchain and supports third-party verification.

[0090] Specifically, the encrypted data node set from ENode1 to ENod2... N The following information is integrated to form a file combination tree encryption credential Π: the name of the encrypted data P, the IPFS-e path of the encrypted data P, the DID of user R, the DRAND random number, the encrypted random number RNG, the Merkle root CommD, the binary additive root SomD, the integer verification value TS(s), the first encryption point GSP(s), the second encryption point GSH(s), and the name of the encrypted storage node. The file combination tree encryption credential Π = {IPFS path ipfs-e, user R's DID, DRAND random number, encrypted random number RNG, Merkle root CommD, binary additive root SomD, integer verification value TS(s), encryption point GSP(s), encryption point GSH(s), and encrypted storage node name}. Subsequently, this encryption credential Π is recorded on the blockchain. Third parties can verify whether the encrypted data P was completely encrypted from the original data D by reading Π on the blockchain, ensuring the integrity and traceability of the encrypted data.

[0091] This invention provides a data encryption method, comprising: acquiring data to be encrypted; padding the data to be encrypted to satisfy byte conditions; obtaining multiple initial data nodes based on the padded data to be encrypted, forming an initial data node set; constructing a Merkle tree based on the initial data node set and determining the corresponding Merkle root; acquiring a DRAND random number and a user's private key; signing the DRAND random number based on the user's private key to obtain an encrypted random number; generating virtual random nodes based on the encrypted random number and the Merkle root of the Merkle tree; encrypting the first initial data node in the initial data node set based on the virtual random nodes to obtain the first encrypted data node; iteratively encrypting the next initial data node in the initial data node set based on the first encrypted data node to obtain the corresponding encrypted data node, until all initial data node sets are encrypted, forming an encrypted data node set; storing the encrypted data node set in a corresponding file path; using the encrypted data nodes in the encrypted data node set as underlying operands, and using every two encrypted data nodes as... A set of operands is added together to obtain the output of each set of operands, forming an addition gate. The output of each addition gate is used as the operand of the current layer. Every two operands are added to form a new addition gate and obtain the corresponding output. This process is repeated recursively layer by layer until a unique top-level output is obtained. The top-level output is used as the binary addition root, forming a binary addition gate computation unit combination tree. For each addition gate in the binary addition gate computation unit combination tree, the corresponding polynomial is determined. Based on the polynomial of each addition gate, the binary addition gate computation unit combination tree is obtained. The method employs a polynomial approach. A random integer is generated based on the DRAND random number. This random integer is then substituted into the polynomial of the binary addition gate computation unit combination tree to obtain an integer verification value. This verification value is then combined with the encryption generation points of the elliptic encryption curve to generate the first and second encryption points. Based on the names of each encrypted data node in the encrypted data node set, the file path storing the encrypted data node set, the user's decentralized identifier, the DRAND random number, the encrypted random number, the Merkle root, the binary addition root, the integer verification value, the first encryption point, and the second encryption point, an encryption credential for the data to be encrypted is generated. This technical solution designs a data encryption method based on the binary addition gate computation unit combination tree, solving the problem of how to determine whether data has already been stored by an encrypted storage node. User R transmits data D to the encrypted storage node. The encrypted storage node, based on the current world's decentralized random number DRAND and the user's private key SK, uses a virtual random node serial encryption algorithm to construct encrypted data P stored under the IPFS path ipfs-e. Then, zero-knowledge proof calculations are performed to generate the file combination tree encryption credential Π. Write the encrypted certificate Π of the file combination tree to the blockchain for storage. This proves to third-party users that data D has been stored by the encrypted storage node and that the ownership of encrypted data P belongs to user R.In the Filecoin system, since one SHA256 computational unit gate is equivalent to 2600 addition gate computational units, the Filecoin system requires a large amount of computing power. This invention can save a significant amount of computing power; for the same file size, the computational cost of this invention is about one-thousandth of that of the Filecoin encrypted storage network.

[0092] A third party can read the file combination tree encryption certificate Π from the blockchain, and then verify whether the file combination tree encryption certificate Π is correct. If it is correct, it means that the encrypted data P was generated by encrypting the data D.

[0093] Therefore, as a first optional embodiment of this method, the method further includes:

[0094] a. In response to a verification request for the data to be encrypted, verify the encryption credentials.

[0095] In this embodiment, the verification request refers to a request initiated by a third party to confirm the compliance and integrity of encrypted data P. The encryption credential contains key information such as the IPFS path ipfs-e, user R's DID, DRAND random number, encrypted random number RNG, Merkle root CommD, binary additive root SomD, integer verification value TS(s), encryption points GSP(s) and GSH(s), and the name of the encrypted storage node. This information is stored on the blockchain and serves as the core basis for verification. The verification process includes two parts: ownership verification of encrypted data P and storage proof verification, aiming to confirm the ownership and correctness of the encrypted data's storage.

[0096] Specifically, when a third party initiates a verification request for data to be encrypted, it first reads the encrypted certificate Π from the file combination tree on the blockchain, and then performs two core verification steps. First, it verifies the ownership of the encrypted data P. The third party obtains user R's public key, uses the Verfy verification function of the ECC encryption algorithm, substitutes the SHA256 hash values ​​of the encrypted random number RNG and the DRAND random number in the certificate, and executes the formula VerfyPK(RNG,SHA256(DRAND)). If the return result is TRUE, it proves that the ownership of the encrypted data P belongs to user R; if the return result is FALSE, it proves that the ownership of the encrypted data P does not belong to user R. Second, it verifies the storage proof of the encrypted data P. Based on the integer verification value TS(s) and the encryption points GSP(s) and GSH(s) in the certificate, the third party verifies the condition "GSP(s) = GSH(s) raised to the power of TS(s)". If the verification passes, it means that the encrypted data P has been correctly stored by the encrypted storage node; if the verification fails, it means that the encrypted data P has not been correctly stored by the encrypted storage node. When both verification steps are completed and the results are correct, it can be confirmed that the encrypted credential is correct and the encrypted data P is generated by encrypting the original data D.

[0097] b. In response to a decryption request for the data to be encrypted, decrypt the data based on the set of encrypted data nodes and the encryption credentials.

[0098] In this embodiment, the decryption request refers to a request initiated by user R to restore encrypted data P to the original data D.

[0099] Specifically, when user R initiates a decryption request for the data to be encrypted, the first step is to read the file combination tree encryption credential Π={IPFS path ipfs-e, user R's DID, DRAND random number, encrypted random number RNG, Merkle root CommD, binary addition root SomD, integer verification value TS(s), encryption point GSP(s), encryption point GSH(s), and encryption storage node name} from the blockchain. Since the encryption storage node stores the encrypted data P under the IPFS path ipfs-e, based on the IPFS path ipfs-e recorded in the credential, the set of encryption data nodes stored under this path is found and retrieved (i.e., encrypted data P={ENode1, ENode2, ..., ENode3}). N Then, verify that the owner of the encrypted data P is user R. First, use the encrypted random number RNG and Merkle root CommD from the credentials to calculate the virtual random node SimNode = SHA256(RNG + CommD). Then, use the Verfy verification function of the ECC encryption algorithm, substituting the SHA256 hash values ​​of RNG and DRAND random numbers, and execute the formula VerfyPK(RNG,SHA256(DRAND)). If it returns TRUE, then user R is confirmed to be the legitimate owner of the encrypted data P. Finally, decrypt the data D and use the antiChaCha20 algorithm to serially decrypt the encrypted data node set according to the formula Node2. N =antiChaCha20(Node2 N ENode2 N -1); ...; Node2 = antiChaCha20(Node2, ENode1); Node1 = antiChaCha20(Node1, RngSeed) are calculated sequentially to obtain the initial data node set {Node1, Node2, ..., Node2}. N The process then removes the trailing zeros from the set, ultimately restoring the original data D. Here, RngSeed is SimNode.

[0100] Example 3

[0101] Figure 5 This is a schematic diagram of a data encryption device provided in Embodiment 3 of the present invention. Figure 5 As shown, the device includes:

[0102] Merkle tree building module 31 is used to obtain the data to be encrypted uploaded by the user, generate an initial data node set based on the data to be encrypted, and build a Merkle tree;

[0103] The data encryption module 32 is used to serially encrypt the initial data node set, determine the encrypted data node set, and store the encrypted data node set.

[0104] The encryption credential generation module 33 is used to construct a binary addition gate computation unit combination tree based on the encrypted data node set, and generate an encryption credential for the data to be encrypted based on the Merkle tree and the binary addition gate computation unit combination tree. The binary addition gate computation unit combination tree is a tree structure constructed by performing layer-by-layer addition operations with encrypted data nodes as operands.

[0105] The data encryption device used in this technical solution optimizes the computing structure, reduces resource consumption, and improves the efficiency of encryption proof.

[0106] Optionally, the Merkle tree building module 31 is specifically used for:

[0107] Obtain the data to be encrypted, and fill the data to be encrypted so that the filled data to be encrypted meets the byte condition;

[0108] Multiple initial data nodes are obtained based on the padded data to be encrypted, forming an initial data node set;

[0109] A Merkle tree is constructed based on the initial set of data nodes, and the corresponding Merkle root is determined.

[0110] Optionally, the data encryption module 32 is specifically used for:

[0111] Obtain the DRAND random number and the user's private key;

[0112] The DRAND random number is signed using the user's private key to obtain an encrypted random number;

[0113] A virtual random node is generated based on the encrypted random number and the Merkle root of the Merkle tree. The first initial data node in the initial data node set is then encrypted based on the virtual random node to obtain the first encrypted data node.

[0114] Based on the first encrypted data node, the next initial data node in the initial data node set is iteratively encrypted to obtain the corresponding encrypted data node, until the encryption of the entire initial data node set is completed, forming an encrypted data node set.

[0115] The encrypted data node set is stored in the corresponding file path.

[0116] Optionally, the encryption credential generation module 33 is specifically used for:

[0117] Using the encrypted data nodes in the set of encrypted data nodes as the underlying operands, and adding every two encrypted data nodes as a group of operands to obtain the output number of each group of operands, an addition gate is formed.

[0118] The output of each addition gate is used as the operand of the current layer. Every two operands are added to form a new addition gate and obtain the corresponding output. This process is repeated layer by layer until a unique top-level output is obtained. The top-level output is used as the binary addition root to form a binary addition gate computation unit combination tree.

[0119] Optionally, the encryption credential generation module 33 is specifically used for:

[0120] For each addition gate in the binary addition gate computation unit combination tree, determine the corresponding polynomial, and obtain the polynomial of the binary addition gate computation unit combination tree based on the polynomial of each addition gate.

[0121] A random integer is generated based on the DRAND random number. The random integer is substituted into the polynomial of the binary addition gate calculation unit combination tree to obtain the integer verification value. The first encryption point and the second encryption point are generated by combining the encryption generation point of the elliptic encryption curve.

[0122] Based on the name of each encrypted data node in the encrypted data node set, the file path storing the encrypted data node set, the user's decentralized identifier, DRAND random number, encrypted random number, Merkle root, binary addition root, integer verification value, first encryption point and second encryption point, an encryption credential for the data to be encrypted is generated.

[0123] Optionally, the device further includes:

[0124] An encryption credential verification module is used to verify the encryption credential in response to a verification request for the data to be encrypted;

[0125] The data decryption module is used to respond to a decryption request for the data to be encrypted by decrypting it based on the set of encrypted data nodes and the encryption credential.

[0126] The data encryption device provided in the embodiments of the present invention can execute the data encryption method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0127] Example 4

[0128] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0129] like Figure 6 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded from storage unit 48 into the RAM 43. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0130] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0131] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as data encryption methods.

[0132] In some embodiments, the data encryption method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the data encryption method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the data encryption method by any other suitable means (e.g., by means of firmware).

[0133] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0134] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0135] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0136] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0137] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0138] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0139] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0140] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A data encryption method, characterized in that, include: Obtain the user-uploaded data to be encrypted, generate an initial set of data nodes based on the data to be encrypted, and establish a Merkle tree; The initial set of data nodes is serially encrypted to determine the set of encrypted data nodes, and the set of encrypted data nodes is stored. A binary addition gate computation unit combination tree is constructed based on the encrypted data node set, and an encryption credential for the data to be encrypted is generated based on the Merkle tree and the binary addition gate computation unit combination tree. The binary addition gate computation unit combination tree is a tree structure constructed by performing layer-by-layer addition operations with encrypted data nodes as operands.

2. The method according to claim 1, characterized in that, The process of obtaining user-uploaded data to be encrypted, generating an initial set of data nodes based on the data to be encrypted, and establishing a Merkle tree includes: Obtain the data to be encrypted, and fill the data to be encrypted so that the filled data to be encrypted meets the byte condition; Multiple initial data nodes are obtained based on the padded data to be encrypted, forming an initial data node set; A Merkle tree is constructed based on the initial set of data nodes, and the corresponding Merkle root is determined.

3. The method according to claim 1, characterized in that, The step of serially encrypting the initial set of data nodes, determining the encrypted set of data nodes, and storing the encrypted set of data nodes includes: Obtain the DRAND random number and the user's private key; The DRAND random number is signed using the user's private key to obtain an encrypted random number; A virtual random node is generated based on the encrypted random number and the Merkle root of the Merkle tree. The first initial data node in the initial data node set is then encrypted based on the virtual random node to obtain the first encrypted data node. Based on the first encrypted data node, the next initial data node in the initial data node set is iteratively encrypted to obtain the corresponding encrypted data node, until the encryption of the entire initial data node set is completed, forming an encrypted data node set. The encrypted data node set is stored in the corresponding file path.

4. The method according to claim 1, characterized in that, The step of constructing a binary addition gate computation unit combination tree based on the encrypted data node set includes: Using the encrypted data nodes in the set of encrypted data nodes as the underlying operands, and adding every two encrypted data nodes as a group of operands to obtain the output number of each group of operands, an addition gate is formed. The output of each addition gate is used as the operand of the current layer. Every two operands are added to form a new addition gate and obtain the corresponding output. This process is repeated layer by layer until a unique top-level output is obtained. The top-level output is used as the binary addition root to form a binary addition gate computation unit combination tree.

5. The method according to claim 4, characterized in that, The process of generating the encryption credential for the data to be encrypted based on the Merkle tree and the binary addition gate computation unit combination tree includes: For each addition gate in the binary addition gate computation unit combination tree, determine the corresponding polynomial, and obtain the polynomial of the binary addition gate computation unit combination tree based on the polynomial of each addition gate. A random integer is generated based on the DRAND random number. The random integer is substituted into the polynomial of the binary addition gate calculation unit combination tree to obtain the integer verification value. The first encryption point and the second encryption point are generated by combining the encryption generation point of the elliptic encryption curve. Based on the name of each encrypted data node in the encrypted data node set, the file path storing the encrypted data node set, the user's decentralized identifier, DRAND random number, encrypted random number, Merkle root, binary addition root, integer verification value, first encryption point and second encryption point, an encryption credential for the data to be encrypted is generated.

6. The method according to claim 1, characterized in that, Also includes: In response to a verification request for the data to be encrypted, verify the encryption credential; In response to a decryption request for the data to be encrypted, decryption is performed based on the set of encrypted data nodes and the encryption credential.

7. A data encryption device, characterized in that, include: The Merkle tree building module is used to obtain the data to be encrypted uploaded by the user, generate an initial set of data nodes based on the data to be encrypted, and build a Merkle tree. A data encryption module is used to serially encrypt the initial set of data nodes, determine the encrypted set of data nodes, and store the encrypted set of data nodes. The encryption credential generation module is used to construct a binary addition gate computation unit combination tree based on the encrypted data node set, and generate an encryption credential for the data to be encrypted based on the Merkle tree and the binary addition gate computation unit combination tree. The binary addition gate computation unit combination tree is a tree structure constructed by performing layer-by-layer addition operations with encrypted data nodes as operands.

8. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a data encryption method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute a data encryption method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements a data encryption method according to any one of claims 1-6.