Encrypted data verification method and device, computer equipment and storage medium
By constructing consistency proof information and zero-knowledge proof, the problem of data integrity verification in the prior art cannot be completed without leaking sensitive information, and efficient data integrity verification is achieved.
Patent Information
- Application Number
- CN202510564268.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-08
AI Technical Summary
Existing searchable encryption methods cannot complete data integrity verification while ensuring that sensitive information is not leaked.
By constructing consistency proof information, including zero-knowledge proof of the target ciphertext and the first commitment, a verification result is generated to indicate the integrity verification result of the target ciphertext, avoiding requesting public keys and sensitive information, and realizing data integrity verification.
Complete data integrity verification without leaking sensitive information, reduce the performance overhead of interactive processes and sign-up verification operations, and optimize the data integrity verification process.
Smart Images

Figure CN120449185A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security, and in particular to encrypted data verification methods, devices, computer equipment, and storage media. Background Art
[0002] In the cloud computing and big data environment, a large amount of user data is stored in cloud databases. The security of the data requires that the data be stored in a confidential form and have the ability to be queried. Searchable encryption technology can meet such requirements. It encrypts the data so that the data exists in ciphertext during storage and transmission, and supports keyword search on the ciphertext.
[0003] In existing searchable encryption methods, when users need to access data, they typically retrieve ciphertext data from a cloud server based on an index and use signature technology to verify the data's integrity. However, this method requires a public key and sensitive information for signature verification, making it impossible to verify data integrity while simultaneously preventing the leakage of sensitive information.
[0004] There is currently no effective solution to the problem in related technologies that it is impossible to complete data integrity verification while ensuring that sensitive information is not leaked. Summary of the Invention
[0005] In this embodiment, an encrypted data verification method, apparatus, computer device, and storage medium are provided to solve the problem in related technologies that it is impossible to complete data integrity verification while ensuring that sensitive information is not leaked.
[0006] In a first aspect, an encrypted data verification method is provided in this embodiment, the method comprising:
[0007] In response to a query request for a target ciphertext, obtaining the target ciphertext and associated information thereof from a cloud database; wherein the associated information includes consistency proof information, the consistency proof information being constructed based on the target ciphertext and a first commitment associated with the target ciphertext;
[0008] The consistency proof information in the association information is verified to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext.
[0009] In some embodiments, constructing the consistency proof information includes:
[0010] Encrypting the first plaintext data to obtain the target ciphertext;
[0011] Determining the first commitment corresponding to the first plaintext data;
[0012] Based on the target ciphertext and the first commitment, the consistency proof information is constructed using a zero-knowledge proof algorithm.
[0013] In some embodiments, encrypting the first plaintext data to obtain the target ciphertext includes:
[0014] Build a corresponding node set based on all qualified computing nodes in the preset committee;
[0015] Determining, based on a threshold secret sharing algorithm, a private key fragment of each computing node in the node set;
[0016] Determining a private key corresponding to each of the private key fragments;
[0017] The first plaintext data is encrypted based on the public key corresponding to the private key to obtain the target ciphertext.
[0018] In some embodiments, when the verification result indicates that the integrity verification of the target ciphertext is successful, the method further includes:
[0019] Decrypting the target ciphertext to obtain corresponding second plaintext data;
[0020] determining a second commitment corresponding to the second plaintext data;
[0021] The first commitment is compared with the second commitment to obtain a corresponding comparison result; the comparison result is used to indicate the authenticity verification result of the target ciphertext.
[0022] In some embodiments, the query request is initiated by a data uploader of the target ciphertext, and decrypting the target ciphertext to obtain the corresponding second plaintext data includes:
[0023] Obtaining the private key held by the data uploader;
[0024] The target ciphertext is decrypted based on the private key to obtain the second plaintext data.
[0025] In some embodiments, the query request is initiated by a third-party authorizer of the target ciphertext, and decrypting the target ciphertext to obtain the corresponding second plaintext data includes:
[0026] In response to submitting the target ciphertext to a preset committee, verifying the identities of the three-party authorizers through each computing node in the preset committee;
[0027] When the identity authentication of the three-party authorizer is successful, the target ciphertext is jointly decrypted based on the private key fragments of the multiple computing nodes participating in the decryption to obtain the second plaintext data.
[0028] In some embodiments, generating a query request for the target ciphertext includes:
[0029] Processing the target ciphertext's query field using hash digest technology to obtain a corresponding index;
[0030] Based on the index, the query request for the target ciphertext is generated.
[0031] In a second aspect, an encrypted data verification device is provided in this embodiment, the device comprising:
[0032] a query module, configured to, in response to a query request for a target ciphertext, obtain the target ciphertext and associated information thereof from a cloud database; wherein the associated information includes consistency proof information, the consistency proof information being constructed based on the target ciphertext and a first commitment associated with the target ciphertext;
[0033] A verification module is used to verify the consistency proof information in the association information to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext.
[0034] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the encrypted data verification method described in the first aspect when executing the computer program.
[0035] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored. When the program is executed by a processor, the encrypted data verification method described in the first aspect is implemented.
[0036] Compared with related technologies, the encrypted data verification method, device, computer equipment and storage medium provided in this embodiment obtain the target ciphertext and the associated information of the target ciphertext from the cloud database by responding to a query request for the target ciphertext; wherein the associated information includes consistency proof information, which is constructed based on the target ciphertext and the first commitment associated with the target ciphertext; the consistency proof information in the associated information is verified to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext, which solves the problem of not being able to complete data integrity verification while ensuring that sensitive information is not leaked, and realizes the completion of data integrity verification without leaking sensitive information.
[0037] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0039] Figure 1 This is a hardware structure block diagram of a terminal device for an encrypted data verification method provided by an embodiment of the present application;
[0040] Figure 2 This is a flowchart of an encrypted data verification method provided by an embodiment of the present application;
[0041] Figure 3 This is a flowchart of an encrypted data verification method provided by an embodiment of the present application;
[0042] Figure 4 This is a flowchart of constructing consistency proof information provided by an embodiment of the present application;
[0043] Figure 5 This is a flowchart of a third-party authorizer requesting decryption provided by an embodiment of the present application;
[0044] Figure 6 This is a flowchart of an encrypted data verification method provided by a preferred embodiment of the present application;
[0045] Figure 7 This is a structural block diagram of an encrypted data verification device provided in one embodiment of the present application.
[0046] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, query module; 20, verification module. DETAILED DESCRIPTION
[0047] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0048] Unless otherwise defined, the technical terms or scientific terms involved in this application should have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "an", "a", "the", "these" and the like in this application do not indicate quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, and B exists alone. Generally, the character " / " indicates that the related objects are in an "or" relationship. The terms "first," "second," "third," etc. used in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0049] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a block diagram of the hardware structure of the terminal of the encrypted data verification method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0050] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the encrypted data verification method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0051] The transmission device 106 is used to receive or send data via a network. The network may include a wireless network provided by the terminal's telecommunications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0052] In this embodiment, a method for verifying encrypted data is provided. Figure 2 is a flow chart of the encrypted data verification method of this embodiment, such as Figure 2 As shown, the process includes the following steps:
[0053] Step S210, in response to a query request for a target ciphertext, obtaining the target ciphertext and associated information of the target ciphertext from a cloud database; wherein the associated information includes consistency proof information, and the consistency proof information is constructed based on the target ciphertext and a first commitment associated with the target ciphertext.
[0054] Step S220, verify the consistency proof information in the associated information to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext.
[0055] Specifically, such as Figure 3As shown, when a user requests a public key from a preset committee, each computing node in the preset committee is verified, and a corresponding node set is constructed based on all qualified computing nodes. A threshold secret sharing algorithm is used to determine the private key fragments of each computing node in the node set, and the private key is recovered based on each private key fragment, and the corresponding public key is calculated based on the recovered private key. Based on the public key generated by the preset committee, the first plaintext data m is encrypted to obtain the target ciphertext C(m). The encryption algorithm used to encrypt the first plaintext data is consistent with the Pederson commitment, such as the public key encryption algorithm based on elliptic curve cryptography (Elliptic Curve Cryptography Elgamal, ECC-Elgamal) algorithm, the Paillier encryption algorithm, etc. It should be noted that in addition to using the public key to directly encrypt and decrypt plaintext data, the public key can also be used to encrypt the symmetric key after the plaintext data is encrypted to complete data encryption, which is not limited here.
[0056] For the fields in the target ciphertext that need to support query, hash summary technology is used to process each field to obtain the tag for each field. i Index Hash(tag i ), and based on each index Hash(tag i ), generating a corresponding index set. To ensure the consistency of the plaintext and ciphertext, a Pederson proof is used to construct a first commitment Comm(m) corresponding to the first plaintext. Based on the target ciphertext and the first commitment, a zero-knowledge proof algorithm based on the Sigma protocol is used to construct consistency proof information. This consistency proof information verifies the consistency of the ciphertext content with the plaintext data without leaking the original plaintext data. The four-tuple consisting of the target ciphertext, the index set, the first commitment, and the consistency proof information is then uploaded to the cloud database.
[0057] When a user initiates a query for a field in the target ciphertext, the query field is processed using hash digest technology to obtain the corresponding index. This index is then used to query the target ciphertext in the cloud database. In response to the query request for the target ciphertext, the cloud database retrieves the target ciphertext and its associated information, including the index set associated with the target ciphertext, the first commitment, and the consistency proof information. The cloud database then returns a four-tuple consisting of the target ciphertext, the index set, the first commitment, and the corresponding consistency proof information.
[0058] Furthermore, the retrieved data is verified. First, the consistency proof information in the associated information is verified. If the verification succeeds, it means that the integrity of the target ciphertext is successfully verified, that is, the commitment is consistent with the message content in the ciphertext. If the verification fails, it means that the integrity of the target ciphertext is destroyed, that is, data tampering has occurred.
[0059] After the data integrity is successfully verified, the target ciphertext is decrypted. If the query request is initiated by the data uploader of the target ciphertext, the private key held by the data uploader is obtained, and the target ciphertext is decrypted based on the private key to obtain the second plaintext data. If the query request is initiated by the third-party authorizer of the target ciphertext, the returned target ciphertext is submitted to the preset committee. The identity of the third-party authorizer is verified by each computing node in the preset committee. If the identity of the third-party authorizer is successful, the target ciphertext is jointly decrypted based on the private key fragments of the multiple computing nodes participating in the decryption to obtain the second plaintext data.
[0060] Next, the second commitment Comm(m)` corresponding to the second plaintext data is calculated and compared with the first commitment. If the comparison result is Comm(m) = Comm(m)`, it indicates that the secondary verification is successful and the decrypted plaintext data is consistent with the plaintext data before encryption, that is, the data authenticity is verified successfully. Otherwise, it indicates that the secondary verification failed and the data authenticity is compromised.
[0061] The following uses ECC-Elgamal as an example to explain the data upload and verification process in detail. First, the first plaintext data is encrypted to obtain the target ciphertext. The target ciphertext is expressed as follows:
[0062] C(m)=(C1,C2)=(rG,rP k +mG) (1)
[0063] In formula (1), m represents the first plaintext data; C(m) represents the target ciphertext; the target ciphertext is divided into two parts, C1 and C2; r is the selected random number; P k is the public key jointly generated by the preset committee; G is the base point of the selected elliptic curve. Accordingly, the expression of the first commitment is as follows:
[0064] Comm(m)=mG+rH (2)
[0065] In formula (2), Comm(m) represents the first commitment; m represents the first plaintext data; r is a random number; G and H are points on the elliptic curve. The consistency proof information is constructed by the zero-knowledge proof algorithm based on the Sigma protocol. The expression of the consistency proof information is as follows:
[0066] Pok{Comm(m),C2:Comm(m)=m1G+rH∧C2=rY+m2G∧m1=m2} (3)
[0067] In formula (3), Comm(m) and C2 are the inputs of the proof; Comm(m) = m1G + rH, C2 = rY + m2G are the specific input contents; m1 = m2 is the content to be proved; G, H and Y are points on the elliptic curve. It should be noted that the zero-knowledge proof scheme assumes that the message in the commitment is equal to the message in the target ciphertext, that is, m1 = m2. When calculating the commitment, the same random number is input for calculation. If the final equation is verified successfully, it means that m1 = m2. Specifically, from the large number field Z q The prover selects random numbers v1, v2, and v3, respectively, and calculates the commitments t1 = v1G + v2H and t2 = v1G + v3Y. The challenge D = Hash(G, H, Y, t1, t2) is calculated, and the responses s1 = mD + v1 and s2 = rD + v2 are calculated. The prover then constructs the consistency proof, obtaining proof(m) = (t1, t2, s1, s2, D). The four-tuple consisting of the target ciphertext, the index set, the first commitment, and proof(m) is uploaded to the cloud database. The index set is the set of indexes that support the query field.
[0068] When a user retrieves data from a cloud database based on an index, the returned data is verified. First, the consistency proof information is verified (proofcheck). The specific process is as follows:
[0069] proofcheck: (D,t1,t2,s1,s2)→res:
[0070] s1G+s2H=Comm(m)D+t1 (4)
[0071] In the above calculation process, the commitment, challenge and response are substituted into formula (4), and the resulting expression is as follows:
[0072] (mD+c1)G+(rD+v2)H=D(mG+rH)+v1G+v2H (5)
[0073] Eliminate the equal content in equation (5). If the left and right sides of the equation are consistent and equation (5) holds, the output res is 1, indicating that the equation verification is successful under the assumption that m1=m2, that is, the commitment is consistent with the message content in the ciphertext, and the data integrity verification is successful. On the contrary, if the equation verification fails, it means that m1≠m2, that is, data tampering has occurred and the data integrity is destroyed. After the data integrity verification is successful, the target ciphertext is decrypted to obtain the corresponding second plaintext data, and the second commitment Comm(m)` corresponding to the second plaintext data is calculated, and the first commitment is compared with the second commitment. Among them, if the comparison result is Comm(m)=Comm(m)`, it indicates that the secondary verification is successful, the plaintext data obtained by decryption is consistent with the plaintext data before encryption, that is, the data authenticity verification is successful. Otherwise, it indicates that the secondary verification failed and the data authenticity is destroyed.
[0074] In existing searchable encryption methods, when users need to access data, they typically retrieve ciphertext data from a cloud server based on an index and use signature technology to verify the data's integrity. However, this method requires a public key and sensitive information for signature verification, making it impossible to verify data integrity while simultaneously preventing the leakage of sensitive information.
[0075] Compared with the prior art, the present application obtains the target ciphertext and the associated information of the target ciphertext from the cloud database in response to a query request for the target ciphertext; wherein the associated information includes consistency proof information, which is constructed based on the target ciphertext and the first commitment associated with the target ciphertext; the consistency proof information in the associated information is verified to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext. Based on this, by constructing consistency proof information of the ciphertext and the commitment, the consistency proof information and the ciphertext are uploaded to the cloud database synchronously, so that when the user retrieves the data, the consistency proof information returned by the cloud database can be verified, and the integrity of the data can be determined by the verification result of the consistency proof information, without requesting the public key and sensitive information for data integrity verification, solving the problem of not being able to complete data integrity verification while ensuring that sensitive information is not leaked, and achieving data integrity verification without leaking sensitive information, while avoiding the need to request the corresponding public key each time the signature is verified, reducing the performance overhead caused by the interactive process and the signature verification operation, thereby optimizing the data integrity verification process, and completing the data integrity verification by non-interactively executing the equation operation once.
[0076] In some of these embodiments, Figure 4 As shown, building consistency proof information includes the following steps:
[0077] Step S201, encrypting the first plaintext data to obtain a target ciphertext;
[0078] Step S202, determining a first commitment corresponding to the first plaintext data;
[0079] Step S203: Based on the target ciphertext and the first commitment, construct consistency proof information through a zero-knowledge proof algorithm.
[0080] Specifically, based on the public key generated by the preset committee, the first plaintext data m is encrypted to obtain the target ciphertext C(m). The encryption algorithm used to encrypt the first plaintext data is consistent with the Pederson commitment, such as the ECC-Elgamal algorithm, the Paillier encryption algorithm, etc.
[0081] Furthermore, the fields in the target ciphertext that need to be supported for query are determined, and each field is processed using hash summary technology to obtain the tag for each field. i Index Hash(tag i ), and based on each index Hash(tag i ), generating a corresponding index set. To ensure the consistency of the plaintext and ciphertext, a Pederson proof is used to construct a first commitment Comm(m) corresponding to the first plaintext. Based on the target ciphertext and the first commitment, a zero-knowledge proof algorithm based on the Sigma protocol is used to construct consistency proof information. This consistency proof information verifies the consistency of the ciphertext content with the plaintext data without leaking the original plaintext data. The four-tuple consisting of the target ciphertext, the index set, the first commitment, and the consistency proof information is then uploaded to the cloud database.
[0082] Through this embodiment, the first plaintext data is encrypted to obtain the target ciphertext, the first commitment corresponding to the first plaintext data is determined, and based on the target ciphertext and the first commitment, consistency proof information is constructed through a zero-knowledge proof algorithm. In this way, zero-knowledge proof is used to provide consistency proof material between the ciphertext and the commitment, thereby efficiently ensuring the integrity of the data.
[0083] In some embodiments, encrypting the first plaintext data to obtain target ciphertext in step S201 includes the following steps:
[0084] Build a corresponding node set based on all qualified computing nodes in the preset committee;
[0085] Based on the threshold secret sharing algorithm, determine the private key fragments of each computing node in the node set;
[0086] Determining the private key corresponding to each private key fragment;
[0087] The first plaintext data is encrypted based on the public key corresponding to the private key to obtain a target ciphertext.
[0088] Specifically, the preset committee contains n computing nodes and adopts the (t,n) threshold scheme. Among the n computing nodes, as long as the number of people reaches t, the key can be recovered. i (i∈(0,n)) in the field Z q Choose any two polynomials a ij and b ij are the coefficients of the selected polynomial, node P i For other nodes P j Complete the intermediate value σ ij =f i (j) mod q and ρ ij =g i (j) Calculate mod q and convert σ ij and ρ ij Send to P j (j∈[1,n],j≠i). Then, node P i Calculating Commitment Value (k=0,…,t, t is the preset system threshold), and broadcast all A ik .
[0089] When node P i Receive σ ji and ρ ji , verify the preset equation, the specific expression of the preset equation is as follows:
[0090]
[0091] If for some values of j, the verification formula (6) does not hold, then the node P i Broadcast COMPLAN of j. When more than the preset threshold number of nodes broadcast COMPLAN of j, P j Show all nodes P that publish COMPLANT messages to j i σ ij and ρ ij Value, each node in the committee uses the broadcast value to verify whether formula (6) is true. If it is detected that formula (6) is not true, it means that node P j The data is malicious or tampered, and the judgment node P j Based on this, each computing node records all the computing nodes that have passed the verification, and builds the corresponding node set Good based on all the computing nodes that have passed the verification. i Calculate your own private key fragment ρ i =∑ i∈Good σ ji mod q and σ i =∑j∈Good σ ji mod q, the shared secret is σ=∑ j∈Good a j0 mod q.
[0092] Furthermore, in the process of recovering the private key, for node P i ∈Good, broadcast value y ik =a ik mod q(k=0,…,t), for node P j Each j of ∈Good, node P i Verify whether the preset equation is true. The specific expression of the preset equation is as follows:
[0093]
[0094] If the above equation (7) does not hold for j, then node P i Broadcast satisfies equation (6) and does not satisfy equation (7) ij and ρ ij , publish COMPLAIN for j. Then, the nodes that did not receive COMPLAIN execute the recovery protocol of Pedersen-VSS and calculate the polynomial and y ik =a ik mod q(k=0,…,t), and then for all the private key fragments of the computing nodes in the node set, calculate the private key corresponding to each private key fragment. The specific calculation formula is as follows:
[0095] S k =∏ i∈Good y i0 mod q (8)
[0096] In formula (8), S k Represents the private key; Good represents the node set constructed based on all verified qualified computing nodes. Then, based on the corresponding encryption algorithm, the public key corresponding to the private key is calculated, for example, using the ECC-Elgamal algorithm to calculate the public key P k =S k G (G is a base point on the elliptic curve), and uses the public key to encrypt the first plaintext data to obtain the target ciphertext.
[0097] It should be noted that the public-private key pair described above is used to encrypt and decrypt user data. Both the private and public keys are held only by the respective users and stored confidentially. When the data's third-party authorized parties need to decrypt the data, the private key is not recovered. Instead, a joint decryption is performed using the private key fragments of the committee nodes to prevent private key leakage.
[0098] Through this embodiment, based on all qualified computing nodes in the preset committee, a corresponding node set is constructed, based on the threshold secret sharing algorithm, the private key fragments of each computing node in the node set are determined, and the private key corresponding to each private key fragment is determined, based on the public key corresponding to the private key, the first plaintext data is encrypted to obtain the target ciphertext, realizing distributed key generation in a searchable encryption scenario, so that the three-party authorized person can complete the decryption of the data without leaking the user's private key, thereby improving the security of the data.
[0099] In some embodiments, when the verification result indicates that the integrity verification of the target ciphertext is successful, the encrypted data verification method further includes the following steps:
[0100] Decrypt the target ciphertext to obtain the corresponding second plaintext data;
[0101] determining a second commitment corresponding to the second plaintext data;
[0102] The first commitment is compared with the second commitment to obtain a corresponding comparison result; the comparison result is used to indicate the authenticity verification result of the target ciphertext.
[0103] Specifically, when the verification result indicates that the integrity verification of the target ciphertext is successful, the target ciphertext is decrypted to obtain the corresponding second plaintext data, and a second commitment Comm(m)` corresponding to the second plaintext data is calculated.
[0104] Furthermore, the second commitment Comm(m)` is compared with the first commitment Comm(m) to determine whether Comm(m)` is equal to Comm(m). If the comparison result is Comm(m)`=Comm(m), it indicates that the secondary verification is successful and the decrypted plaintext data is consistent with the plaintext data before encryption, that is, the data authenticity is successfully verified. Otherwise, it indicates that the secondary verification failed and the data authenticity is determined to be compromised.
[0105] It should be noted that since the public key for encrypting data is kept confidential only by the data uploader, other users cannot obtain the public key to encrypt data and upload it, which can ensure the authenticity of the uploaded data. If other users use incorrect keys to construct data ciphertext and upload it after commitment, the ciphertext obtained after query cannot meet the secondary verification after decryption, and it can be detected that the authenticity of the data has been destroyed.
[0106] Through this embodiment, the target ciphertext is decrypted to obtain the corresponding second plaintext data, the second commitment corresponding to the second plaintext data is determined, the first commitment is compared with the second commitment, and the corresponding comparison result is obtained, indicating the authenticity verification result of the target ciphertext. In this way, the authenticity of the data is verified through secondary verification in the decryption stage.
[0107] In some embodiments, the query request is initiated by the data uploader of the target ciphertext, and decrypting the target ciphertext to obtain the corresponding second plaintext data includes the following steps:
[0108] Obtain the private key held by the data uploader;
[0109] The target ciphertext is decrypted based on the private key to obtain the second plaintext data.
[0110] Specifically, when a query request is initiated by the data uploader of the target ciphertext, the private key held by the data uploader is obtained, and the target ciphertext is decrypted based on the private key to obtain the second plaintext data. Taking ECC-Elgamal encryption as an example, the specific decryption process is as follows:
[0111] m′G=C2-C1S k (9)
[0112] In formula (9), the private key S k Multiply it with the first part of the target ciphertext C1 to get C1S k , subtract C1S from the second part of the target ciphertext C2 k , get m`G, m` is the second plaintext data obtained by decryption, and G is the base point on the elliptic curve.
[0113] Through this embodiment, the private key held by the data uploader is obtained, and the target ciphertext is decrypted based on the private key to obtain the second plaintext data, thereby completing the data decryption and facilitating the subsequent secondary verification of the data.
[0114] In some of these embodiments, Figure 5 As shown, the query request is initiated by the third-party authorized person of the target ciphertext, and the target ciphertext is decrypted to obtain the corresponding second plaintext data, including the following steps:
[0115] In response to submitting the target ciphertext to the preset committee, verifying the identities of the three-party authorizers through each computing node in the preset committee;
[0116] When the identity authentication of the three-party authorizer is successful, the target ciphertext is jointly decrypted based on the private key fragments of multiple computing nodes participating in the decryption to obtain the second plaintext data.
[0117] Specifically, the tripartite authorizer of the data refers to a third-party entity other than the data uploader, who can access and use the data with authorization. When the query request is initiated by the tripartite authorizer of the target ciphertext, the returned target ciphertext will be submitted to the preset committee, and the preset committee will verify the identity of the tripartite authorizer. If the identity authentication of the tripartite authorizer is successful, the target ciphertext will be jointly decrypted based on the private key fragments of multiple computing nodes participating in the decryption to obtain the second plaintext data. It should be noted that when verifying the identity of the tripartite authorizer, when the number of people in the preset committee who agree to perform the decryption operation reaches the system preset threshold, it indicates that the identity authentication of the tripartite authorizer is successful and the joint decryption stage can be entered.
[0118] Taking ECC-Elgamal encryption as an example, in the joint decryption process, n computing nodes participate in decryption, and each computing node P participating in decryption i Calculate the product of the first part of the target ciphertext and its private key fragment to get the corresponding t i , and t i Broadcast to other computing nodes participating in decryption, and then jointly calculate Get the first part of the target ciphertext C1 and the private key S k The product of t and t is subtracted from the second part C2 of the target ciphertext to obtain m`G, where m` is the second plaintext data obtained by decryption and G is the base point on the elliptic curve.
[0119] Through this embodiment, in response to submitting the target ciphertext to the preset committee, the identity of the three-party authorizer is verified by each computing node in the preset committee. When the identity authentication of the three-party authorizer is successful, the target ciphertext is jointly decrypted based on the private key fragments of multiple computing nodes participating in the decryption to obtain the second plaintext data. In this way, the three-party authorizer completes the decryption of the data without leaking the user's private key, thereby improving the security of the data.
[0120] In some embodiments, generating a query request for a target ciphertext includes the following steps:
[0121] The target ciphertext's query field is processed using hash summary technology to obtain the corresponding index;
[0122] Based on the index, a query request for the target ciphertext is generated.
[0123] It should be noted that during the data upload phase, for the fields in the target ciphertext that need to support query, hash summary technology is used to process each field to obtain the tag for each field. i Index Hash(tag i ), based on each index Hash(tag i), generates a corresponding index set, and uploads a four-tuple consisting of the target ciphertext, the index set, the first commitment, and the consistency proof information to the cloud database. In this embodiment, the indexes are generated using the same hash function, and the established indexes correspond to the supported query fields. This allows a small number of indexes to be precisely established based on demand, significantly reducing database storage space costs.
[0124] Correspondingly, when the user retrieves data, the target ciphertext's queried fields are processed using hash summary technology to generate a corresponding index, and a query request is initiated to the cloud database based on the index, so that the quadruple data of the target ciphertext in the cloud database can be retrieved based on the index and the data is returned to the user.
[0125] Through this embodiment, the to-be-queried field of the target ciphertext is processed by hash summary technology to obtain the corresponding index, and based on the index, a query request for the target ciphertext is generated, thereby protecting data privacy while achieving data acquisition.
[0126] The present embodiment is described and illustrated below through preferred embodiments.
[0127] Figure 6 Flowchart of the encrypted data verification method of the preferred embodiment is as follows: Figure 6 As shown, the encrypted data verification method includes the following steps:
[0128] Step S601: Based on all qualified computing nodes in a preset committee, a corresponding node set is constructed, and the private key fragments of each computing node in the node set are determined based on a threshold secret sharing algorithm.
[0129] Step S602: Determine the private key corresponding to each private key fragment, and encrypt the first plaintext data based on the public key corresponding to the private key to obtain a target ciphertext;
[0130] Step S603: Process the fields in the target ciphertext that need to be queried using hash digest technology to obtain an index for each field, and generate a corresponding index set based on each index;
[0131] Step S604: construct a first commitment corresponding to the first plaintext data, and construct consistency proof information based on the target ciphertext and the first commitment using a zero-knowledge proof algorithm based on the Sigma protocol;
[0132] Step S605: uploading the four-tuple consisting of the target ciphertext, the index set, the first commitment, and the consistency proof information to the cloud database;
[0133] Step S606: When the third-party authorizer of the data initiates a query on a field in the target ciphertext, the cloud database returns the four-tuple data containing the target ciphertext in response to the query request on the target ciphertext;
[0134] Step S607: Verify the consistency proof information in the returned data. If the verification succeeds, it indicates that the integrity of the target ciphertext has been successfully verified. If the verification fails, it indicates that the integrity of the target ciphertext has been destroyed.
[0135] Step S608: After the data integrity verification is successful, the returned target ciphertext is submitted to the preset committee, and the preset committee verifies the identity of the three-party authorizer;
[0136] Step S609: When the identity authentication of the three-party authorizer is successful, the target ciphertext is jointly decrypted based on the private key fragments of the multiple computing nodes participating in the decryption to obtain the second plaintext data;
[0137] Step S610, calculate the second commitment corresponding to the second plaintext data, compare the first commitment with the second commitment, if it is detected that the first commitment is equal to the second commitment, it indicates that the authenticity verification of the data is successful, otherwise it indicates that the authenticity of the data is destroyed.
[0138] Through this embodiment, a corresponding node set is constructed based on all verified qualified computing nodes in a preset committee. Based on the threshold secret sharing algorithm, the private key fragments of each computing node in the node set are determined, and the private key corresponding to each private key fragment is determined. The first plaintext data is encrypted based on the public key corresponding to the private key to obtain the target ciphertext. Next, the fields in the target ciphertext that need to support query are processed using hash summary technology to obtain an index for each field. A corresponding index set is generated based on each index, and a first commitment corresponding to the first plaintext data is constructed. Based on the target ciphertext and the first commitment, consistency proof information is constructed using a zero-knowledge proof algorithm based on the Sigma protocol. The four-tuple consisting of the target ciphertext, the index set, the first commitment, and the consistency proof information is uploaded to the cloud database.
[0139] Furthermore, when a third-party data authorizer initiates a query targeting a field in the target ciphertext, the cloud database responds to the query request by returning the four-tuple data containing the target ciphertext. The consistency proof information in the returned data is verified. If the verification succeeds, the integrity of the target ciphertext has been successfully verified. If the verification fails, the integrity of the target ciphertext has been compromised. This solves the problem of being unable to verify data integrity while ensuring the non-leakage of sensitive information, achieving data integrity verification without leaking sensitive information.
[0140] In addition, after the data integrity is successfully verified, the returned target ciphertext is submitted to the preset committee, which verifies the identity of the three authorized parties. If the three authorized parties are successfully authenticated, the target ciphertext is jointly decrypted based on the private key fragments of the multiple computing nodes participating in the decryption, obtaining the second plaintext data. The second commitment corresponding to the second plaintext data is calculated, and the first commitment is compared with the second commitment. If the first commitment and the second commitment are detected to be equal, the data authenticity verification is successful. Otherwise, it indicates that the data authenticity has been compromised. In this way, the data authenticity is verified through the secondary verification in the decryption stage.
[0141] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0142] In this embodiment, an encrypted data verification device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments. The terms "module", "unit", "sub-unit", etc. used below can be a combination of software and / or hardware that implements the predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0143] Figure 7 This is a structural block diagram of the encrypted data verification device of this embodiment. Figure 7 As shown, the device includes:
[0144] A query module 10 is configured to, in response to a query request for a target ciphertext, obtain the target ciphertext and associated information thereof from a cloud database; wherein the associated information includes consistency proof information, the consistency proof information being constructed based on the target ciphertext and a first commitment associated with the target ciphertext;
[0145] The verification module 20 is used to verify the consistency proof information in the associated information and obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext.
[0146] Through the device provided by this embodiment, in response to a query request for a target ciphertext, the target ciphertext and the associated information of the target ciphertext are obtained from the cloud database; wherein the associated information includes consistency proof information, and the consistency proof information is constructed based on the target ciphertext and the first commitment associated with the target ciphertext; the consistency proof information in the associated information is verified to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext, which solves the problem of being unable to complete data integrity verification while ensuring that sensitive information is not leaked, and realizes the completion of data integrity verification without leaking sensitive information.
[0147] In some of these embodiments, Figure 7 On the basis of, the device also includes a construction module for encrypting the first plaintext data to obtain a target ciphertext; determining a first commitment corresponding to the first plaintext data; and constructing consistency proof information through a zero-knowledge proof algorithm based on the target ciphertext and the first commitment.
[0148] In some of the embodiments, the above-mentioned construction module is also used to construct a corresponding node set based on all verified qualified computing nodes in a preset committee; determine the private key fragments of each computing node in the node set based on a threshold secret sharing algorithm; determine the private key corresponding to each private key fragment; and encrypt the first plaintext data based on the public key corresponding to the private key to obtain the target ciphertext.
[0149] In some embodiments, the verification module 20 is further used to decrypt the target ciphertext to obtain the corresponding second plaintext data; determine the second commitment corresponding to the second plaintext data; compare the first commitment with the second commitment to obtain a corresponding comparison result; and the comparison result is used to indicate the authenticity verification result of the target ciphertext.
[0150] In some of these embodiments, Figure 7 On the basis of, the device also includes a decryption module for obtaining a private key held by the data uploader; decrypting the target ciphertext based on the private key to obtain the second plaintext data.
[0151] In some of these embodiments, Figure 7 On the basis of, the device also includes a decryption module for verifying the identity of the three-party authorizer through each computing node in the preset committee in response to submitting the target ciphertext to the preset committee; when the identity authentication of the three-party authorizer is successful, the target ciphertext is jointly decrypted based on the private key fragments of multiple computing nodes participating in the decryption to obtain the second plaintext data.
[0152] In some of these embodiments, Figure 7On the basis of, the device also includes a generation module for processing the to-be-queried field of the target ciphertext through hash summary technology to obtain a corresponding index; based on the index, a query request for the target ciphertext is generated.
[0153] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0154] This embodiment further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0155] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0156] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0157] S1, in response to a query request for a target ciphertext, obtaining the target ciphertext and associated information thereof from a cloud database; wherein the associated information includes consistency proof information, the consistency proof information being constructed based on the target ciphertext and a first commitment associated with the target ciphertext;
[0158] S2, verify the consistency proof information in the associated information to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext.
[0159] It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0160] In addition, in conjunction with the encrypted data verification method provided in the above embodiments, a storage medium may also be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the encrypted data verification methods in the above embodiments is implemented.
[0161] It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0162] Obviously, the accompanying drawings are merely examples or embodiments of the present application. A person skilled in the art can also apply the present application to other similar situations based on these drawings without inventive effort. Furthermore, it is understandable that, although the work involved in this development process may be complex and lengthy, certain design, manufacturing, or production changes based on the technical content disclosed in this application are merely routine technical means for a person skilled in the art and should not be considered to constitute a deficiency in the disclosure of the present application.
[0163] The term "embodiment" as used in this application refers to specific features, structures, or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily mean that the embodiment is the same, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is understood, either explicitly or implicitly, by those skilled in the art that the embodiments described in this application can be combined with other embodiments when there is no conflict.
[0164] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for verifying encrypted data, characterized in that: The method comprises: In response to a query request for a target ciphertext, obtaining the target ciphertext and associated information thereof from a cloud database; wherein the associated information includes consistency proof information, the consistency proof information being constructed based on the target ciphertext and a first commitment associated with the target ciphertext; The consistency proof information in the association information is verified to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext.
2. The encrypted data verification method according to claim 1, wherein: Constructing the consistency proof information includes: Encrypting the first plaintext data to obtain the target ciphertext; Determining the first commitment corresponding to the first plaintext data; Based on the target ciphertext and the first commitment, the consistency proof information is constructed using a zero-knowledge proof algorithm.
3. The encrypted data verification method according to claim 2, wherein: The encrypting the first plaintext data to obtain the target ciphertext includes: Build a corresponding node set based on all qualified computing nodes in the preset committee; Determining, based on a threshold secret sharing algorithm, a private key fragment of each computing node in the node set; Determining a private key corresponding to each of the private key fragments; The first plaintext data is encrypted based on the public key corresponding to the private key to obtain the target ciphertext.
4. The encrypted data verification method according to claim 1, wherein: If the verification result indicates that the integrity verification of the target ciphertext is successful, the method further includes: Decrypting the target ciphertext to obtain corresponding second plaintext data; Determining a second commitment corresponding to the second plaintext data; The first commitment is compared with the second commitment to obtain a corresponding comparison result; the comparison result is used to indicate the authenticity verification result of the target ciphertext.
5. The encrypted data verification method according to claim 4, characterized in that: The query request is initiated by the data uploader of the target ciphertext, and the decryption of the target ciphertext to obtain the corresponding second plaintext data includes: Obtaining the private key held by the data uploader; The target ciphertext is decrypted based on the private key to obtain the second plaintext data.
6. The encrypted data verification method according to claim 4, characterized in that: The query request is initiated by a third-party authorized person of the target ciphertext, and the target ciphertext is decrypted to obtain the corresponding second plaintext data, including: In response to submitting the target ciphertext to a preset committee, verifying the identities of the three-party authorizers through each computing node in the preset committee; When the identity authentication of the three-party authorizer is successful, the target ciphertext is jointly decrypted based on the private key fragments of the multiple computing nodes participating in the decryption to obtain the second plaintext data.
7. The encrypted data verification method according to claim 1, wherein: Generating a query request for the target ciphertext, including: Processing the target ciphertext's query field using hash digest technology to obtain a corresponding index; Based on the index, the query request for the target ciphertext is generated.
8. An encrypted data verification device, characterized in that: The device comprises: a query module, configured to, in response to a query request for a target ciphertext, obtain the target ciphertext and associated information thereof from a cloud database; wherein the associated information includes consistency proof information, the consistency proof information being constructed based on the target ciphertext and a first commitment associated with the target ciphertext; A verification module is used to verify the consistency proof information in the association information to obtain a corresponding verification result; the verification result is used to indicate the integrity verification result of the target ciphertext.
9. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps of the encrypted data verification method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the encrypted data verification method according to any one of claims 1 to 7 are implemented.