A cross-chain data sharing method based on IPFS secure search
By establishing a cross-chain data sharing method based on IPFS between blockchain systems, using the F-SPRE algorithm and F-CCDS solution, the problems of poor cross-chain interoperability, insufficient security and low data search efficiency in data sharing among blockchain systems are solved, and safe and efficient data sharing and fine-grained data sharing are achieved.
Patent Information
- Application Number
- CN202411166976.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The prior art has problems such as poor cross-chain interoperability, insufficient security and low data search efficiency in data sharing among blockchain systems, especially when different blockchain systems structures, consensus mechanisms and cryptographic mechanisms are different.
A cross-chain data sharing method for secure search based on IPFS is proposed. By building an F-SPRE algorithm and F-CCDS solution, the relay chain and side chain are used as cross-chain bridges to realize full cross-chain data sharing, and through proxy re-encryption and conditional proxy re-encryption technology, the security and efficiency of data search are ensured.
It realizes secure and efficient data sharing among different blockchain systems, avoids sensitive information leakage, simplifies the data retrieval process, and supports efficient data sharing at a fine-grained and efficient data sharing.
Smart Images

Figure CN119051872B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a cross-chain data sharing method based on IPFS secure search. Background Art
[0002] With the widespread application of blockchain technology in multiple industries such as finance and healthcare, its role as a trusted entity has become increasingly prominent. However, the scalability limitations of blockchain and the delays associated with the consensus process hinder the efficiency of users storing and accessing data. Therefore, many users have turned to outsourcing data storage to the InterPlanetary File System (IPFS), which greatly reduces the storage burden of blockchain systems. However, this outsourced data often contains sensitive information, so the data owner must encrypt it with their public key before outsourcing.
[0003] To facilitate secure and efficient data search, searchable encryption (SE) algorithms are widely adopted in IPFS data storage. Using the SE algorithm, data owners encrypt keywords in documents to create indexes stored on the blockchain. Data users, based on their permissions, can generate traps linked to these keywords to find and retrieve the corresponding data in IPFS. However, the use of encryption increases the complexity of data sharing between different blockchain systems. For example, if a data user retrieves ciphertext from IPFS, the data owner must reveal his private key after obtaining the required ciphertext, thereby risking the disclosure of this sensitive key. Alternatively, if ciphertext retrieval is handled by the data owner, they must handle complex processes such as downloading, decrypting, and transmitting data, which requires a lot of storage and computing resources. Therefore, the challenge is not only to enable search capabilities, but also to ensure efficient data sharing.
[0004] However, the existing SE algorithm only encrypts keywords to achieve searchability, but cannot decrypt ciphertext, making it difficult to use them safely and efficiently in data sharing environments. The proxy re-encryption algorithm (PRE) is an algorithm widely used in the field of data sharing. PRE can re-encrypt the ciphertext generated by user A into a ciphertext that user B can decrypt with his own private key. Compared with traditional schemes, PRE does not need to perform tedious steps such as data downloading, decryption and re-encryption, but can directly re-encrypt the ciphertext. This process only requires the data user to generate a re-encryption key, and the proxy uses the re-encryption key to convert the ciphertext, and it does not know the private key of the data user.
[0005] Inspired by SE and PRE, a SE-based proxy re-encryption (SPRE) scheme was proposed to solve the problem of data search and sharing. The researchers proposed a proxy re-encryption algorithm (PREKS) that supports the proxy to perform keyword search and re-encryption distribution. However, this scheme cannot limit the re-encryption permissions of the re-encryption key held by the proxy. To solve this problem, the researchers used conditional proxy re-encryption (CPRE) to implement fine-grained re-encryption control, and the original ciphertext that meets the conditions can be re-encrypted by the proxy using the re-encryption key.
[0006] The existing technical solutions have the following phenomenon when performing data search: a random number, namely probabilistic trapdoor, is selected when generating a trapdoor, so as to ensure that attackers cannot directly distinguish the similarities and differences of trapdoors from the transmitted values. However, the above approach cannot resist FAA. Attackers can judge the similarities and differences of trapdoors by constructing a bilinear map to perform division operations to eliminate random numbers, thereby leaking sensitive information such as keywords.
[0007] In terms of data sharing: some existing solutions are centralized structures, and they require an honest proxy server to ensure the correct execution of the cross-chain conversion process. Such cloud servers may not exist in reality. In reality, semi-honest cloud servers may return incorrect answers after a search fails. Other technologies attempt to use decentralized blockchains to replace centralized servers, solving the problem of reliable data search while achieving efficient data sharing. As an emerging technology, blockchain has the characteristics of credibility, security, tamper resistance, and traceability. However, directly replacing centralized servers with blockchains may introduce problems such as privacy information leakage. For example, a malicious attacker may obtain the privacy of data users by launching internal keyword guessing attacks or file injection attacks. Existing solutions mainly study data sharing within the same blockchain. For the problems faced by different blockchains in cross-chain data sharing, such as different system structures, consensus mechanisms, and cryptographic mechanisms, the existing solutions are not applicable.
[0008] In order to solve the above problems, the present invention proposes a cross-chain data sharing method based on IPFS secure search. Summary of the invention
[0009] The purpose of the present invention is to propose a cross-chain data sharing method based on IPFS secure search to solve the problems raised in the background technology:
[0010] 1. How to solve the problem of different blockchain system structures, establish a trust mechanism, and achieve cross-chain information exchange.
[0011] 2. How to achieve secure data search so that sensitive information is not leaked during the search process.
[0012] 3. How to achieve efficient sharing of data at a fine-grained level without complicated steps and when the number of query operations increases.
[0013] In order to achieve the above object, the present invention adopts the following technical solutions:
[0014] A cross-chain data sharing method based on IPFS secure search, comprising the following steps:
[0015] S1: Build a searchable proxy re-encryption algorithm that is effective against FAA, namely the F-SPRE algorithm;
[0016] S2: Use the relay chain and side chain as a cross-chain bridge. In the scenario where data is stored in IPFS, a complete cross-chain data sharing solution, namely the F-CCDS solution, is constructed through the F-SPRE algorithm.
[0017] S3: Sharing cross-chain data based on the F-CCDS solution.
[0018] Preferably, the F-SPRE algorithm is specifically as follows:
[0019] S1.1: System establishment: The system is initialized by the trusted authority, as follows:
[0020] G1 and G2 are cyclic groups of prime order p, e is a bilinear map from G1×G1→G2; g is a generator of the cyclic group; randomly select g1, g2←G2, and calculate L=e(g1,g2); select a collision-resistant hash function Public system parameters PP = {e, g, g1, g2, L, H};
[0021] S1.2: Key generation: used to generate the public and private keys of users and agents, as follows:
[0022] Users u1 and u2 are randomly selected Calculate the private key The public keys are Random selection of agents And calculate the private key Public Key
[0023] S1.3: Data encryption: used to encrypt message m into original ciphertext m1, as follows:
[0024] For a given m1, the system parameter PP, the private key of user u1 Public keys of users u1 and u2 Keyword ω and random number As input, calculate the original ciphertext m1:
[0025] C0=Lr ·m
[0026]
[0027] C2=e(g1,g) r
[0028]
[0029]
[0030]
[0031]
[0032] Thus, the initial encrypted ciphertext P is obtained. CT =(C0,C1,C2,C3,C6), the ciphertext S can be searched CT =(C1,C3,C4,C5); where C0, C1, C2, C2, C3, C4, C5, C6 are the ciphertext sequences in the initial ciphertext respectively;
[0033] S1.4: Data decryption: used to decrypt the original ciphertext m1, as follows:
[0034] Given the private key of user u1 Initial encrypted ciphertext P CT ;calculate
[0035] S1.5: Trapdoor generation: used to generate user query trapdoors, as follows:
[0036] Given the private key of user u2 Public keys of users u1 and u2 and query keyword ω, select a random number Calculate query trap door T ω :
[0037]
[0038]
[0039]
[0040]
[0041] Generate query trap T ω =(T1, T2, T3, T4); where T1, T2, T3, and T4 are the sequences of query trapdoors respectively;
[0042] S1.6: Data query: used to query files containing the keyword ω, as follows:
[0043] Use query trap T ω Search S CT , and use the following formula to determine S CT Does it contain keywords:
[0044] ω:e(T1,C3)·e(T5,C4)=e(T4,C2)·e(T3,C1)
[0045] If the equation holds, the query is successful, otherwise the query fails;
[0046] S1.7: Re-encryption key generation: used to generate re-encryption keys, as follows:
[0047] Given the private key of user u1 Public key of user u2 and the public key of the proxy node Generate the re-encryption key as:
[0048]
[0049] S1.8: Re-encryption: After receiving the ciphertext address, the proxy re-encrypts the initial encrypted ciphertext as follows:
[0050] Given the re-encryption key RK 1→2 and the initial encrypted ciphertext P CT , and its own private key Calculate the re-encryption calculation:
[0051] C'0=C0
[0052] C1'=C1
[0053]
[0054] Get the re-encrypted ciphertext P C ' T =(C'0,C1',C'2); where C'0, C1', C'2 are the re-encrypted ciphertext sequences;
[0055] S1.9: Decryption of re-encrypted ciphertext: used to decrypt re-encrypted ciphertext P C ' T , as follows:
[0056] Given the private key of user u2 Re-encrypt the ciphertext P C ' T As input, calculate
[0057]
[0058] Preferably, the F-CCDS solution is as follows:
[0059] S2.1: System establishment:
[0060] The consortium chain first runs the Setup algorithm to generate system parameters, and then uses the KeyGen algorithm to generate the public and private keys of the nodes. Among them, the public and private keys of MS1 are PK MS1 , S.K. MS1 , and finally publish the public key information and system parameters PP = {e, g, g1, g2, L, H};
[0061] The data owner DO and data user DU in the alliance chain use the KeyGen algorithm to generate their own public and private keys pk DO ,sk DO and pk DU ,sk DU ;
[0062] The side chain integrates the corresponding consortium chain module and generates a cross-chain access request smart contract; the node CN1 in Side-chain 1 generates its own public and private key PK CN1 , S.K. CN1 ;
[0063] The consortium chain connects to the relay chain through the side chain, reads the public key information and system parameters of other consortium chains under the relay chain, and deploys the cryptographic mechanism of the corresponding consortium chain;
[0064] S2.2: Storage Data:
[0065] At this stage, the data owner DO generates data ciphertext and uploads it to IPFS1 storage, generates keyword index and writes it into the blockchain; the specific content is described as follows:
[0066] Computing node CN1 generates i temporary public and private key pairs and And i temporary public keys Send to DO;
[0067] DO And the Encrypt algorithm generates a keyword ω i The corresponding ciphertext and will Upload to IPFS1 for storage;
[0068] DO Generate Keyword Index and will Sent to MS1 and written into the blockchain;
[0069] For each DO calculation generation and keyword ω i The corresponding hash value R i =H i (ω i ), and will contain and R i The corresponding relationship is sent to CN1; CN1 forms a R i The relationship list Lis1 is saved locally;
[0070] S2.3: Send cross-chain access request:
[0071] At this stage, the data user DU in Blockchain2 initiates a cross-chain access request to the data owner DO in Blockchain1;
[0072] DU will keyword ω i Encrypted to ciphertext Send a cross-chain access request message Among them, request1 is the cross-chain access identifier, T1 is the timestamp, and N1 is the parameter for maintaining session freshness; message M1 is forwarded to CN1 through the relay chain;
[0073] CN1 query pk DU The blockchain and specific node to which it belongs, mobilizes the cross-chain smart contract, and initiates a session request message to establish a session with the DU to MS1;
[0074] MS1 verifies the identity of DU. After the identity of DU is verified, it sends the cross-chain access permission message Send to DO;
[0075] After receiving the message, DO decrypts m1 to obtain the keyword ω i , establish a session channel with CN1, and then generate R i =H i (ω i ) is sent to CN1;
[0076] DO by R i Search locally And use the Rekey algorithm to generate a re-signing key Send the message Sent to MS1, where request4 is the ciphertext conversion request identifier;
[0077] S2.4: Data query:
[0078] CN1 searches for R in the relation list Lis1 i The corresponding public and private key pair and SK CN1, and use the Trapdoor algorithm to generate query keywords ω i Trapdoor T ω =(T1,T2,T3,T4);
[0079] CN1 uses T ω Search keyword index in MS1 Use the Query algorithm to determine the keyword index Does it contain the user query keyword: e(T1,C3)·e(T5,C4)=e(T4,C2)·e(T3,C1)? If the equation holds, the query is successful and the keyword index is The corresponding ciphertext The address is given to MS1; otherwise, the query fails;
[0080] MS1 searches for ciphertext in IPFS1 according to the ciphertext address And download it to MS1 locally;
[0081] S2.5: Ciphertext conversion:
[0082] MS1 first sends the ciphertext Re-signing key RK 1→2 And its own private key SK MS1 As input, use the ReEncrypt algorithm to output the re-encrypted ciphertext P C ' T =(C'0, C1', C'2); Secondly, MS1 uses the public key pk of DU DU Encryption P C ' T ,generate The final MS1 generation And send it to CN1;
[0083] CN1 decrypts M5 and obtains it in the relationship list Lis1 The corresponding private key SK CN1 , the message Send to DU;
[0084] S2.6: Information Acquisition:
[0085] Data user DU uses his own private key to decrypt ciphertext M6 and obtain Decrypt m2 again to get P C ' T ;
[0086] Finally, DU used SK CN1 and ReDecrypt algorithm to decrypt P C ' T , thereby obtaining the keyword ω i The corresponding data.
[0087] Preferably, during the data sharing process, S3 adopts an identity authentication protocol and a DAG-D consensus algorithm for heterogeneous nodes.
[0088] Compared with the prior art, the present invention provides a cross-chain data sharing method based on IPFS secure search, which has the following beneficial effects:
[0089] The present invention builds a searchable proxy re-encryption algorithm that effectively resists FAA, realizes secure search while ensuring the indistinguishability of trapdoors and the unforgeability of ciphertexts. At the same time, there is no need for cumbersome downloading, decryption and re-encryption processes, and when the number of query operations increases, fine-grained and efficient data sharing can be achieved. In the scenario where data is stored in IPFS, a fully cross-chain data sharing solution based on searchable security is constructed. The present application realizes fully heterogeneous cross-chain, which can realize data sharing between blockchains with different system structures, authentication mechanisms, cryptographic systems, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] Figure 1 This is a flow chart of the method mentioned in Example 1 of the present invention;
[0091] Figure 2 This is a schematic diagram of the F-CCDS solution system model mentioned in Example 1 of the present invention;
[0092] Figure 3 This is an overall flow chart of the F-CCDS solution mentioned in Example 1 of the present invention;
[0093] Figure 4 This is a schematic diagram of the results of testing the F-CCDS solution using the Scyther tool mentioned in Example 1 of the present invention. DETAILED DESCRIPTION
[0094] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0095] The present invention builds a searchable proxy re-encryption algorithm that is effective against FAA, achieving secure search while ensuring the indistinguishability of trapdoors and the unforgeability of ciphertexts. At the same time, there is no need for cumbersome downloading, decryption, and re-encryption processes, and when the number of query operations increases, fine-grained and efficient data sharing can be achieved. In the scenario where data is stored in IPFS, a fully cross-chain data sharing solution based on searchable security is constructed. The present application implements fully heterogeneous cross-chain, which can realize data sharing between blockchains with different system structures, authentication mechanisms, cryptographic systems, etc. Specifically includes the following contents.
[0096] Embodiment 1:
[0097] See also Figure 1-4 The present invention provides a cross-chain data sharing method based on IPFS secure search, comprising the following steps:
[0098] S1: Build a searchable proxy re-encryption algorithm that is effective against FAA, namely the F-SPRE algorithm; the details are as follows:
[0099] S1.1: System establishment: The system is initialized by the trusted authority, as follows:
[0100] G1 and G2 are cyclic groups of prime order p, e is a bilinear map from G1×G1→G2; g is a generator of the cyclic group; randomly select g1, g2←G2, and calculate L=e(g1,g2); select a collision-resistant hash function Public system parameters PP = {e, g, g1, g2, L, H};
[0101] S1.2: Key generation: used to generate the public and private keys of users and agents, as follows:
[0102] Users u1 and u2 are randomly selected Calculate the private key The public keys are Random selection of agents And calculate the private key Public Key
[0103] S1.3: Data encryption: used to encrypt message m into original ciphertext m1, as follows:
[0104] For a given m1, the system parameter PP, the private key of user u1 Public keys of users u1 and u2 Keyword ω and random number As input, calculate the original ciphertext m1:
[0105] C0=L r ·m
[0106]
[0107] C2=e(g1,g) r
[0108]
[0109]
[0110]
[0111]
[0112] Thus, the initial encrypted ciphertext P is obtained. CT =(C0,C1,C2,C3,C6), the ciphertext S can be searched CT =(C1,C3,C4,C5); where C0, C1, C2, C2, C3, C4, C5, C6 are the ciphertext sequences in the initial ciphertext respectively;
[0113] S1.4: Data decryption: used to decrypt the original ciphertext m1, as follows:
[0114] Given the private key of user u1 Initial encrypted ciphertext P CT ;calculate
[0115] S1.5: Trapdoor generation: used to generate user query trapdoors, as follows:
[0116] Given the private key of user u2 Public keys of users u1 and u2 and query keyword ω, select a random number Calculate query trap door T ω :
[0117]
[0118]
[0119]
[0120]
[0121] Generate query trap T ω =(T1, T2, T3, T4); where T1, T2, T3, and T4 are the sequences of query trapdoors respectively;
[0122] S1.6: Data query: used to query files containing the keyword ω, as follows:
[0123] Use query trap T ω Search S CT , and use the following formula to determine S CT Does it contain keywords:
[0124] ω:e(T1,C3)·e(T5,C4)=e(T4,C2)·e(T3,C1)
[0125] If the equation holds, the query is successful, otherwise the query fails;
[0126] S1.7: Re-encryption key generation: used to generate re-encryption keys, as follows:
[0127] Given the private key of user u1 Public key of user u2 and the public key of the proxy node Generate the re-encryption key as:
[0128]
[0129] S1.8: Re-encryption: After receiving the ciphertext address, the proxy re-encrypts the initial encrypted ciphertext as follows:
[0130] Given the re-encryption key RK 1→2 and the initial encrypted ciphertext P CT , and its own private key Calculate the re-encryption calculation:
[0131] C'0=C0
[0132] C1'=C1
[0133]
[0134] Get the re-encrypted ciphertext P C ' T =(C'0,C1',C'2); where C'0, C1', C'2 are the re-encrypted ciphertext sequences;
[0135] S1.9: Decryption of re-encrypted ciphertext: used to decrypt re-encrypted ciphertext P C ' T , as follows:
[0136] Given user u2's private key sk u2 , re-encrypt the ciphertext P C ' T As input, calculate
[0137]
[0138] The F-SPRE algorithm realizes secure search while ensuring the indistinguishability of trapdoors and the unforgeability of ciphertext. At the same time, it does not require tedious downloading, decryption, and re-encryption processes, and when the number of query operations increases, it can achieve efficient sharing of data in a fine-grained manner.
[0139] S2: Use the relay chain and side chain as a cross-chain bridge. In the scenario where data is stored in IPFS, a complete cross-chain data sharing solution, namely the F-CCDS solution, is constructed through the F-SPRE algorithm.
[0140] Reference Figure 2 The system model consists of seven entities, as follows:
[0141] 1. Data Owner (DO): A user under the alliance chain who encrypts the data and uploads it to IPFS for storage, and writes the keyword index corresponding to the ciphertext into the blockchain through the node to which it belongs.
[0142] 2. Data User (DU): A user under the alliance chain needs to provide the keyword of the data when sending a cross-chain access request. After the identity and authority verification are successful, the corresponding data can be obtained.
[0143] 3. Nodes: The nodes of each chain can be divided into three categories: coordination nodes, computing nodes and supervision nodes. Different types of nodes focus on different functions. Coordination nodes are responsible for connecting to other blockchain nodes, computing nodes are responsible for the main computing tasks, and supervision nodes supervise other nodes and record supervision information to eliminate malicious nodes.
[0144] 4. Master Server (MS): It is the highest-level server in a node (this paper regards it as the same node as the blockchain node), responsible for operations such as keyword index storage and search.
[0145] 5. Interplanetary File System (IPFS): It is a semi-trusted distributed database responsible for storing data.
[0146] 6. Sidechain: It is a parallel chain of the alliance chain, which integrates the modules of the alliance chain and can interact with the alliance chain using the interface protocol. A smart contract is deployed to handle cross-chain requests of the alliance chain.
[0147] 7. Relay Chain: As the main chain, the relay chain connects two heterogeneous chains and can read and verify the data information of the alliance chain connected to the side chain through user ID, data identification and other information. It can realize data traceability, audit and other operations.
[0148] The F-CCDS scheme uses relay chains and side chains as cross-chain bridges. Data owners DO encrypt their data and upload it to IPFS for storage, and upload the keyword index corresponding to the ciphertext to the blockchain storage. When the authenticated data user DU needs to access data corresponding to a keyword, the side chain CN1 will generate a trapdoor to search for the index corresponding to the keyword in MS1. Then, MS1 obtains the ciphertext from IPFS according to the address corresponding to the searched index. DO sends the re-encryption key to MS1. Finally, MS1 re-encrypts the ciphertext, and the re-encrypted ciphertext is forwarded to DU through CN1. DU can use the key to decrypt and obtain the data.
[0149] S3: Sharing cross-chain data based on the F-CCDS solution.
[0150] Reference Figure 3As can be seen from the figure, this embodiment enables data on one blockchain to be shared with another blockchain.
[0151] Test the F-CCDS solution based on the Scyther tool. For details, please refer to Figure 4 After formally modeling and security attribute modeling of the F-CCDS solution using the Scyther tool, the SPDL model was run and the four aspects of security statements were tested. The results are as follows Figure 3 As shown. The test shows that the F-CCDS solution can definitely resist replay attacks, man-in-the-middle attacks, etc. In summary, under the proof of the Scyther tool, it can be shown that the F-CCDS solution does not have any suspicious security attacks.
[0152] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A cross-chain data sharing method based on IPFS secure search, characterized in that: The steps include: S1: Build a searchable proxy re-encryption algorithm that is effective against FAA, namely the F-SPRE algorithm; S2: Using the relay chain and side chain as a cross-chain bridge, in the scenario where data is stored in IPFS, a complete cross-chain data sharing solution, namely the F-CCDS solution, is constructed through the F-SPRE algorithm; the F-CCDS solution is as follows: S2.1: System establishment: The alliance chain first runs the Setup algorithm to generate system parameters, and then uses the KeyGen algorithm to generate the public and private keys PK of the node. yi , S.K. yi , where the public and private keys of MS1 are PK MS1 , S.K. MS1 , and finally publish the public key information and system parameters PP = {e, g, g1, g2, L, H}; The data owner DO and data user DU in the alliance chain use the KeyGen algorithm to generate their own public and private keys pk DO ,sk DO and pk DU ,sk DU ; The side chain integrates the corresponding alliance chain module and generates a cross-chain access request smart contract; the node CN1 in Side-chain 1 generates its own public and private key PK CN1 , S.K. CN1 ; The consortium chain connects to the relay chain through the side chain, reads the public key information and system parameters of other consortium chains under the relay chain, and deploys the cryptographic mechanism of the corresponding consortium chain; S2.2: Storage Data: At this stage, the data owner DO generates data ciphertext and uploads it to IPFS1 storage, generates keyword index and writes it into the blockchain; the specific content is described as follows: Computing node CN1 generates i temporary public-private key pairs PK CN1i and SK CN1i , and i temporary public keys Send to DO; DO And the Encrypt algorithm generates a keyword ω i The corresponding ciphertext and will Upload to IPFS1 for storage; DO Generate Keyword Index and will Sent to MS1 and written into the blockchain; For each DO calculation generation and keyword ω i The corresponding hash value R i =H i (ω i ), and will contain and R i The corresponding relationship is sent to CN1; CN1 forms a R i The relationship list Lis1 is saved locally; S2.3: Send cross-chain access request: At this stage, the data user DU in Blockchain2 initiates a cross-chain access request to the data owner DO in Blockchain1; DU will keyword ω i Encrypted to ciphertext Send a cross-chain access request message Among them, request1 is the cross-chain access identifier, T1 is the timestamp, and N1 is the parameter for maintaining session freshness; message M1 is forwarded to CN1 through the relay chain; CN1 query pk DU The blockchain and specific node to which it belongs, mobilizes the cross-chain smart contract, and initiates a session request message to establish a session with the DU to MS1; MS1 verifies the identity of DU. After the identity of DU is verified, it sends the cross-chain access permission message Send to DO; After receiving the message, DO decrypts m1 to obtain the keyword ω i , establish a session channel with CN1, and then generate R i =H i (ω i ) is sent to CN1; DO by R i Search locally And use the Rekey algorithm to generate a re-signing key Send the message Sent to MS1, where request4 is the ciphertext conversion request identifier; S2.4: Data query: CN1 searches for R in the relation list Lis1 i The corresponding public and private key pair and SK CN1 , and use the Trapdoor algorithm to generate query keywords ω i Trapdoor T ω =(T1,T2,T3,T4); CN1 uses T ω Search keyword index in MS1 Use the Query algorithm to determine the keyword index Does it contain the user query keyword: e(T1,C3)·e(T5,C4)=e(T4,C2)·e(T3,C1)? If the equation holds, the query is successful and the keyword index is The corresponding ciphertext The address is given to MS1; otherwise, the query fails; MS1 searches for ciphertext in IPFS1 according to the ciphertext address And download it to MS1 locally; S2.5: Ciphertext conversion: MS1 first sends the ciphertext Re-signing key RK 1→2 And its own private key SK MS1 As input, use the ReEncrypt algorithm to output the re-encrypted ciphertext P′ CT =(C'0, C'1, C'2); Secondly, MS1 uses the public key pk of DU DU Encryption P′ CT ,generate The final MS1 generation And send it to CN1; CN1 decrypts M5 and obtains it in the relationship list Lis1 The corresponding private key SK CN1 , the message Send to DU; S2.6: Information Acquisition: Data user DU uses his own private key to decrypt ciphertext M6 and obtain Decrypt m2 again to get P C ' T ; Finally, DU used SK CN1 and ReDecrypt algorithm to decrypt P C ' T , thereby obtaining the keyword ω i Corresponding data; S3: Sharing cross-chain data based on the F-CCDS solution.
2. A cross-chain data sharing method based on IPFS secure search according to claim 1, characterized in that: The F-SPRE algorithm is as follows: S1.1: System establishment: The system is initialized by the trusted authority, as follows: G1 and G2 are cyclic groups of prime order p, e is a bilinear map from G1×G1→G2; g is a generator of the cyclic group; randomly select g1, g2←G2, and calculate L=e(g1,g2); select a collision-resistant hash function Public system parameters PP = {e, g, g1, g2, L, H}; S1.2: Key generation: used to generate the public and private keys of users and agents, as follows: Users u1 and u2 are randomly selected Calculate the private key The public keys are Random selection of agents And calculate the private key Public Key S1.3: Data encryption: used to encrypt message m into original ciphertext m1, as follows: For a given m1, the system parameter PP, the private key of user u1 Public keys of users u1 and u2 Keyword ω and random number As input, calculate the original ciphertext m1: C0=L r ·m C2=e(g1,g) r Thus, the initial encrypted ciphertext P is obtained CT =(C0,C1,C2,C3,C6), the ciphertext S can be searched CT =(C1,C3,C4,C5); where C0, C1, C2, C2, C3, C4, C5, C6 are the ciphertext sequences in the initial ciphertext respectively; S1.4: Data decryption: used to decrypt the original ciphertext m1, as follows: Given the private key of user u1 Initial encrypted ciphertext P CT ;calculate S1.5: Trapdoor generation: used to generate user query trapdoors, as follows: Given the private key of user u2 Public keys of users u1 and u2 and query keyword ω, select a random number Calculate query trap door T ω : Generate query trap T ω =(T1, T2, T3, T4); where T1, T2, T3, and T4 are the sequences of query trapdoors respectively; S1.6: Data query: used to query files containing the keyword ω, as follows: Use query trap T ω Search S CT , and use the following formula to determine S CT Does it contain keywords: ω:e(T1,C3)·e(T5,C4)=e(T4,C2)·e(T3,C1) If the equation holds, the query is successful, otherwise the query fails; S1.7: Re-encryption key generation: used to generate re-encryption keys, as follows: Given the private key of user u1 Public key of user u2 and the public key of the proxy node Generate the re-encryption key as: S1.8: Re-encryption: After receiving the ciphertext address, the proxy re-encrypts the initial encrypted ciphertext as follows: Given the re-encryption key RK 1→2 and the initial encrypted ciphertext P CT , and its own private key Calculate the re-encryption calculation: C'0=C0 C1'=C1 Get the re-encrypted ciphertext P′ CT =(C'0,C'1,C'2); where C'0, C'1, C'2 are the re-encrypted ciphertext sequences; S1.9: Decryption of re-encrypted ciphertext: used to decrypt the re-encrypted ciphertext P′ CT , as follows: Given the private key of user u2 Re-encrypt the ciphertext P′ CT As input, calculate 3. A cross-chain data sharing method based on IPFS secure search according to claim 2, characterized in that: In the process of data sharing, the S3 adopts an identity authentication protocol and a DAG-D consensus algorithm for heterogeneous nodes.
Citation Information
Patent Citations
Cross-chain data security sharing method based on alliance chain
CN115378640A
System and method for securely storing and sharing information
US20180232526A1