A method for supporting privacy protection of multi-party data sharing, ciphertext storage and ciphertext retrieval
By employing hash mapping and random parameter encryption technologies, privacy protection is achieved for multi-party data sharing, ensuring secure storage and encrypted retrieval of data on public cloud servers, and protecting the privacy and security of data providers and users.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2026-06-23
AI Technical Summary
How can we ensure secure data storage while enabling data users to retrieve data securely in encrypted form, and protect the privacy of both data providers and users?
Hash bit strings are generated through hash mapping, plaintext data is symmetrically encrypted, data is encrypted and stored using a random key, and decrypted using a key matrix with random parameters and public/private key pairs. This ensures that data users can only obtain the specified data results, while data providers cannot obtain the data users' retrieval information.
This allows data providers to securely store data on public cloud servers while data users can securely retrieve the data, ensuring the privacy of both parties and preventing data providers from obtaining the data users' retrieval information.
Smart Images

Figure CN121036953B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and more specifically to a method for encrypted storage and retrieval that supports privacy protection in multi-party data sharing. Background Technology
[0002] Currently, with the rapid development of the digital economy, the value of data as a key production factor is becoming increasingly prominent, deeply promoting the transformation of traditional industries to the digital economy and rapidly integrating into various fields such as production, R&D, and consumption. However, as data elements become increasingly important, how to ensure the secure flow of data elements has become a growing concern for researchers. If data security is not guaranteed, data flow will become increasingly difficult, seriously hindering the development of the digital economy. The explosive growth of data has also put severe pressure on users' storage resources. More and more users are considering storing encrypted data elements on cloud servers to reduce their storage costs. However, traditional encrypted storage is not suitable for scenarios involving the flow of data elements. Therefore, how to ensure the secure storage of user data while simultaneously enabling secure retrieval by other users in encrypted form is a crucial issue.
[0003] In the process of data circulation, it is necessary not only to protect the privacy and security of data providers, but also to protect the search privacy of data users.
[0004] Therefore, how to protect the data security of data providers and users during the circulation of data elements is an urgent problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method for encrypted storage and encrypted retrieval that supports privacy protection for multi-party data sharing. While ensuring that the data provider's data is securely stored in a public cloud server, it also supports privacy protection for the search keywords of the data user.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A method for encrypted storage and retrieval that supports privacy protection in multi-party data sharing includes the following steps:
[0008] Step 1: The data provider performs hash mapping on the original plaintext data to generate a hash bit string, and selects a key from the generated random key pair according to the hash bit string to symmetrically encrypt the original plaintext data, obtaining a ciphertext data pair and sending it to the cloud server.
[0009] Step 2: The data user performs hash mapping on the data to be retrieved to generate the bit string to be retrieved, and sends it to the cloud server;
[0010] Step 3: The cloud server finds the corresponding ciphertext data pair based on the bit string to be retrieved, obtains the queried ciphertext data pair, and sends it back to the data user;
[0011] Step 4: The data user generates a key request and sends it to the data provider;
[0012] Step 5: The data provider generates random parameters based on the key request, calculates the intermediate parameter ciphertext using the random parameters, and sends it to the data user;
[0013] Step 6: The data user constructs an encryption key matrix based on the intermediate parameter ciphertext and sends it to the data provider;
[0014] Step 7: The data provider decrypts the encryption key matrix according to the random parameters to obtain the decryption key matrix, and generates the key ciphertext based on the decryption key matrix;
[0015] Step 8: The data user decrypts the key ciphertext according to the bit string to be retrieved, obtains the final key, and decrypts the ciphertext data pair returned by the cloud server to obtain the original plaintext data corresponding to the data to be retrieved.
[0016] Preferably, the original plaintext data is in the following format: ,in, For keyword indexing, For specific data.
[0017] Preferably, the specific process of step 1 is as follows:
[0018] Step 11: The data provider uses a hash function to map all keyword indices in the original plaintext data into several sets of hash bit strings of length n. 'm' represents the total number of data entries, and each data entry's keyword index corresponds to a hash bit string. ;
[0019] Step 12: The data provider uses a random number generator to generate n pairs of random key pairs. The random number generator can be equipped with a Hardware Security Module (HSM) and a dedicated cryptographic card.
[0020] Step 13: Based on the hash bit string corresponding to each data, select n calculation keys from n pairs of random key pairs, XOR the n calculation keys to obtain the final key corresponding to each data. Repeat this step for all bit strings to obtain their respective final keys, and finally obtain m final keys.
[0021] Step 14: Perform symmetric encryption on each piece of data in the original plaintext data using the final key to obtain ciphertext C. , This represents the ciphertext corresponding to the ith data item, and Enc represents the encryption function. This represents the i-th final key corresponding to the i-th data item. Each data item is encrypted using its corresponding final key.
[0022] Step 15: Construct ciphertext data pairs based on the hash bit string mapped by the keyword index and the ciphertext. And send all encrypted data pairs to the cloud server.
[0023] Preferably, the specific process of step 13 is as follows:
[0024] Step 131: Traverse each element in each hash bit string and select a corresponding random key pair based on the element's position in the hash bit string;
[0025] Step 132: Based on the value of each element in the hash bit string, select the corresponding random key from the selected random key pair as the calculation key, and filter out n calculation keys from each hash bit string;
[0026] Step 133: XOR the n computation keys to obtain the final key corresponding to each hash bit string.
[0027] Preferably, the data to be retrieved by the data user is the index of keywords to be retrieved. In step 2, the data user uses the same hash function as the data provider to retrieve the index of keywords to be retrieved. Perform hash mapping to obtain the bit string to be retrieved. Based on the bit string to be retrieved A query request is generated and sent to the cloud server.
[0028] Preferably, the cloud server retrieves the bit string to be searched from the query request. Find the corresponding ciphertext data pair. , > and provide feedback to the data user.
[0029] Preferably, the specific process of step 4 is as follows:
[0030] Step 41: The data user generates a A random matrix A of size , and using the column vectors of each column of random matrix A with the bit string to be retrieved. Performing an XOR operation yields a new key matrix B, where the column vector b of the i-th column of key matrix B is... i =a i ⊕ a i Let be the column vector of the i-th column in the random matrix A;
[0031] Step 42: The data user generates s pairs of public and private keys {pk1, sk1, ..., pk}. s ,sk s}, and s for the first random number pair {x} 1,0 ,x 1,1 ,.....x s,0 ,x s,1}, pk s Let sk represent the public key in the s-th public-private key pair. s Let x represent the private key in the s-th public-private key pair. s,0 Let x represent the first random number in the s-th pair of first random numbers. s,1 This represents the second first random number in the s-th pair of first random numbers;
[0032] Step 43: Combine the public and private key pair with the first random number pair to form a key request and send it to the data provider.
[0033] Preferably, the specific process of step 5 is as follows:
[0034] Step 51: After receiving the key request, the data provider generates a random 0-1 vector r of length s, and s second random numbers { };
[0035] Step 52: The data provider uses the public key from the public-private key pair and the first random number pair to encrypt each of the second random numbers, obtaining the intermediate parameter ciphertext. All intermediate parameter ciphertexts R = (R1, R2, ... R... s Send to the data user; the intermediate parameters are represented in encrypted form as follows:
[0036] ;
[0037] The ciphertext represents the i-th intermediate parameter; Enc represents the encryption function; pk i This represents the public key in the i-th public-private key pair; This represents the i-th second random number; Represents the r-th element in the i-th pair of the first random number pair. i +1 first random number, r i This represents the i-th value in a random 0-1 vector r.
[0038] Preferably, the specific process of step 6 is as follows:
[0039] Step 61: The data user uses the private key from the public-private key pair to decrypt the intermediate parameter ciphertext sequentially, generating an encryption key pair; the encryption key pair is represented as:
[0040] ;
[0041] ;
[0042] in, This represents the first encryption key in the encryption key pair; Dec represents the decryption function; sk i This represents the private key in the i-th public-private key pair; This represents the ciphertext of the i-th intermediate parameter; This represents the first random number in the i-th pair of first random number pairs; This represents the second encryption key in the encryption key pair; This represents the second first random number in the i-th pair of first random number pairs;
[0043] Step 62: Encrypt the column vectors of random matrix A using the first encryption key, and encrypt the column vectors of key matrix B using the second encryption key, obtaining two sets of encryption key matrices, and send them to the data provider. (Random matrix A is encrypted to obtain the encryption key matrices.) The encryption key matrix is obtained by encrypting key matrix B. .
[0044] Preferably, the specific process of step 7 is as follows:
[0045] Step 71: The data provider decrypts the two sets of encryption key matrices sent by the data user based on the random 0-1 vector r, and obtains the decryption key matrix Q;
[0046] Step 72: The data provider XORs each row vector of the decryption key matrix Q with a random 0-1 vector r to obtain a new decryption key matrix Q'; where the row vector of the j-th row of the new decryption key matrix Q' is... , Let Q' be the row vector of the j-th row of the decryption key matrix Q. Both Q and Q' are... Matrix;
[0047] Step 73: Use the row vectors of matrices Q and Q' as inputs to the hash function to obtain n pairs of matrix key pairs, i.e., H(q j ) and H(q j ⊕r);
[0048] Step 74: Use n matrix key pairs to apply the n random key pairs stored locally. Encryption is performed to obtain n pairs of key ciphertexts.
[0049] Preferably, the specific process of step 71 is as follows:
[0050] Iterate through all elements of the random 0-1 vector r. If the value of the i-th element is 0, then use the i-th second random number d. iThe encryption key matrix corresponding to the decryption of random matrix A The i-th column vector is used to obtain the i-th column vector a of the random matrix A. i If the value of the i-th element is 1, then the i-th second random number d is used. i The encryption key matrix corresponding to decryption key matrix B The i-th column vector is used to obtain the i-th column vector b of the random matrix B. i All the decrypted column vectors form a brand new decryption key matrix Q.
[0051] Since the data provider calculates the intermediate parameter ciphertext R based on the second random number and the first random number selected using a random 0-1 vector r, and the data user cannot deduce the other key solely from the intermediate parameter ciphertext R, the data user uses the first random number to decrypt the intermediate parameter ciphertext, generating M. i,0 Or M i,1 Only one of them equals the second random number d. Which one equals d depends on the choice of the first random number x when calculating R. Only the data provider knows which one equals d. The other tends towards a random value, which the data provider cannot know. Therefore, when the data user uses M... i,0 and M i,1 Encryption can be understood as using d and a random value to encrypt the column vectors of matrices A and B respectively, and then sending the encrypted data to the data provider. The data provider possesses d and knows that d is M. i,0 Or M i,1 That is, the first r of r i The value is 0, M i,0 =d i The data provider can obtain a i Conversely, M i,1 =d i The data provider can only use the decryption key d i Decryption yields column vector b of key matrix B. i ;For example:
[0052] The process by which the data user decrypts the first piece of ciphertext data is as follows:
[0053] If the first value of r1 is 0, then the value of R1 is... Meanwhile, the encryption key matrix of the data user. column vectors and encryption key matrix column vectors The encryption key pair used is and That is, M 1,0 =d1, then The data provider only owns M 1,0 =d1, therefore the data provider can only use the decryption key d1 to decrypt and obtain the column vector a of the random matrix A. 1 ;
[0054] If the first value of r1 is 1, then the value of R1 is... Meanwhile, the encryption key matrix of the data user. column vector a 1 and encryption key matrix column vector b 1 The encryption key pair used is and ;Right now Then M 1,1 =d1, the data provider only owns M 1,1 =d1, therefore the data provider can only use the decryption key d1 to decrypt and obtain the column vector b of the key matrix B. 1 ;
[0055] By repeating the above process s times, the data provider can obtain a new n. The s matrix is denoted as the decryption key matrix Q, where the column vectors q of Q are... i For r i ⊕a i , that is, r i When q is 0, i =a i ,r i When q is 1, i = ⊕a i The row vector of Q is q. j = r⊕a j ,in, for The j-th position, a j Let A be the vector of the j-th row of matrix A, i.e. When q is 0, j =a j , When q is 1, j =r⊕a j .
[0056] Preferably, the specific process of step 8 is as follows:
[0057] Step 81: The data user retrieves the bit string according to the data. Decrypt each key ciphertext pair sequentially using the row vectors of random matrix A to obtain the corresponding final key; iterate through the bit string to be searched. For each element, decrypt a pair of key ciphertexts according to the position of each element. If the value of the element is 0, decrypt the first key ciphertext in the key ciphertext. If the value of the element is 1, decrypt the second key ciphertext in the key ciphertext. Then, use the row vectors of the random matrix A to perform hash calculations to decrypt one of the key ciphertexts in the pair of key ciphertexts to obtain the corresponding random key. Finally, XOR the n decrypted random keys to obtain the final key.
[0058] After performing hash calculation using the row vector of the i-th row of the random matrix A, the i-th key in the ciphertext is decrypted. Take a ciphertext, obtain the corresponding random key, and then XOR the n decrypted random keys to obtain the final key;
[0059] From the above calculation process of the decryption key matrix Q, it can be seen that if the bit string to be retrieved... With the first bit set to 0, we can obtain the row vector q1 = a1 in the first row of Q, where a1 represents the row vector of the first row of the random matrix A. This means the data user can calculate H(q1). However, since r is unique to the data provider, the data user can only decrypt the first random key in the first pair of key ciphertexts. ;
[0060] If the bit string to be retrieved Since the first bit is 1, we can obtain the row vector q1 = r ⊕ a1 in the first row of Q. Since q1 ⊕ r = a1, the data user can calculate H(q1 ⊕ r) = H(a1), but cannot calculate H(q1) = H(a1 ⊕ r). Therefore, the data user can only decrypt the second random key in the first pair of key ciphertexts. ;
[0061] The bit strings to be searched are processed sequentially. Performing this step on n bits will yield the bit string to be retrieved. The corresponding n random keys are XORed to obtain the final key corresponding to this data. ;
[0062] Step 82: The data user uses the decrypted final key. For querying encrypted data pairs , The ciphertext in Decryption is performed to obtain the corresponding original plaintext data. Meanwhile, the data user can verify the decrypted data. Used for querying itself If the data matches, the decryption is successful; otherwise, an alarm is triggered to ensure the accuracy of the queried data.
[0063] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a method for encrypted storage and encrypted retrieval that supports privacy protection for multi-party data sharing. Data providers can securely encrypt and store their own data on a public cloud server, while data users can securely perform encrypted retrieval on the cloud server. The present invention ensures that data users can only obtain the specified data results, while data providers cannot obtain which specific data the data user is retrieving, thus ensuring the privacy and security of all participating parties. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0065] Figure 1 A schematic diagram of the encrypted storage and retrieval method for supporting privacy protection in multi-party data sharing provided by the present invention;
[0066] Figure 2 This is a schematic diagram of data transmission provided by the present invention;
[0067] Figure 3 This is a schematic diagram of keyword index conversion provided by the present invention;
[0068] Figure 4 This is a schematic diagram of the encrypted data provided by the data provider in this invention. Detailed Implementation
[0069] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0070] This invention discloses a method for encrypted storage and retrieval that supports privacy protection in multi-party data sharing, such as... Figure 1-2 As shown, this system enables data transmission between the data provider, data user, and cloud server. All data provided by the data provider is encrypted, the cloud server provides storage and computing services, and the data user retrieves the encrypted ciphertext. The system includes the following steps:
[0071] Step 1: The data provider performs hash mapping on the original plaintext data to generate a hash bit string, and selects a key from the generated random key pair according to the hash bit string to symmetrically encrypt the original plaintext data, obtaining a ciphertext data pair and sending it to the cloud server.
[0072] Step 2: The data user performs hash mapping on the data to be retrieved to generate the bit string to be retrieved, and sends it to the cloud server;
[0073] Step 3: The cloud server finds the corresponding ciphertext data pair based on the bit string to be retrieved, obtains the queried ciphertext data pair, and sends it back to the data user;
[0074] Step 4: The data user generates a key request and sends it to the data provider;
[0075] Step 5: The data provider generates random parameters based on the key request, calculates the intermediate parameter ciphertext using the random parameters, and sends it to the data user;
[0076] Step 6: The data user constructs an encryption key matrix based on the intermediate parameter ciphertext and sends it to the data provider;
[0077] Step 7: The data provider decrypts the encryption key matrix according to the random parameters to obtain the decryption key matrix, and generates the key ciphertext based on the decryption key matrix;
[0078] Step 8: The data user decrypts the key ciphertext based on the bit string to be retrieved to obtain the final key, and decrypts the query ciphertext data pair returned by the cloud server to obtain the original plaintext data corresponding to the data to be retrieved.
[0079] Furthermore, the original plaintext data is in the form of ,in, For keyword indexing, For specific data.
[0080] Furthermore, the specific process of step 1 is as follows:
[0081] Step 11: The data provider uses a hash function to map all keyword indices in the original plaintext data into several sets of hash bit strings of length n. m represents the total number of data entries, and each data entry's keyword index corresponds to a hash bit string;
[0082] Step 12: The data provider uses a random number generator to generate n pairs of random key pairs. The random number generator can be equipped with a Hardware Security Module (HSM) and a dedicated cryptographic card.
[0083] Step 13: Based on each hash bit string corresponding to each data, select n calculation keys from n pairs of random key pairs, XOR the n calculation keys to obtain the final key corresponding to each data. Repeat this step for all bit strings to obtain their respective final keys, and finally obtain m final keys.
[0084] Step 131: Traverse each element in each hash bit string and select a corresponding random key pair based on the element's position in the hash bit string;
[0085] Step 132: Based on the value of each element in the hash bit string, select the corresponding random key from the selected random key pair as the calculation key, and filter out n calculation keys from each hash bit string;
[0086] Step 133: XOR the n computation keys to obtain the final key corresponding to each hash bit string;
[0087] Keyword index of the first data entry The mapped bit string is It is a hash bit string (01 bit string) of length n, if If the first digit is 0, then select... As the first calculation key If this bit is 1, then select As the first calculation key And so on, according to The i-th position, from Select the i-th computation key Finally, select n computation keys, and XOR the n computation keys to obtain the final key corresponding to the first data. ;
[0088] Step 14: Perform symmetric encryption on each piece of data in the original plaintext data using the final key to obtain ciphertext C. , This represents the ciphertext corresponding to the ith data item, and Enc represents the encryption function. This represents the i-th final key corresponding to the i-th data item. Each data item is encrypted using its corresponding final key.
[0089] Step 15: Based on the hash bit string mapped by the keyword index Construct ciphertext data pairs using ciphertext and ciphertext. , > and send all encrypted data pairs to the cloud server.
[0090] Furthermore, the data to be retrieved by the data user is the index of the keywords to be retrieved. In step 2, the data user uses the same hash function as the data provider to retrieve the index of the keywords to be retrieved. Perform hash mapping to obtain the bit string to be retrieved. Based on the bit string to be retrieved A query request is generated and sent to the cloud server.
[0091] Furthermore, the cloud server retrieves the bit string to be searched from the query request. Find the corresponding ciphertext data pair. , > and provide feedback to the data user.
[0092] Furthermore, the data user receives the encrypted data pair. , The data provider then sends a key request in hopes of obtaining the decryption key. The final key The decryption request does not contain any information about the ciphertext data pair. , > Any information, and does not want the data provider to obtain a single piece of data queried by the data user.
[0093] Furthermore, the specific process of step 4 is as follows:
[0094] Step 41: The data user generates an n A random matrix A of size s, and the column vectors of each column of random matrix A are used to retrieve the bit string. Performing an XOR operation yields a new key matrix B, where the column vector b of the i-th column of key matrix B is... i =a i ⊕ a i Let be the column vector of the i-th column in the random matrix A;
[0095] Step 42: The data user generates s pairs of public and private keys {pk1, sk1, ..., pk}. s ,sk s}, and s for the first random number pair {x} 1,0 ,x 1,1 ,.....x s,0 ,x s,1}, pk s Let sk represent the public key in the s-th public-private key pair. s Let x represent the private key in the s-th public-private key pair. s,0 Let x represent the first random number in the s-th pair of first random numbers. s,1 This represents the second first random number in the s-th pair of first random numbers;
[0096] Step 43: Combine the public and private key pair with the first random number pair to form a key request and send it to the data provider.
[0097] Furthermore, the specific process of step 5 is as follows:
[0098] Step 51: After receiving the key request, the data provider generates a random 0-1 vector r of length s, and s second random numbers { };
[0099] Step 52: The data provider uses the public key from the public-private key pair and the first random number pair to encrypt each of the second random numbers, obtaining the intermediate parameter ciphertext. All intermediate parameter ciphertexts R = (R1, R2, ... R... s Send to the data user; the intermediate parameters are represented in encrypted form as follows:
[0100] ,
[0101] pk represents the ciphertext of the i-th intermediate parameter. i This represents the public key in the i-th public-private key pair. This represents the i-th second random number. Represents the r-th element in the i-th pair of the first random number pair. i +1 first random number, r i This represents the i-th value in a random 0-1 vector r.
[0102] Furthermore, the specific process of step 6 is as follows:
[0103] Step 61: The data user uses the private key from the public-private key pair to decrypt the intermediate parameter ciphertext sequentially, generating an encryption key pair;
[0104] The encryption key pair is represented as:
[0105] ;
[0106] ;
[0107] in, This represents the first encryption key in the encryption key pair, Dec represents the decryption function, and sk represents the first encryption key. i This represents the private key in the i-th public-private key pair; This represents the ciphertext of the i-th intermediate parameter. This represents the first random number in the i-th pair of first random number pairs; This represents the second encryption key in the encryption key pair; This represents the second first random number in the i-th pair of first random number pairs;
[0108] Step 62: Encrypt the column vectors of random matrix A using the first encryption key, and encrypt the column vectors of key matrix B using the second encryption key, obtaining two sets of encryption key matrices, and send them to the data provider. (Random matrix A is encrypted to obtain the encryption key matrices.) The encryption key matrix is obtained by encrypting key matrix B. .
[0109] Furthermore, the specific process of step 7 is as follows:
[0110] Step 71: The data provider decrypts the two sets of encryption key matrices sent by the data user based on the random 0-1 vector r, and obtains the decryption key matrix Q;
[0111] Iterate through all elements of the random 0-1 vector r. If the value of the i-th element is 0, then use the i-th second random number d. i The encryption key matrix corresponding to the decryption of random matrix A The i-th column vector is used to obtain the i-th column vector a of the random matrix A. i If the value of the i-th element is 1, then the i-th second random number d is used. i The encryption key matrix corresponding to decryption key matrix B The i-th column vector is used to obtain the i-th column vector b of the random matrix B. i All the decrypted column vectors form a brand new decryption key matrix Q;
[0112] Since the data provider calculates the intermediate parameter ciphertext R based on the second random number and the first random number selected using a random 0-1 vector r, and the data user cannot deduce the other key solely from the intermediate parameter ciphertext R, the data user uses the first random number to decrypt the intermediate parameter ciphertext, generating M. i,0 Or M i,1 Only one of them equals the second random number d. Which one equals d depends on the choice of the first random number x when calculating R. Only the data provider knows which one equals d. The other tends towards a random value, which the data provider cannot know. Therefore, when the data user uses M... i,0 and M i,1 Encryption can be understood as using d and a random value to encrypt the column vectors of matrices A and B respectively, and then sending the encrypted data to the data provider. The data provider possesses d and knows that d is M. i,0 Or M i,1 That is, the first r of r i The value is 0, M i,0 =d i The data provider can obtain a i Conversely, Mi,1 =d i The data provider can only use the decryption key d i Decryption yields column vector b of key matrix B. i ;For example:
[0113] The process by which the data user decrypts the first piece of ciphertext data is as follows:
[0114] If the first value of r1 is 0, then the value of R1 is... Meanwhile, the encryption key matrix of the data user. column vectors and encryption key matrix column vectors The encryption key pair used is and That is, M 1,0 =d1, then The data provider only owns M 1,0 =d1, therefore the data provider can only use the decryption key d1 to decrypt and obtain the column vector a of the random matrix A. 1 ;
[0115] If the first value of r1 is 1, then the value of R1 is... Meanwhile, the encryption key matrix of the data user. column vector a 1 and encryption key matrix column vector b 1 The encryption key pair used is and ;Right now Then M 1,1 =d1, the data provider only owns M 1,1 =d1, therefore the data provider can only use the decryption key d1 to decrypt and obtain the column vector b of the key matrix B. 1 ;
[0116] By repeating the above process s times, the data provider can obtain a new n. The s matrix is denoted as the decryption key matrix Q, where the column vectors q of Q are... i For r i ⊕a i , that is, r i When q is 0, i =a i ,r i When q is 1, i = ⊕a i The row vector of Q is q. j = r⊕a j ,in, for The j-th position, a j Let A be the vector of the j-th row of matrix A, i.e. When q is 0, j =a j , When q is 1, j =r⊕a j ;
[0117] Step 72: The data provider XORs each row vector of the decryption key matrix Q with a random 0-1 vector r to obtain a new decryption key matrix Q'; where the row vector of the j-th row of Q' is... , Let Q' be the row vector of the j-th row of matrix Q. Both matrices Q and Q' are n. The matrix of s;
[0118] Step 73: Use the row vectors of matrices Q and Q' as inputs to the hash function to obtain n pairs of matrix key pairs, i.e., H(q j ) and H(q j ⊕r);
[0119] Step 74: Use n matrix key pairs to apply the n random key pairs stored locally. Encryption is performed to obtain n pairs of key ciphertexts.
[0120] Furthermore, the specific process of step 8 is as follows:
[0121] Step 81: The data user retrieves the bit string according to the data. Decrypt each key ciphertext pair sequentially using the row vectors of random matrix A to obtain the corresponding final key; iterate through the bit string to be searched. For each element, decrypt a pair of key ciphertexts according to the position of each element. If the value of the element is 0, decrypt the first key ciphertext in the key ciphertext. If the value of the element is 1, decrypt the second key ciphertext in the key ciphertext. Then, use the row vectors of the random matrix A to perform hash calculations to decrypt one of the key ciphertexts in the pair of key ciphertexts to obtain the corresponding random key. Finally, XOR the n decrypted random keys to obtain the final key.
[0122] After performing hash calculation using the row vector of the i-th row of the random matrix A, the i-th key in the ciphertext is decrypted. From the encrypted text, obtain the corresponding random key;
[0123] From the above calculation process of the decryption key matrix Q, it can be seen that if the bit string to be retrieved... With the first bit set to 0, we can obtain the row vector q1 = a1 in the first row of Q, where a1 represents the row vector of the first row of the random matrix A. This means the data user can calculate H(q1). However, since r is unique to the data provider, the data user can only decrypt the first random key in the first pair of key ciphertexts. ;
[0124] If the bit string to be retrieved Since the first bit is 1, we can obtain the row vector q1 = r ⊕ a1 in the first row of Q. Since q1 ⊕ r = a1, the data user can calculate H(q1 ⊕ r) = H(a1), but cannot calculate H(q1) = H(a1 ⊕ r). Therefore, the data user can only decrypt the second random key in the first pair of key ciphertexts. ;
[0125] The bit strings to be searched are processed sequentially. Performing this step on n bits will yield the bit string to be retrieved. The corresponding n random keys are XORed to obtain the final key corresponding to this data. ;
[0126] Step 82: The data user uses the decrypted final key. For querying encrypted data pairs , The ciphertext in Decryption is performed to obtain the corresponding original plaintext data. Meanwhile, the data user can verify the decrypted data. Used for querying itself Consistency is used to ensure the correctness of the queried data.
[0127] In one specific embodiment, the process of encrypted storage and retrieval by the data provider, data user, and cloud server is as follows:
[0128] S1: The data provider has 5 data entries, such as... Figure 3 As shown, each piece of data has its own keyword index. The data provider first indexes the keywords of these five pieces of data. Use a hash function to map to a string of a specified length, l = Hash(key); all l's need to be represented in binary. For example, l1 in binary is 100100011011001000000101111010001001101010111101110110011101010011100010010110100011001010110100101 00010101101001110100011101001101000000100001110101011100001100100010010110000011001001111001100001001100100101110001001011110100010000001101.
[0129] S2: The data provider needs to construct and store 256 pairs of random keys, denoted as... Since the length of l is 256, 256 pairs of random keys are constructed. Taking l1 as an example, the first bit of l1 is 1, starting from the first pair of random keys. Select Record The second bit of l1 is 0, starting from the second pair of random keys. Select , recorded as Similarly, 256 keys are selected for l1; XORing the selected 256 keys yields the final encryption key for the first data. This method allows the data provider to construct a corresponding encryption key for each piece of data based on l.
[0130] S3: The data provider encrypts all data using its own data encryption key; the ciphertext is denoted as C= ,like Figure 4 As shown; after encryption, the data provider will<l,C> Send it to the cloud server for storage.
[0131] S4: The data user possesses the keyword index key1; the data user first uses a hash function to map key1 to l1, and then sends l1 to the cloud server; the cloud server queries the corresponding ciphertext based on l1.<l1,C1> And return it to the data user.
[0132] S5: The data user generates a random matrix A of size 256×128, and XORs each column of matrix A with the bit string l1 to obtain a new matrix B, where each column b of B... i All are a i ⊕l1(ai (For the i-th column of A); the data user generates 128 pairs of public and private keys {pk1, sk1, ..., pk...} 128 ,sk 128}, and 128 pairs of random numbers {x 1,0 ,x 1,1 ,.....x 128,0 ,x 128,1 The data user sends a key request to the data provider based on the generated public and private keys and a random number.
[0133] S6: After receiving the decryption request from the data user, the data provider generates a random 0-1 vector r of length 128, and 128 random numbers { };
[0134] Data providers use public key PK i , calculate ciphertext , where r i Let r be the i-th element of a random 0-1 vector; after calculation, the data provider will assign all R(R1, R2, ..., R...) to the i-th element. 128 (Send to the data user.)
[0135] S7: Data users use the private key sk i Decrypt and calculate sequentially and ,use and As the i-th encryption key, it is used to encrypt the column vectors a of matrices A and B respectively. i and b i Encrypt the data and send it to the data provider.
[0136] S8: The data provider selects the information to decrypt based on a random 0-1 vector r of length 128. The data provider then obtains a new 256... 128 matrix Q;
[0137] The data provider XORs each row of matrix Q with a random 0-1 vector r of length 128 to obtain a new matrix Q', where each row of Q'... ; Both matrices Q and Q' are n Given a matrix s, the data provider uses the row vectors of matrices Q and Q' as inputs to a hash function to obtain n pairs of keys, i.e., H(q j ) and H(q j (⊕r); The data provider uses these n key pairs to store 256 pairs of random keys locally. Encrypt it.
[0138] S9: Data users determine the hash bit string. We use matrix A to decrypt the corresponding key, and use the row vectors of matrix A to decrypt the i-th pair of ciphertexts sequentially. The ciphertext is used to obtain the corresponding key; bit string Since the first bit is 1, we can get q1 = r ⊕ a1. Therefore, the data user can calculate H(q1 ⊕ r) = H(a1). Thus, the data user can only decrypt the second key in the first ciphertext pair. ;
[0139] sequentially on the bit string Performing this step on the 256-bit data will yield the bit string. The corresponding 256 keys can be XORed to obtain the final key corresponding to this data. ;
[0140] Data users use keys For encrypted data Decrypt to obtain the corresponding plaintext. The data user verifies and decrypts the data. Used for querying itself If they match, obtain the final result and complete data sharing.
[0141] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0142] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for encrypted storage and retrieval that supports privacy protection in multi-party data sharing, characterized in that, Includes the following steps: Step 1: The data provider performs hash mapping on the original plaintext data to generate a hash bit string, and selects a key from the generated random key pair according to the hash bit string to symmetrically encrypt the original plaintext data, obtaining a ciphertext data pair and sending it to the cloud server. Step 2: The data user performs hash mapping on the data to be retrieved to generate the bit string to be retrieved, and sends it to the cloud server; Step 3: The cloud server finds the corresponding ciphertext data pair based on the bit string to be retrieved, obtains the queried ciphertext data pair, and sends it back to the data user; Step 4: The data user generates a key request and sends it to the data provider; Step 5: The data provider generates random parameters based on the key request, calculates the intermediate parameter ciphertext using the random parameters, and sends it to the data user; Step 6: The data user constructs an encryption key matrix based on the intermediate parameter ciphertext and sends it to the data provider; Step 7: The data provider decrypts the encryption key matrix according to the random parameters to obtain the decryption key matrix, generates the key ciphertext based on the decryption key matrix, and sends it to the data user; Step 8: The data user decrypts the key ciphertext according to the bit string to be retrieved, obtains the final key, and decrypts the query ciphertext data pair returned by the cloud server to obtain the original plaintext data corresponding to the data to be retrieved. The original plaintext data is in the form of<key,value> Where key is keyword index and value is actual data; the specific process of step 1 is as follows: Step 11: The data provider uses a hash function to map all keyword indices in the original plaintext data into several sets of hash bit strings of length n. 'm' represents the total number of data entries, and each data entry's keyword index corresponds to a hash bit string. ; Step 12: The data provider uses a random number generator to generate n pairs of random key pairs. And save it locally; Step 13: Based on the hash bit string corresponding to each data, select n calculation keys from n pairs of random key pairs, XOR the n calculation keys to obtain the final key corresponding to each data; Step 14: Perform symmetric encryption on each piece of data in the original plaintext data using the final key to obtain ciphertext C. , This represents the ciphertext corresponding to the ith data item, and Enc represents the encryption function. This represents the i-th final key corresponding to the i-th data item. Each data item is encrypted using its corresponding final key. Step 15: Construct ciphertext data pairs based on the hash bit string mapped by the keyword index and the ciphertext. And send all encrypted data pairs to the cloud server.
2. The encrypted storage and retrieval method supporting privacy protection for multi-party data sharing according to claim 1, characterized in that, The specific process of step 13 is as follows: Step 131: Traverse each element in each hash bit string and select a corresponding random key pair based on the element's position in the hash bit string; Step 132: Based on the value of each element in the hash bit string, select the corresponding random key from the selected random key pair as the calculation key, and filter out n calculation keys from each hash bit string; Step 133: XOR the n computation keys to obtain the final key corresponding to each hash bit string.
3. The encrypted storage and retrieval method supporting privacy protection for multi-party data sharing according to claim 1, characterized in that, The data to be retrieved by the data user is the index of the keywords to be retrieved. In step 2, the data user uses the same hash function as the data provider to retrieve the index of the keywords to be retrieved. Perform hash mapping to obtain the bit string to be retrieved. Based on the bit string to be retrieved Generate a query request and send it to the cloud server; The cloud server retrieves the bit string from the query request. Find the corresponding ciphertext data pair. , > and provide feedback to the data user.
4. The encrypted storage and retrieval method supporting privacy protection for multi-party data sharing according to claim 3, characterized in that, The specific process of step 4 is as follows: Step 41: The data user generates a A random matrix A of size , and using the column vectors of each column of random matrix A with the bit string to be retrieved. Performing an XOR operation yields a new key matrix B, where the column vector b of the i-th column of key matrix B is... i =a i ⊕ a i Let be the column vector of the i-th column in the random matrix A; Step 42: The data user generates s pairs of public and private keys {pk1, sk1, ..., pk}. s ,sk s }, and s for the first random number pair {x} 1,0 ,x 1,1 ,.....x s,0 ,x s,1 }, pk s Let sk represent the public key in the s-th public-private key pair. s Let x represent the private key in the s-th public-private key pair. s,0 Let x represent the first random number in the s-th pair of first random numbers. s,1 This represents the second first random number in the s-th pair of first random numbers; Step 43: Combine the public and private key pair with the first random number pair to form a key request and send it to the data provider.
5. The encrypted storage and retrieval method for supporting privacy protection in multi-party data sharing according to claim 4, characterized in that, The specific process of step 5 is as follows: Step 51: After receiving the key request, the data provider generates a random 0-1 vector r of length s, and s second random numbers { }; Step 52: The data provider uses the public key from the public-private key pair and the first random number pair to encrypt each of the second random numbers, obtaining the intermediate parameter ciphertext. All intermediate parameter ciphertexts R = (R1, R2, ... R... s Send to the data user; the intermediate parameters are represented in encrypted form as follows: ; The ciphertext represents the i-th intermediate parameter; Enc represents the encryption function; pk i This represents the public key in the i-th public-private key pair; This represents the i-th second random number; Represents the r-th element in the i-th pair of the first random number pair. i +1 first random number, r i This represents the i-th value in a random 0-1 vector r.
6. The encrypted storage and retrieval method for supporting privacy protection in multi-party data sharing according to claim 5, characterized in that, The specific process of step 6 is as follows: Step 61: The data user uses the private key from the public-private key pair to decrypt the intermediate parameter ciphertext sequentially, generating an encryption key pair; the encryption key pair is represented as: in, This represents the first encryption key in the encryption key pair; Dec represents the decryption function; sk i This represents the private key in the i-th public-private key pair; This represents the ciphertext of the i-th intermediate parameter; This represents the first random number in the i-th pair of first random number pairs; This represents the second encryption key in the encryption key pair; This represents the second first random number in the i-th pair of first random number pairs; Step 62: Encrypt the column vectors of random matrix A using the first encryption key, and encrypt the column vectors of key matrix B using the second encryption key to obtain two sets of encryption key matrices, which are then sent to the data provider; encrypting random matrix A yields the encryption key matrix. The encryption key matrix is obtained by encrypting key matrix B. .
7. The encrypted storage and retrieval method for supporting privacy protection in multi-party data sharing according to claim 6, characterized in that, The specific process of step 7 is as follows: Step 71: The data provider decrypts the two sets of encryption key matrices sent by the data user based on the random 0-1 vector r, and obtains the decryption key matrix Q; Step 72: The data provider XORs each row vector of the decryption key matrix Q with a random 0-1 vector r to obtain a new decryption key matrix Q'; where the row vector of the j-th row of the new decryption key matrix Q' is... , This represents the row vector of the j-th row of the decryption key matrix Q. Both the decryption key matrix Q and the new decryption key matrix Q' are... Matrix; Step 73: Perform hash operations on the row vectors of the decryption key matrix Q and the new decryption key matrix Q' respectively to obtain n pairs of matrix key pairs, including H(q j ) and H(q j ⊕r), H represents hash operation; Step 74: Use n matrix key pairs to apply the n random key pairs stored locally. Encryption is performed to obtain n pairs of key ciphertexts.
8. The encrypted storage and retrieval method for supporting privacy protection in multi-party data sharing according to claim 7, characterized in that, The specific process of step 71 is as follows: Iterate through all elements of the random 0-1 vector r. If the value of the i-th element is 0, then use the i-th second random number d. i Decrypting the encryption key matrix The i-th column vector is used to obtain the i-th column vector a of the random matrix A. i ; If the value of the i-th element is 1, then the i-th second random number d is used. i Decrypting the encryption key matrix The i-th column vector is used to obtain the i-th column vector b of the random matrix B. i The decrypted column vectors form the decryption key matrix Q.
9. The encrypted storage and retrieval method supporting privacy protection for multi-party data sharing according to claim 7, characterized in that, The specific process of step 8 is as follows: Step 81: The data user iterates through the bit string to be retrieved. For each element, decrypt a pair of key ciphertexts according to the position of each element. If the value of the element is 0, decrypt the first key ciphertext in the key ciphertext. If the value of the element is 1, decrypt the second key ciphertext in the key ciphertext. Then, use the row vectors of the random matrix A to perform hash calculations to decrypt one of the key ciphertexts in the pair of key ciphertexts to obtain the corresponding random key. Finally, XOR the n decrypted random keys to obtain the final key. Step 82: The data user uses the decrypted final key. For querying encrypted data pairs , The ciphertext in Decryption is performed to obtain the corresponding original plaintext data. At the same time, verify the decrypted result. Used for querying itself Check if they match. If they match, the decryption is successful; otherwise, an alarm will be triggered if the decryption is incorrect.
Citation Information
Patent Citations
Similar-shape-Chinese-character full-text fuzzy-retrieval method for ciphertext domain
CN108334612A
Method and system for efficiently retrieving private information
CN115642999A
Data query method and device, equipment and medium
CN116361344A