Data encryption calculation method, system and device and storage medium

By using blockchain-deployed key generators and encryption agents in the financial industry to generate and manage matrix keys, homomorphic encryption technology solves the high computational complexity, ciphertext expansion and cryptographic keys in the financial industry. The complex problem of key management achieves efficient data encryption and privacy protection.

CN119442283APending Publication Date: 2025-02-14CHONGQING RURAL COMMERCIAL BANK CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411552084.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In joint privacy computing in the financial industry, homomorphic encryption technology has high computational complexity, resulting in performance problems; the expansion of encrypted ciphertext increases the burden of storage and transmission; distributed key management is complex, making it difficult to achieve efficient key security Transmission and management.

Method used

Using a privacy computing system composed of encryption agents, key generators and computing agents, the key generator is deployed on the blockchain, and a matrix key is generated based on the computing requirements, and the calculation process is simplified by inverse matrix and inverse matrix to realize data encryption. Efficient execution of processing and computing tasks.

Benefits of technology

It improves the efficiency of homomorphic encryption technology in large-scale data processing and real-time applications, enhances data privacy protection, simplifies computing processes, reduces the complexity of key management, and improves the security of data transmission and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442283A_ABST
    Figure CN119442283A_ABST
Patent Text Reader

Abstract

The invention discloses a data encryption calculation method, system and device and a storage medium. The method provided by the embodiment of the invention is applied to the private computing system comprising an encryption agent, a key generator and a computing agent. The key generator is a smart contract deployed on a block chain, and the logic of generating a key is determined according to calculation requirements. The encryption agent is responsible for identifying participants and collecting identity identifiers of the participants, and then sending the information to the key generator. The key generator generates a matrix key based on the identity identifier and the calculation requirement, binds the key with the identifier and then returns the key and the identifier to the encryption agent; the encryption agent uses the binding data to configure a key, generates ciphertext data, and transmits a ciphertext and a calculation requirement to the calculation agent. And the computing agent processes the ciphertext data according to the requirements to finally obtain a decryption result. According to the method, the efficiency of the homomorphic encryption technology in large-scale data processing and real-time application can be improved on the premise of guaranteeing privacy and data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and specifically to a data encryption calculation method, system, device and storage medium. Background Art

[0002] In the financial sector, data is a key resource for building models such as risk assessment, credit scoring, and market forecasting. After a long period of digital transformation, the financial industry has established a large number of information systems and accumulated massive amounts of data. However, due to the limited amount of data from a single institution and its homogeneity, the generalization ability of the model is insufficient. If multiple institutions can share data and jointly build models, the performance of the model will be significantly improved. However, due to data privacy and compliance requirements, financial institutions cannot directly share raw data. Therefore, when implementing joint computing of data models, privacy protection and data security become the primary considerations.

[0003] Homomorphic encryption technology provides an effective solution to this problem. Homomorphic encryption is an encryption technology that allows calculations to be performed on encrypted data without first decrypting the data. In other words, the data can still be operated in an encrypted state, and the calculation results will be returned in encrypted form. Only the authorized party with the key can decrypt the result. However, there are some difficulties in joint privacy computing in the financial industry. First, the computational complexity of homomorphic encryption is high, especially when processing large-scale data, the performance problem is significant, which poses a challenge to application scenarios that require real-time response, such as real-time trading systems. Secondly, the ciphertext after homomorphic encryption is generally larger than the original data, which not only increases the storage burden, but also affects the efficiency of data transmission. Finally, distributed key management is complex, and the keys of homomorphic encryption need to be securely transmitted and managed between multiple parties, which is also a huge challenge.

[0004] Therefore, how to improve the efficiency of homomorphic encryption technology in large-scale data processing and real-time applications while ensuring privacy and data security is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] Based on the above problems, the present application provides a data encryption calculation method, system, device and storage medium, which can improve the efficiency of homomorphic encryption technology in large-scale data processing and real-time applications while ensuring privacy and data security.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] A data encryption calculation method is applied to a privacy computing system, wherein the privacy computing system includes an encryption agent, a key generator, and a computing agent; the key generator is a smart contract storing a key generation logic; the key generator is deployed in a blockchain; the key generation logic is determined based on a computing requirement; each computing requirement corresponds to a unique key generation logic; the computing requirement is provided by a data user, and the method includes:

[0008] The encryption agent determines N participants, obtains the identity identifier of each participant, and sends the identity identifier of each participant to the key generator; the participants include a data provider that provides calculation data for the calculation requirement, the calculation data is a processing object of the calculation requirement, and the calculation data is stored in the form of a matrix; N is a positive integer greater than 1;

[0009] The key generator generates a matrix key for each of the participants based on the key generation logic corresponding to the calculation requirement and the identity identifier of each of the participants, binds the matrix key of each of the participants and its identity identifier to obtain binding data, and returns the binding data to the encryption agent; in the calculation requirement, the matrix keys of the two added calculation data are inverse matrices of each other, and the matrix keys of the two multiplied calculation data are inverse matrices of each other;

[0010] The encryption agent configures a matrix key for the computing data of each of the participants based on the computing requirements and the identity identifier in the binding data, obtains the ciphertext data of each of the participants, and sends the ciphertext data and the computing requirements to the computing agent;

[0011] The computing agent computes the ciphertext data of each participant based on the computing requirements to obtain a decryption computing result.

[0012] In a possible implementation, the matrix key includes an addition matrix, an inverse matrix, a multiplication matrix and an inverse matrix; the addition matrix is ​​a random matrix added to the calculation data; the inverse matrix is ​​a negative matrix of the addition matrix; the multiplication matrix is ​​a random matrix multiplied with the calculation data; and the inverse matrix is ​​an inverse matrix of the multiplication matrix.

[0013] In a possible implementation, the generation process of the addition matrix includes: the key generator generates a random matrix having the same rows and columns as the calculation data through a random seed according to the rows and columns of the calculation data;

[0014] The generation process of the multiplication matrix includes: the key generator generates a random matrix having opposite rows and columns to the calculation data through a random seed according to the rows and columns of the calculation data.

[0015] In a possible implementation, the process of determining the key generation logic includes:

[0016] The encryption agent determines a calculation formula based on the calculation requirement; the calculation formula includes two or more calculation items; the calculation item is one of the calculation data, the sum of two of the calculation data, or the product of two of the calculation data;

[0017] The encryption agent splits the calculation item in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form based on the calculation symbol and the number of calculation symbols in the calculation formula;

[0018] The key generator determines that the matrix keys of two calculation items in the form of two calculation items added are respectively an addition matrix and an inverse matrix, and determines that the matrix keys of two calculation items in the form of two calculation items multiplied are respectively a multiplication matrix and an inverse matrix.

[0019] In a possible implementation, splitting the calculation item in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form based on the calculation symbol and the number of the calculation symbols in the calculation formula includes:

[0020] When the calculation symbol in the calculation formula includes a plus sign, the key generator determines the two calculation items in the calculation formula as a two-calculation item addition form;

[0021] When the calculation symbol in the calculation formula includes a multiplication sign, the key generator determines the calculation item in the calculation formula as a multiplication form of two calculation items;

[0022] When the calculation symbol in the calculation formula includes two or more plus signs, the key generator splits any two adjacent calculation items in the calculation formula into multiple addition forms of the two calculation items;

[0023] When the calculation symbols in the calculation formula include two or more multiplication signs, the key generator splits any two adjacent calculation items in the calculation formula into multiple forms of multiplication of the two calculation items.

[0024] In a possible implementation, the method further includes:

[0025] After obtaining the ciphertext data, the encryption agent destroys the binding data in the encryption agent.

[0026] A privacy computing system, comprising an encryption agent, a key generator and a computing agent; the key generator is a smart contract storing key generation logic; the key generator is deployed in a blockchain; the key generation logic is determined based on computing requirements; each computing requirement corresponds to a unique key generation logic; the computing requirements are provided by a data user, and the method comprises:

[0027] The encryption agent is used to determine N participants, obtain the identity identifier of each participant, and send the identity identifier of each participant to the key generator; the participants include a data provider that provides calculation data for the calculation requirement, the calculation data is the processing object of the calculation requirement, and the calculation data is stored in the form of a matrix; N is a positive integer greater than 1;

[0028] The key generator is used to generate a matrix key for each of the participants based on the key generation logic corresponding to the calculation requirement and the identity identifier of each of the participants, and bind the matrix key of each of the participants and its identity identifier to obtain binding data, and return the binding data to the encryption agent; in the calculation requirement, the matrix keys of the two added calculation data are inverse matrices of each other, and the matrix keys of the two multiplied calculation data are inverse matrices of each other;

[0029] The encryption agent is further used to configure a matrix key for the computing data of each of the participants based on the computing requirements and the identity identifier in the binding data, obtain the ciphertext data of each participant, and send the ciphertext data and the computing requirements to the computing agent;

[0030] The computing agent is used to compute the ciphertext data of each participant based on the computing requirements to obtain a decryption computing result.

[0031] In a possible implementation, the matrix key includes an addition matrix, an inverse matrix, a multiplication matrix and an inverse matrix; the addition matrix is ​​a random matrix added to the calculation data; the inverse matrix is ​​a negative matrix of the addition matrix; the multiplication matrix is ​​a random matrix multiplied with the calculation data; and the inverse matrix is ​​an inverse matrix of the multiplication matrix.

[0032] A data encryption computing device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the data encryption computing method as described above is implemented.

[0033] A computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the encryption calculation method for data as described above.

[0034] Compared with the prior art, this application has the following beneficial effects:

[0035] The present application provides a data encryption calculation method, system, device and storage medium. Specifically, the method provided in the embodiment of the present application is applied to a privacy computing system composed of an encryption agent, a key generator and a computing agent. The key generator is a smart contract deployed on the blockchain, which has the logic of generating keys based on computing requirements. After the data user provides the computing requirements, the encryption agent determines N participants, obtains their identity identifiers, and sends them to the key generator. The key generator generates a matrix key based on the identity identifier and the computing requirements, and returns the binding data to the encryption agent. The encryption agent uses the binding data to configure the key for the computing data of each participant, generates ciphertext data, and sends it to the computing agent together with the computing requirements. In the computing requirements, the added key is a reciprocal matrix, and the multiplied key is a reciprocal matrix. The computing agent processes the ciphertext data according to the computing requirements and finally obtains the decryption result.

[0036] This application uses matrix keys to perform data encryption processing, and under specific computing requirements, the key properties of addition and multiplication operations make it possible to complete the calculation without exposing the original calculation data, effectively improving the privacy protection level of the data. At the same time, the use of inverse matrices and inverse matrices as keys, especially the subtraction and multiplication operations in matrix operations are directly converted into matrix addition and multiplication, which greatly simplifies the calculation process, improves the calculation efficiency, and facilitates the encryption processing of large-scale data and the real-time execution of computing tasks. In addition, the key generator is deployed in a blockchain environment, and the decentralized and tamper-proof characteristics of the blockchain are used to achieve secure key generation and efficient management, reduce the risk of illegal access to the key, and enhance the security of data transmission and storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 A method flow chart of a data encryption calculation method provided in an embodiment of the present application;

[0039] Figure 2A method flow chart of a method for determining a key generation logic provided in an embodiment of the present application;

[0040] Figure 3 A schematic diagram of the structure of a data encryption computing system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] To facilitate understanding of the technical solutions provided by the embodiments of the present application, the background technology involved in the embodiments of the present application will be described below.

[0042] Homomorphic encryption is an encryption technique that allows calculations to be performed on encrypted data without first decrypting the data. That is, the data can still be operated on in an encrypted state, and the calculation results will be returned in encrypted form, and only authorized parties with the key can decrypt the results.

[0043] In the financial sector, building efficient and accurate models relies on abundant data resources. Although digital transformation has significantly improved the data accumulation capabilities of financial institutions, the amount and diversity of data from a single institution is often insufficient to support the effective training of complex models. In order to make up for this shortcoming and promote the improvement of model performance, data sharing among multiple institutions has become a trend. However, this process faces the dual challenges of privacy leakage and compliance. Therefore, it is particularly critical to ensure that data is analyzed and modeled without exposing the original content.

[0044] In response to this demand, homomorphic encryption technology is seen as a potential solution to achieve "transparent" computing. It allows operations to be performed on encrypted data, thereby enabling joint use and analysis of data while maintaining data privacy. However, the application of homomorphic encryption technology to joint privacy computing in the financial industry still faces a series of practical problems:

[0045] Performance bottleneck: Compared with traditional encryption algorithms, homomorphic encryption has a significantly increased computing and time costs due to its complex structural design. For application scenarios that require real-time processing of large amounts of data, such as high-speed trading systems, there is a significant contradiction between this high-performance requirement and the high computing overhead of homomorphic encryption;

[0046] Ciphertext expansion problem: Existing homomorphic encryption algorithms generate ciphertext that is significantly larger than the original data size during the encryption process. This not only increases the economic burden of storage, but also affects the efficiency of data transmission, especially when large-scale data exchange is carried out;

[0047] Challenges of distributed key management: In a collaborative environment involving multiple parties, properly managing the key distribution and access rights for homomorphic encryption is a complex issue. This process needs to ensure the security of the key while adapting to the dynamic structure of participants to avoid key leakage or management chaos.

[0048] In order to solve the above problems, an encryption calculation method, system, device and storage medium for data are provided in the embodiments of the present application. The method of the present application is applied to a privacy computing system composed of an encryption agent, a key generator and a computing agent. The key generator is a smart contract deployed on the blockchain, which stores the logic of generating keys. Each computing requirement corresponds to a unique key generation logic, and the computing requirement is provided by the data user. The encryption agent first determines the participant, obtains and transmits its identity identifier to the key generator. The key generator generates a matrix key for each participant based on the computing requirements and the identity identifier, and returns the binding data. The encryption agent uses these keys to configure the computing data of the participant, generates ciphertext data, and sends it to the computing agent together with the computing requirements. In the computing requirements, the added key is a reciprocal matrix, and the multiplied key is a reciprocal matrix. The computing agent processes the ciphertext data according to the computing requirements and finally obtains the decryption result. The present application uses matrix keys to encrypt data, combines specific computing requirements, and uses inverse matrices and inverse matrices to simplify the computing process, thereby avoiding the exposure of original data, thereby improving data privacy protection. The key generator is deployed in the blockchain, using the decentralized nature of the blockchain to ensure secure key generation and efficient management, reducing the risk of illegal access, enhancing the security of data transmission and storage, and improving the real-time efficiency of large-scale data processing and computing tasks.

[0049] In addition, after the encryption agent obtains the ciphertext data, it will destroy the binding data in the encryption agent. When the encryption agent destroys the binding data, even if the attacker has access to the agent or related storage facilities, it becomes extremely difficult to recover the original unencrypted computing data due to the lack of necessary keys and identifiers, thereby improving the security of the original unencrypted computing data.

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] See also Figure 1 , which is a flow chart of a method for encryption calculation of data provided in an embodiment of the present application.

[0052] It should be noted that Figure 1Each step in the method flow chart relies on the implementation of the privacy computing system, which is composed of an encryption agent, a key generator, and a computing agent. The key generator is responsible for generating keys in the privacy computing system, and it uses a smart contract to store the specified key generation logic. This smart contract is deployed on the blockchain, using the distributed characteristics, immutability, and transparency of blockchain technology to ensure the security and reliability of the key generation process. The design of the key generation logic will be determined based on specific computing requirements or task-specific conditions, which means that each different computing requirement will correspond to a unique key generation logic, thereby achieving a more personalized and more suitable encryption scheme. Under this mechanism, data users directly provide specific data processing or computing task requirements (i.e., computing requirements), which serve as inputs to the key generation process to guide smart contracts on how to generate encryption keys that meet the characteristics of the task. In this way, it can not only adapt to different data encryption scenarios and business needs, but also ensure that the data encryption process is both efficient and secure, and achieve accurate privacy protection and data security.

[0053] like Figure 1 As shown, the encryption calculation method of the data may include steps S101-S104:

[0054] S101: The encryption agent determines N participants, obtains an identity identifier of each of the participants, and sends the identity identifier of each of the participants to the key generator.

[0055] In order to realize the encryption calculation of the calculation data, the encryption agent first needs to identify the N entities (i.e., participants) included in the calculation requirements. Here, N is a positive integer greater than 1, which means that the task involves at least two or more participants. Participants refer to data providers who provide calculation data for the calculation requirements. Then obtain the identity identifiers of each of the participants. For these N different participants, the encryption agent needs to collect and record the unique identity of each participant. These identifiers may exist in the form of numbers, codes, barcodes, or other forms, allowing the system to track and distinguish different participants. Finally, the collected identities of all participants are passed to another key component of the system, the key generator. The data provided by the participants is stored in the form of a matrix, and these data need to be processed according to the calculation requirements.

[0056] As an intermediate coordinator, the encryption agent lays the foundation for the entire data encryption calculation by identifying the participants, obtaining their identities, and forwarding this information to the key generator, ensuring the security and privacy of the data during the encryption, storage and calculation process.

[0057] In a possible implementation, the calculation data of all participants are matrix data with the same rows and columns.

[0058] S102: The key generator generates a matrix key for each of the participants based on the key generation logic corresponding to the calculation requirement and the identity identifier of each of the participants, binds the matrix key of each of the participants and its identity identifier to obtain binding data, and returns the binding data to the encryption agent.

[0059] The key generator will generate a unique matrix key for each party involved in the computing process (i.e., participant) based on the specific computing needs (i.e., "computing requirements") and the pre-set key generation logic. These keys are key tools for performing specific computing operations, and in order to ensure that each step of the operation can accurately identify the corresponding participant, the key generator will also bind the generated matrix key to the unique identity identifier of each participant.

[0060] This binding operation forms a specific set of "binding data", which contains matrix key information and corresponding identity identifiers to ensure that in the subsequent data processing or calculation process, each part of the data (especially the matrix data) can accurately correspond to the participant to which it belongs. This set of binding data will be returned by the key generator to the "encryption agent" responsible for overall coordination and management tasks. The encryption agent can use this binding data to further manage and monitor the entire calculation process to ensure data security and operation effectiveness.

[0061] See also Figure 2 , Figure 2 A method flow chart of a method for determining a key generation logic provided in an embodiment of the present application. Specifically, the process of determining the key generation logic can be implemented through steps A1-A3:

[0062] A1: The encryption agent determines a calculation formula based on the calculation requirement.

[0063] Based on the computing requirements, the encryption agent can determine a unique calculation formula that contains two or more interrelated calculation items. Each calculation item can be a calculation data, the sum of two calculation data, or the product of two calculation data. These calculation items are combined to build a highly flexible and adaptable computing framework, so that the generated key can not only reflect the properties of the data itself, but also provide stronger security and higher efficiency when performing specific encryption or decryption tasks. This design ensures that when dealing with different computing requirements, the key generation process can accurately adapt to and optimize the computing process, thereby meeting a wide range of needs in practical applications.

[0064] Example 1: Assuming the calculation requirement is "calculate the sum of the calculated data of Party A and Party B", the calculation formula can be determined to be "S1+S2", where S1 is the calculated data of Party A and S2 is the calculated data of Party B.

[0065] Example 2: Assuming that the calculation requirement is "calculate the product of the calculation data of Party A and Party B", the calculation formula S1·S2 can be determined, where S1 is the calculation data of Party A and S2 is the calculation data of Party B.

[0066] A2: The encryption agent splits the calculation items in the calculation formula into a form of addition of two calculation items and / or a form of multiplication of two calculation items based on the calculation symbols and the number of calculation symbols in the calculation formula.

[0067] When processing a calculation formula, the key generator first identifies and analyzes the mathematical operation symbols (such as addition and multiplication) and their frequency of occurrence. Based on this information, the key generator adopts a strategy to reassemble the original calculation items and decompose the complex calculation formula into the form of two parts added or two parts multiplied.

[0068] In a possible implementation, splitting the calculation item in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form based on the calculation symbol and the number of the calculation symbols in the calculation formula includes:

[0069] When the calculation symbol in the calculation formula includes a plus sign, the key generator determines the two calculation items in the calculation formula as a two-calculation item addition form.

[0070] Exemplarily, the description is continued by taking Example 1 as an example. The calculation symbol in the calculation formula of Example 1, then it is determined that the two calculation items in the calculation formula are in the form of S1+S2.

[0071] In a possible implementation, splitting the calculation item in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form based on the calculation symbol and the number of the calculation symbols in the calculation formula includes:

[0072] When the calculation symbol in the calculation formula includes a multiplication sign, the encryption agent determines the calculation item in the calculation formula as a multiplication form of two calculation items.

[0073] Exemplarily, the description is continued by taking Example 2 as an example. The calculation symbol in the calculation formula of Example 2 is , then it is determined that the two calculation items in the calculation formula are in the form of S1·S2.

[0074] In a possible implementation, splitting the calculation item in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form based on the calculation symbol and the number of the calculation symbols in the calculation formula includes:

[0075] When the calculation symbols in the calculation formula include two or more plus signs, the encryption agent splits any two adjacent calculation items in the calculation formula into a plurality of addition forms of the two calculation items.

[0076] Exemplarily, assuming that the calculation formula is S1+S2+S3+S4, the calculation formula is split into three forms of adding two calculation items, namely, S1+S2, S2+S3 and S3+S4.

[0077] In a possible implementation, splitting the calculation item in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form based on the calculation symbol and the number of the calculation symbols in the calculation formula includes:

[0078] When the calculation symbols in the calculation formula include two or more multiplication signs, the encryption agent splits any two adjacent calculation items in the calculation formula into multiple forms of multiplication of the two calculation items.

[0079] Exemplarily, assuming that the calculation formula is S1*S2*S3*S4, the calculation formula is split into three forms of multiplication of two calculation items, namely S1*S2, S2*S3 and S3*S4.

[0080] A3: The key generator determines that the matrix keys of two calculation items in the form of two calculation items added are respectively an addition matrix and an inverse matrix, and determines that the matrix keys of two calculation items in the form of two calculation items multiplied are respectively a multiplication matrix and an inverse matrix.

[0081] In the key generator strategy, the matrix keys of the two calculation items in the form of the addition of the two calculation items are labeled as "addition matrix" and "inverse matrix". The inverse matrix is ​​the negative form of the addition matrix, that is, each element is multiplied by -1. This design allows point-to-point addition operations by simply adding the addition matrix to the inverse matrix.

[0082] The matrix keys for the two computations in the form of the multiplication of the two computations are labeled "multiplication matrix" and "inverse matrix". An inverse matrix is ​​a matrix that can be multiplied with the multiplication matrix to obtain the identity matrix, which is a matrix with all elements 1 on the main diagonal and all elements 0 elsewhere. This configuration allows efficient implementation of division operations when needed, that is, solving equations or performing specific transformations by multiplying with the inverse matrix.

[0083] For example, suppose the calculation items of the calculation formula are split into three forms of adding two calculation items, namely S1+S2, S2+S3 and S3+S4. Then it is necessary to set an addition matrix M and an opposite matrix N that are opposite matrices for S1 and S2; it is necessary to set an addition matrix P and an opposite matrix Q that are opposite matrices for S2 and S3; it is necessary to set an addition matrix Y and an opposite matrix Z that are opposite matrices for S3 and S4.

[0084] In a possible implementation, in the calculation requirement, the matrix keys of the two calculation data to be added are inverse matrices of each other, and the matrix keys of the two calculation data to be multiplied are inverse matrices of each other.

[0085] Exemplarily, the description is continued by taking Example 1 as an example. In Example 1, S1 and S2 are two calculation data added in the calculation requirement, and the matrix keys of S1 and S2 are inverse matrices of each other.

[0086] Exemplarily, the description is continued by taking Example 2 as an example. In Example 2, S1 and S2 are two calculation data that are multiplied in the calculation requirement, and the matrix keys of S1 and S2 are inverse matrices of each other.

[0087] It should be noted that the inverse matrix means that if there is a matrix A, then its inverse matrix -A is obtained by multiplying all elements of matrix A by -1.

[0088] The inverse matrix is ​​another case, especially for square matrices. If there is a matrix A, and there is another matrix B such that A·B=B·A=I (I is the identity matrix), then matrix B is the inverse matrix of matrix A, usually denoted by A -1 In short, if the result of multiplying two matrices is the identity matrix, then they are each other's inverse matrices.

[0089] In this way, not only the flexibility and efficiency of data processing are guaranteed, but also the protection of data security is strengthened, ensuring data privacy and integrity in a multi-party collaborative environment.

[0090] In a possible implementation, the matrix key includes an addition matrix, an inverse matrix, a multiplication matrix and an inverse matrix; the addition matrix is ​​a random matrix added to the calculation data; the inverse matrix is ​​a negative matrix of the addition matrix; the multiplication matrix is ​​a random matrix multiplied with the calculation data; and the inverse matrix is ​​an inverse matrix of the multiplication matrix.

[0091] In a possible implementation, the generation process of the addition matrix includes: the key generator generates a random matrix having the same rows and columns as the calculation data through a random seed according to the rows and columns of the calculation data.

[0092] Specifically, first, the dimension of the addition matrix is ​​determined according to the number of rows and columns of the calculation data. This means that the addition matrix will have the same number of rows and columns as the calculation data to be added. Next, the key generator uses a random seed (usually a known initial point used to generate a pseudo-random number sequence) to start generating each element in the matrix. For each position i, j (i represents the row index, j represents the column index), the key generator generates a random number based on the seed value of the current position and the index of the current position, and places it in the corresponding position. This process ensures that all elements in the matrix are independent and randomly distributed. The final generated matrix is ​​a matrix with the same number of rows and columns as the calculation data, and the element values ​​are randomly selected, which is used for linear transformations in subsequent encryption or decryption operations.

[0093] To obtain the inverse matrix of the addition matrix, each element in the addition matrix can be directly multiplied by -1 based on the addition matrix.

[0094] In a possible implementation, the process of generating the multiplication matrix includes: the key generator generates a random matrix having opposite rows and columns to the calculation data through a random seed according to the rows and columns of the calculation data.

[0095] Specifically, first, the dimension of the multiplication matrix is ​​determined according to the number of rows and columns of the calculated data. The multiplication matrix will have the same number of rows as the number of columns of the calculated data, but its number of columns will be the same as the number of rows of the calculated data, forming a transposed concept. A random seed is also used as the starting point to generate elements in the matrix. For each position i, j (this time i represents the column index and j represents the row index), the key generator generates a random number using the seed and the position index and puts it into the corresponding position in the matrix. In this way, the number of rows of the multiplication matrix corresponds to the number of columns of the calculated data multiplied with it, and the number of columns corresponds to the number of rows of the calculated data multiplied with it. The multiplication matrix is ​​not only random, but also transposed in dimension with the addition matrix (that is, the rows of the original data become the columns of the matrix, and vice versa). This matrix is ​​used to perform dot product operations with the calculated data and may play a key role in the encryption or decryption process.

[0096] S103: The encryption agent configures a matrix key for the computing data of each participant based on the computing requirements and the identity identifier in the binding data, obtains the ciphertext data of each participant, and sends the ciphertext data and the computing requirements to the computing agent.

[0097] When receiving computing requirements and binding data, including identity identifiers, from various participants, the encryption agent first generates a specific matrix key for each participant's computing data based on these requirements and identifiers. This process is achieved through complex encryption algorithms, which are designed to protect the original data from being accessed or tampered with by unauthorized parties during transmission and processing. After generating the key, the encryption agent encrypts the original computing data to make it ciphertext data. This step ensures that even during data transmission, unauthorized third parties cannot directly obtain or understand the data content. At the same time, the encryption agent also needs to encapsulate the computing requirements and the corresponding ciphertext data to form a complete package, and then send it to the computing agent responsible for the actual computing task.

[0098] For example, suppose the calculation items of the calculation formula are split into two calculation items, S1+S2, which are added together. Then, it is necessary to set an addition matrix M and an inverse matrix N, which are inverse matrices of each other, for S1 and S2, so that (S1+M)+(N+S2)=S1+S2. Then, (S1+M) and (N+S2) are the ciphertext data.

[0099] In a possible implementation, the method further includes:

[0100] After obtaining the ciphertext data, the encryption agent destroys the binding data in the encryption agent.

[0101] After the encryption agent obtains the ciphertext data, it destroys the binding data in the encryption agent. When the encryption agent destroys the binding data, even if the attacker has access to the agent or related storage facilities, it becomes extremely difficult to recover the original unencrypted computing data due to the lack of necessary keys and identifiers, thereby improving the security of the original unencrypted computing data.

[0102] S104: The computing agent computes the ciphertext data of each participant based on the computing requirement to obtain a decryption computing result.

[0103] After receiving the ciphertext data and corresponding calculation requirements sent by the encryption agent, the calculation agent will calculate the ciphertext data of each participant based on the calculation requirements to obtain the decryption calculation result.

[0104] For example, assuming that the calculation requirement is "calculate the sum of the calculation data of participant A and participant B", the ciphertext data are (S1+M) and (N+S2), S1 is the ciphertext data of participant A, and S2 is the ciphertext data of participant A, then (S1+M) and (N+S2) can be added to obtain the decryption calculation result S1+S2.

[0105] Based on the contents of S101-S104, it can be seen that the data transaction method of this application relies on a privacy computing system to be implemented, and the privacy computing system consists of an encryption agent, a key generator, and a computing agent. The key generator is a smart contract deployed on the blockchain, which contains key generation logic, which is set according to the computing requirements, and each computing requirement corresponds to a unique logic. After the data user provides the computing requirements, the encryption agent determines the number of participants N, obtains and sends their identity identifiers to the key generator. The key generator generates a matrix key based on the identity identifier and the computing requirements, and returns the binding data to the encryption agent. The encryption agent uses these binding data to configure the matrix key for the computing data of each participant, generates ciphertext data, and sends the ciphertext data and the computing requirements to the computing agent. In the computing requirements, the added key is a reciprocal matrix, and the multiplied key is a reciprocal matrix. The computing agent processes the ciphertext data according to the computing requirements and finally obtains the decryption result. This application uses matrix key encryption technology, combined with specific computing logic, to achieve privacy protection and high-efficiency computing in the data processing process. The use of inverse matrices and inverse matrices simplifies matrix operations and improves the computing efficiency of large-scale data processing. Placing the key generator in the blockchain system ensures the secure generation and management of keys and improves the security of data transmission and storage, thereby effectively supporting real-time data analysis tasks while protecting privacy.

[0106] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a data encryption computing system provided in an embodiment of the present application. Figure 3 As shown, the system includes an encryption agent 301, a key generator 302 and a computing agent 303; the key generator 302 is a smart contract storing a key generation logic; the key generator 302 is deployed in the blockchain; the key generation logic is determined based on the computing requirements; each computing requirement corresponds to a unique key generation logic; the computing requirements are provided by the data user.

[0107] The encryption agent 301 is used to determine N participants, obtain the identity identifier of each participant, and send the identity identifier of each participant to the key generator 302; the participants include data providers that provide calculation data for the calculation requirement, the calculation data is the processing object of the calculation requirement, and the calculation data is stored in the form of a matrix; N is a positive integer greater than 1;

[0108] The key generator 302 is used to generate a matrix key for each of the participants based on the key generation logic corresponding to the calculation requirement and the identity identifier of each of the participants, and bind the matrix key of each of the participants and its identity identifier to obtain binding data, and return the binding data to the encryption agent 301; in the calculation requirement, the matrix keys of the two added calculation data are inverse matrices of each other, and the matrix keys of the two multiplied calculation data are inverse matrices of each other;

[0109] The encryption agent 301 is further used to configure a matrix key for the computing data of each participant based on the computing requirement and the identity identifier in the binding data, obtain the ciphertext data of each participant, and send the ciphertext data and the computing requirement to the computing agent 303;

[0110] The computing agent 303 is used to compute the ciphertext data of each participant based on the computing requirements to obtain a decryption computing result.

[0111] In a possible implementation, the matrix key includes an addition matrix, an inverse matrix, a multiplication matrix and an inverse matrix; the addition matrix is ​​a random matrix added to the calculation data; the inverse matrix is ​​a negative matrix of the addition matrix; the multiplication matrix is ​​a random matrix multiplied with the calculation data; and the inverse matrix is ​​an inverse matrix of the multiplication matrix.

[0112] In a possible implementation, the key generator 302 is further used to:

[0113] According to the rows and columns of the calculation data, a random matrix having the same rows and columns as the calculation data is generated by a random seed;

[0114] According to the rows and columns of the calculation data, a random matrix having opposite rows and columns to the calculation data is generated by a random seed.

[0115] In a possible implementation, the key generation logic is further used to:

[0116] Determine a calculation formula based on the calculation requirement; the calculation formula includes two or more calculation items; the calculation item is one of the calculation data, the sum of two of the calculation data, or the product of two of the calculation data;

[0117] Based on the calculation symbols and the number of calculation symbols in the calculation formula, splitting the calculation items in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form;

[0118] The matrix keys of the two calculation items in the form of two calculation items added are respectively an addition matrix and an inverse matrix, and the matrix keys of the two calculation items in the form of two calculation items multiplied are respectively a multiplication matrix and an inverse matrix.

[0119] In a possible implementation, the key generator 302 is specifically used to:

[0120] When the calculation symbol in the calculation formula includes a plus sign, the two calculation items in the calculation formula are determined as a two-calculation item addition form;

[0121] When the calculation symbol in the calculation formula includes a multiplication sign, determining the calculation item in the calculation formula as a multiplication form of two calculation items;

[0122] When the calculation symbol in the calculation formula includes two or more plus signs, any two adjacent calculation items in the calculation formula are split into multiple addition forms of two calculation items;

[0123] When the calculation symbols in the calculation formula include two or more multiplication signs, any two adjacent calculation items in the calculation formula are split into multiple forms of multiplication of the two calculation items.

[0124] In a possible implementation, the encryption agent 301 is further used to:

[0125] After obtaining the ciphertext data, the binding data in the encryption agent 301 is destroyed.

[0126] In addition, an embodiment of the present application also provides a data encryption computing device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data encryption computing method as described above is implemented.

[0127] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the encryption calculation method for the data as described above.

[0128] The embodiment of the present application provides a data encryption computing system, first using the encryption agent 301 to determine N participants, obtain the identity identifier of each participant, and send the identity identifier of each participant to the key generator 302. Then, the key generator 302 generates a matrix key for each participant based on the key generation logic corresponding to the computing requirements and the identity identifier of each participant, and binds the matrix key of each participant and its identity identifier to obtain binding data, and returns the binding data to the encryption agent 301. The encryption agent 301 configures the matrix key for the computing data of each participant based on the computing requirements and the identity identifier in the binding data, obtains the ciphertext data of each participant, and sends the ciphertext data and the computing requirements to the computing agent 303. In the computing requirements, the matrix keys of the two computing data added are mutually inverse matrices, and the matrix keys of the two computing data multiplied are mutually inverse matrices. Finally, the computing agent 303 is used to calculate the ciphertext data of each participant based on the computing requirements to obtain the decryption calculation result. The present application uses matrix keys for data encryption, and through the key characteristics under specific computing requirements, the computing process does not need to disclose the original data, thereby significantly improving data privacy protection. At the same time, the inverse matrix and inverse matrix are used as keys to convert the subtraction and multiplication in matrix operations into addition and multiplication, which simplifies the calculation process and improves efficiency, making it suitable for large-scale data encryption processing and real-time calculation. The key generator is based on blockchain technology and uses its decentralized and tamper-proof characteristics to ensure the security of key generation and management, reduce the risk of illegal access, and enhance the security of data transmission and storage.

[0129] The above is a detailed introduction to the encryption calculation method, system, device and storage medium of a data provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

[0130] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0131] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

Claims

1. A data encryption calculation method, characterized in that: Applied to a privacy computing system, the privacy computing system includes an encryption agent, a key generator and a computing agent; the key generator is a smart contract storing key generation logic; the key generator is deployed in a blockchain; The key generation logic is determined based on the calculation requirements; each calculation requirement corresponds to a unique key generation logic; The calculation requirement is provided by a data user, and the method comprises: The encryption agent determines N participants, obtains the identity identifier of each participant, and sends the identity identifier of each participant to the key generator; the participants include a data provider that provides calculation data for the calculation requirement, the calculation data is a processing object of the calculation requirement, and the calculation data is stored in the form of a matrix; N is a positive integer greater than 1; The key generator generates a matrix key for each of the participants based on the key generation logic corresponding to the calculation requirement and the identity identifier of each of the participants, binds the matrix key of each of the participants and its identity identifier to obtain binding data, and returns the binding data to the encryption agent; in the calculation requirement, the matrix keys of the two added calculation data are inverse matrices of each other, and the matrix keys of the two multiplied calculation data are inverse matrices of each other; The encryption agent configures a matrix key for the computing data of each of the participants based on the computing requirements and the identity identifier in the binding data, obtains the ciphertext data of each of the participants, and sends the ciphertext data and the computing requirements to the computing agent; The computing agent computes the ciphertext data of each participant based on the computing requirements to obtain a decryption computing result.

2. The method according to claim 1, characterized in that The matrix key includes an addition matrix, an inverse matrix, a multiplication matrix and an inverse matrix; the addition matrix is ​​a random matrix added to the calculation data; the inverse matrix is ​​a negative matrix of the addition matrix; the multiplication matrix is ​​a random matrix multiplied with the calculation data; and the inverse matrix is ​​an inverse matrix of the multiplication matrix.

3. The method according to claim 2, characterized in that The generation process of the addition matrix includes: the key generator generates a random matrix having the same rows and columns as the calculation data through a random seed according to the rows and columns of the calculation data; The generation process of the multiplication matrix includes: the key generator generates a random matrix having opposite rows and columns to the calculation data through a random seed according to the rows and columns of the calculation data.

4. The method according to claim 1, characterized in that The key generation logic determination process includes: The encryption agent determines a calculation formula based on the calculation requirement; the calculation formula includes two or more calculation items; the calculation item is one of the calculation data, the sum of two of the calculation data, or the product of two of the calculation data; The encryption agent splits the calculation item in the calculation formula into a two-calculation item addition form and / or a two-calculation item multiplication form based on the calculation symbol and the number of calculation symbols in the calculation formula; The key generator determines that the matrix keys of two calculation items in the form of two calculation items added are respectively an addition matrix and an inverse matrix, and determines that the matrix keys of two calculation items in the form of two calculation items multiplied are respectively a multiplication matrix and an inverse matrix.

5. The method according to claim 4, characterized in that The step of splitting the calculation items in the calculation formula into two addition forms and / or two multiplication forms of the calculation items based on the calculation symbols and the number of the calculation symbols in the calculation formula includes: When the calculation symbol in the calculation formula includes a plus sign, the key generator determines the two calculation items in the calculation formula as a two-calculation item addition form; When the calculation symbol in the calculation formula includes a multiplication sign, the key generator determines the calculation item in the calculation formula as a multiplication form of two calculation items; When the calculation symbol in the calculation formula includes two or more plus signs, the key generator splits any two adjacent calculation items in the calculation formula into multiple addition forms of the two calculation items; When the calculation symbols in the calculation formula include two or more multiplication signs, the key generator splits any two adjacent calculation items in the calculation formula into multiple forms of multiplication of the two calculation items.

6. The method according to claim 1, characterized in that The method further comprises: After obtaining the ciphertext data, the encryption agent destroys the binding data in the encryption agent.

7. A privacy computing system, characterized in that: The privacy computing system includes an encryption agent, a key generator and a computing agent; the key generator is a smart contract storing key generation logic; the key generator is deployed in the blockchain; The key generation logic is determined based on the computational requirements; Each of the calculation requirements corresponds to a unique key generation logic; The calculation requirement is provided by a data user, and the method comprises: The encryption agent is used to determine N participants, obtain the identity identifier of each participant, and send the identity identifier of each participant to the key generator; the participants include a data provider that provides calculation data for the calculation requirement, the calculation data is the processing object of the calculation requirement, and the calculation data is stored in the form of a matrix; N is a positive integer greater than 1; The key generator is used to generate a matrix key for each of the participants based on the key generation logic corresponding to the calculation requirement and the identity identifier of each of the participants, and bind the matrix key of each of the participants and its identity identifier to obtain binding data, and return the binding data to the encryption agent; in the calculation requirement, the matrix keys of the two added calculation data are inverse matrices of each other, and the matrix keys of the two multiplied calculation data are inverse matrices of each other; The encryption agent is further used to configure a matrix key for the computing data of each of the participants based on the computing requirements and the identity identifier in the binding data, obtain the ciphertext data of each participant, and send the ciphertext data and the computing requirements to the computing agent; The computing agent is used to compute the ciphertext data of each participant based on the computing requirements to obtain a decryption computing result.

8. The system according to claim 7, characterized in that The matrix key includes an addition matrix, an inverse matrix, a multiplication matrix and an inverse matrix; the addition matrix is ​​a random matrix added to the calculation data; the inverse matrix is ​​a negative matrix of the addition matrix; the multiplication matrix is ​​a random matrix multiplied with the calculation data; and the inverse matrix is ​​an inverse matrix of the multiplication matrix.

9. A data encryption computing device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the encryption calculation method for data as described in any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the data encryption calculation method according to any one of claims 1 to 6.