Information encryption access method based on block chain
By processing and splitting text data in an out-of-order manner, and combining blockchain and asymmetric encryption technology, the problem of data security in the existing technology is solved, and the security and recovery of data in the case of leakage are achieved.
Patent Information
- Application Number
- CN202411730592.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art is difficult to effectively protect the data security of distributed storage, especially in the face of data breaches.
By processing and splitting text data out of order, unsorted text shards and recovery sequence shards are generated, and stored incorrectly in multiple nodes of the blockchain, combining asymmetric encryption and unique digital numbers of nodes for encryption transmission.
It realizes that even in the case of data leakage of some nodes, data security can be effectively protected, data integrity and recovery can be ensured, and security during transmission is improved.
Smart Images

Figure CN119808138A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain encryption technology, and more specifically, to a blockchain-based information encryption access method. Background Art
[0002] In order to protect the privacy and security of data, encryption technology is one of the important means. There are many data encryption methods, such as symmetric encryption, asymmetric encryption, shared encryption, etc. Encryption technology encrypts data and converts raw data into ciphertext, so that unauthorized users cannot directly obtain the plaintext information of the data, thereby protecting the privacy and security of users. For text data, encryption technology can be applied to the processing and transmission of text data to effectively protect data security.
[0003] However, with the occurrence of various data leakage incidents, the security of plaintext stored data cannot be effectively guaranteed. Blockchain technology has strong security, but distributed storage solutions still have the risk of data leakage. Based on this, the present invention intends to combine ciphertext storage and distributed storage technology to develop a data protection solution based on blockchain but with stronger security, which can effectively protect user data security even in the event of data leakage. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide an information encryption access method based on blockchain, so as to utilize the distributed storage characteristics of blockchain and adopt a distributed fragmented ciphertext storage solution. When a user accesses such text data, each node sends relevant data, which is decrypted and restored on the user terminal to achieve information encryption access. Even if a data leakage incident occurs on some nodes, the fragmented ciphertext storage can ensure data security.
[0005] In order to achieve the above purpose, the embodiments of the present application are implemented in the following ways:
[0006] In a first aspect, an embodiment of the present application provides an information encryption access method based on blockchain, wherein the blockchain includes multiple nodes, and the method includes: obtaining text data uploaded by a data provider, performing random processing on the text data, obtaining random text and a corresponding text recovery sequence, wherein the text data has a unique text identifier, and the random text also corresponds to the unique text identifier; splitting the random text and the corresponding text recovery sequence to obtain m random text fragments and m corresponding recovery sequence fragments, and storing the m random text fragments and the m recovery sequence fragments in a disordered order in m nodes of the blockchain, generating a node mapping relationship table, and splitting the node relationship mapping table and storing it in m nodes, wherein each node has a unique digital number, and each random text fragment corresponds to a unique text identifier. A text identifier, and the disordered text fragments and the recovery sequence fragments stored in the same node are not corresponding, and the node mapping relationship table is used to reveal the correspondence between the disordered text fragments and the recovery sequence fragments in the node; any node of the blockchain is used to: obtain a data access request issued by any user terminal, and consensus the data access request to each node in the blockchain, wherein the data access request contains a user identifier and a unique text identifier; if the current node stores a disordered text fragment corresponding to the unique text identifier, determine the target public key based on the user identifier, and encrypt the disordered text fragment and the recovery sequence fragment based on the target public key and the unique digital number of the current node, and transmit the encrypted data to the user terminal after obtaining it, so that the user terminal decrypts the encrypted data based on its private key and restores the text data.
[0007] In combination with the first aspect, in a first possible implementation of the first aspect, the disordered text and the corresponding text recovery sequence are split to obtain m disordered text fragments and m corresponding recovery sequence fragments, and the m disordered text fragments and the m recovery sequence fragments are stored in a disordered order in m nodes of the blockchain, a node mapping relationship table is generated, and the node relationship mapping table is split and stored in the m nodes, including: splitting the disordered text and the corresponding text recovery sequence to obtain m disordered text fragments and m corresponding recovery sequence fragments, wherein each element in the disordered text and the text recovery sequence corresponds one to one, and any element in the text recovery sequence is used to reveal the position where the current element in the disordered text should be located; from m nodes are determined in the blockchain, wherein each node has a unique digital number; m random text fragments and m recovery sequence fragments are stored in the m nodes in a disordered order, and a node mapping relationship table is generated, wherein the random text fragments and the recovery sequence fragments stored in the same node are not corresponding, and the node mapping relationship table is used to reveal the corresponding relationship between the random text fragments and the recovery sequence fragments in the node through the mapping relationship between the unique digital numbers of the nodes; s copies of the node relationship mapping table are obtained by copying, s<m, each node relationship mapping table is split into m independent groups of mapping relationships, different groups of mapping relationships are combined to obtain m mapping fragments containing s groups of mapping relationships, and then the m mapping fragments are respectively stored in the m nodes.
[0008] In combination with the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, each user is assigned a private key from a set of keys, a public key from the set of keys is stored and used by a blockchain, a target public key is determined based on a user identifier, and based on the target public key and a unique digital number of a current node, a scrambled text segment and a recovery sequence segment are encrypted, and the encrypted data is transmitted to a user terminal after being obtained, including: determining a target public key based on a user identifier in a data access request; encrypting a scrambled text segment based on the target public key and a unique digital number of a current node to obtain an encrypted text segment; encrypting a recovery sequence segment based on the target public key and a unique digital number of a current node to obtain an encrypted sequence segment; encrypting a mapping segment based on the target public key and a unique digital number of a current node to obtain an encrypted mapping segment; packaging and public key encryption based on encrypted text segments, encrypted sequence segments, and encrypted mapping segments to obtain encrypted data, and carrying the unique digital number of the current node to transmit the encrypted data to the user terminal.
[0009] In combination with the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, based on the target public key and the unique digital number of the current node, the random text segment is encrypted to obtain the encrypted text segment, including: for each character in the random text segment, using the target public key (e, n) and the unique digital number r of the current nodei , encrypted using the following formula:
[0010]
[0011] in, is the jth character v in the random text segment j The corresponding encryption parameter value, U(v j ) is the jth character v in the random text segment j The corresponding unique random number, r i is the unique digital number of the current node, e is the public key exponent in the target public key, and n is the modulus in the target public key; the encryption parameter value corresponding to each character is combined to obtain the encrypted text fragment corresponding to the random text fragment.
[0012] In combination with the second possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, based on the target public key and the unique digital number of the current node, the recovery sequence slice is encrypted to obtain the encrypted sequence slice, including: for each sequence number value in the recovery sequence slice, using the target public key (e, n) and the unique digital number r of the current node i , encrypted using the following formula:
[0013]
[0014] in, To restore the jth sequence number value u in the sequence fragment j The corresponding encryption parameter value, r i is the unique digital number of the current node, e is the public key exponent in the target public key, and n is the modulus in the target public key; the encryption parameter value corresponding to each sequence number value is combined to obtain the encryption sequence fragment corresponding to the recovery sequence fragment.
[0015] In combination with the second possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, based on the target public key and the unique digital number of the current node, the mapping slice is encrypted to obtain the encrypted mapping slice, including: for each group of mapping relationships in the mapping slice, using the target public key (e, n) and the unique digital number r of the current node i , encrypted using the following formula:
[0016]
[0017] in, is the encrypted mapping parameter corresponding to the kth group of mapping relations in the mapping shard, r i is the unique number of the current node, x k is the unique number of a node in the k-th group mapping relationship, y kis the unique digital number of another node in the kth group mapping relationship, e is the public key exponent in the target public key, and n is the modulus in the target public key; the encrypted mapping parameters corresponding to each group of mapping relationships are combined to obtain the encrypted mapping fragment corresponding to the mapping fragment.
[0018] In combination with the second possible implementation method of the first aspect, in a sixth possible implementation method of the first aspect, the user terminal decrypts the encrypted data based on its private key, and the method of restoring the text data is as follows: for each encrypted data: use the private key to decrypt the encrypted data to obtain encrypted text fragments, encrypted sequence fragments, and encrypted mapping fragments; based on the private key and the unique digital number of the current node, decrypt the encrypted text fragments to obtain random text fragments; based on the private key and the unique digital number of the current node, decrypt the encrypted sequence fragments to obtain recovery sequence fragments; based on the private key and the unique digital number of the current node, decrypt the encrypted mapping fragments to obtain mapping fragments; summarize the mapping relationships in all mapping fragments and remove duplication to obtain a node relationship mapping table containing m groups of mapping relationships; based on the node relationship mapping table, all recovery sequence fragments are matched one-to-one with the random text fragments, and then m random text fragments are combined into random text, and m recovery sequence fragments are combined into a text recovery sequence; based on the text recovery sequence, the random text is sequenced and restored to obtain text data.
[0019] In combination with the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, based on the private key and the unique digital number of the current node, the encrypted text segment is decrypted to obtain the disordered text segment, including: for each encryption parameter value in the encrypted text segment, using the private key (d, n) and the unique digital number r of the current node i , use the following formula to decrypt:
[0020]
[0021] in, is the jth character v in the random text segment j The corresponding encryption parameter value, U(v j ) is the jth character v in the random text segment j The corresponding unique random number, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key; based on the unique random number U(v j ) Determine the corresponding character v j , and obtain the decrypted and restored random text fragments.
[0022] In combination with the sixth possible implementation manner of the first aspect, in an eighth possible implementation manner of the first aspect, based on the private key and the unique digital number of the current node, the encrypted sequence slices are decrypted to obtain the restored sequence slices, including: for each encryption parameter value in the encrypted sequence slice, using the private key (d, n) and the unique digital number r of the current node i , use the following formula to decrypt:
[0023]
[0024] in, To restore the jth sequence number value u in the sequence fragment j The corresponding encryption parameter value, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key; based on the sequence value u j , and obtain the decrypted and restored recovery sequence fragments.
[0025] In combination with the sixth possible implementation manner of the first aspect, in a ninth possible implementation manner of the first aspect, based on the private key and the unique digital number of the current node, the encrypted mapping slice is decrypted to obtain the mapping slice, including: for each group of encrypted mapping parameters in the encrypted mapping slice, using the private key (d, n) and the unique digital number r of the current node i , use the following formula to decrypt:
[0026]
[0027] in, is the encrypted mapping parameter corresponding to the kth group of mapping relations in the mapping shard, is the encrypted mapping parameter corresponding to a node in the kth group mapping relationship, y k is the encrypted mapping parameter of another node in the kth group mapping relationship, {x k ,y k} is the kth group of mapping relations in the mapping shard, x k is the unique number of a node in the k-th group mapping relationship, y k is the unique number of another node in the k-th group mapping relationship, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key; based on the mapping relationship {x k ,y k}, and obtain the decrypted and restored mapping fragment.
[0028] Beneficial effects:
[0029] 1. This solution obtains text data uploaded by the data provider, performs random processing on the text data, and obtains random text and corresponding text recovery sequence; splits the random text and the corresponding text recovery sequence to obtain m random text fragments and m corresponding recovery sequence fragments, and stores the m random text fragments and the m recovery sequence fragments in a disordered order in m nodes of the blockchain, generates a node mapping relationship table, and splits the node relationship mapping table and stores it in m nodes. The random text fragments and the recovery sequence fragments stored in the same node are not corresponding. The node mapping relationship table is used The corresponding relationship between the disordered text fragment and the recovery sequence fragment in the node is revealed; any node of the blockchain is used to obtain a data access request issued by any user terminal, and the data access request is shared to each node in the blockchain; if the current node stores the disordered text fragment corresponding to the unique text identifier, the target public key is determined based on the user identifier, and the disordered text fragment and the recovery sequence fragment are encrypted based on the target public key and the unique digital number of the current node, and the encrypted data is transmitted to the user terminal after being obtained, so that the user terminal can decrypt the encrypted data based on its private key and restore the text data. By processing the text data in disorder, the difficulty of illegal access or tampering of the data is increased. The disordered text, recovery sequence and corresponding node mapping relationship table are split into multiple fragments and stored in multiple nodes of the blockchain in a disordered order, which improves the security of the data and ensures the integrity and recoverability of the data. In addition, by utilizing the redundant nature of the fragmented storage, when the information of some nodes is lost, it can also be restored by relying on the remaining information. When some nodes are attacked or tampered with, the information relying on the remaining nodes can also be restored. The information leaked by the node has been processed and stored in a disordered order and cannot be restored, which effectively improves the security of the data. When each node of the blockchain sends data, it uses asymmetric encryption and the node's unique digital number to encrypt it. Users can use their private keys to decrypt and restore it, which can further improve the security of the transmission process.
[0030] 2. The specific encryption scheme proposed in this scheme relies on the idea of asymmetric encryption, uses the public key, introduces the unique digital number of the node, and designs an encryption scheme (using different schemes for encryption for different data shards) to asymmetric encrypt the disordered text shards, the recovery sequence shards, and the mapping shards, and obtain the encrypted text shards, the encrypted sequence shards, and the encrypted mapping shards, which are packaged, signed, encrypted, and sent to the user terminal, and the user terminal uses its private key and the unique digital number of the node for decryption (using different schemes for decryption for different data shards), thereby realizing the encrypted transmission and decryption recovery of the data, and finally obtaining the text data. Such a scheme has high security, can cope with scenarios such as attacks and leaks, and effectively protect data security.
[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 This is an interaction diagram between the blockchain system, data providers, and user terminals.
[0034] Figure 2 A flowchart of a blockchain-based information encryption access method provided in an embodiment of the present application.
[0035] Figure 3 Flowchart for decrypting and restoring text data for a user terminal. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0037] This embodiment intends to provide a blockchain-based information encryption access method, which involves a blockchain (including multiple nodes), a data provider and a user terminal. Through the mutual cooperation between the blockchain, the data provider and the user terminal, the blockchain-based information encryption access is realized.
[0038] See also Figure 1 , Figure 1 This is an interaction diagram between the blockchain system, data providers, and user terminals.
[0039] In this embodiment, the data provider can upload the text data that needs to be uploaded to the blockchain, and the blockchain can run a blockchain-based information encryption access method.
[0040] See also Figure 2 , Figure 2 Flow chart of the information encryption access method based on blockchain provided in an embodiment of the present application. In this embodiment, the information encryption access method based on blockchain may include step S11, step S12, step S13, and step S14.
[0041] First, step S11 may be executed.
[0042] Step S11: Acquire the text data uploaded by the data provider, perform random processing on the text data, and obtain random text and a corresponding text recovery sequence, wherein the text data has a unique text identifier, and the random text also corresponds to the unique text identifier.
[0043] In this embodiment, the blockchain can obtain the text data uploaded by the data provider and shuffle the text data (randomly shuffle the order of each character) to obtain shuffled text and a corresponding text recovery sequence. Both the text data and the shuffled text correspond to a unique text identifier of the text data, and the text recovery sequence is used to record the original serial number corresponding to each character in the shuffled text.
[0044] After obtaining the disordered text and the corresponding text recovery sequence, the blockchain can run step S12.
[0045] Step S12: Split the random text and the corresponding text recovery sequence to obtain m random text fragments and corresponding m recovery sequence fragments, and store the m random text fragments and the m recovery sequence fragments in a disordered order in m nodes of the blockchain, generate a node mapping relationship table, and split the node relationship mapping table and store it in m nodes, wherein each node has a unique digital number, each random text fragment corresponds to a unique text identifier, and the random text fragments and the recovery sequence fragments stored in the same node do not correspond, and the node mapping relationship table is used to reveal the correspondence between the random text fragments and the recovery sequence fragments in the node.
[0046] In this embodiment, the blockchain can split the random text and the corresponding text recovery sequence to obtain m random text fragments and corresponding m recovery sequence fragments, wherein the random text and each element in the text recovery sequence correspond one to one, and any element (serial number value) in the text recovery sequence is used to reveal the position where the current element (i.e., character) in the random text should be located.
[0047] For example, a 100,000-character shuffled text is split into 100 shuffled text fragments, and a text recovery sequence (also containing 100,000 elements, i.e., serial number values) is correspondingly divided into 100 recovery sequence fragments. Each element in the shuffled text and the text recovery sequence corresponds one to one (the elements in each shuffled text fragment and the recovery sequence fragment also correspond one to one). Of course, the splitting does not need to be evenly divided according to the number of elements. Generally, the upper limit of the number of characters in each shuffled text fragment is limited to the upper limit, and no specific limit is made.
[0048] In addition, when splitting the disordered text fragments and the recovery sequence fragments, redundant splitting can also be considered. Of course, redundancy can also be performed after the split is completed (for example, merging several copies into one, but the disordered text fragments and the recovery sequence fragments need to be redundant one by one, otherwise it may not be restored), or it can be a copy-type redundancy. For example, under normal circumstances, each node stores a disordered text fragment, a recovery sequence fragment, and a mapping fragment. Considering redundancy, two copies can be specially stored in the form of copies (different from the disordered text fragments, recovery sequence fragments, and mapping fragments that have been stored). Copies are not issued at ordinary times, and only when a corresponding request for recovery data is received, the copies are used for recovery. This embodiment takes the redundancy of disordered text fragments and recovery sequence fragments in the form of copies as an example.
[0049] Afterwards, the blockchain can determine m nodes from all nodes (each node has a unique digital number), store m random text fragments and m recovery sequence fragments in a disordered order in the m nodes, and generate a node mapping relationship table based on this. The random text fragments and recovery sequence fragments stored in the same node do not correspond. The node mapping relationship table is used to reveal the correspondence between the random text fragments and the recovery sequence fragments in the node through the mapping relationship between the unique digital numbers of the nodes.
[0050] Afterwards, the blockchain can copy s (s<m, for example, s is 2, 3, 5, etc.) copies of the node relationship mapping table based on the generated node mapping relationship table, and then split each node relationship mapping table into m independent groups of mapping relationships, combine different groups of mapping relationships, and finally obtain m mapping shards containing s groups of mapping relationships (also corresponding to the unique text identifier of the text data), and then store the m mapping shards in m nodes respectively (for example, random storage, each node only stores 1 mapping shard).
[0051] After completing the pre-processing of the text data, the random text fragments (corresponding to the unique text identifier of the text data), recovery sequence fragments (corresponding to the unique text identifier of the text data) and mapping fragments (corresponding to the unique text identifier of the text data) that each of the m nodes needs to store can be officially uploaded to the chain (cannot be changed after uploading to the chain), the time of uploading to the chain is recorded, and the original file (text data) and related intermediate files (random text, text recovery sequence, node mapping relationship table, random text fragments, recovery sequence fragments, mapping fragments, etc.) are deleted, and the on-chain data (unique text identifier, random text fragments, recovery sequence fragments, mapping fragments, chain time, data provider and other related information) are retained.
[0052] The blockchain can issue data access rights and a private key from a set of keys to users (essentially achieved with the help of an external key generation and issuance agency, which is not introduced in this embodiment and can be regarded as blockchain distribution), and the corresponding public key is stored in the blockchain for blockchain verification and use. Different data access rights can also be assigned to different users accordingly.
[0053] When a user needs to access certain text data, he can send a data access request to the blockchain through his user terminal. At this time, any node of the blockchain can run step S13.
[0054] Step S13: Obtain a data access request issued by any user terminal, and pass the data access request consensus to each node in the blockchain, where the data access request includes a user identifier and a unique text identifier.
[0055] In this embodiment, any node in the blockchain can obtain a data access request from any user terminal. The data access request contains a user ID and a unique text ID. The unique text ID can be used to determine the text data that the user needs to access, and the user ID can be used to determine the target public key for encrypted transmission. At the same time, this node can also share the data access request consensus with each node in the blockchain, so that each node can determine whether it stores the corresponding data.
[0056] For nodes that store corresponding data (random text fragments, restored sequence fragments, mapping fragments, etc.), step S14 can be executed.
[0057] Step S14: If the current node stores the disordered text fragment corresponding to the unique text identifier, the target public key is determined based on the user identifier, and the disordered text fragment and the recovery sequence fragment are encrypted based on the target public key and the unique digital number of the current node. After the encrypted data is obtained, it is transmitted to the user terminal so that the user terminal can decrypt the encrypted data based on its private key and restore the text data.
[0058] In this embodiment, if the current node stores the random text fragment corresponding to this unique text identifier, the target public key can be determined based on the user identifier, and the random text fragment and the recovery sequence fragment can be encrypted based on the target public key and the unique digital number of the current node, and the encrypted data can be transmitted to the user terminal after obtaining it.
[0059] Exemplarily, the current node can determine the target public key based on the user identifier in the data access request, and the target public key is recorded as (e, n). It should be noted that the modulus n is a very large value. For example, in this embodiment, the selection of the modulus n requires selecting two large prime numbers p and q, and calculating their product n = p × q. The length of n is the key length, which is usually 1024 bits or 2048 bits, and then calculating the Euler function Then choose an integer e that satisfies And e and e and n form a public key (e,n), which is stored on the blockchain and can be made public. Then calculate e for The modular inverse element d, that is, find an integer d such that Then, d and n form a private key, recorded as private key (d, n), which needs to be kept confidential by the user. The random number U (v j ), unique digital number r i 、x k ,y k etc., are all values much smaller than n.
[0060] First, the current node may encrypt the recovery sequence fragment based on the target public key and the unique digital number of the current node to obtain an encrypted sequence fragment.
[0061] Specifically, for each character in the random text segment, the current node can use the target public key (e, n) and the unique digital number r of the current node i , encrypted using the following formula:
[0062]
[0063] in, is the jth character v in the random text segment j The corresponding encryption parameter value, U(v j ) is the jth character v in the random text segment j The corresponding unique random number, j, does not exceed the total number of characters in the random text segment, r i is the unique numeric number of the current node (for example, the current node is recorded as the i-th node among m target nodes, then i∈[1,m]), e is the public key exponent in the target public key, and n is the modulus in the target public key. Based on this, the current node can combine the encryption parameter values corresponding to each character to obtain the encrypted text fragment corresponding to the scrambled text fragment.
[0064] Secondly, the current node can encrypt the recovery sequence fragment based on the target public key and the unique digital number of the current node to obtain the encrypted sequence fragment.
[0065] Specifically, for each serial number value in the recovery sequence shard, the current node can use the target public key (e,n) and the unique digital number r of the current node i , encrypted using the following formula:
[0066]
[0067] in, To restore the jth sequence number value u in the sequence fragment j The corresponding encryption parameter value, r i is the unique digital number of the current node, e is the public key exponent in the target public key, and n is the modulus in the target public key. Based on this, the current node can combine the encryption parameter values corresponding to each sequence number value to obtain the encryption sequence fragment corresponding to the recovery sequence fragment.
[0068] Afterwards, the current node can encrypt the mapping shard based on the target public key and the unique digital number of the current node to obtain an encrypted mapping shard.
[0069] Specifically, for each set of mapping relationships in the mapping shard, the current node can use the target public key (e, n) and the unique digital number r of the current node i , encrypted using the following formula:
[0070]
[0071] in, is the encrypted mapping parameter corresponding to the kth group of mapping relations in the mapping shard, k∈[1,s], r i is the unique number of the current node, x k is the unique number of a node in the k-th group mapping relationship, y k is the unique digital number of another node in the kth group mapping relationship, e is the public key exponent in the target public key, and n is the modulus in the target public key. Based on this, the current node can combine the encrypted mapping parameters corresponding to each group mapping relationship to obtain the encrypted mapping fragment corresponding to the mapping fragment.
[0072] After obtaining the encrypted text fragments, encrypted sequence fragments, and encrypted map fragments, the current node can package and encrypt the encrypted data based on the encrypted text fragments, encrypted sequence fragments, and encrypted map fragments, obtain encrypted data, and carry the unique digital number of the current node to transmit the encrypted data to the user terminal, so that the user terminal can decrypt the encrypted data based on its private key and restore the text data.
[0073] The above is an introduction to the workflow of the information encryption access method based on blockchain application. For the layout of blockchain, the architecture can be determined according to different application scenarios. For example, for the scenario focusing on the overall operation efficiency of blockchain, if the frequency of data provider uploading data is not high, the pre-work (step S11 and step S12) can be handed over to a dedicated pre-work node to do, and then uploaded to the blockchain. The nodes in the blockchain can run steps S13 and S14 according to the access requirements, so each node does not need to perform cumbersome pre-work (i.e., steps S11 and S12), which is more efficient. However, if the frequency of data provider (multiple) uploading data is high, for example, there are more data providers and more data, so the frequency of uploading data is high, then each node of the blockchain can run a complete information encryption access method based on blockchain, that is, each node can run steps S11 to S14, so as to balance the load, give play to the advantages of blockchain, and improve the overall operation efficiency of blockchain.
[0074] After the user terminal receives the encrypted data returned by the node in the blockchain (if there are no unexpected circumstances, the number of encrypted data is m, and each encrypted data corresponds to a node, and each node has a unique digital number), it can run the method part of decrypting and restoring the text data.
[0075] See also Figure 3 , Figure 3 Flow chart for decrypting and restoring text data for a user terminal. In this embodiment, the process of decrypting and restoring text data by a user terminal may include steps S21, S22, S23, S24, S25, S26, and S27.
[0076] For each encrypted data, the user terminal may execute step S21.
[0077] Step S21: Decrypt the encrypted data using the private key to obtain encrypted text fragments, encrypted sequence fragments, and encrypted mapping fragments.
[0078] In this embodiment, the user terminal can use the user's own private key (d, n) to decrypt the encrypted data and obtain the encrypted text fragment, the encrypted sequence fragment, and the encrypted mapping fragment. At the same time, the unique digital number r of the node that sent the encrypted data can be obtained. i .
[0079] For the encrypted text segment, the user terminal may execute step S22.
[0080] Step S22: Based on the private key and the unique digital number of the current node, the encrypted text fragment is decrypted to obtain the random text fragment.
[0081] In this embodiment, the user terminal can decrypt the encrypted text fragments based on the private key and the unique digital number of the current node to obtain the disordered text fragments.
[0082] For example, for each encryption parameter value in the encrypted text segment, the user terminal can use the private key (d, n) and the unique digital number r of the current node i , use the following formula to decrypt:
[0083]
[0084] in, is the jth character v in the random text segment j The corresponding encryption parameter value, U(v j ) is the jth character v in the random text segment j The corresponding unique random number, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key. Based on this, the user terminal can j ) Determine the corresponding character v j , thus obtaining the decrypted and restored disordered text fragments.
[0085] For encrypted sequence fragmentation, the user terminal may execute step S23.
[0086] Step S23: Based on the private key and the unique digital number of the current node, the encrypted sequence fragments are decrypted to obtain the restored sequence fragments.
[0087] In this embodiment, the user terminal can decrypt the encrypted sequence fragments based on the private key and the unique digital number of the current node to obtain the restored sequence fragments.
[0088] For example, for each encryption parameter value in the encryption sequence segment, the user terminal can use the private key (d, n) and the unique digital number r of the current node i , use the following formula to decrypt:
[0089]
[0090] in, To restore the jth sequence number value u in the sequence fragment j The corresponding encryption parameter value, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key. Based on this, the user terminal can obtain the recovery sequence fragments for decryption and restoration based on each sequence number value.
[0091] For the encrypted mapping fragments, the user terminal may execute step S24.
[0092] Step S24: Based on the private key and the unique digital number of the current node, the encrypted mapping slice is decrypted to obtain the mapping slice.
[0093] In this embodiment, the user terminal can decrypt the encrypted mapping fragment based on the private key and the unique digital number of the current node to obtain the mapping fragment.
[0094] For example, for each set of encrypted mapping parameters in the encrypted mapping slice, the user terminal can use the private key (d, n) and the unique digital number r of the current node i , use the following formula to decrypt:
[0095]
[0096] in, is the encrypted mapping parameter corresponding to the kth group of mapping relations in the mapping shard, is the encrypted mapping parameter corresponding to a node in the kth group mapping relationship, y k is the encrypted mapping parameter of another node in the kth group mapping relationship, {x k ,y k} is the kth group of mapping relations in the mapping shard, x k is the unique number of a node in the k-th group mapping relationship, y k is the unique number of another node in the k-th group mapping relationship, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key. Based on this, the user terminal can k ,y k}, and obtain the decrypted and restored mapping fragment.
[0097] After obtaining the decrypted and restored disordered text fragments (m pieces), the restored sequence fragments (m pieces), and the mapping fragments (m pieces), the user terminal can execute step S25.
[0098] Step S25: Summarize the mapping relationships in all mapping slices and remove duplications to obtain a node relationship mapping table containing m groups of mapping relationships.
[0099] In this embodiment, the user terminal can summarize the mapping relationships in all mapping slices to obtain sm groups of mapping relationships, and then perform deduplication to obtain a node relationship mapping table containing m groups of mapping relationships. Of course, if a replica redundancy solution is used, then s takes the value of 1, and there is no need to perform direct redundancy of the mapping relationship group, but redundancy is performed in the form of replicas (e.g., 2 copies).
[0100] After obtaining the node relationship mapping table, the user terminal may execute step S26.
[0101] Step S26: Based on the node relationship mapping table, all recovery sequence fragments are matched one-to-one with the disordered text fragments, and then the m disordered text fragments are combined into disordered text, and the m recovery sequence fragments are combined into a text recovery sequence.
[0102] In this embodiment, the user terminal can make a one-to-one correspondence between all the recovery sequence fragments and the disordered text fragments based on the node relationship mapping table. For example, the mapping relationship includes a mapping relationship of unique digital numbers of two nodes, the unique digital number of the first node reveals the node storing the disordered text fragment, and the unique digital number of the second node reveals the node storing the recovery sequence fragment, thereby achieving a one-to-one correspondence between all the recovery sequence fragments and the disordered text fragments.
[0103] Afterwards, the user terminal can combine the m random text fragments into random text and the m recovery sequence fragments into a text recovery sequence. The order in which the m random text fragments are combined into the random text is irrelevant, but the recovery sequence fragments need to correspond to them and cannot correspond incorrectly, otherwise the text data cannot be recovered.
[0104] After obtaining the combined disordered text and text recovery sequence, the user terminal may execute step S27.
[0105] Step S27: Perform sequence recovery on the disordered text based on the text recovery sequence to obtain text data.
[0106] In this embodiment, the user terminal can rearrange the characters of the disordered text according to the sequence number relationship of the disordered text in the text recovery sequence, and finally restore it to text data.
[0107] In summary, the embodiment of the present application provides an information encryption access method based on blockchain, which obtains text data uploaded by a data provider, performs random processing on the text data, and obtains random text and a corresponding text recovery sequence; splits the random text and the corresponding text recovery sequence to obtain m random text fragments and m corresponding recovery sequence fragments, and stores the m random text fragments and the m recovery sequence fragments in a disordered order in m nodes of the blockchain, generates a node mapping relationship table, and splits the node relationship mapping table and stores it in m nodes, and the random text fragments and the recovery sequence fragments stored in the same node are If not, the node mapping relationship table is used to reveal the correspondence between the disordered text fragments and the recovery sequence fragments in the node; any node of the blockchain is used to obtain a data access request issued by any user terminal, and the data access request is shared by each node in the blockchain; if the current node stores the disordered text fragment corresponding to the unique text identifier, the target public key is determined based on the user identifier, and the disordered text fragment and the recovery sequence fragment are encrypted based on the target public key and the unique digital number of the current node, and the encrypted data is transmitted to the user terminal after being obtained, so that the user terminal can decrypt the encrypted data based on its private key and restore the text data. By processing the text data in disorder, the difficulty of illegal access or tampering of the data is increased. The disordered text, recovery sequence and corresponding node mapping relationship table are split into multiple fragments and stored in multiple nodes of the blockchain in a disordered order, which improves the security of the data and ensures the integrity and recoverability of the data. In addition, by utilizing the redundant nature of the shard storage, when the information of some nodes is lost, it can also be restored by relying on the remaining information. If some nodes are attacked or tampered with, the information relying on the remaining nodes can also be restored. The information leaked by the node has been processed and stored in a disordered order and cannot be restored, which effectively improves the security of the data. When each node of the blockchain sends data, it uses asymmetric encryption and the node's unique digital number to encrypt it. Users can use their private keys to decrypt and restore it, which can further improve the security of the transmission process.
[0108] The specific encryption scheme proposed in this scheme relies on the idea of asymmetric encryption, uses the public key, introduces the unique digital number of the node, and designs an encryption scheme (using different schemes for encryption for different data shards) to asymmetric encrypt the disordered text shards, the recovery sequence shards, and the mapping shards, and obtain the encrypted text shards, the encrypted sequence shards, and the encrypted mapping shards, which are packaged, signed, encrypted, and sent to the user terminal, and the user terminal uses its private key and the unique digital number of the node to decrypt (using different schemes for decryption for different data shards), thereby realizing the encrypted transmission and decryption recovery of the data, and finally obtaining the text data. Such a scheme has high security, can cope with scenarios such as attacks and leaks, and effectively protect data security.
[0109] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0110] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A blockchain-based information encryption access method, characterized in that: The blockchain includes multiple nodes, and the method includes: Obtaining text data uploaded by a data provider, performing random processing on the text data, and obtaining random text and a corresponding text recovery sequence, wherein the text data has a unique text identifier, and the random text also corresponds to the unique text identifier; The disordered text and the corresponding text recovery sequence are split to obtain m disordered text fragments and m corresponding recovery sequence fragments, and the m disordered text fragments and the m recovery sequence fragments are stored in m nodes of the blockchain in a disordered order, a node mapping relationship table is generated, and the node relationship mapping table is split and stored in m nodes, wherein each node has a unique digital number, each disordered text fragment corresponds to a unique text identifier, and the disordered text fragments and the recovery sequence fragments stored in the same node are not corresponding, and the node mapping relationship table is used to reveal the correspondence between the disordered text fragments and the recovery sequence fragments in the node; Any node of the blockchain is used to: obtain a data access request from any user terminal, and pass the data access request to each node in the blockchain by consensus, wherein the data access request contains a user ID and a unique text ID; If the current node stores the random text fragment corresponding to this unique text identifier, the target public key is determined based on the user identifier, and the random text fragment and the recovery sequence fragment are encrypted based on the target public key and the unique digital number of the current node. After obtaining the encrypted data, it is transmitted to the user terminal so that the user terminal can decrypt the encrypted data based on its private key and restore the text data.
2. The information encryption access method based on blockchain according to claim 1 is characterized in that: The disordered text and the corresponding text recovery sequence are split to obtain m disordered text fragments and m corresponding recovery sequence fragments, and the m disordered text fragments and the m recovery sequence fragments are stored in m nodes of the blockchain in a disordered order, a node mapping relationship table is generated, and the node relationship mapping table is split and stored in m nodes, including: The disordered text and the corresponding text recovery sequence are split to obtain m disordered text fragments and m corresponding recovery sequence fragments, wherein the disordered text and each element in the text recovery sequence correspond one to one, and any element in the text recovery sequence is used to reveal the position where the current element in the disordered text should be located; Determine m nodes from the blockchain, where each node has a unique digital number; m random text fragments and m recovery sequence fragments are stored in m nodes in a disordered order, and a node mapping relationship table is generated, wherein the random text fragments and the recovery sequence fragments stored in the same node are not corresponding, and the node mapping relationship table is used to reveal the corresponding relationship between the random text fragments and the recovery sequence fragments in the node through the mapping relationship between the unique digital numbers of the nodes; Copy s copies of the node relationship mapping table, s<m, split each copy of the node relationship mapping table into m independent groups of mapping relationships, combine different groups of mapping relationships to obtain m mapping slices containing s groups of mapping relationships, and then store the m mapping slices in m nodes respectively.
3. The information encryption access method based on blockchain according to claim 2 is characterized in that: Each user is assigned a private key from a set of keys. The public key from the set of keys is stored and used by the blockchain. The target public key is determined based on the user identity, and the random text fragments and the recovery sequence fragments are encrypted based on the target public key and the unique digital number of the current node. The encrypted data is then transmitted to the user terminal, including: Determine the target public key based on the user identifier in the data access request; Based on the target public key and the unique digital number of the current node, the random text fragment is encrypted to obtain the encrypted text fragment; Based on the target public key and the unique digital number of the current node, the recovery sequence fragment is encrypted to obtain the encrypted sequence fragment; Based on the target public key and the unique digital number of the current node, the mapping slice is encrypted to obtain an encrypted mapping slice; Based on the encrypted text fragments, encrypted sequence fragments, and encrypted map fragments, the encrypted data is packaged and encrypted with the public key to obtain the encrypted data, and the encrypted data is transmitted to the user terminal with the unique digital number of the current node.
4. The information encryption access method based on blockchain according to claim 3 is characterized in that: Based on the target public key and the unique digital number of the current node, the random text fragment is encrypted to obtain the encrypted text fragment, including: For each character in the shuffled text segment, use the target public key (e,n) and the unique digital number r of the current node i , encrypted using the following formula: in, is the jth character v in the random text segment j The corresponding encryption parameter value, U(v j ) is the jth character v in the random text segment j The corresponding unique random number, r i is the unique numeric ID of the current node, e is the public key exponent in the target public key, and n is the modulus in the target public key; The encryption parameter values corresponding to each character are combined to obtain the encrypted text fragment corresponding to the random text fragment.
5. The information encryption access method based on blockchain according to claim 3 is characterized in that: Based on the target public key and the unique digital number of the current node, the recovery sequence fragment is encrypted to obtain the encrypted sequence fragment, including: For each serial number value in the recovery sequence shard, use the target public key (e,n) and the unique digital number r of the current node i , encrypted using the following formula: in, To restore the jth sequence number value u in the sequence fragment j The corresponding encryption parameter value, r i is the unique numeric ID of the current node, e is the public key exponent in the target public key, and n is the modulus in the target public key; The encryption parameter values corresponding to each sequence number value are combined to obtain the encryption sequence fragment corresponding to the recovery sequence fragment.
6. The information encryption access method based on blockchain according to claim 3 is characterized in that: Based on the target public key and the unique digital number of the current node, the mapping slice is encrypted to obtain an encrypted mapping slice, including: For each set of mapping relationships in the mapping shard, use the target public key (e,n) and the unique digital number r of the current node i , encrypted using the following formula: in, is the encrypted mapping parameter corresponding to the kth group of mapping relations in the mapping shard, r i is the unique number of the current node, x k is the unique number of a node in the k-th group mapping relationship, y k is the unique numeric ID of another node in the k-th group mapping, e is the public key exponent in the target public key, and n is the modulus in the target public key; The encrypted mapping parameters corresponding to each group of mapping relationships are combined to obtain the encrypted mapping fragments corresponding to the mapping fragments.
7. The information encryption access method based on blockchain according to claim 3 is characterized in that: The user terminal decrypts the encrypted data based on its private key and restores the text data in the following way: For each encrypted data: Decrypt the encrypted data using the private key to obtain encrypted text fragments, encrypted sequence fragments, and encrypted mapping fragments; Based on the private key and the unique digital number of the current node, the encrypted text fragment is decrypted to obtain the random text fragment; Based on the private key and the unique digital number of the current node, the encrypted sequence fragment is decrypted to obtain the recovery sequence fragment; Based on the private key and the unique digital number of the current node, the encrypted mapping slice is decrypted to obtain the mapping slice; Summarize the mapping relationships in all mapping shards and remove duplicates to obtain a node relationship mapping table containing m groups of mapping relationships; Based on the node relationship mapping table, all recovery sequence fragments are matched one by one with the disordered text fragments, and then the m disordered text fragments are combined into disordered text, and the m recovery sequence fragments are combined into a text recovery sequence; The disordered text is sequenced and restored based on the text recovery sequence to obtain text data.
8. The method for accessing information encrypted based on blockchain according to claim 7, characterized in that: Based on the private key and the unique digital number of the current node, the encrypted text fragment is decrypted to obtain the random text fragment, including: For each encryption parameter value in the encrypted text segment, use the private key (d,n) and the unique digital number r of the current node i , use the following formula to decrypt: in, is the jth character v in the random text segment j The corresponding encryption parameter value, U(v j ) is the jth character v in the random text segment j The corresponding unique random number, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key; Based on the unique random number U(v j ) Determine the corresponding character v j , and obtain the decrypted and restored random text fragments.
9. The information encryption access method based on blockchain according to claim 7 is characterized in that: Based on the private key and the unique digital number of the current node, the encrypted sequence fragment is decrypted to obtain the recovery sequence fragment, including: For each encryption parameter value in the encryption sequence shard, use the private key (d,n) and the unique digital number r of the current node i , use the following formula to decrypt: in, To restore the jth sequence number value u in the sequence fragment j The corresponding encryption parameter value, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key; Based on the sequence value u j , and obtain the decrypted and restored recovery sequence fragments.
10. The information encryption access method based on blockchain according to claim 7 is characterized in that: Based on the private key and the unique digital number of the current node, the encrypted mapping slice is decrypted to obtain the mapping slice, including: For each set of encrypted mapping parameters in the encrypted mapping shard, use the private key (d,n) and the unique digital number r of the current node i , use the following formula to decrypt: in, is the encrypted mapping parameter corresponding to the kth group of mapping relations in the mapping shard, is the encrypted mapping parameter corresponding to a node in the kth group mapping relationship, y k is the encrypted mapping parameter of another node in the kth group mapping relationship, {x k ,y k } is the kth group of mapping relations in the mapping shard, x k is the unique number of a node in the k-th group mapping relationship, y k is the unique number of another node in the k-th group mapping relationship, r i is the unique digital number of the current node, d is the private key exponent in the private key, and n is the modulus in the private key; Based on the mapping relationship {x k ,y k }, and obtain the decrypted and restored mapping fragment.