Method and system for secure sharing of private data
By encrypting and offsetting private data, and combining this with blockchain hash value storage, the problem of privacy data leakage in energy blockchains is solved, achieving highly secure and efficient data sharing.
Patent Information
- Application Number
- CN202311675310.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2043-12-07
Smart Images

Figure CN117540430B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to a method for securely sharing private data and a system for securely sharing private data. Background Art
[0002] Energy is the foundation for the survival and development of modern society. The centralized and unified management of traditional energy networks is "incapable" when facing sudden energy crises. Combining emerging information technology with distributed energy management, the Energy Internet came into being.
[0003] In the Energy Internet, energy producers, energy transporters and energy consumers will generate a large amount of energy transaction data, such as: the time of energy transaction, the location of energy transaction, the information of both parties to the transaction, the amount of energy transaction, the price of energy transaction, the settlement method of energy transaction, energy consumption data, etc. If the above energy transaction data is leaked, it may be used by attackers to obtain improper benefits and threaten the operation of the entire Energy Internet.
[0004] On the other hand, as a breakthrough for independent innovation in digital technology and an important part of the "new infrastructure", blockchain provides new opportunities for the digital transformation of the energy industry due to its distributed data storage, encryption algorithm and other characteristics. With the application and research of blockchain in the energy industry, the concept of energy blockchain has been proposed and gradually formed a consensus. Energy blockchain is a new form of energy industry development that deeply integrates blockchain with energy production, transmission, storage, consumption and energy market. With blockchain as the underlying basic technology, it deeply integrates the energy Internet, builds an open and cooperative subject trust system, and provides technical support and services for various open and integrated innovative business models. Energy trading is one of the main functions of energy blockchain. Different transaction participants (energy producers, energy suppliers, etc.) can make full use of the distributed and tamper-proof characteristics of blockchain to realize how to conveniently trade energy. The purpose of transaction privacy sharing is to protect user privacy while realizing the openness and transparency of energy transactions and avoiding information leakage and abuse. This will enable more energy transactions, promote the development of the energy market, improve energy utilization efficiency, and provide better services to users. Summary of the invention
[0005] The embodiments of the present application provide a method and system for securely sharing private data. The method for securely sharing private data can use the above-mentioned offset process and storage process to make the M index data segments include the (N+1) identical first index and second index located in different index data segments, and the M encrypted data segments include the (N+1) identical first encrypted data and second encrypted data located in different encrypted data segments, so that during the query process of the query user, the query index and the retrieval index are no longer one-to-one corresponding, and the cloud storage provider cannot infer the meaning of the query index. Therefore, the method for securely sharing private data can further improve security and avoid leakage of private data.
[0006] At least one embodiment of the present application provides a method for securely sharing private data, including a private data outsourcing storage process, wherein the private data outsourcing storage process includes:
[0007] Encrypting M private data files in the private data respectively according to the first key, and generating M first encrypted data;
[0008] Encrypting the M identifiers of the M private data files respectively according to the second key, and generating M first indexes, wherein the M first indexes correspond one-to-one to the M first encrypted data;
[0009] Performing N shifts on each of the first indexes and each of the first encrypted data respectively, so as to generate corresponding N groups of second indexes and N groups of second encrypted data;
[0010] Generate an index data segment by using each of the first indexes and the corresponding N groups of second indexes, and generate an encrypted data segment by using each of the first encrypted data and the corresponding N groups of second encrypted data; and
[0011] The M index data segments corresponding to the M first indexes and the M encrypted data segments corresponding to the M first encrypted data are stored in a cloud storage,
[0012] Among them, the above-mentioned shifting of each first index and each first encrypted data is performed N times respectively, so that the M index data segments include (N+1) identical first indexes and second indexes located in different index data segments, and the M encrypted data segments include (N+1) identical first encrypted data and second encrypted data located in different encrypted data segments, M is a positive integer greater than N, and N is a positive integer greater than or equal to 1.
[0013] For example, the secure sharing method of private data provided in an embodiment of the present application also includes the private data sharing process, and the private data sharing process includes:
[0014] The query user initiates a viewing request, wherein the viewing request includes an identifier to be searched;
[0015] randomly generating a query guide set, wherein the query guide set is configured to indicate a logical position of a target index in the index data segment, wherein the target index includes the first index or the second index;
[0016] Encrypting the identifier to be searched by the querying user by using the second key and generating an encrypted query index, generating query request information according to the encrypted query index and the query guide set, and sending the query request information to the cloud storage;
[0017] The cloud storage finds the index data segment including the encrypted query index in the M index data segments according to the query request information, and processes the (N+1) index data segments including the encrypted query index using the query guide set to find the target index data segment including the target index in the (N+1) index data segments;
[0018] extracting the encrypted data segment corresponding to the target index data segment, processing the encrypted data segment corresponding to the target index data segment using the query guide set, and sending the processing result to the query user; and
[0019] The querying user uses the third key to decrypt the processing result to obtain the first encrypted data or the second encrypted data corresponding to the identifier to be queried, and then obtains the private data file corresponding to the identifier to be queried through the first key.
[0020] For example, in the secure sharing method of private data provided in an embodiment of the present application, the query guide set may include (N+1) binary numbers, and the (N+1) binary numbers include only one "1".
[0021] For example, in the secure sharing method of private data provided in an embodiment of the present application, using the query guide set to process the (N+1) index data segments including the encrypted query index includes:
[0022] The query guide set is used to perform product processing on the (N+1) index data segments including the encrypted query index to eliminate the first index or the second index corresponding to "0" in the (N+1) binary numbers.
[0023] For example, in the secure sharing method of private data provided in an embodiment of the present application, processing the encrypted data segment corresponding to the target index data segment using the query guide set includes:
[0024] The encrypted data segment corresponding to the target index data segment is subjected to product processing using the query guide set to eliminate the first encrypted data or the second encrypted data corresponding to "0" in the (N+1) binary numbers.
[0025] For example, in the secure sharing method of private data provided in an embodiment of the present application, the query request information Q={prf k (ω),C,E}, where prf k (ω) is the encrypted query index, prf(·) is a pseudo-random function, k is the second key, which is a pseudo-random function, and C is a series of {c d |1≤d≤n}, the ciphertext set composed of encrypted data, c d The fourth key pk and the random number In the Paillier encryption algorithm, E is obtained by the fourth key pk and the encrypted query index prf k (ω) The encrypted data obtained, the third key and the fourth key are a public-private key pair.
[0026] For example, in the secure sharing method of private data provided in an embodiment of the present application, c d The calculation formula is: The calculation formula of E is:
[0027]
[0028] For example, in the secure sharing method of private data provided in an embodiment of the present application, using the query guide set to process the (N+1) index data segments including the encrypted query index also includes:
[0029] The following calculations are performed on the (N+1) index data segments including the encrypted query index:
[0030]
[0031] Judgment C * (prf k (W)) is equal to E. If they are equal, the current index data segment is the target index data segment including the target index.
[0032] For example, in the secure sharing method of private data provided in an embodiment of the present application, processing the encrypted data segment corresponding to the target index data segment using the query guide set includes:
[0033] The following calculation is performed on the encrypted data segment corresponding to the target index data segment:
[0034]
[0035] For example, in the secure sharing method of private data provided in an embodiment of the present application, the private data outsourcing storage process further includes:
[0036] The hash values of the M private data files in the private data are stored in the blockchain.
[0037] For example, in the secure sharing method of private data provided in an embodiment of the present application, the data sharing process further includes:
[0038] The authority of the query user is determined, and if the query user meets the conditions, the query guide set is returned to the query user.
[0039] For example, the secure sharing method of private data provided in an embodiment of the present application further includes a private data verification process, wherein the private data verification process includes:
[0040] Verifying the cloud that sends the processing result; and
[0041] The correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked are verified.
[0042] For example, in the secure sharing method of private data provided in an embodiment of the present application, the private data outsourcing storage process further includes: encrypting the cloud identifier of the cloud where each of the M private data files is located by a fifth key, and generating an encrypted cloud identifier; generating an m-bit first counting Bloom filter for each corresponding encrypted cloud identifier in the M private data files; and hashing each corresponding encrypted cloud identifier in the M private data files in the first counting Bloom filter by a first hash function family to generate a cloud verification object;
[0043] Verifying the cloud that sends the processing result includes:
[0044] encrypting the cloud identifier of the cloud that sends the processing result using the fifth key, and generating a sending cloud identifier;
[0045] The sending cloud identifier is hashed by the first hash function family and the value of the corresponding position in the corresponding cloud verification object is checked to determine whether the cloud sending the processing result is correct,
[0046] The first hash function family includes multiple first hash functions.
[0047] For example, in the secure sharing method of private data provided in an embodiment of the present application, the fifth key is the same as the second key.
[0048] For example, in the secure sharing method of private data provided in an embodiment of the present application, the private data outsourcing storage process further includes: recording the actual number of multiple segments of encrypted data in the first encrypted data or the second encrypted data;
[0049] Verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked further includes:
[0050] Query the first encrypted data or the second encrypted data corresponding to the identifier to be checked, which is configured to describe the number of the multiple segments of encrypted data. ω , if the number Sum ω If the number of encrypted data or the second encrypted data corresponding to the identifier to be checked is not equal to the real number, it is determined that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete.
[0051] For example, in the secure sharing method of privacy data provided in an embodiment of the present application, the privacy data outsourcing storage process also includes: generating an n-bit second counting Bloom filter for the first encrypted data or the second encrypted data; encrypting multiple segments of encrypted data in the first encrypted data or the second encrypted data respectively by a sixth key to form multiple encrypted character segments; hashing the multiple encrypted character segments in the first m verification areas of the second counting Bloom filter by a second hash function family; and using a padding function to randomly fill the last nm padding areas of the second counting Bloom filter to ensure that the final sum of the numbers in the second counting Bloom filter is l*T, so as to generate a data verification object.
[0052] The second hash function family includes multiple second hash functions, l is the number of the second hash functions in the second hash function family, and T is a fixed value that is greater than the number of the multiple segments of encrypted data in the first encrypted data or the second encrypted data.
[0053] For example, in the secure sharing method of private data provided in an embodiment of the present application, verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked includes:
[0054] Encrypt multiple segments of encrypted data in the first encrypted data or the second encrypted data corresponding to the identifier to be checked respectively by the sixth key to form multiple encrypted character segments; hash the multiple encrypted character segments by the second hash function family and check the values of corresponding positions in the corresponding data verification object, so as to determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is correct.
[0055] For example, in the secure sharing method of private data provided in an embodiment of the present application, verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked further includes:
[0056] Encrypt multiple segments of encrypted data in the first encrypted data or the second encrypted data corresponding to the identifier to be checked respectively by using the sixth key to form multiple encrypted character segments; hash the multiple encrypted character segments by using the second hash function family, and reduce the value of the corresponding position in the corresponding data verification object by one; if the value of the corresponding position of the encrypted character segment after being processed by a certain second hash function in the corresponding data verification object is less than or equal to 0, or the sum of the values of all positions in the hashed data verification object is not equal to 0, then it is determined that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete.
[0057] For example, in a method for securely sharing private data provided in an embodiment of the present application, the private data includes energy transaction data.
[0058] An embodiment of the present application further provides a secure sharing system for private data, comprising: a storage user, a query user and a cloud storage, wherein the storage user is configured to encrypt M private data files in the private data according to a first key, and generate M first encrypted data; encrypt M identifiers of the M private data files according to a second key, and generate M first indexes, wherein the M first indexes correspond one-to-one to the M first encrypted data; perform N shifts on each of the first indexes and each of the first encrypted data, respectively, to generate corresponding N groups of second indexes and N groups of second encrypted data; and generate index data segments from each of the first indexes and the corresponding N groups of second indexes, and generate encrypted data segments from each of the first encrypted data and the corresponding N groups of second encrypted data;
[0059] The cloud storage is configured to store the M index data segments corresponding to the M first indexes and the M encrypted data segments corresponding to the M first encrypted data.
[0060] Among them, the above-mentioned first index and the first encrypted data are shifted N times respectively, so that the M index data segments include (N+1) identical first indexes located in different index data segments, and the M encrypted data segments include (N+1) identical first encrypted data located in different encrypted data segments, M is a positive integer greater than N, and N is a positive integer greater than or equal to 1.
[0061] For example, in the secure sharing system of private data provided in an embodiment of the present application, during the sharing process of private data, the querying user initiates a viewing request, and the viewing request includes an identifier to be checked;
[0062] The storage user is configured to randomly generate a query guide set, wherein the query guide set is configured to indicate a logical position of a target index in the index data segment, wherein the target index includes the first index or the second index;
[0063] The query user is configured to encrypt the identifier to be checked by the query user by using the second key and generate an encrypted query index, generate query request information according to the encrypted query index and the query guide set, and send the query request information to the cloud storage;
[0064] The cloud storage is configured to find the index data segment including the encrypted query index in the M index data segments according to the query request information, and use the query guide set to process the (N+1) index data segments including the encrypted query index, so as to find the target index data segment including the target index in the (N+1) index data segments; extract the encrypted data segment corresponding to the target index data segment, and use the query guide set to process the encrypted data segment corresponding to the target index data segment, and send the processing result to the query user;
[0065] The querying user uses the third key to decrypt the processing result to obtain the first encrypted data or the second encrypted data corresponding to the identifier to be checked, and then obtains the private data file corresponding to the identifier to be checked through the first key. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present application, rather than limiting the present application.
[0067] Figure 1-Figure 3 A flowchart of a method for securely sharing private data provided in one embodiment of the present application.
[0068] Figure 4 A schematic diagram of a lookup table structure provided in one embodiment of the present application.
[0069] Figure 5 A schematic diagram of a secure sharing system for private data provided in accordance with an embodiment of the present application.
[0070] Figure 6 A schematic diagram of a cloud verification object provided in one embodiment of the present application.
[0071] Figure 7 A schematic diagram of a data verification object provided in one embodiment of the present application. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme of the embodiments of the present application will be clearly and completely described below in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the described embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0073] Unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which this application belongs. "First", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and other similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and other similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0074] Due to the open and transparent nature of blockchain, user data in the process of on-chain energy transactions may be leaked, exposing the user's privacy information. The existing energy blockchain technology lacks a complete transaction privacy protection mechanism. On the other hand, the efficiency of secure sharing of privacy data cannot be ignored.
[0075] As the number of users participating in energy trading continues to increase, the amount of transaction data information is also growing. A feasible solution is to adopt an on-chain and off-chain sharing solution, that is, outsourcing the storage of the complete user transaction information database (for example, storing it in cloud storage), and only retaining the hash index of the transaction information on the blockchain; when private data needs to be shared securely, the required private data is obtained based on the index. This solution can effectively save on-chain space while ensuring the security of the on-chain sharing process, but there may be the following problems:
[0076] (1) As an untrusted third party, the provider of the outsourced storage service effectively ensures the secure sharing of data on the blockchain, but the provider of the outsourced storage service itself may leak private data. In addition, before outsourcing the storage of private data, encrypting the private data is an effective measure to protect the confidentiality of the private data, but encrypted data also increases the difficulty of retrieval, which in turn affects the efficiency of data sharing. On the other hand, searchable encryption technology allows users to search encrypted data by querying encrypted keywords without decrypting the data, so that the user's transaction private data can achieve the security of the off-chain process. However, after encrypting the private data using searchable encryption technology, the one-to-one correspondence between the query index and the retrieval index cannot be solved. That is, no matter what the encryption form of the retrieval index is, the provider of the outsourced storage service can obtain the statistical results of the number of retrieval index accesses. Based on the statistical results, the provider of the outsourced storage service can infer the meaning of some retrieval indexes. Therefore, even if the private data is encrypted by searchable encryption technology, users may still face the risk of private data leakage.
[0077] (2) Providers of outsourced storage services may also engage in dishonest behavior and interfere with data sharing. For example, in order to save their own storage space, outsourced storage service providers may maliciously discard infrequently used user data content; outsourced storage service providers may also return incorrect data, affecting the secure sharing of private data. Therefore, it is necessary to add a verification mechanism to the query process in data security sharing. However, most of the current verification mechanisms embed verification information into specified security indexes or query results, and provide coarse-grained verification, which can only verify the correctness of all query results as a whole and is not universal. In addition, if the provider of outsourced storage services knows the complete query result verification scheme in advance, it may undermine the verification mechanism to evade responsibility for improper behavior.
[0078] In this regard, an embodiment of the present application provides a method for securely sharing private data, including a private data outsourcing storage process, the private data outsourcing storage process comprising: encrypting M private data files in the private data according to a first key, and generating M first encrypted data; encrypting M identifiers of the M private data files according to a second key, and generating M first indexes, the M first indexes corresponding to the M first encrypted data one by one; offsetting each first index and each first encrypted data N times, respectively, to generate corresponding N groups of second indexes and N groups of second encrypted data; and generating index data segments from each first index and the corresponding N groups of second indexes, and generating index data segments from each first index and the corresponding N groups of second indexes. Each first encrypted data and the corresponding N groups of second encrypted data generate an encrypted data segment; and the M index data segments corresponding to the M first indexes and the M encrypted data segments corresponding to the M first encrypted data are stored in the cloud storage, wherein each first index and each first encrypted data are offset N times respectively, so that the M index data segments include the first index and the second index with the same (N+1) data located in different index data segments, and the M encrypted data segments include the first encrypted data and the second encrypted data with the same (N+1) data located in different encrypted data segments, M is a positive integer greater than N, and N is a positive integer greater than or equal to 1. Thus, the method for securely sharing private data can be implemented through the above offset process and storage process, so that the M index data segments include the first index and the second index with the same (N+1) data located in different index data segments, and the M encrypted data segments include the first encrypted data and the second encrypted data with the same (N+1) data located in different encrypted data segments, so that during the query process, the query index and the retrieval index are no longer one-to-one corresponding to the query user, and the cloud storage provider cannot infer the meaning of the query index. Therefore, the secure sharing method of private data can further improve security and avoid leakage of private data.
[0079] The embodiment of the present application also provides a secure sharing system for private data, including a storage user, a query user and a cloud storage, wherein the storage user is configured to encrypt M private data files in the private data according to a first key, and generate M first encrypted data; encrypt M identifiers of the M private data files according to a second key, and generate M first indexes, the M first indexes correspond to the M first encrypted data one by one; offset each first index and each first encrypted data N times, respectively, to generate corresponding N groups of second indexes and N groups of second encrypted data; and generate index data segments from each first index and the corresponding N groups of second indexes, and Each first encrypted data and the corresponding N groups of second encrypted data generate an encrypted data segment; the cloud storage is configured to store M index data segments corresponding to M first indexes and M encrypted data segments corresponding to M first encrypted data, and each first index and each first encrypted data are offset N times respectively, so that the M index data segments include (N+1) identical first indexes and second indexes located in different index data segments, and the M encrypted data segments include (N+1) identical first encrypted data and second encrypted data located in different encrypted data segments, M is a positive integer greater than N, and N is a positive integer greater than or equal to 1. Thus, the secure sharing system of private data can, through the above offset process and storage process, make the M index data segments include (N+1) identical first indexes and second indexes located in different index data segments, and the M encrypted data segments include (N+1) identical first encrypted data and second encrypted data located in different encrypted data segments, so that during the query process of the query user, the query index and the retrieval index are no longer one-to-one corresponding, and the cloud storage provider cannot infer the meaning of the query index. Therefore, the secure sharing system of private data can further improve security and avoid leakage of private data.
[0080] Below, the secure sharing method and secure sharing system of privacy data provided in the embodiments of the present application are described in detail with reference to the accompanying drawings.
[0081] Figure 1-Figure 3 A flowchart of a method for securely sharing private data provided in one embodiment of the present application; Figure 1 The privacy data outsourcing storage process of the privacy data security sharing method is shown. Figure 2 The private data sharing process of the private data secure sharing method is shown; Figure 3 The private data verification process of the private data secure sharing method is shown.
[0082] like Figure 1 As shown, the secure sharing method of private data includes a private data outsourcing storage process, and the private data outsourcing storage process includes the following steps S101-S105.
[0083] Step S101: Encrypt M private data files in the private data respectively according to a first key, and generate M first encrypted data.
[0084] Step S102: Encrypt the M identifiers of the M private data files respectively according to the second key, and generate M first indexes, where the M first indexes correspond one-to-one to the M first encrypted data.
[0085] Step S103: performing N shifts on each first index and each first encrypted data respectively, so as to generate corresponding N groups of second indexes and N groups of second encrypted data.
[0086] Step S104: Generate an index data segment from each first index and the corresponding N groups of second indexes, and generate an encrypted data segment from each first encrypted data and the corresponding N groups of second encrypted data.
[0087] Step S105: Store the M index data segments corresponding to the M first indexes and the M encrypted data segments corresponding to the M first encrypted data in the cloud storage, and perform N shifts on each first index and each first encrypted data respectively, so that the M index data segments include (N+1) first indexes and second indexes with the same data located in different index data segments, and the M encrypted data segments include (N+1) first encrypted data and second encrypted data with the same data located in different encrypted data segments, where M is a positive integer greater than N, and N is a positive integer greater than or equal to 1.
[0088] In the secure sharing method of private data provided in the embodiment of the present application, the private data file and the identifier in the private data are encrypted respectively, so that encrypted storage and encrypted retrieval can be realized, and the confidentiality of the private data is effectively protected. In addition, the secure sharing system of private data can make M index data segments include (N+1) identical first indexes located in different index data segments, and M encrypted data segments include (N+1) identical first encrypted data located in different encrypted data segments through the above-mentioned offset process and storage process, so that during the query process of the query user, one query index can correspond to (N+1) identical first indexes located in different index data segments, so that the query index and the retrieval index are no longer one-to-one corresponding, and the provider of the cloud storage cannot infer the meaning of the query index. Therefore, the secure sharing system of private data can provide a method to ensure the secure sharing of private data, so that the provider or service provider of the cloud storage cannot obtain any useful information from the stored data itself and the query process, and to a certain extent prevent the provider or service provider of the cloud storage from doing evil, thereby further improving security and avoiding the leakage of private data.
[0089] For example, the above-mentioned privacy data may be energy transaction data, such as the time of energy transaction, the location of energy transaction, information of both parties to the transaction, the amount of energy transaction, the price of energy transaction, the settlement method of energy transaction, energy consumption data, etc.
[0090] Figure 4 A schematic diagram of a lookup table structure provided in one embodiment of the present application. Figure 2 As shown, the first column of the lookup table is a cloud identifier, which is used to represent different cloud storages; the second column of the lookup table is an identifier of different storage locations in the cloud storage; the third column of the lookup table is an index data segment including a first index and a corresponding second index; the fourth column of the lookup table may be an encrypted data segment including a first encrypted data and a corresponding second encrypted data. It should be noted that the lookup table may be stored in the cloud storage.
[0091] For example, Figure 4 As shown, each index data segment includes two data, namely, a first index and a corresponding second index. The second index is offset and therefore different from the corresponding first index. However, the first index prf in the last index data segment in the cloud storage T(g1) is k (ω θ ) corresponds to the second index prf k (ω θ+α ) can be combined with the first index prf in the first index data segment k (ω1) is the same data. Thus, the offset processing makes the M index data segments include (N+1) identical first indexes located in different index data segments; similarly, the offset processing makes the M encrypted data segments include (N+1) identical first encrypted data located in different encrypted data segments. It should be noted that the example described above is only an example of implementing the above offset process, and the embodiments of the present application include but are not limited to this.
[0092] In some examples, the above-mentioned method for securely sharing private data also includes a private data sharing process, such as Figure 2 As shown, the privacy data sharing process includes the following steps S106-S111.
[0093] Step S106: The query user initiates a query request, and the query request includes the identifier to be checked. For example, the identifier to be checked may include information such as the trader name, the name of the transaction product, and the transaction time in the energy transaction information.
[0094] Step S107: randomly generate a query guide set, where the query guide set is configured to indicate a logical position of a target index in the index data segment, where the target index includes the first index or the second index.
[0095] Step S108: Encrypt the identifier to be searched by the querying user with the second key and generate an encrypted query index, generate query request information according to the encrypted query index and the query guide set, and send the query request information to the cloud storage.
[0096] Step S109: The cloud storage finds the index data segment including the encrypted query index in the M index data segments according to the query request information, and uses the query guide set to process the (N+1) index data segments including the encrypted query index to find the target index data segment including the target index in the (N+1) index data segments.
[0097] Step S110: extract the encrypted data segment corresponding to the target index data segment, process the encrypted data segment corresponding to the target index data segment using the query guide set, and send the processing result to the query user.
[0098] Step S111: the querying user uses the third key to decrypt the processing result to obtain the first encrypted data or the second encrypted data corresponding to the identifier to be queried, and then obtains the private data file corresponding to the identifier to be queried through the first key.
[0099] In the secure sharing method of privacy data provided in the embodiment of the present application, by randomly generating a query guide set, the logical position of the target index in the index data segment can be randomly indicated in each privacy data sharing process, thereby ensuring that the query index and the retrieval index are no longer one-to-one corresponding, and the cloud storage provider cannot infer the meaning of the query index; and after the cloud storage finds the index data segment including the encrypted query index in the M index data segments according to the query request information, on the one hand, the query guide set can be used to process the (N+1) index data segments including the encrypted query index, so as to find the target index data segment including the target index in the (N+1) index data segments, and exclude other index data segments; on the other hand, after the encrypted data segment corresponding to the target index data segment is extracted, the query guide set can be used to process the encrypted data segment corresponding to the target index data segment, so as to exclude invalid encrypted data in the encrypted data segment.
[0100] In some examples, the query guide set may include (N+1) binary numbers, where the (N+1) binary numbers include only one "1" and the rest are "0".
[0101] For example, when N=1, the query guide set may be {1,0} or {0,1}, where "1" may be used to indicate the logical position of the target index in the index data segment.
[0102] For example, when N=2, the query guide set may be {1,0,0}, {0,1,0}, or {0,0,1}, where "1" may be used to indicate the logical position of the target index in the index data segment.
[0103] In some examples, the above-mentioned processing of the (N+1) index data segments including the encrypted query index using the query guide set includes: performing product processing on the (N+1) index data segments including the encrypted query index using the query guide set to eliminate the first index or the second index corresponding to "0" in the (N+1) binary numbers. Thus, through the product processing, the above-mentioned processing process can eliminate the first index or the second index corresponding to "0" in the (N+1) binary numbers, thereby finding the target index data segment including the target index in the (N+1) index data segments, and excluding other index data segments.
[0104] In some examples, processing the encrypted data segment corresponding to the target index data segment using the query guide set includes: performing a product process on the encrypted data segment corresponding to the target index data segment using the query guide set to eliminate the first encrypted data or the second encrypted data corresponding to "0" in the (N+1) binary numbers. Thus, through the product process, the above processing can eliminate the first encrypted data or the second encrypted data corresponding to "0" in the (N+1) binary numbers, thereby excluding invalid encrypted data in the encrypted data segment.
[0105] It should be noted that the above processing process can be performed on the cloud storage, thereby reducing the computing burden of the querying user, and also ensuring that the data received by the querying user is only valid privacy data files, thereby improving the user experience.
[0106] In some examples, the query request information Q={prf k (ω),C,E}, where prf k (ω) is the encrypted query index, prf(·) is a pseudo-random function, k is the second key, which is a pseudo-random function, and C is a series of the form {c d |1≤d≤n}, the ciphertext set composed of encrypted data, c d The fourth key pk and the random number In the Paillier encryption algorithm, E is obtained by the fourth key pk and the encrypted query index prf k (ω) The encrypted data obtained, the third key and the fourth key are a public-private key pair.
[0107] In some examples, c d The calculation formula is: The calculation formula of E is:
[0108]
[0109] In some examples, the above-mentioned processing of the (N+1) index data segments including the encrypted query index using the query guide set further includes: performing the following calculations on the (N+1) index data segments including the encrypted query index:
[0110]
[0111] Judgment C * (prf k (W)) is equal to E. If they are equal, the current index data segment is the target index data segment including the target index.
[0112] In the above example, through C * (prf k (W)) is equal to E, the target index data segment including the target index can be found in the (N+1) index data segments including the encrypted query index.
[0113] In some examples, processing the encrypted data segment corresponding to the target index data segment using the query guide set includes: performing the following calculation on the encrypted data segment corresponding to the target index data segment:
[0114]
[0115] In the above example, the above calculation formula can be used to process the encrypted data segment corresponding to the target index data segment using the query guide set to exclude invalid encrypted data in the encrypted data segment.
[0116] In some examples, the above-mentioned outsourcing storage process of private data further includes: storing the hash values of the M private data files in the private data in the blockchain. Therefore, the secure sharing method of private data can also use the distributed and tamper-proof characteristics of the blockchain to prevent the cloud storage provider from tampering with the private data, thereby further improving security. On the other hand, since the hash values of the private data files are stored in the blockchain, the amount of data is small and will not impose too much burden on the blockchain.
[0117] In some examples, the data sharing process further includes: determining the authority of the querying user, and if the querying user meets the conditions, returning the query guide set to the querying user. For example, the storage user or the blockchain can jointly determine the authority of the querying user.
[0118] In some examples, the method for securely sharing private data also includes a private data verification process, such as Figure 3 As shown, the privacy data verification process includes the following steps S112-S113.
[0119] Step S112: Verify the cloud that sends the processing results.
[0120] For example, since different private data may be stored in different cloud storages, whether the private data file in the processing result is accurate can be determined by verifying the cloud that sends the processing result.
[0121] Step S113: verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked.
[0122] In the privacy data security sharing method provided in this example, by verifying the cloud that sends the processing results and verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked, the privacy data security sharing method can determine whether the provider of the cloud storage maliciously discards data or returns erroneous data, thereby further improving security.
[0123] In some examples, the privacy data outsourcing storage process also includes: encrypting the cloud identifier of each cloud in the M privacy data files by a fifth key and generating an encrypted cloud identifier; generating an m-bit first counting Bloom filter for each corresponding encrypted cloud identifier in the M privacy data files; and hashing each corresponding encrypted cloud identifier in the M privacy data files in the first counting Bloom filter by a first hash function family to generate a cloud verification object; verifying the cloud that sends the processing result includes: encrypting the cloud identifier of the cloud that sends the processing result by a fifth key and generating a sending cloud identifier; hashing the sending cloud identifier by a first hash function family and checking the value of the corresponding position in the corresponding cloud verification object, so as to determine whether the cloud that sends the processing result is correct, and the above-mentioned first hash function family includes multiple first hash functions. For example, if the value of the corresponding position in the corresponding cloud verification object is equal to 0, it can be determined that the cloud that sends the processing result is incorrect. If the values obtained after hashing are not equal to 0, it can be determined that the cloud that sends the processing result is correct. Therefore, the privacy data security sharing method can quickly and efficiently determine whether the cloud that sends the processing result is correct. It should be noted that the specific implementation of the above verification method can refer to the subsequent Algorithm 2.
[0124] In some examples, the fifth key is the same as the second key, which can simplify the procedure.
[0125] In some examples, the privacy data outsourcing storage process further includes: recording the actual number of multiple encrypted data segments in the first encrypted data or the second encrypted data; verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked also includes: querying the number Sum configured to describe the number of multiple encrypted data segments in the first encrypted data or the second encrypted data corresponding to the identifier to be checked ω , if the number Sum ωIf the number of encrypted data segments is not equal to the real number, the first encrypted data or the second encrypted data corresponding to the identifier to be checked is judged to be incomplete. Thus, the method for securely sharing private data can quickly judge that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete by judging whether the number of multiple encrypted data segments in the first encrypted data or the second encrypted data is correct.
[0126] In some examples, the privacy data outsourcing storage process also includes: generating an n-bit second counting Bloom filter for the first encrypted data or the second encrypted data; encrypting multiple encrypted data segments in the first encrypted data or the second encrypted data respectively by the sixth key to form multiple encrypted character segments; hashing the multiple encrypted character segments in the first m verification areas of the second counting Bloom filter by the second hash function family; and using the padding function to randomly fill the last nm padding areas of the second counting Bloom filter to ensure that the sum of the numbers in the final second counting Bloom filter is l*T to generate a data verification object, the second hash function family includes multiple second hash functions, l is the number of second hash functions in the second hash function family, and T is a fixed value, which is greater than the number of multiple encrypted data segments in the first encrypted data or the second encrypted data. Therefore, the secure sharing method of privacy data can resist possible statistical attacks and prevent attackers from obtaining the true number of multiple encrypted data segments in the privacy data file by dividing the total number in the data verification object (i.e., the filled second counting Bloom filter mentioned above) by the number of hash functions.
[0127] It should be noted that the second hash function family is the same as the first hash function family, so that the program can be simplified. Of course, the embodiments of the present application include but are not limited to this. In addition, in other examples, the second counting Bloom filter may not include a padding area.
[0128] In some examples, verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked includes: encrypting multiple segments of encrypted data in the first encrypted data or the second encrypted data corresponding to the identifier to be checked by the sixth key respectively to form multiple encrypted character segments; hashing the multiple encrypted character segments by the second hash function family and checking the values of the corresponding positions in the corresponding data verification object, so as to determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is correct. For example, when the value of the corresponding position in the corresponding data verification object is equal to 0, it can be determined that the current encrypted character segment does not belong to the correct privacy data file, so that the first encrypted data or the second encrypted data corresponding to the identifier to be checked can be determined to be incorrect. Therefore, the privacy data security sharing method can quickly and efficiently determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is correct. It should be noted that the specific implementation of the above verification method can refer to the subsequent algorithm 2.
[0129] In some examples, verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked also includes: encrypting multiple encrypted data segments in the first encrypted data or the second encrypted data corresponding to the identifier to be checked by the sixth key respectively to form multiple encrypted character segments; hashing the multiple encrypted character segments by the second hash function family, and reducing the value of the corresponding position in the corresponding data verification object by one, if the value of the encrypted character segment processed by a certain second hash function in the corresponding position in the corresponding data verification object is less than or equal to 0, or the sum of the values of all positions in the hashed data verification object is not equal to 0, then it is judged that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete. Therefore, the secure sharing method of privacy data can effectively and accurately determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is complete. It should be noted that the specific implementation of the above verification process can refer to the subsequent algorithm 3.
[0130] For example, Figure 4 As shown in the figure, the fifth column C(Λ) is the actual number of encrypted data in the encrypted privacy data file. w∈W ) represents the encrypted data set corresponding to the actual number of multiple encrypted data in the encrypted privacy data file (i.e., c(ds) w∈W ); the sixth column VO G To expand to a one-to-two cloud verification object; the seventh column VO W Expanded to a one-to-two data validation object.
[0131] Figure 5 A schematic diagram of a secure sharing system for private data provided in one embodiment of the present application. Figure 5As shown, the secure sharing system of private data includes a storage user 110, a query user 120 and a cloud storage 130; the storage user 110 is configured to encrypt M private data files in the private data according to a first key, and generate M first encrypted data; encrypt M identifiers of the M private data files according to a second key, and generate M first indexes, the M first indexes correspond to the M first encrypted data one by one; perform N shifts on each first index and each first encrypted data, respectively, to generate corresponding N groups of second indexes and N groups of second encrypted data; and shift each first index and the corresponding N groups of The second index generates an index data segment, and each first encrypted data and the corresponding N groups of second encrypted data generate an encrypted data segment; the cloud storage 130 is configured to store M index data segments corresponding to the M first indexes and M encrypted data segments corresponding to the M first encrypted data, and the above-mentioned first indexes and first encrypted data are offset N times respectively, so that the M index data segments include (N+1) identical first indexes located in different index data segments, and the M encrypted data segments include (N+1) identical first encrypted data located in different encrypted data segments, M is a positive integer greater than N, and N is a positive integer greater than or equal to 1.
[0132] In the secure sharing system of private data provided in the embodiment of the present application, the private data file and identifier in the private data are encrypted respectively, so that encrypted storage and encrypted retrieval can be realized, and the confidentiality of the private data is effectively protected. In addition, the secure sharing system of private data can make M index data segments include (N+1) identical first indexes located in different index data segments, and M encrypted data segments include (N+1) identical first encrypted data located in different encrypted data segments through the above-mentioned offset process and storage process, so that during the query process of the query user, one query index can correspond to (N+1) identical first indexes located in different index data segments, so that the query index and the retrieval index are no longer one-to-one corresponding, and the provider of the cloud storage cannot infer the meaning of the query index. Therefore, the secure sharing system of private data can provide a system to ensure the secure sharing of private data, so that the provider or service provider of the cloud storage cannot obtain any useful information from the stored data itself and the query process, and to a certain extent prevent the provider or service provider of the cloud storage from doing evil, thereby further improving security and avoiding the leakage of private data.
[0133] For example, the above-mentioned privacy data may be energy transaction data, such as the time of energy transaction, the location of energy transaction, information of both parties to the transaction, the amount of energy transaction, the price of energy transaction, the settlement method of energy transaction, energy consumption data, etc.
[0134] In some examples, in the above-mentioned secure sharing system for private data, during the private data sharing process, the query user 120 initiates a viewing request, and the viewing request includes an identifier to be queried; the storage user 110 is configured to randomly generate a query guide set, and the query guide set is configured to indicate the logical position of a target index in an index data segment, and the target index includes a first index or a second index; the query user 120 is configured to encrypt the identifier to be queried that the query user 120 wants to view using a second key and generate an encrypted query index, and generate query request information based on the encrypted query index and the query guide set, and send the query request information to the cloud storage 130; the cloud storage 130 is configured to generate a query request information based on the query request information. The method comprises the following steps: finding the index data segment including the encrypted query index in the M index data segments, and using the query guide set to process the (N+1) index data segments including the encrypted query index, so as to find the target index data segment including the target index in the (N+1) index data segments; extracting the encrypted data segment corresponding to the target index data segment, and using the query guide set to process the encrypted data segment corresponding to the target index data segment, and sending the processing result to the query user 120; the query user 120 uses the third key to decrypt the processing result to obtain the first encrypted data or the second encrypted data corresponding to the identifier to be queried, and then obtains the privacy data file corresponding to the identifier to be queried through the first key.
[0135] In the secure sharing system for privacy data provided in the embodiment of the present application, by randomly generating a query guide set, the logical position of the target index in the index data segment can be randomly indicated during each privacy data sharing process, thereby ensuring that the query index and the retrieval index are no longer one-to-one corresponding, and the cloud storage provider cannot infer the meaning of the query index; and after the cloud storage finds the index data segment including the encrypted query index in the M index data segments according to the query request information, on the one hand, the query guide set can be used to process the (N+1) index data segments including the encrypted query index, so as to find the target index data segment including the target index in the (N+1) index data segments, and exclude other index data segments; on the other hand, after the encrypted data segment corresponding to the target index data segment is extracted, the query guide set can be used to process the encrypted data segment corresponding to the target index data segment, so as to exclude invalid encrypted data in the encrypted data segment.
[0136] In some examples, such as Figure 5 As shown, the secure sharing system for private data further includes a blockchain 140, which is configured to store the hash values of M private data files in the private data. Therefore, the secure sharing method for private data can also utilize the distributed and tamper-proof characteristics of the blockchain to prevent the cloud storage provider from tampering with the private data, thereby further improving security. On the other hand, since the hash values of the private data files are stored in the blockchain, the amount of data is relatively small, and will not impose an excessive burden on the blockchain.
[0137] In some examples, the query guide set may include (N+1) binary numbers, where the (N+1) binary numbers include only one "1" and the rest are "0".
[0138] For example, when N=1, the query guide set may be {1,0} or {0,1}, where "1" may be used to indicate the logical position of the target index in the index data segment.
[0139] For example, when N=2, the query guide set may be {1,0,0}, {0,1,0}, or {0,0,1}, where "1" may be used to indicate the logical position of the target index in the index data segment.
[0140] In some examples, the above-mentioned processing of the (N+1) index data segments including the encrypted query index using the query guide set includes: performing product processing on the (N+1) index data segments including the encrypted query index using the query guide set to eliminate the first index or the second index corresponding to "0" in the (N+1) binary numbers. Thus, through the product processing, the above-mentioned processing process can eliminate the first index or the second index corresponding to "0" in the (N+1) binary numbers, thereby finding the target index data segment including the target index in the (N+1) index data segments, and excluding other index data segments.
[0141] In some examples, processing the encrypted data segment corresponding to the target index data segment using the query guide set includes: performing a product process on the encrypted data segment corresponding to the target index data segment using the query guide set to eliminate the first encrypted data or the second encrypted data corresponding to "0" in the (N+1) binary numbers. Thus, through the product process, the above processing can eliminate the first encrypted data or the second encrypted data corresponding to "0" in the (N+1) binary numbers, thereby excluding invalid encrypted data in the encrypted data segment.
[0142] It should be noted that the above processing process can be performed on the cloud storage, thereby reducing the computing burden of the querying user, and also ensuring that the data received by the querying user is only valid privacy data files, thereby improving the user experience.
[0143] In some examples, the privacy data security sharing system also includes a privacy data verification process, which includes: verifying the cloud that sends the processing result; and verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked. For example, since different privacy data may exist in different cloud storages, by verifying the cloud that sends the processing result, it can be determined whether the privacy data file in the processing result is accurate.
[0144] In the privacy data security sharing system provided in this example, by verifying the cloud that sends the processing results and verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked, the privacy data security sharing method can determine whether the provider of the cloud storage maliciously discards data or returns erroneous data, thereby further improving security.
[0145] In some examples, in the privacy data security sharing system provided in the example, the privacy data outsourcing storage process further includes: encrypting the cloud identifier of each cloud in the M privacy data files by the fifth key and generating an encrypted cloud identifier; generating an m-bit first counting Bloom filter for each corresponding encrypted cloud identifier in the M privacy data files; and hashing each corresponding encrypted cloud identifier in the M privacy data files in the first counting Bloom filter by the first hash function family to generate a cloud verification object; verifying the cloud that sends the processing result includes: encrypting the cloud identifier of the cloud that sends the processing result by the fifth key and generating a sending cloud identifier; hashing the sending cloud identifier by the first hash function family and checking the value of the corresponding position in the corresponding cloud verification object, so as to determine whether the cloud that sends the processing result is correct, and the first hash function family includes multiple first hash functions. For example, if the value of the corresponding position in the corresponding cloud verification object is equal to 0, it can be determined that the cloud that sends the processing result is incorrect. If the values obtained after hashing are not equal to 0, it can be determined that the cloud that sends the processing result is correct. Therefore, the privacy data security sharing method can quickly and efficiently determine whether the cloud that sends the processing result is correct. It should be noted that the specific implementation of the above verification method can refer to the subsequent Algorithm 2.
[0146] In some examples, the fifth key is the same as the second key, which can simplify the procedure.
[0147] In some examples, in the privacy data security sharing system provided in the example, the privacy data outsourcing storage process further includes: recording the actual number of multiple encrypted data segments in the first encrypted data or the second encrypted data; verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked also includes: querying the number Sum configured to describe the number of multiple encrypted data segments in the first encrypted data or the second encrypted data corresponding to the identifier to be checked ω , if the number Sum ω If the number of encrypted data segments is not equal to the real number, the first encrypted data or the second encrypted data corresponding to the identifier to be checked is judged to be incomplete. Thus, the method for securely sharing private data can quickly judge that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete by judging whether the number of multiple encrypted data segments in the first encrypted data or the second encrypted data is correct.
[0148] In some examples, in the privacy data secure sharing system provided in the example, the privacy data outsourcing storage process also includes: generating an n-bit second counting Bloom filter for the first encrypted data or the second encrypted data; encrypting multiple encrypted data segments in the first encrypted data or the second encrypted data respectively by the sixth key to form multiple encrypted character segments; hashing the multiple encrypted character segments in the first m verification areas of the second counting Bloom filter by the second hash function family; and using the padding function to randomly fill the last nm padding areas of the second counting Bloom filter to ensure that the sum of the numbers in the final second counting Bloom filter is l*T to generate a data verification object, the second hash function family includes multiple second hash functions, l is the number of second hash functions in the second hash function family, and T is a fixed value, which is greater than the number of multiple encrypted data segments in the first encrypted data or the second encrypted data. Therefore, the secure sharing method of privacy data can resist possible statistical attacks and prevent attackers from obtaining the true number of multiple encrypted data segments in the privacy data file by dividing the total number in the data verification object (i.e., the filled second counting Bloom filter mentioned above) by the number of hash functions.
[0149] It should be noted that the second hash function family is the same as the first hash function family, so that the program can be simplified. Of course, the embodiments of the present application include but are not limited to this. In addition, in other examples, the second counting Bloom filter may not include a padding area.
[0150] In some examples, in the privacy data security sharing system provided in the example, verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked includes: encrypting multiple encrypted data segments in the first encrypted data or the second encrypted data corresponding to the identifier to be checked by the sixth key respectively to form multiple encrypted character segments; hashing the multiple encrypted character segments by the second hash function family and checking the values of the corresponding positions in the corresponding data verification object, so as to determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is correct. For example, when the value of the corresponding position in the corresponding data verification object is equal to 0, it can be determined that the current encrypted character segment does not belong to the correct privacy data file, so that the first encrypted data or the second encrypted data corresponding to the identifier to be checked can be determined to be incorrect. Therefore, the privacy data security sharing method can quickly and efficiently determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is correct. It should be noted that the specific implementation of the above verification method can refer to the subsequent algorithm 2.
[0151] In some examples, in the privacy data security sharing system provided in the example, verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked also includes: encrypting multiple encrypted data segments in the first encrypted data or the second encrypted data corresponding to the identifier to be checked by the sixth key respectively to form multiple encrypted character segments; hashing the multiple encrypted character segments by the second hash function family, and reducing the value of the corresponding position in the corresponding data verification object by one, if the value of the encrypted character segment processed by a certain second hash function in the corresponding position in the corresponding data verification object is less than or equal to 0, or the sum of the values of all positions in the hashed data verification object is not equal to 0, then it is judged that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete. Therefore, the secure sharing method of privacy data can effectively and accurately determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is complete. It should be noted that the specific implementation of the above verification process can refer to the subsequent algorithm 3.
[0152] For example, Figure 4 As shown in the figure, the fifth column C(Λ) is the actual number of encrypted data in the encrypted privacy data file. w∈W ) represents the encrypted data set corresponding to the actual number of multiple encrypted data in the encrypted privacy data file (i.e., c(ds) w∈W ); the sixth column VO G To expand to a one-to-two cloud verification object; the seventh column VO W Expanded to a one-to-two data validation object.
[0153] It is worth noting that the above-mentioned secure sharing system for private data also includes method steps corresponding to the above-mentioned secure sharing method for private data, which will not be repeated here.
[0154] Next, Figure 5 The secure sharing system of privacy data shown in the figure is used for the secure sharing of energy transaction data. Figure 5 As shown in the figure, the secure sharing system of private data mainly includes: storage user (StorageUser), the owner of energy transaction private data, outsources the storage of on-chain transaction private data to the cloud; blockchain (Blockchain), where energy transaction users reach energy transaction intentions and retain the hash value of the user's on-chain transaction private data; query user (QueryUser), the shared object of energy transaction private data, queries the shared transaction private data from the cloud; cloud (Cloud), that is, the provider of the outsourced storage service mentioned above, uses a one-to-many lookup table (e.g. Figure 4 ) to store the data provided by the user, receive the query request from the query user and return the corresponding data.
[0155] Figure 6 A schematic diagram of a cloud verification object provided in one embodiment of the present application. Figure 6 As shown in the figure, the cloud verification object is essentially a standard m-dimensional counting Bloom filter, and its initial value is 0. After the blockchain uses the AES encryption algorithm to encrypt the identifier of each cloud, it uses a pseudo-random function to process the encryption result, and finally uses l hash functions in the same hash function family to hash the processing result into the m-dimensional Bloom filter, and adds one to the corresponding hash position.
[0156] Figure 7 A schematic diagram of a data verification object provided by an embodiment of the present application. Figure 7 As shown, the data verification object is essentially an n-dimensional counting Bloom filter, where [0, m-1] is the verification area, and [m, n-1] is the filling area, and their initial values are all 0. The storage user uses a pseudo-random function to process multiple segments of encrypted data in the first encrypted data or the second encrypted data, and uses l hash functions in the same hash function family to hash the processing results to the first m verification areas of the n-dimensional counting Bloom filter, and adds one to the corresponding hash position. In the filling area of [m, n-1], the filling function P is used to perform random filling of T*l-the number of times filled, to ensure that the total number in each n-dimensional counting Bloom filter is l*T. (T is a fixed value, which is greater than the maximum number of transaction privacy data information of a single user).
[0157] Figure 4 A schematic diagram of a lookup table structure provided in one embodiment of the present application. Figure 4 As shown, the first column T(G) is the cloud identifier; the second column ID is the label under the same cloud; the third column prf k (W) is the index data segment expanded to one-to-two; the fourth column C (DS) w∈W is expanded to a one-to-two encrypted data segment; the fifth column C(Λ) is the actual number of encrypted data segments in the encrypted private data file. Each c(λ w∈W ) represents the encrypted data set corresponding to the actual number of multiple encrypted data in the encrypted privacy data file (i.e., c(ds) w∈W ); the sixth column VO G To expand to a one-to-two cloud verification object; the seventh column VO W Expanded to a one-to-two data validation object.
[0158] The data sharing scheme of the secure sharing system for private data includes:
[0159] (1) Privacy Data Outsourcing Storage Process
[0160] Whenever new transaction result data is generated, the blockchain will pre-process the private data file, use the identifier w corresponding to the private data file as the keyword, encrypt the private data file, and outsource the storage to the cloud, and update the encrypted data segment C(DS) stored therein. w At the same time, the corresponding data verification object VO w It also needs to be updated to ensure the real-time sharing of private data. The blockchain only needs to store the hash value of the private data file to ensure the consistency between the chain and the off-chain.
[0161] (2) Encrypted privacy data sharing process
[0162] The querying user first initiates a request to the blockchain to view the private data of the transaction user, and the party being viewed and the blockchain jointly determine their permissions. If the conditions are met, the user storing the private data will send a command to the blockchain and the cloud to agree to share, and the blockchain will return the cloud identifier and query guide set to the querying user. The querying user encrypts the identifier to be viewed ω and generates an encrypted query index prf k (ω), initiates a query request Q = {prf k (ω),C,E}.
[0163] After receiving the request from the user, the cloud first scans the index data segment column prf in the one-to-many lookup table. k (W), find multiple containing prf k (ω) corresponds to the index data segment. Then, the cloud can check C * (prf k (W)) is equal to E to find the target index data segment. After finding the target index data segment, the cloud further calculates C * (C(DS) w∈W ), C * (C(Λ)), C * (VO G ) and C * (VO W ), and returns the calculation result to the user.
[0164] After receiving the returned data, the user can use the private key sk to get c(ds) ω ,c(λ ω ), VO g and VO ω , and then use the shared key k AES Get available result set (ds) ω and the number of real transaction privacy data files λ ω It should be noted that the private key mentioned above is the third key mentioned above, and the shared key mentioned above is the first key.
[0165] (3) Encrypted privacy data verification process
[0166] The user first verifies the cloud that sent the message: the user uses the key k and l hash functions in the hash function family H to hash the cloud identifier information of the cloud that sent the message. The cloud verification object is checked. If all hash results are not 0, the cloud can be determined to be correct under the premise of satisfying the hash collision probability. Otherwise, it can be determined that the data is not sent by the requested cloud and the data is discarded. The key k mentioned above is the fifth key.
[0167] Next, the correctness and integrity of the message itself are verified: the user uses the key k and l hash functions in the hash function family H to hash the received encrypted data into the data verification object. If it is found that all hash results are not 0, the authenticity of the verification object can be determined under the premise of satisfying the hash collision probability, otherwise it can be determined that the data is not requested by the user and the data is discarded. Each time the hash is performed, the hash is reduced by one. When all the data are hashed, it can be confirmed that the information sent by the cloud is complete and reliable, otherwise it indicates that there is an omission.
[0168] Next, Figure 3 The secure sharing system for privacy data shown is used to describe in detail another specific working process of secure sharing of energy transaction data.
[0169] The system is initialized, a public-private key pair (pk, sk) is assigned to each transaction user, and a pseudo-random function key k and an encryption key k are generated. AES It should be noted that the above-mentioned transaction user can be a query user or a storage user.
[0170] First, based on the privacy data generated during the user transaction process, the blockchain will update the user transaction privacy data and verification objects stored in the cloud. The construction algorithm of the verification object is as follows:
[0171]
[0172]
[0173] Second, the querying user initiates a request to the blockchain to view the energy transaction privacy data of the trading user;
[0174] Third, the party being viewed and the blockchain jointly determine the query user's authority.
[0175] Fourth, if the corresponding permissions are met, the user who stores the private data will send a command to the cloud to agree to share. At the same time, the blockchain returns the cloud identifier g and the query guide set guideset to the query user. Based on the one-to-many lookup table, a form of F = {f d|1≤d≤n}, where n is the redundancy of the one-to-many lookup table. Specifically, a guide set F consists of a series of binary digits, each element f d is a binary number. Here, please note that there is only one binary "digit 1" in each guide set. For example Figure 4 is a one-to-two lookup table, then the guide set can be designed in the form of {1,0} or {0,1}. It should be noted here that the form of the guide set sent to the user is random, that is, the guide set received by the user may be {1,0} or {0,1}.
[0176] Fifth, the query user encrypts the identifier of the storage user to be viewed and generates the search index prf k (ω), initiates a query request Q = {prf k (ω), C, E}, where prf(·) is a pseudo-random function, k is the key of the pseudo-random function, and C is a series of the form {c d |1≤d≤n}, the ciphertext set composed of encrypted data, c d By public key pk and random number It is obtained by the Paillier encryption algorithm. The process is as follows:
[0177]
[0178] E indicates the query index prf through the public key pk and encryption k (ω) The encrypted data obtained. The calculation process is as follows:
[0179]
[0180] After receiving the request from the user, the cloud first scans the retrieval index column prf in the one-to-many lookup table. k (W), find multiple containing prf k (ω) The corresponding data item. The calculation is performed on each found data item as follows:
[0181]
[0182] Then, the cloud can check C * (prf k (W)) is equal to E to find the target data item. After finding the target data item, the cloud further calculates:
[0183]
[0184]
[0185]
[0186]
[0187] After completing the above calculations, the cloud returns the calculation results to the user.
[0188] When the user receives the calculation result from the cloud, he will verify the correctness and integrity of the result to ensure that the shared privacy data received is authentic and reliable. The user first uses AES to encode the cloud identifier g o Encrypt to get c(g o ), and then get prf k (c(g o )). Then, calculate {h1(prf k (c(g o ))),...,h l (prf k (c(g o )))} and check VO go Based on the above comparison, the user can confirm whether the returned data is g o Sent. To check the shared data result c(ds) ω To check the correctness of the calculation, the user first calculates {h1(prf k (c)),...,h l (prf k (c))}. Then, the user compares {h1(prf k (c)),...,h l (prf k (c))} and vo ω If VO ω A counter in ω If is 0, the private data is incorrect. The correctness verification process is shown in Algorithm 2.
[0189]
[0190]
[0191] To check the query results c(ds) ω To ensure completeness, the user first selects the available result set ds ω Find the number Sum representing the available description files ω Then, if Sum ω Not equal to the number of real description files λ ω , then the query result is c(ds) ω It can be directly judged as incomplete. Otherwise, the user can ω Find the corresponding available encrypted transaction data. In addition, for each available encrypted description file c∈c(ds)ω , the user calculates {h1(prf k (c)),...,h l (prf k (c))}, the corresponding counter vo w [h j (prf k (c))] are all reduced by 1. Finally, the user can judge R ω Is it equal to 0 to confirm the query result c(ds) ω Is it complete?
[0192] The above R ω Satisfies the following formula:
[0193]
[0194] The integrity verification process is shown in Algorithm 3.
[0195]
[0196]
[0197] After the final verification is completed, the querying user can obtain the required energy trading user privacy data. The on-chain and off-chain privacy information sharing process is completed.
[0198] Sixth, the query user finally reaches a transaction intention with the storage user on the blockchain;
[0199] Seventh, conduct energy transactions off-chain;
[0200] Eighth, record the transaction results on the blockchain.
[0201] There are a few points to note:
[0202] (1) In the drawings of the embodiments of the present application, only the structures related to the embodiments of the present application are involved, and other structures can refer to the general design.
[0203] (2) Unless there is a conflict, the features in the same embodiment or in different embodiments of the present application may be combined with each other.
[0204] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for securely sharing private data, including a private data outsourcing storage process and a private data sharing process. in, The privacy data outsourcing storage process includes: Encrypting M private data files in the private data respectively according to the first key, and generating M first encrypted data; Encrypting the M identifiers of the M private data files respectively according to the second key, and generating M first indexes, wherein the M first indexes correspond one-to-one to the M first encrypted data; Performing N shifts on each of the first indexes and each of the first encrypted data respectively, so as to generate corresponding N groups of second indexes and N groups of second encrypted data; Generate an index data segment by using each of the first indexes and the corresponding N groups of second indexes, and generate an encrypted data segment by using each of the first encrypted data and the corresponding N groups of second encrypted data; and The M index data segments corresponding to the M first indexes and the M encrypted data segments corresponding to the M first encrypted data are stored in a cloud storage, The first indexes and the first encrypted data are shifted N times respectively, so that the M index data segments include (N+1) identical first indexes and second indexes located in different index data segments, and the M encrypted data segments include (N+1) identical first encrypted data and second encrypted data located in different encrypted data segments, M is a positive integer greater than N, and N is a positive integer greater than or equal to 1. The privacy data sharing process includes: The query user initiates a viewing request, wherein the viewing request includes an identifier to be searched; randomly generating a query guide set, wherein the query guide set is configured to indicate a logical position of a target index in the index data segment, wherein the target index includes the first index or the second index; Encrypting the identifier to be searched by the querying user by using the second key and generating an encrypted query index, generating query request information according to the encrypted query index and the query guide set, and sending the query request information to the cloud storage; The cloud storage finds the index data segment including the encrypted query index in the M index data segments according to the query request information, and processes the (N+1) index data segments including the encrypted query index using the query guide set to find the target index data segment including the target index in the (N+1) index data segments; extracting the encrypted data segment corresponding to the target index data segment, processing the encrypted data segment corresponding to the target index data segment using the query guide set, and sending the processing result to the query user; and The querying user uses the third key to decrypt the processing result to obtain the first encrypted data or the second encrypted data corresponding to the identifier to be queried, and then obtains the private data file corresponding to the identifier to be queried through the first key.
2. The method for securely sharing private data according to claim 1, in, The query guide set may include (N+1) binary numbers, and the (N+1) binary numbers include only one "1".
3. The method for securely sharing private data according to claim 2, in, Processing the (N+1) index data segments including the encrypted query index using the query guide set includes: The query guide set is used to perform product processing on the (N+1) index data segments including the encrypted query index to eliminate the first index or the second index corresponding to "0" in the (N+1) binary numbers.
4. The method for securely sharing private data according to claim 2, in, Processing the encrypted data segment corresponding to the target index data segment using the query guide set includes: The encrypted data segment corresponding to the target index data segment is subjected to product processing using the query guide set to eliminate the first encrypted data or the second encrypted data corresponding to "0" in the (N+1) binary numbers.
5. The method for securely sharing private data according to claim 3, in, The query request information Q = {prf k (w),C,E}, where prf k (w) is the encrypted query index, prf(×) is a pseudo-random function, k is the second key, which is a pseudo-random function, and C is a series of the form {c d |1£d£n}, a ciphertext consisting of encrypted data, c d The fourth key pk and the random number In the Paillier encryption algorithm, E is obtained by the fourth key pk and the encrypted query index prf k (w) The encrypted data obtained, the third key and the fourth key are a public-private key pair.
6. The method for securely sharing private data according to claim 5, in, c d The calculation formula is: The calculation formula of E is:
7. According to the method for securely sharing private data according to claim 6, in, And using the query guide set to process the (N+1) index data segments including the encrypted query index also includes: The following calculations are performed on the (N+1) index data segments including the encrypted query index: Judgment C * (prf k (W)) is equal to E. If they are equal, the current index data segment is the target index data segment including the target index.
8. The method for securely sharing private data according to claim 6, in, Processing the encrypted data segment corresponding to the target index data segment using the query guide set includes: The following calculation is performed on the encrypted data segment corresponding to the target index data segment:
9. The method for securely sharing private data according to any one of claims 1 to 8, in, The privacy data outsourcing storage process also includes: The hash values of the M private data files in the private data are stored in the blockchain.
10. The method for securely sharing private data according to any one of claims 1 to 8, in, The data sharing process also includes: The authority of the query user is determined, and if the query user meets the conditions, the query guide set is returned to the query user.
11. The method for securely sharing private data according to any one of claims 1 to 8, further comprising a private data verification process, in, The privacy data verification process includes: Verifying the cloud that sends the processing result; and The correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked are verified.
12. The method for securely sharing private data according to claim 11, in, The privacy data outsourcing storage process also includes: encrypting the cloud identifier of the cloud where each of the M privacy data files is located by a fifth key, and generating an encrypted cloud identifier; generating an m-bit first counting Bloom filter for each corresponding encrypted cloud identifier in the M privacy data files; and hashing each corresponding encrypted cloud identifier in the M privacy data files in the first counting Bloom filter by a first hash function family, so as to generate a cloud verification object; Verifying the cloud that sends the processing result includes: encrypting the cloud identifier of the cloud that sends the processing result using the fifth key, and generating a sending cloud identifier; The sending cloud identifier is hashed by the first hash function family and the value of the corresponding position in the corresponding cloud verification object is checked to determine whether the cloud sending the processing result is correct, The first hash function family includes multiple first hash functions.
13. The method for securely sharing private data according to claim 12, in, The fifth key is the same as the second key.
14. The method for securely sharing private data according to claim 11, in, The privacy data outsourcing storage process further includes: recording the actual number of multiple segments of encrypted data in the first encrypted data or the second encrypted data; Verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked further includes: Query the first encrypted data or the second encrypted data corresponding to the identifier to be checked, which is configured to describe the number of the multiple segments of encrypted data. ω , if the number Sum ω If the number of encrypted data or the second encrypted data corresponding to the identifier to be checked is not equal to the real number, it is determined that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete.
15. The method for securely sharing private data according to claim 11, in, The privacy data outsourcing storage process also includes: generating an n-bit second counting Bloom filter for the first encrypted data or the second encrypted data; encrypting multiple encrypted data segments in the first encrypted data or the second encrypted data respectively by a sixth key to form multiple encrypted character segments; hashing the multiple encrypted character segments in the first m verification areas of the second counting Bloom filter by a second hash function family; and using a padding function to randomly fill the last nm padding areas of the second counting Bloom filter to ensure that the final sum of the numbers in the second counting Bloom filter is l*T, so as to generate a data verification object. The second hash function family includes multiple second hash functions, l is the number of the second hash functions in the second hash function family, and T is a fixed value that is greater than the number of the multiple segments of encrypted data in the first encrypted data or the second encrypted data.
16. According to the method for securely sharing private data according to claim 15, in, Verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked includes: Encrypt multiple segments of encrypted data in the first encrypted data or the second encrypted data corresponding to the identifier to be checked respectively by the sixth key to form multiple encrypted character segments; hash the multiple encrypted character segments by the second hash function family and check the values of corresponding positions in the corresponding data verification object, so as to determine whether the first encrypted data or the second encrypted data corresponding to the identifier to be checked is correct.
17. The method for securely sharing private data according to claim 15, in, Verifying the correctness and integrity of the first encrypted data or the second encrypted data corresponding to the identifier to be checked further includes: Encrypt multiple segments of encrypted data in the first encrypted data or the second encrypted data corresponding to the identifier to be checked respectively by using the sixth key to form multiple encrypted character segments; hash the multiple encrypted character segments by using the second hash function family, and reduce the value of the corresponding position in the corresponding data verification object by one; if the value of the corresponding position of the encrypted character segment after being processed by a certain second hash function in the corresponding data verification object is less than or equal to 0, or the sum of the values of all positions in the hashed data verification object is not equal to 0, then it is determined that the first encrypted data or the second encrypted data corresponding to the identifier to be checked is incomplete.
18. The method for securely sharing private data according to any one of claims 1 to 8, in, The private data includes energy transaction data.
19. A secure sharing system for private data. include: A storage user, a query user and a cloud storage, wherein the storage user is configured to encrypt M private data files in the private data according to a first key, and generate M first encrypted data; encrypt M identifiers of the M private data files according to a second key, and generate M first indexes, wherein the M first indexes correspond one-to-one to the M first encrypted data; offset each of the first indexes and each of the first encrypted data N times, respectively, to generate corresponding N groups of second indexes and N groups of second encrypted data; and generate index data segments from each of the first indexes and the corresponding N groups of second indexes, and generate encrypted data segments from each of the first encrypted data and the corresponding N groups of second encrypted data; The cloud storage is configured to store the M index data segments corresponding to the M first indexes and the M encrypted data segments corresponding to the M first encrypted data. The first indexes and the first encrypted data are shifted N times respectively, so that the M index data segments include (N+1) identical first indexes located in different index data segments, and the M encrypted data segments include (N+1) identical first encrypted data located in different encrypted data segments, where M is a positive integer greater than N, and N is a positive integer greater than or equal to 1. During the private data sharing process, the querying user initiates a viewing request, and the viewing request includes an identifier to be searched; The storage user is configured to randomly generate a query guide set, wherein the query guide set is configured to indicate a logical position of a target index in the index data segment, wherein the target index includes the first index or the second index; The query user is configured to encrypt the identifier to be checked by the query user by using the second key and generate an encrypted query index, generate query request information according to the encrypted query index and the query guide set, and send the query request information to the cloud storage; The cloud storage is configured to find the index data segment including the encrypted query index in the M index data segments according to the query request information, and use the query guide set to process the (N+1) index data segments including the encrypted query index, so as to find the target index data segment including the target index in the (N+1) index data segments; extract the encrypted data segment corresponding to the target index data segment, and use the query guide set to process the encrypted data segment corresponding to the target index data segment, and send the processing result to the query user; The querying user uses the third key to decrypt the processing result to obtain the first encrypted data or the second encrypted data corresponding to the identifier to be queried, and then obtains the private data file corresponding to the identifier to be queried through the first key.
