Cipher state data processing method and system supporting retrieval and credible verification
By encrypting plaintext columns, generating ciphertext columns and secure index columns, and building data holdability and integrity proofs, the problem of difficulty in taking into account data security and processing efficiency in the prior art is solved, and efficient and secure data retrieval and trusted verification are achieved.
Patent Information
- Application Number
- CN202411838456.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-05-23
AI Technical Summary
The prior art is difficult to take into account data security and data processing efficiency, especially when processing data containing sensitive information, it is difficult to fully tap the value of data while ensuring that data does not leak privacy.
By encrypting the plaintext columns, the ciphertext column and the secure index column are obtained, and the data holding proof and data integrity proof are constructed in a cryptic database, so as to achieve efficient data retrieval and trustworthy verification without leaking plaintext information.
It effectively protects data privacy, improves data retrieval efficiency, ensures data integrity and authenticity, and enhances data credibility.
Smart Images

Figure CN120030558A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a method and system for processing secret data supporting retrieval and trusted verification. Background Art
[0002] The circulation of data must first consider the security of the data. In the process of data circulation, privacy data often faces the risk of being illegally obtained, tampered with or leaked. Protecting the security of data is the top priority in the process of data circulation.
[0003] Secondly, the circulation of data needs to consider the efficiency of data circulation. Traditional data circulation methods often find it difficult to take both into account, especially when processing data containing sensitive information, that is, it is difficult to fully tap the value of data while ensuring that data privacy is not leaked.
[0004] It can be seen from this that the data circulation processing method in the relevant technology has technical problems that make it difficult to balance data security and data processing efficiency. Summary of the invention
[0005] The present invention provides a method and system for processing confidential data that supports retrieval and trusted verification, so as to solve the defect that it is difficult to balance data security and data processing efficiency in the data circulation processing mode in the prior art, and realize efficient storage and retrieval of structured data under the premise of protecting privacy data.
[0006] The present invention provides a method for processing secret data supporting retrieval and trusted verification, comprising the following steps.
[0007] Acquire multiple plaintext columns of structured data input by a user; encrypt each of the multiple plaintext columns according to multiple preset encryption algorithms to obtain ciphertext columns and multiple security index columns corresponding to each plaintext column; construct a secret database data possession proof based on the plaintext columns, ciphertext columns and a first target encryption algorithm, wherein the secret database data possession proof is used to prove that the ciphertext column is constructed by the plaintext column using the first target encryption algorithm; when a search statement input by the user is obtained, determine a target security index column corresponding to the search statement, search the ciphertext column based on the target security index column, and obtain a query result; wherein the query result includes: the target plaintext data obtained after decryption and the secret database data possession proof corresponding to the target plaintext data.
[0008] According to a method for processing confidential data supporting retrieval and trusted verification provided by the present invention, each of the multiple plaintext columns is encrypted according to multiple preset encryption algorithms to obtain ciphertext columns and multiple security index columns corresponding to each plaintext column, including: determining the query requirement of each plaintext column in the multiple plaintext columns, wherein the query requirement is used to represent the type of SQL statement; according to the preset query requirement and encryption algorithm correspondence table, each of the plaintext columns is encrypted based on a basic encryption database to obtain a ciphertext column corresponding to each plaintext column and a security index column corresponding to each plaintext column; wherein the ciphertext column and the security index column are respectively stored in different library tables of an underlying database, and the underlying encryption database includes at least the following encryption algorithms: OPE order-preserving encryption algorithm, Paillier semi-homomorphic encryption algorithm, and Blowfish encryption algorithm.
[0009] According to a method for processing confidential data supporting retrieval and trusted verification provided by the present invention, after encrypting each of the multiple plaintext columns according to multiple preset encryption algorithms to obtain ciphertext columns and multiple security index columns corresponding to each plaintext column, the method also includes: converting the execution operation on the plaintext column into the execution operation on the ciphertext column and the security index column, which includes: obtaining a dictionary including INSERT statements and a user key input by the user, wherein the dictionary includes: a target column name and a target plaintext; encrypting the target column name to obtain a target encrypted column name; encrypting the target plaintext based on the user key and a preset query requirement and encryption algorithm correspondence table to obtain a target ciphertext; replacing the target column name and the target plaintext in the dictionary based on the correspondence between the target encrypted column name and the target ciphertext to obtain a processed dictionary.
[0010] According to a method for processing secret data supporting retrieval and trusted verification provided by the present invention, the first target encryption algorithm is the Caesar encryption algorithm, and the method for constructing a proof of data possession of a secret database based on the plaintext column, the ciphertext column and the first target encryption algorithm includes: splitting the plaintext column and the ciphertext column respectively to obtain a plaintext character array and a ciphertext character array, wherein the ciphertext column is obtained by encrypting the plaintext column with the Caesar encryption algorithm; in a first zero-knowledge proof circuit, allocating variable elements to the plaintext character array and the ciphertext character array to obtain a configured first zero-knowledge proof circuit; Determine a first public input and a first private variable, wherein the first public input includes the plaintext character array, and the first private variable includes an offset of the Caesar encryption algorithm; determine a first constraint between the ciphertext column and the plaintext column, the first constraint being used to make the sum of the plaintext column and the offset equal to the ciphertext column; generate a first proof key based on the configured first zero-knowledge proof circuit and the first constraint; assign a value to the configured first zero-knowledge proof circuit based on the first public input and the first private variable, and use the first proof key to generate a proof of data possession of a secret database.
[0011] According to a method for processing confidential data that supports retrieval and trusted verification provided by the present invention, after determining the target security index column corresponding to the retrieval statement, searching the ciphertext column based on the target security index column, and obtaining the query result, the method also includes: constructing a confidential database data integrity proof based on a second target encryption algorithm and the retrieval statement, wherein the confidential database data integrity proof is used to prove that all data that meets the retrieval statement are returned without leaking other plaintext.
[0012] According to a method for processing secret data supporting retrieval and trusted verification provided by the present invention, the second target encryption algorithm is an OPE order-preserving encryption algorithm, and the secret database data integrity proof is constructed based on the second target encryption algorithm and the retrieval statement, including: obtaining a first plaintext array that conforms to the retrieval statement, a second plaintext array that does not conform to the retrieval statement, a ciphertext array, and a conditional value; wherein the ciphertext array is used to represent the ciphertext corresponding to the first plaintext array and the second plaintext array, and the conditional value is used to compare with the first plaintext array and the second plaintext array respectively; in a second zero-knowledge proof circuit, variable originals are respectively assigned to the first plaintext array, the second plaintext array, the ciphertext array, and the conditional value to obtain a configured second zero-knowledge proof circuit; determining a second public input and a second private variable, wherein the second public input includes : the first plaintext array, the second plaintext array, the conditional value and the expected comparison result; the second private variable includes: the encryption key of the OPE order-preserving encryption algorithm; determining the first plaintext array, the second plaintext array, and the second constraint of the conditional value based on the comparison circuit corresponding to the search statement, wherein the second constraint is used to compare the first plaintext array and the second plaintext array with the conditional value respectively; determining the actual comparison result corresponding to the second constraint; determining the equivalence constraint between the actual comparison result and the expected comparison result; generating a second proof key based on the configured second zero-knowledge proof circuit and the equivalence constraint; assigning a value to the configured second zero-knowledge proof circuit based on the second public input and the second private variable, and using the second proof key to generate a confidential database data integrity proof.
[0013] The present invention also provides a confidential data processing system that supports retrieval and trusted verification, including the following modules: an acquisition module, used to acquire multiple plaintext columns of structured data input by a user; an encryption module, used to encrypt each of the multiple plaintext columns according to multiple preset encryption algorithms, and obtain ciphertext columns and multiple security index columns corresponding to each plaintext column; a construction module, used to construct a confidential database data possession proof based on the plaintext columns, ciphertext columns and a first target encryption algorithm, wherein the confidential database data possession proof is used to prove that the ciphertext column is constructed by the plaintext column using the first target encryption algorithm; a retrieval module, used to determine the target security index column corresponding to the retrieval statement input by the user when the retrieval statement is acquired, and retrieve the ciphertext column based on the target security index column to obtain a query result; wherein the query result includes: the target plaintext data obtained after decryption and the confidential database data possession proof corresponding to the target plaintext data.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements any of the above-described methods for processing confidential data that supports retrieval and trusted verification.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described confidential data processing methods supporting retrieval and trusted verification.
[0016] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned confidential data processing methods supporting retrieval and trusted verification.
[0017] The secret data processing method and system supporting retrieval and trusted verification provided by the present invention encrypt the plaintext column to obtain the ciphertext column and the security index column, thereby ensuring the privacy of the data during storage and transmission. Even if the data is illegally obtained, the plaintext information cannot be directly obtained, thereby effectively protecting the privacy of the data. By constructing the security index column, the ciphertext data can be quickly retrieved without leaking the plaintext information, thereby ensuring the privacy of the data and improving the retrieval efficiency of the data. The data possession proof of the secret database is constructed based on the plaintext column, the ciphertext column and the first target encryption algorithm. The data possession proof of the secret database can confirm The confidential text column is constructed from the plaintext column through a specific encryption algorithm, thereby ensuring the integrity and authenticity of the data; when the search statement entered by the user is obtained, the security index column corresponding to the target search statement is determined, and the ciphertext column is searched based on the index column to quickly obtain the query results. The query results include the target plaintext data obtained after decryption and the corresponding data possession certificate; users can confirm the correctness and authenticity of the query results by verifying the data possession certificate, thereby enhancing the credibility of the data, and then solving the technical problem of the data circulation processing method in the related technology that it is difficult to balance data security and data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a schematic diagram of the non-interactive zero-knowledge proof process provided by the present invention.
[0020] Figure 2 It is a flow chart of the method for processing secret data supporting retrieval and trusted verification provided by the present invention.
[0021] Figure 3 It is a schematic diagram of the structure of generating a security index column provided by the present invention.
[0022] Figure 4 It is a schematic diagram of the searchable encryption core construction process provided by the present invention.
[0023] Figure 5 It is a structural diagram of a confidential data service platform supporting efficient retrieval and trusted verification provided by the present invention.
[0024] Figure 6 It is a schematic diagram of the tripartite architecture provided by the present invention.
[0025] Figure 7 It is a schematic diagram of the structure of the secret data processing system supporting retrieval and trusted verification provided by the present invention.
[0026] Figure 8 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] With the rapid development of information technology and the widespread popularity of the Internet, the amount of data stored in databases has shown an explosive growth trend, especially databases managed by large organizations or enterprises. This phenomenon involves all walks of life, especially in the fields of finance, medical care and e-commerce. As a key production factor, data has become the "oil" of the new era. How to efficiently and securely realize the circulation of large-scale data has become a problem that needs to be solved urgently.
[0029] The circulation of data must first consider the security of the data. In the process of data circulation, private data often faces the risk of being illegally obtained, tampered with or leaked. Protecting the security of data is the top priority in the process of data circulation. Secondly, the circulation of data needs to consider the efficiency of data circulation. Traditional data circulation methods often find it difficult to take both into account, especially when processing data containing sensitive information. How to fully tap the value of data while ensuring that data does not leak privacy has become a core issue of common concern in academia and industry.
[0030] In this context, secret databases, as a cutting-edge technology, have gradually entered people's field of vision. Different from traditional data circulation methods, secret databases store ciphertext data and ensure that the data remains confidential during the processing process. This not only protects private data from being leaked when a dangerous situation occurs in the database, but also provides new possibilities for the secure circulation of data across organizations and platforms.
[0031] Applying confidential databases to data circulation can maximize the value of data while protecting data privacy. However, achieving the circulation of confidential data also faces a series of technical challenges, including but not limited to the design of efficient data encryption algorithms, the processing of complex query scenarios in confidential environments, the seamless migration of existing large-scale data, and the high security and reliability of encrypted data.
[0032] Searchable encryption technology allows users to securely store data in the form of encrypted data on cloud servers while ensuring the searchability of the encrypted data.
[0033] Searchable encryption technology can solve the untrustworthy issues of cloud servers and transmission routes, ensure that plaintext data is not leaked during storage and transmission, and protect the security of private data.
[0034] The present invention relies on searchable encryption technology to implement data encryption processing. While generating ciphertext, it also generates a security index, and uploads the security index and ciphertext together to a cloud server for storage. During retrieval, the security index and ciphertext are used together to complete the data retrieval process, and then the decrypted plaintext is returned.
[0035] Zero-knowledge proof is a two-party cryptographic protocol that runs between a prover and a verifier. It is a method for a prover to prove a proposition to another verifier. Its characteristic is that no other information is leaked except that "the proposition is true" during the process. ZK-SNARK (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) is a non-interactive and concise zero-knowledge proof. In the actual construction process of ZK-SNARK, there are a variety of construction schemes to choose from, among which Groth16 is a widely used scheme. Compared with other non-interactive zero-knowledge proof protocols, Groth16 has certain advantages in the comprehensive complexity of proof, communication, and verification. The specific protocols can be referred to in Table 1 below: Table 1
[0036] in, represents a group element, Represents a domain element, represents operations on the domain, represents the group power operation, represents the pairing operation on the bilinear group, and They refer to the elements of the bilinear mapping group, Indicates the circuit scale, Indicates common input and output.
[0037] refer to Figure 1 , Figure 1 This is a schematic diagram of the non-interactive zero-knowledge proof process provided by the present invention, which includes a preparation phase (Prepare) and a core phase (Core). The preparation phase includes: Statement, R1CS model, QAP (Quadratic Arithmetic Program); the core phase includes: Setup, Prove, and Verify.
[0038] The following describes the process of building a ZK-SNARK based on the Groth16 algorithm: Step 1: Describe the goal and business (Statement) of the proof, abstract the computational logic based on the goal and business logic, and convert the computational logic into an arithmetic circuit, that is, a high-level language program that describes the computational constraints.
[0039] Step 2: Convert the arithmetic circuit into a first-order constraint system. The first-order constraint system is the result of the arithmetic circuit compilation, which is a further expression of the circuit constraints, and can convert the arithmetic circuit into multiple gate circuits. The R1CS model describes a set of constraints, each of which is an equation of the form A*B=C, where A, B, and C are vectors, which can be public inputs, private inputs, or intermediate variables.
[0040] Step 3: Convert R1CS into polynomial form. QAP is a set of polynomials. By converting R1CS into QAP, the problem can be converted into a polynomial proof. QAP describes a polynomial relation, which contains three polynomials: the main polynomial, the auxiliary polynomial, and the constraint polynomial. The basic form of QAP is as follows: P(x)*Q(x)-R(x)=H(x)*Z(x). P(x), Q(x), and R(x) are the main polynomial, auxiliary polynomial, and constraint polynomial, which are polynomials about the unknown variable x. H(x) and Z(x) are two factors of the auxiliary polynomial. The main idea of QAP is to convert the proof generation and verification process into a polynomial solution problem. When generating a proof, it is necessary to calculate the main polynomial, auxiliary polynomial, and constraint polynomial according to the input data and constraints, and generate a proof to prove the correctness of the polynomial relation. When verifying the proof, it is necessary to verify whether the main polynomial, auxiliary polynomial, and constraint polynomial satisfy the QAP relation.
[0041] Step 4: Set public challenge parameters, etc. At this stage, the security parameters of the system and the relevant parameters of the protocol need to be defined. The selection of security parameters has an impact on both performance and security, and usually needs to be weighed according to the specific application scenario. This stage generates the proof key and verification key for the ZK-SNARK protocol. The verification key can be used to verify the correctness of the proof, while the proof key is used to generate the proof.
[0042] Step 5: Generate a proof. The prover uses the proof key, public input data, and private input data to generate a proof that the input data satisfies a certain statement. First, the declared expression and related constraints are converted into a circuit; the prover calculates the input data to obtain the intermediate value during the circuit execution process; the prover uses the intermediate value and the proof key to generate a proof that its calculation is correct.
[0043] Step 6: Verify the proof. The verifier uses the verification key, public input data, and proof to verify the correctness of the proof. The verifier can verify the proof by performing a series of computational steps without having to understand the proof generation process. If the verification is successful, the claim can be confirmed to be true, otherwise it is considered false.
[0044] The above process completes the construction and verification process of ZK-SNARK. In actual application scenarios, circuit construction, proof generation, and proof verification are completed by the trusted third party, service requester, and verifier respectively.
[0045] In the actual scenario of a confidential database, the server is usually the holder of the confidential database. During the data transaction process, the confidential database first returns the ciphertext query result and related proof. The user verifies the proof and completes the payment before obtaining the plaintext result.
[0046] The present invention proposes a method for processing secret data that supports retrieval and trusted verification, which ensures efficient retrieval of secret databases based on searchable encryption technology, and ensures trusted verification of secret databases based on non-interactive zero-knowledge proof technology. First, the present invention proposes a secret database implementation scheme based on searchable encryption technology, which implements the functions of SQL statement parsing and reconstruction, basic encryption algorithm library, and secure index column generation in the form of a front-end transparent proxy component, and can realize efficient storage and retrieval of structured data under the premise of protecting privacy data; secondly, the present invention implements optional trusted verification based on non-interactive zero-knowledge proof technology, and feeds back corresponding proofs according to the user's query requirements to ensure high credibility of the query results.
[0047] Optionally, the confidential data processing method supporting retrieval and trusted verification in the embodiment of the present application can be executed by a server, or by a terminal device, or jointly by a server and a terminal device, taking the example of the confidential data processing method supporting retrieval and trusted verification in the embodiment of the present application being executed by a server.
[0048] Figure 2 is a flow chart of a method for processing secret data supporting retrieval and trusted verification provided by the present invention, such as Figure 2 As shown, the method includes the following steps.
[0049] Step 201: Acquire multiple plain text columns of structured data input by a user.
[0050] Structured data is usually highly organized quantitative data, such as date, name, address, mobile phone number, etc., which can usually be stored in a relational database, managed in the form of tables, and retrieved through SQL statements.
[0051] Plaintext columns usually refer to data columns stored in databases, data tables or data structures in the form of raw text without encryption or any form of encoding. These data columns directly contain text information that is input by users or generated by the system and can be directly read and understood.
[0052] The use scenarios of plain text columns include but are not limited to: User information: such as name, address, phone number, etc. This information usually needs to be stored in plain text so that it can be directly read and displayed to users or system administrators when needed. Business data: such as order details, product descriptions, transaction records, etc. This data is critical to business operations and customer service and needs to be stored in plain text for query and analysis. Log and audit information: such as system logs, user operation records, etc. This information is very important for troubleshooting, security audits, and compliance checks, and needs to be stored in plain text for easy reference.
[0053] Step 202 , encrypt each plaintext column in the plurality of plaintext columns according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns corresponding to each plaintext column.
[0054] For structured data, the embodiment of the present invention processes data in plaintext columns, selects different encryption methods from the basic encryption algorithm library according to different query requirements (QueryType), and generates corresponding ciphertext columns and security index columns.
[0055] According to a method for processing secret data supporting retrieval and trusted verification provided by the present invention, each of a plurality of plaintext columns is encrypted according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns respectively corresponding to each plaintext column, including: Determine a query requirement for each plaintext column in the plurality of plaintext columns, wherein the query requirement is used to indicate a type of an SQL statement; According to the preset query requirements and encryption algorithm correspondence table, each plaintext column is encrypted based on the basic encryption database to obtain the ciphertext column corresponding to each plaintext column and the security index column corresponding to each plaintext column; Among them, the ciphertext column and the security index column are stored in different database tables of the underlying database respectively. The basic encryption database includes at least the following encryption algorithms: OPE order-preserving encryption algorithm, Paillier semi-homomorphic encryption algorithm, and Blowfish encryption algorithm.
[0056] In the embodiment of the present invention, when creating a database, the user can encrypt the structured data by adding a query requirement (QueryType) attribute to the column, complete the generation of the security index column, and ensure efficient search of the ciphertext.
[0057] Here, the query requirements define the specific objectives, scope, methods, etc. of the query so that the system can accurately return the information required by the user. The query requirements are the query types specified by the user through SQL statements or other query languages, such as: SELECT query, INSERT query, etc.
[0058] The preset query requirements and encryption algorithm correspondence table can refer to the following Table 2: Table 2
[0059] The solution for constructing secure index columns relies on the idea of searchable encryption. When encrypting plaintext columns to generate ciphertext columns, it generates multiple columns of secure indexes. Ciphertext columns and secure index columns are stored in different tables of the underlying database, and plaintext columns are not stored directly. Since ciphertext columns and secure index columns are generated based on specific encryption algorithms, user data privacy can be protected even in the face of a semi-honest database or a database under malicious attack.
[0060] refer to Figure 3 , Figure 3 It is a structural schematic diagram of generating a security index column provided by the present invention, which includes a plaintext column, a ciphertext column obtained by encrypting the plaintext column, and multiple security index columns (including security index column 1 and security index column 2).
[0061] The construction of the security index column is supported by the basic encryption algorithm library to ensure the searchability of the ciphertext data. In the actual construction process, different encryption algorithms are used to generate the corresponding security index columns according to different query requirements. In the actual retrieval process, the front-end proxy component determines the column object to be queried according to the SQL statement WHERE query condition, and then completes the query task.
[0062] refer to Figure 4 , Figure 4 It is a schematic diagram of the searchable encryption core construction process provided by the present invention, which includes: inputting a plaintext column, configuring a structured data encryption scheme, a basic encryption algorithm library, and building a security index column.
[0063] The basic encryption database is the basic part of the secret data processing method of the present invention, which includes encryption algorithms such as OPE order-preserving encryption, Paillier semi-homomorphic encryption, Blowfish encryption, and hash summary methods such as MD5.
[0064] The OPE algorithm is an order-preserving encryption algorithm, which means that the originally ordered plaintext remains in order after encryption and does not leak any additional information. The core difficulty of the algorithm is how to ensure that the recovery of the ciphertext is complex and difficult to crack while retaining the comparison characteristics.
[0065] Homomorphic encryption means that after encrypting the data, the ciphertext is decrypted after addition or multiplication, and the result obtained is consistent with the result of the same operation performed on the plaintext. According to the number of supported operations, homomorphic encryption can be divided into semi-homomorphic encryption and fully homomorphic encryption. Compared with fully homomorphic encryption, semi-homomorphic encryption only supports one of addition or multiplication operations, which also brings better performance.
[0066] Paillier semi-homomorphic encryption is a classic public key cryptosystem that supports additive homomorphism. Compared with other semi-homomorphic encryption schemes, Paillier has the advantages of high efficiency and complete security proof.
[0067] In addition to the above encryption methods, the basic encryption database also contains encryption methods such as Blowfish and hash digest methods such as MD5.
[0068] Through the embodiments of the present invention, in order to support efficient query operations, it is necessary to generate a security index column, which is encrypted based on the plaintext column, aiming to improve query efficiency while maintaining data security. By clarifying query requirements, selecting appropriate encryption algorithms, performing encryption processing and generating ciphertext columns and security index columns, data security can be effectively protected and subsequent query and usage requirements can be met.
[0069] Step 203, constructing a proof of data possession of a secret database based on the plaintext column, the ciphertext column and the first target encryption algorithm, wherein the proof of data possession of the secret database is used to prove that the ciphertext column is constructed from the plaintext column using the first target encryption algorithm.
[0070] The purpose of proof of data possession in a secret database is to prove to the verifier that the ciphertext data in the secret database is generated by the corresponding plaintext data through a specific encryption algorithm without leaking the plaintext. Reflected in zero-knowledge proof, that is, after abstracting the encryption algorithm into a QAP circuit, it is proved to the verifier that the ciphertext data output by the circuit is generated by the hidden plaintext input by the circuit and certain hidden parameters. These hidden parameters may be keys, random numbers, etc.
[0071] According to a method for processing secret data supporting retrieval and trusted verification provided by the present invention, the first target encryption algorithm is the Caesar encryption algorithm, and a proof of data possession of a secret database is constructed based on a plaintext column, a ciphertext column and the first target encryption algorithm, including: The plaintext column and the ciphertext column are split respectively to obtain a plaintext character array and a ciphertext character array, wherein the ciphertext column is obtained by encrypting the plaintext column using the Caesar encryption algorithm; In the first zero-knowledge proof circuit, variable elements are assigned to the plaintext character array and the ciphertext character array to obtain a configured first zero-knowledge proof circuit; Determine a first public input and a first private variable, wherein the first public input includes a plaintext character array, and the first private variable includes an offset of a Caesar encryption algorithm; Determine a first constraint between the ciphertext column and the plaintext column, the first constraint being used to make the sum of the plaintext column and the offset equal to the ciphertext column; Generate a first proof key based on the configured first zero-knowledge proof circuit and the first constraint; The configured first zero-knowledge proof circuit is assigned a value based on the first public input and the first private variable, and a proof of data possession of the secret database is generated using the first proof key.
[0072] Take Caesar encryption as an example. It is a basic substitution encryption technology. The encryption process is to shift all letters in the plaintext backward or forward by a specific value in the alphabet. According to this encryption method, the constraint condition that can be constructed is that the value of each ciphertext is equal to the value of the corresponding plaintext plus the offset value. Proving that the plaintext, offset value and ciphertext meet these constraints can prove that the ciphertext is generated by Caesar encryption of the plaintext, or prove that the output string is a ciphertext and the plaintext value corresponding to the ciphertext exists.
[0073] The following steps describe this process in detail: Step 1: Split the carser plaintext and ciphertext strings into variable arrays.
[0074] Split the plaintext and ciphertext strings into individual characters so that they can be processed as variables in subsequent circuits. For the plaintext and ciphertext, create an array where each element in the array corresponds to a character in the string.
[0075] Step 2, allocate variable elements on the circuit.
[0076] In the circuit model of zero-knowledge proof, variable elements are assigned to plaintext, ciphertext, and the bias value (i.e., shift value) used in the encryption process. A variable node is created in the circuit for each character (plaintext and ciphertext) and bias value.
[0077] Step 3, set public input and private variables.
[0078] Set up public inputs (what the verifier can see) and private variables (what the verifier cannot see, but the prover needs to know to generate the proof).
[0079] For example, ciphertexts can be used as public inputs because they are what the verifier needs to verify, while plaintexts and bias values can be used as private variables because their values should not be disclosed during the proof process.
[0080] Step 4: Construct the corresponding constraints between ciphertext and plaintext.
[0081] Based on the definition of Caesar encryption, construct constraints in the circuit to ensure that the ciphertext is generated from the plaintext through the correct encryption process. For each character, construct a constraint that states that the ciphertext character is equal to the plaintext character plus the bias value (cyclic shift on the alphabet). These constraints will be part of the circuit.
[0082] Step 5: Generate a certification key and a verification key.
[0083] In a zero-knowledge proof system, a pair of keys is usually generated: one for generating proof (proof key) and the other for verifying proof (verification key). Use the key generation algorithm of the zero-knowledge proof system to generate this pair of keys.
[0084] Step 6: Assign public inputs and private variables and generate proofs.
[0085] Use the proof key, public input (ciphertext), and private variables (plaintext and bias value) to generate a proof that the ciphertext was generated from the plaintext through the correct encryption process. Assign values to the public input and private variables in the circuit and use the proof generation algorithm of the zero-knowledge proof system to generate the proof.
[0086] In some embodiments, the above steps can be implemented by the following code:
[0087] Through the embodiments of the present invention, by proving the possession of data in the secret database, it is possible to prove to the verifier that the ciphertext data in the secret database is generated by the corresponding plaintext data through a specific encryption algorithm without leaking the plaintext.
[0088] Step 204, when the search statement input by the user is obtained, a target security index column corresponding to the search statement is determined, and the ciphertext column is searched based on the target security index column to obtain a query result; The query results include: the target plaintext data obtained after decryption and the proof of data possession in the confidential database corresponding to the target plaintext data.
[0089] In an embodiment of the present invention, a security index is generated while generating a ciphertext, and the security index and the ciphertext are uploaded to a cloud server for storage. During retrieval, the security index and the ciphertext are used together to complete the data retrieval process, and then the decrypted plaintext is returned.
[0090] In the actual retrieval process, the column objects that need to be queried are determined according to the WHERE query conditions of the SQL statement, thereby completing the query task.
[0091] In the embodiment of the present invention, first, according to the content of the search statement, the security index columns associated therewith are determined. These index columns are pre-set in the database, they correspond to specific data fields, and are encrypted to ensure the security of the data. Using the determined security index columns, the system will search in the encrypted database. This step involves processing the encrypted data to find records that match the search statement.
[0092] Subsequently, the retrieved ciphertext data is decrypted to obtain the target plaintext data. In addition, in order to ensure the integrity and possession of the data, the system will also generate a proof of possession of the secret database data corresponding to the target plaintext data. This proof can prove to the user or other verification party that the retrieved data does exist in the database and has not been tampered with.
[0093] Finally, the decrypted target plaintext data and its corresponding data possession proof are returned to the user. In this way, the user can not only obtain the required information, but also verify the authenticity and integrity of the data.
[0094] Through the above steps of the embodiment of the present invention, the plaintext column is encrypted to obtain the ciphertext column and the security index column, thereby ensuring the privacy of the data during storage and transmission. Even if the data is illegally obtained, the plaintext information cannot be directly obtained, thereby effectively protecting the privacy of the data. By constructing the security index column, the ciphertext data can be quickly retrieved without leaking the plaintext information, thereby ensuring the privacy of the data and improving the data retrieval efficiency. Based on the plaintext column, the ciphertext column and the first target encryption algorithm, the data possession proof of the secret database is constructed, and the data possession proof of the secret database can ensure that the ciphertext column is constructed by the plaintext column through a specific encryption algorithm, thereby ensuring the integrity and authenticity of the data. When the search statement input by the user is obtained, the security index column corresponding to the target search statement is determined, and the ciphertext column is retrieved based on the index column, thereby quickly obtaining the query result, and the query result includes the target plaintext data obtained after decryption and the corresponding data possession proof. The user can confirm the correctness and authenticity of the query result by verifying the data possession proof, thereby enhancing the credibility of the data.
[0095] According to a method for processing secret data supporting retrieval and trusted verification provided by the present invention, after encrypting each of the plurality of plaintext columns according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns respectively corresponding to each plaintext column, the method further comprises: Convert the operations on plaintext columns to operations on ciphertext columns and security index columns, including: Obtain a dictionary including an INSERT statement and a user key input by the user, wherein the dictionary includes: a target column name and a target plain text; Encrypt the target column name to obtain the target encrypted column name; Based on the user key and the preset query requirements and encryption algorithm correspondence table, the target plaintext is encrypted to obtain the target ciphertext; The target column name and the target plaintext in the dictionary are replaced based on the correspondence between the target encrypted column name and the target ciphertext to obtain a processed dictionary.
[0096] In the embodiment of the present invention, after the security index column is created, the execution of the SQL statement also needs to be changed accordingly. Taking the INSERT statement as an example, the change of the plaintext column is changed to the processing of the ciphertext column and the security index column after being processed by the front-end proxy component.
[0097] The following is a brief description of this process, editing the parsed SQL statement dictionary according to the scheme set by the user: Step 1, traverse the input dictionary , process each column element.
[0098] Receives a dictionary containing the data to be inserted ,dictionary Each element in is a key-value pair, with the key being the column name , the value is plain text data .
[0099] Step 2: Get the query requirement list .
[0100] Get the query requirement list , query the requirements list Defines which columns need to be encrypted and how to encrypt them.
[0101] Step 3: Get the user key .
[0102] Get the user-provided key , used for data encryption.
[0103] Step 4: Get the key-value pairs of column names and plain text .
[0104] From the dictionary Get the key-value pairs of column names and plain text .
[0105] Step 5: Modify the column name of each column element The encrypted column name .
[0106] For dictionaries Each column element (i.e. key-value pair) in ), modify the column name The encrypted column name .
[0107] Step 6: Get the plaintext from the input dictionary .
[0108] Step 7: Traverse the query type list .
[0109] Step 8: Use the user key The encryption method corresponding to the query type encrypts the plaintext to obtain the ciphertext .
[0110] Iterate over the list of query types , select the appropriate encryption method according to each query type. Use user key , and the selected encryption method, the plaintext Encrypt and get the ciphertext .
[0111] Step 9: Encrypted column names and ciphertext Write back to dictionary .
[0112] The encrypted column name and ciphertext Write back to the dictionary as new key-value pairs ,dictionary Each element in represents an encrypted column name and the corresponding ciphertext data.
[0113] Step 10, return to dictionary .
[0114] In some embodiments, the above steps can be implemented by the following code:
[0115] In actual scenarios, it is necessary to analyze a variety of SQL statements in detail and process a variety of clauses and judgment conditions.
[0116] Through the embodiments of the present invention, it is possible to ensure that when inserting data, the plaintext data is correctly encrypted and stored in the encrypted database, and at the same time, a corresponding security index column is generated to support subsequent query operations.
[0117] According to a method for processing secret data supporting retrieval and trusted verification provided by the present invention, after determining a target security index column corresponding to the search statement, searching the ciphertext column based on the target security index column, and obtaining a query result, the method further includes: Based on the second target encryption algorithm and the search statement, a proof of the data integrity of the secret database is constructed, wherein the proof of the data integrity of the secret database is used to prove that all data that meets the search statement are returned without leaking other plaintexts.
[0118] In the embodiment of the present invention, the purpose of the data integrity proof of the secret database is to prove to the verifier that all data that meet the query conditions are returned without leaking other plaintexts. In the circuit of zero-knowledge proof, in addition to proving that the returned ciphertext data is generated by the plaintext data, it is also necessary to prove that the plaintext value corresponding to the returned ciphertext meets the query conditions.
[0119] Through the embodiments of the present invention, a secure and efficient data integrity certification mechanism for a confidential database is constructed, providing users with the ability to verify the integrity of returned data without leaking other plaintext data.
[0120] According to a method for processing secret data supporting retrieval and trusted verification provided by the present invention, the second target encryption algorithm is an OPE order-preserving encryption algorithm, and based on the second target encryption algorithm and the retrieval statement, a proof of the data integrity of the secret database is constructed, including: Obtain a first plaintext array that matches the search statement, a second plaintext array that does not match the search statement, a ciphertext array, and a condition value; The ciphertext array is used to represent the ciphertexts corresponding to the first plaintext array and the second plaintext array, and the conditional value is used to compare with the first plaintext array and the second plaintext array respectively; In the second zero-knowledge proof circuit, variable originals are respectively assigned to the first plaintext array, the second plaintext array, the ciphertext array, and the conditional value to obtain a configured second zero-knowledge proof circuit; Determine a second public input and a second private variable, wherein the second public input includes: a first plaintext array, a second plaintext array, a conditional value, and an expected comparison result; the second private variable includes: an encryption key of an OPE order-preserving encryption algorithm; Determining the first plaintext array, the second plaintext array, and a second constraint of the conditional value based on a comparison circuit corresponding to the search statement, wherein the second constraint is used to compare the first plaintext array and the second plaintext array with the conditional value respectively; determining an actual comparison result corresponding to the second constraint; Determine an equivalence constraint between the actual comparison result and the expected comparison result; Generate a second proof key based on the configured circuit and equivalence constraint of the second zero-knowledge proof; The configured second zero-knowledge proof circuit is assigned a value based on the second public input and the second private variable, and a secret database data integrity proof is generated using the second proof key.
[0121] In the embodiment of the present invention, taking OPE order-preserving encryption as an example, the embodiment of the present invention abstracts the input-output relationship of the order-preserving encryption algorithm, takes the encryption key that needs to be kept confidential as private input, and separates the key update from the proof circuit. The proof circuit is only responsible for the correctness of the calculation relationship between plaintext, key and ciphertext, which not only serves the plaintext and ciphertext consistency proof, but also protects the key security.
[0122] The following steps describe this process in detail: Step 1: Define the plaintext array X that meets the comparison conditions, the plaintext array Y that does not meet the comparison conditions, the ciphertext array Outs, the conditional value Base, and the comparison result arrays XLESS and YLESS.
[0123] Plaintext array X: contains all plaintext data that meet the query conditions.
[0124] Plaintext array Y: contains all plaintext data that do not meet the query conditions.
[0125] Ciphertext array Outs: stores the ciphertext corresponding to the data in X and Y.
[0126] Condition value Base: The condition value used to compare with the plain text data (for example, a threshold in a query).
[0127] Comparison result arrays XLESS and YLESS: store the results of comparing the data in X and Y with Base respectively (for example, true if less than Base, false otherwise).
[0128] Step 2, allocate variable elements on the circuit.
[0129] In the circuit of zero-knowledge proof, each variable (such as plaintext, ciphertext, comparison result, etc.) is assigned a corresponding circuit element (such as wire, gate, etc.).
[0130] Step 3, set public input and private variables.
[0131] The public input includes the plaintext arrays X and Y, the ciphertext array Outs, the conditional value Base, and the expected comparison result. The private variables include the encryption key (used to generate the ciphertext array Outs) and the specific plaintext data (the values in X and Y).
[0132] Step 4, abstract the OPE algorithm into a circuit and construct the corresponding constraints between the ciphertext Outs and the plaintext X, Y.
[0133] The input-output relationship of the OPE algorithm is abstracted into a circuit, in which constraints are constructed for each ciphertext in the ciphertext array Outs and the corresponding plaintext in the plaintext arrays X and Y. These constraints ensure that the ciphertext is generated by the correct plaintext and key.
[0134] Step 5: Construct constraints of plaintext X, Y and conditional value base based on the comparison circuit, store the results in comparison result arrays XLESS, YLESS, and then construct equal value constraints of comparison result arrays and expected results.
[0135] Use the comparison circuit to compare the data in the plaintext arrays X and Y according to the conditional value Base, and store the results in the comparison result arrays XLESS and YLESS. Construct equal value constraints between the comparison result arrays and the expected results to ensure the correctness of the comparison results.
[0136] Step 6: Generate a certification key and a verification key.
[0137] A zero-knowledge proof system is used to generate a proving key (used to generate the proof) and a verification key (used to verify the proof).
[0138] Step 7: Assign public inputs and private variables and generate proofs.
[0139] Assign the values of public inputs and private variables to the corresponding elements in the circuit. Generate a data integrity proof using the attestation key and the circuit.
[0140] In some embodiments, the above steps can be implemented by the following code:
[0141] Through the embodiments of the present invention, a safe and efficient data integrity proof mechanism for a confidential database is constructed, which can ensure that all data that meets the query conditions are correctly returned to the verifier without leaking other plaintext data.
[0142] refer to Figure 5 , Figure 5 It is a structural diagram of a confidential data service platform supporting efficient retrieval and trusted verification provided by the present invention, which includes: users, confidential database; wherein the confidential database includes a front-end transparent proxy component (including search encryption and non-interactive zero-knowledge proof) and an underlying database.
[0143] The present invention realizes a secret data service platform supporting efficient retrieval and trusted verification, ensures efficient retrieval of secret databases based on searchable encryption technology, and ensures trusted verification of secret databases based on non-interactive zero-knowledge proof technology.
[0144] In order to ensure that the secret database has good practicality and scalability, the secret database of the present invention consists of two parts: a front transparent proxy component and an underlying database. The front proxy component implements functions such as SQL statement parsing and reconstruction, basic encryption algorithm library, and secure index column generation to ensure efficient storage and query of ciphertext. At the same time, it also implements the optional generation of non-interactive zero-knowledge proofs, and feeds back corresponding proofs according to the user's query requirements to ensure high credibility of the query results. Specifically, it implements proof of data possession in the secret database to verify that the ciphertext in the database is generated by the corresponding plaintext data, rather than forged; it implements proof of data integrity in the secret database to verify that all data in the database that meets the query conditions are returned to the purchaser.
[0145] The underlying database can be any common database, such as MySQL, SQL Server, PostgreSQL, etc. The front-end proxy component provides corresponding interfaces for docking and provides corresponding SQL standard compatibility according to different underlying databases.
[0146] refer to Figure 6 , Figure 6 It is a schematic diagram of the three-party architecture provided by the present invention, which includes: a user who purchases services, a service provider who provides proof, and a trusted third party, which is usually some special security agency.
[0147] The above process completes the construction and verification process of ZK-SNARK. In actual application scenarios, circuit construction, proof generation, and proof verification are completed by the trusted third party, service requester, and verifier respectively.
[0148] In the actual scenario of a confidential database, the server is usually the holder of the confidential database. During the data transaction process, the confidential database first returns the ciphertext query result and related proof. The user verifies the proof and completes the payment before obtaining the plaintext result.
[0149] In summary, the present invention has built a confidential data service platform that supports efficient retrieval and trusted verification. It solves the security and efficiency problems in the circulation of confidential data through technological innovation, and conducts in-depth research on the trusted verification problem of confidential databases, promoting the rational allocation and efficient use of data resources.
[0150] The following is a description of the confidential data processing system supporting retrieval and trusted verification provided by the present invention. The confidential data processing system supporting retrieval and trusted verification described below and the confidential data processing method supporting retrieval and trusted verification described above can be referenced to each other.
[0151] refer to Figure 7 , Figure 7 It is a schematic diagram of the structure of the secret data processing system supporting retrieval and trusted verification provided by the present invention.
[0152] The acquisition module 701 is used to acquire multiple plain text columns of structured data input by the user; The encryption module 702 is used to encrypt each plaintext column in the plurality of plaintext columns according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns corresponding to each plaintext column; A construction module 703 is used to construct a data possession proof of a secret database based on the plaintext column, the ciphertext column and the first target encryption algorithm, wherein the data possession proof of the secret database is used to prove that the ciphertext column is constructed by the plaintext column through the first target encryption algorithm; The search module 704 is used to determine the target security index column corresponding to the search statement when obtaining the search statement input by the user, and search the ciphertext column based on the target security index column to obtain the query result; The query results include: the target plaintext data obtained after decryption and the proof of data possession in the confidential database corresponding to the target plaintext data.
[0153] Specifically, the above-mentioned confidential data processing system supporting retrieval and trusted verification provided by the present invention can implement all the method steps implemented by the above-mentioned confidential data processing method embodiment supporting retrieval and trusted verification, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.
[0154] Figure 8 is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 8 As shown, the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute a confidential data processing method that supports retrieval and trusted verification, the method comprising: obtaining multiple plaintext columns of structured data input by a user; encrypting each of the multiple plaintext columns according to multiple preset encryption algorithms to obtain ciphertext columns and multiple security index columns corresponding to each plaintext column; constructing a confidential database data possession proof based on the plaintext column, the ciphertext column and the first target encryption algorithm, wherein the confidential database data possession proof is used to prove that the ciphertext column is constructed from the plaintext column using the first target encryption algorithm; when a search statement input by the user is obtained, determining the target security index column corresponding to the search statement, searching the ciphertext column based on the target security index column to obtain a query result; wherein the query result includes: the target plaintext data obtained after decryption and the confidential database data possession proof corresponding to the target plaintext data.
[0155] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0156] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the confidential data processing method supporting retrieval and trusted verification provided by the above methods, the method including: obtaining multiple plaintext columns of structured data input by a user; encrypting each of the multiple plaintext columns according to multiple preset encryption algorithms to obtain ciphertext columns and multiple security index columns corresponding to each plaintext column; constructing a confidential database data possession proof based on the plaintext column, the ciphertext column and the first target encryption algorithm, wherein the confidential database data possession proof is used to prove that the ciphertext column is constructed by the plaintext column through the first target encryption algorithm; when a search statement input by the user is obtained, the target security index column corresponding to the search statement is determined, and the ciphertext column is retrieved based on the target security index column to obtain a query result; wherein the query result includes: the target plaintext data obtained after decryption and the confidential database data possession proof corresponding to the target plaintext data.
[0157] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the confidential data processing method supporting retrieval and trusted verification provided by the above-mentioned methods, the method comprising: obtaining multiple plaintext columns of structured data input by a user; encrypting each of the multiple plaintext columns according to multiple preset encryption algorithms to obtain ciphertext columns and multiple security index columns corresponding to each plaintext column; constructing a confidential database data possession proof based on the plaintext columns, the ciphertext columns and the first target encryption algorithm, wherein the confidential database data possession proof is used to prove that the ciphertext columns are constructed from the plaintext columns using the first target encryption algorithm; when a search statement input by the user is obtained, determining the target security index column corresponding to the search statement, searching the ciphertext column based on the target security index column, and obtaining a query result; wherein the query result includes: the target plaintext data obtained after decryption and the confidential database data possession proof corresponding to the target plaintext data.
[0158] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing secret data supporting retrieval and trusted verification, characterized in that: include: Get multiple plaintext columns of structured data entered by the user; Encrypting each of the plurality of plaintext columns according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns respectively corresponding to each plaintext column; Constructing a data possession proof of a secret database based on the plaintext column, the ciphertext column and the first target encryption algorithm, wherein the data possession proof of the secret database is used to prove that the ciphertext column is constructed by the plaintext column through the first target encryption algorithm; When a search statement input by a user is obtained, a target security index column corresponding to the search statement is determined, and the ciphertext column is searched based on the target security index column to obtain a query result; The query result includes: the target plaintext data obtained after decryption and the proof of possession of the secret database data corresponding to the target plaintext data.
2. The method for processing secret data supporting retrieval and trusted verification according to claim 1, characterized in that: The step of encrypting each plaintext column in the plurality of plaintext columns according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns respectively corresponding to each plaintext column includes: Determine a query requirement for each plaintext column in the plurality of plaintext columns, wherein the query requirement is used to represent a type of an SQL statement; According to the preset query requirements and encryption algorithm correspondence table, each of the plaintext columns is encrypted based on the basic encryption database to obtain a ciphertext column corresponding to each plaintext column and a security index column corresponding to each plaintext column; Among them, the ciphertext column and the security index column are respectively stored in different library tables of the underlying database, and the basic encryption database includes at least the following encryption algorithms: OPE order-preserving encryption algorithm, Paillier semi-homomorphic encryption algorithm, and Blowfish encryption algorithm.
3. The method for processing secret data supporting retrieval and trusted verification according to claim 1, characterized in that: After encrypting each of the plurality of plaintext columns according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns respectively corresponding to each plaintext column, the method further includes: Converting the execution operation on the plaintext column into the execution operation on the ciphertext column and the security index column, including: Obtain a dictionary including an INSERT statement and a user key input by a user, wherein the dictionary includes: a target column name and a target plaintext; Encrypting the target column name to obtain a target encrypted column name; Based on the user key and the preset query requirement and encryption algorithm correspondence table, the target plaintext is encrypted to obtain the target ciphertext; The target column name and the target plaintext in the dictionary are replaced based on the correspondence between the target encrypted column name and the target ciphertext to obtain a processed dictionary.
4. The method for processing secret data supporting retrieval and trusted verification according to claim 1, characterized in that: The first target encryption algorithm is a Caesar encryption algorithm, and the method of constructing a proof of data possession of a secret database based on the plaintext column, the ciphertext column and the first target encryption algorithm includes: Splitting the plaintext column and the ciphertext column respectively to obtain a plaintext character array and a ciphertext character array, wherein the ciphertext column is obtained by encrypting the plaintext column using the Caesar encryption algorithm; In the first zero-knowledge proof circuit, variable elements are assigned to the plaintext character array and the ciphertext character array to obtain a configured first zero-knowledge proof circuit; Determine a first public input and a first private variable, wherein the first public input includes the plaintext character array, and the first private variable includes an offset of the Caesar encryption algorithm; Determine a first constraint between the ciphertext column and the plaintext column, wherein the first constraint is used to make the sum of the plaintext column and the offset equal to the ciphertext column; generating a first proof key based on the configured first zero-knowledge proof circuit and the first constraint; The configured first zero-knowledge proof circuit is assigned a value based on the first public input and the first private variable, and the first proof key is used to generate a proof of data possession in a secret database.
5. The method for processing secret data supporting retrieval and trusted verification according to claim 1, characterized in that: After determining the target security index column corresponding to the search statement, searching the ciphertext column based on the target security index column, and obtaining the query result, the method further includes: Based on the second target encryption algorithm and the search statement, a proof of the data integrity of the secret database is constructed, wherein the proof of the data integrity of the secret database is used to prove that all data that meets the search statement are returned without leaking other plaintexts.
6. The method for processing secret data supporting retrieval and trusted verification according to claim 5, characterized in that: The second target encryption algorithm is an OPE order-preserving encryption algorithm, and the method of constructing a data integrity proof of a secret database based on the second target encryption algorithm and the search statement includes: Obtain a first plaintext array that matches the search statement, a second plaintext array that does not match the search statement, a ciphertext array, and a condition value; The ciphertext array is used to represent the ciphertexts corresponding to the first plaintext array and the second plaintext array, and the conditional value is used to compare with the first plaintext array and the second plaintext array respectively; In the second zero-knowledge proof circuit, variable originals are respectively assigned to the first plaintext array, the second plaintext array, the ciphertext array, and the conditional value to obtain a configured second zero-knowledge proof circuit; Determine a second public input and a second private variable, wherein the second public input includes: the first plaintext array, the second plaintext array, the conditional value, and the expected comparison result; the second private variable includes: an encryption key of the OPE order-preserving encryption algorithm; Determining a second constraint of the first plaintext array, the second plaintext array, and the conditional value based on a comparison circuit corresponding to the search statement, wherein the second constraint is used to compare the first plaintext array and the second plaintext array with the conditional value respectively; determining an actual comparison result corresponding to the second constraint; Determining an equivalence constraint between the actual comparison result and the expected comparison result; generating a second proof key based on the configured second zero-knowledge proof circuit and the equivalence constraint; The configured second zero-knowledge proof circuit is assigned a value based on the second public input and the second private variable, and the secret database data integrity proof is generated using the second proof key.
7. A confidential data processing system supporting retrieval and trusted verification, characterized in that: include: An acquisition module, used to acquire multiple plain text columns of structured data input by a user; An encryption module, used to encrypt each plaintext column in the plurality of plaintext columns according to a plurality of preset encryption algorithms to obtain a ciphertext column and a plurality of security index columns respectively corresponding to each plaintext column; A construction module, used to construct a secret database data possession proof based on the plaintext column, the ciphertext column and the first target encryption algorithm, wherein the secret database data possession proof is used to prove that the ciphertext column is constructed by the plaintext column through the first target encryption algorithm; A retrieval module, configured to, when obtaining a search statement input by a user, determine a target security index column corresponding to the search statement, and search the ciphertext column based on the target security index column to obtain a query result; The query result includes: the target plaintext data obtained after decryption and the proof of possession of the secret database data corresponding to the target plaintext data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for processing confidential data supporting retrieval and trusted verification as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for processing confidential data supporting retrieval and trusted verification as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for processing confidential data supporting retrieval and trusted verification as described in any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Zero-knowledge proof generation and verification method and device
CN121567340A