Blockchain-based data sharing method and terminal
By generating access keys to perform nested encryption on blockchain data, the problem of data divergence in blockchain data sharing is solved, and real-time data management and security control are achieved.
Patent Information
- Application Number
- CN202410866099.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Data sharing on the blockchain cannot synchronize state updates in real time, leading to the divergent propagation of data and affecting data security.
By obtaining the access status information of the accessing user, a corresponding access key is generated. The target data uploaded by the source user is then nested and encrypted and stored in the shared data block corresponding to the accessing user. Data access permissions are controlled based on the accessing user's status information.
It enables real-time management of shared data, prevents data from spreading uncontrollably, and ensures data security.
Smart Images

Figure CN118740455B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a data sharing method based on a block chain and a terminal. BACKGROUND
[0002] At present, when data on a block chain needs to be shared, the shared data on the block chain can be exported to an external database under the premise of ensuring data security, and a link verification mechanism is used to ensure that the shared data is only propagated on the current link. When the state of the shared data changes, relevant steps are taken to ensure that the shared data can be updated and synchronized accordingly. The block chain usually sets the shared data as a shared block, and shares the shared block with other users for access. This sharing method cannot effectively control the shared data because the state update of the shared data cannot be synchronized in real time to all access nodes, and the data is prone to divergent propagation, affecting data security. SUMMARY
[0003] The technical problem to be solved by the present application is to provide a data sharing method based on a block chain, which can effectively control shared data while realizing data sharing on a block chain, and improve data security.
[0004] To solve the above technical problems, the technical scheme adopted by the present application is:
[0005] A data sharing method based on a block chain, comprising:
[0006] Obtaining access state information configured by at least two access users, the access state information being a shared identifier or a non-shared identifier;
[0007] Generating an access key corresponding to each access user according to the access state information;
[0008] Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested encrypted according to the access key corresponding to each access user to obtain target encrypted data of each access user;
[0009] Storing the target encrypted data in a shared data block corresponding to the access user.
[0010] To solve the above technical problems, another technical scheme adopted by the present application is:
[0011] A data sharing terminal based on a block chain, comprising a memory, a processor and a computer program stored in the memory and running on the processor, and the processor implements the following steps when executing the computer program:
[0012] Obtaining access state information configured by at least two access users, the access state information being shared identification or non-shared identification;
[0013] Generating an access key corresponding to each of the access users according to the access state information respectively;
[0014] Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested encrypted according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users;
[0015] Storing the target encrypted data in a shared data block corresponding to the access user.
[0016] The beneficial effects of the present application are that the corresponding access key is generated according to the access state information of each access user, and the target data shared by the source user is nested encrypted based on the access key of each access user, so that each access user can control the shared data. When the access state information set by the access user is shared identification, other access users can obtain shared data from the shared data block based on the access key of the access user. When the access state information set by the access user is non-shared identification, other access users cannot obtain shared data from the shared data block. In this way, each access user can manage shared data in real time, avoid the divergence of data propagation, and ensure data security. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A step flow chart of a data sharing method based on a block chain provided by an embodiment of the present application;
[0018] Figure 2 An interaction schematic diagram of a data sharing method based on a block chain provided by an embodiment of the present application;
[0019] Figure 3 A structure schematic diagram of a data sharing terminal based on a block chain provided by an embodiment of the present application;
[0020] LABEL EXPLANATION
[0021] 100, a data sharing terminal based on a block chain;101, a memory;102, a processor. DETAILED DESCRIPTION
[0022] To explain the technical content, the achieved purposes and effects of the present application in detail, the following will be explained in combination with the embodiments and the accompanying drawings.
[0023] An embodiment of the present application provides a data sharing method based on a block chain, comprising:
[0024] obtaining access state information configured by at least two access users, the access state information being shared identification or non-shared identification;
[0025] generating an access key corresponding to each of the access users according to the access state information;
[0026] based on a data access relationship between the access users, sequentially performing nested encryption on target data uploaded by a source user according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users;
[0027] storing the target encrypted data in a shared data block corresponding to the access users.
[0028] From the above description, the beneficial effects of the present application are that: according to the access state information of each access user, a corresponding access key is generated, and then the target data shared by the source user is nested encrypted based on the access key of each access user, so that each access user can control the shared data. When the access state information set by the access user is shared identification, other access users can obtain shared data from the shared data block based on the access key of the access user. When the access state information set by the access user is non-shared identification, other access users cannot obtain shared data from the shared data block. In this way, each access user can manage shared data in real time, avoid the divergence of data propagation, and ensure data security.
[0029] Further, before the obtaining access state information configured by at least two access users, the method further comprises:
[0030] obtaining target data uploaded by a source user and source state information;
[0031] generating a source key according to identification information of the target data and the source state information;
[0032] encrypting the target data according to the source key to obtain source encrypted data;
[0033] the sequentially performing nested encryption on target data uploaded by a source user according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users comprises:
[0034] sequentially performing nested encryption on the source encrypted data according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users.
[0035] As can be seen from the above description, since the source key and other access keys are generated based on the same identification information and different state information configured by different users, when the state information configured by the source user and the access user is the same, the encryption keys of all users are the same, and at this time, the access key of each user can decrypt all the nested encrypted target encryption data, so as to realize data sharing. When the state information configured by the source user and the access user is different, the encryption keys of the users are different, and at this time, only part of the access keys of the users can decrypt the nested encrypted target encryption data, so as to realize data management and control. At the same time, when the source state information uploaded by the source user is a non-sharing identifier, after the target data is encrypted based on the source key of the non-sharing identifier, even if the source key is the same as the other access keys, the access user cannot access the data, that is, all access users are prohibited from accessing the data, so as to realize the safe management and control of the shared data source.
[0036] Further, the storing the target encryption data in the shared data block corresponding to the access user comprises:
[0037] calculating a hash value of the target encryption data, and generating a data identifier according to the data type, the data name of the target encryption data and the hash value;
[0038] storing the target encryption data in the shared data block corresponding to the access user according to the data identifier.
[0039] As can be seen from the above description, the target encryption data is stored in the shared data block, so that other access users can access the shared data through the shared data block. At the same time, the data identifier is created by the hash value, the data type and the data name, which is convenient for the access user to search for specified data.
[0040] Further, the sequentially nesting encryption of the source encryption data according to the access key corresponding to each of the access users to obtain the target encryption data of each of the access users comprises:
[0041] in response to a data access request of a target access user, determining an i th access user requested by the target access user, obtaining i th target encryption data of the i th access user after the i th access user performs nested encryption on the source encryption data through the shared data block, i is an integer greater than or equal to 1;
[0042] re-encrypting the i th target encryption data according to the access key corresponding to the target access user to obtain the target encryption data corresponding to the target access user.
[0043] From the above description, if i is 1, when the target access user requests to access the first access user, the first target encryption data of the first access user after the source encryption data is nested encrypted is obtained, that is, the first target encryption data is nested encrypted twice (the source key and the access key of the first access user). After obtaining the first target encryption data, the first target encryption data is encrypted according to the access key of the target access user. At this time, the target encryption data corresponding to the target access user is nested encrypted three times (the source key, the access key of the first access user and the access key of the target access user). In this way, when the next access user needs to access the target access user, the access permission needs to be determined based on the state information of the source user, the first access user and the target access user, and the divergent propagation of the shared data is effectively avoided.
[0044] Further, after obtaining the i-th target encryption data of the i-th access user after the source encryption data is nested encrypted by the shared data block, the method further comprises:
[0045] decrypting the i-th target encryption data according to the access key corresponding to the i-th access user;
[0046] if the decryption is successful and the source state information is the shared identifier, returning the target data uploaded by the source user to the target access user;
[0047] if the decryption fails or the source state information is a non-shared identifier, prohibiting the target access user from accessing the target data.
[0048] From the above description, since when the state information of the source user and the access user is set to the shared identifier, the keys for nested encryption of the target encryption data are the same, all encryption layers can be decrypted based on the access key of the previous access user, so that the target data is obtained. When the state information of the source user or the access user exists a non-shared identifier, the keys for nested encryption are different, so all encryption layers cannot be decrypted based on the access key of the previous user, and the target data cannot be obtained. In this way, the data sharing ladder is formed based on the state information configured by the access user, so that the data propagation is managed in the blockchain, and the data security is ensured.
[0049] Another embodiment of the application provides a data sharing terminal based on a blockchain, comprising a memory, a processor and a computer program stored in the memory and running on the processor, and the processor implements the following steps when executing the computer program:
[0050] obtaining access state information configured by at least two access users, the access state information being a shared identifier or a non-shared identifier;
[0051] generating an access key corresponding to each of the access users according to the access state information;
[0052] based on the data access relationship between the access users, sequentially performing nested encryption on the target data uploaded by the source user according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users;
[0053] storing the target encrypted data in a shared data block corresponding to the access user.
[0054] From the above description, the beneficial effects of the present application are that: according to the access state information of each access user, a corresponding access key is generated, and then the target data shared by the source user is nested encrypted based on the access key of each access user, so that each access user can control the shared data. When the access state information set by the access user is a sharing identifier, other access users can obtain the shared data from the shared data block based on the access key of the access user. When the access state information set by the access user is a non-sharing identifier, other access users cannot obtain the shared data from the shared data block. In this way, each access user can manage the shared data in real time, avoid the divergence of data propagation, and ensure data security.
[0055] Further, before the access state information configured by the at least two access users is obtained, the method further comprises:
[0056] obtaining target data uploaded by a source user and source state information;
[0057] generating a source key according to the identification information of the target data and the source state information;
[0058] encrypting the target data according to the source key to obtain source encrypted data;
[0059] the sequentially performing nested encryption on the target data uploaded by the source user according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users comprises:
[0060] sequentially performing nested encryption on the source encrypted data according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users.
[0061] As can be seen from the above description, since the source key and other access keys are generated based on the same identification information and different state information configured by different users, when the state information configured by the source user and the access user is the same, the encryption keys of all users are the same, and at this time, the access key of each user can decrypt all the nested encrypted target encryption data, so as to realize data sharing. When the state information configured by the source user and the access user is different, the encryption keys of the users are different, and at this time, only part of the access keys of the users can decrypt the nested encrypted target encryption data, so as to realize data management and control. At the same time, when the source state information uploaded by the source user is a non-sharing identifier, after the target data is encrypted based on the source key of the non-sharing identifier, even if the source key is the same as the other access keys, the access user cannot access the data, that is, all access users are prohibited from accessing the data, so as to realize the safe management and control of the shared data source.
[0062] Further, the storing the target encryption data in the shared data block corresponding to the access user comprises:
[0063] calculating a hash value of the target encryption data, and generating a data identifier according to the data type, the data name of the target encryption data and the hash value;
[0064] storing the target encryption data in the shared data block corresponding to the access user according to the data identifier.
[0065] As can be seen from the above description, the target encryption data is stored in the shared data block, so that other access users can access the shared data through the shared data block. At the same time, the data identifier is created by the hash value, the data type and the data name, which is convenient for the access user to search for specified data.
[0066] Further, the sequentially nesting encryption of the source encryption data according to the access key corresponding to each of the access users to obtain the target encryption data of each of the access users comprises:
[0067] in response to a data access request of a target access user, determining an i th access user requested by the target access user, obtaining i th target encryption data of the i th access user after the i th access user performs nested encryption on the source encryption data through the shared data block, i is an integer greater than or equal to 1;
[0068] re-encrypting the i th target encryption data according to the access key corresponding to the target access user to obtain the target encryption data corresponding to the target access user.
[0069] From the above description, if i is 1, when the target access user requests to access the first access user, the first target encryption data of the first access user after the source encryption data is nested encrypted is obtained, that is, the first target encryption data is nested encrypted twice (the source key and the access key of the first access user). After obtaining the first target encryption data, the first target encryption data is encrypted according to the access key of the target access user. At this time, the target encryption data corresponding to the target access user is nested encrypted three times (the source key, the access key of the first access user and the access key of the target access user). In this way, when the next access user needs to access the target access user, the access permission needs to be determined based on the state information of the source user, the first access user and the target access user, and the divergent propagation of the shared data is effectively avoided.
[0070] Further, after obtaining the i-th target encryption data of the source encryption data nested encrypted by the i-th access user through the shared data block, the method further includes:
[0071] decrypting the i-th target encryption data according to the access key corresponding to the i-th access user;
[0072] if the decryption is successful and the source state information is the shared identifier, returning the target data uploaded by the source user to the target access user;
[0073] if the decryption fails or the source state information is a non-shared identifier, prohibiting the target access user from accessing the target data.
[0074] From the above description, since the keys for nested encryption of the target encryption data are all the same when the state information of the source user and the access user is set as the shared identifier, all encryption layers can be decrypted based on the access key of the previous access user, so that the target data is obtained. When the state information of the source user or the access user exists a non-shared identifier, the keys for nested encryption are different, so all encryption layers cannot be decrypted based on the access key of the previous user, and the target data cannot be obtained. In this way, the data sharing ladder is formed based on the state information configured by the access user, so that the data propagation is managed in the blockchain, and the data security is ensured.
[0075] Embodiments of the application provide a data sharing method and a terminal based on a blockchain, which can be applied to a local area network file sharing scene, can effectively manage and control shared data while realizing blockchain data sharing, and improves data security. The following will be described through specific embodiments:
[0076] Please refer to Figures 1 to 2 Embodiments of the application are:
[0077] A blockchain-based data sharing method, comprising:
[0078] S1, obtaining access state information configured by at least two access users, the access state information being a sharing identifier or a non-sharing identifier.
[0079] Specifically, before the step S1, further comprising:
[0080] S101, obtaining target data uploaded by a source user and source state information, wherein the source state information is a sharing identifier or a non-sharing identifier.
[0081] S102, generating a source key according to identification information of the target data and the source state information.
[0082] In some embodiments, the identification information of the target data includes a device unique identifier and a user unique identifier of the target device.
[0083] In some embodiments, the steps S101 to S102 are specifically: in response to the source user uploading the target data, obtaining, by a server, device attributes, user attributes and the source state information of the target data, and confirming a device unique identifier and a user unique identifier according to the device attributes and the user attributes respectively; and finally generating, by the server, the source key in the form of device unique identifier-user unique identifier-source state information. For example, the sharing identifier is set as 1, the non-sharing identifier is set as 0, if the source user uploads target data A, the device unique identifier of the target data A is OS1952471DE, the user unique identifier is 91547112, and the source state information is a non-sharing identifier, then the source key key0 generated by the source user is {OS1952471DE-91547112-0}.
[0084] In some embodiments, the keys of different users are stored by a key center.
[0085] S103, encrypting the target data according to the source key to obtain source encrypted data.
[0086] In some embodiments, after the key center obtains the source key from the server, the target data is encrypted according to the source key based on an encryption algorithm preset by the source user to obtain the source encrypted data. The encryption algorithm is XOR, AES or DES.
[0087] S2, generating an access key corresponding to each of the access users according to the access state information.
[0088] In some embodiments, when the access state information configured by the access user is obtained, the identification information of the target data configured by the access user is also obtained synchronously, so as to generate an access key according to the identification information and the access state information. That is, the source key and the access key are generated in the same way. For example, the access user 1 currently configures the access state information of the target data A as a sharing identification, and the access key key1 generated by the access user 1 is {OS1952471DE-91547112-1}.
[0089] S3, based on the data access relationship between the access users, sequentially performing nested encryption on the target data uploaded by the source user according to the access key corresponding to each access user to obtain target encrypted data of each access user.
[0090] Specifically, the step S3 includes:
[0091] S31, sequentially performing nested encryption on the source encrypted data according to the access key corresponding to each access user to obtain target encrypted data of each access user.
[0092] Specifically, the step S31 includes:
[0093] S311, in response to a data access request of a target access user, determining an ith access user requested by the target access user, obtaining the ith target encrypted data of the source encrypted data nested encrypted by the ith access user through the shared data block, and i is an integer greater than or equal to 1.
[0094] As Figure 2As shown, in some embodiments, if the current data blockchain L includes a source user, an access user 1 and an access user 2, wherein the source key key0 of the source user is {OS1952471DE-91547112-0}, the access key key1 of the access user 1 is {OS1952471DE-91547112-1}, and the access key key2 of the access user 2 is {OS1952471DE-91547112-1}, then the first target encrypted data nested encryption of the access user 1 can be represented as [key1(key0(target data))], and the second target encrypted data nested encryption of the access user 2 can be represented as [key2(key1(key0(target data)))]. If the current access user 3 requests to access the target data, it is determined that the user requested by the access user 3 is the access user 1, and the first target encrypted data [key1(key0(target data))] is obtained through the shared data block. If the current access user 3 requests to access the target data, it is determined that the user requested by the access user 3 is the access user 2, and the second target encrypted data [key2(key1(key0(target data))) is obtained through the shared data block. Similarly, the above process can be repeated.
[0095] In some embodiments, if the user requested by the target access user is the source user, the source encrypted data of the source user is obtained through the shared data block. For example, if the current access user 3 requests to access the target data, it is determined that the user requested by the access user 3 is the source user, and the source encrypted data [key0(target data)] is obtained through the shared data block.
[0096] S312, according to the access key corresponding to the target access user, the i-th target encrypted data is encrypted again to obtain the target encrypted data corresponding to the target access user.
[0097] In some embodiments, the access key key3 of the current access user 3 is {OS1952471DE-91547112-1}. If the user requested by the access user 3 is the access user 1, the target encrypted data of the access user 3 is [key3(key1(key0(target data)))]. If the user requested by the access user 3 is the access user 2, the target encrypted data of the access user 3 is [key3(key2(key1(key0(target data))))]. If the user requested by the access user 3 is the source user, the target encrypted data of the access user 3 is [key3(key0(target data))]. Similarly, the above process can be repeated.
[0098] After the step S311, the method further includes:
[0099] S3101, decrypt the i-th target encrypted data according to the access key corresponding to the i-th access user.
[0100] S3102, if the decryption is successful and the source state information is the shared identifier, return the target data uploaded by the source user to the target access user.
[0101] S3103, if the decryption fails or the source state information is the non-shared identifier, prohibit the target access user from accessing the target data.
[0102] In some embodiments, if the current access user 3 obtains the first target encrypted data as [key1 (key0 (target data))], the first target encrypted data [key1 (key0 (target data))] is decrypted according to the access key key1 of the access user 1, wherein since key1 = {OS1952471DE-91547112-1} and key0 = {OS1952471DE-91547112-0}, and the source state information is the non-shared identifier. Therefore, the decryption fails, and the access user 3 is prohibited from accessing the target data.
[0103] In some embodiments, if the source state information of the source user and the access state information of the access user 1 are both shared identifiers, the source key key0 of the source user and the access key key1 of the access user 1 are both {OS1952471DE-91547112-1}. At this time, if the current access user 3 obtains the first target encrypted data as [key1 (key0 (target data))], the first target encrypted data [key1 (key0 (target data))] is decrypted according to the access key key1 of the access user 1, since key1 and key0 are the same, and the source state information is the shared identifier. Therefore, the decryption is successful, and the target data is returned to the access user 3.
[0104] In some embodiments, if the source state information of the source user and the access state information of the access user 1 are both shared identifiers, and the access state information of the access user 2 is the non-shared identifier, the access key key2 of the access user 2 is {OS1952471DE-91547112-0}. At this time, if the current access user 3 obtains the second target encrypted data as [key2 (key1 (key0 (target data)))], the second target encrypted data [key2 (key1 (key0 (target data))) is decrypted according to the access key key2 of the access user 2, since key2 is different from key1 and key0, key2 cannot decrypt the encryption layer of key1 and key0, the decryption fails, and the access user 3 is prohibited from accessing the target data.
[0105] In some embodiments, if the source state information of the source user and the access state information of the access user 2 are both shared identifiers, and the access state information of the access user 1 is a non-shared identifier, the access key of the access user 1 is key1 = {OS1952471DE-91547112-0}. At this time, if the current access user 3 obtains the second target encrypted data as [key2(key1(key0(target data)))], the second target encrypted data [key2(key1(key0(target data))) ] is decrypted level by level according to the access key key2 of the access user 2. Since key1 and key2, key0 are all different, key2 cannot decrypt the encryption layer of key1, and the decryption fails, preventing the access user 3 from accessing the target data.
[0106] Therefore, whether the target access user can access the target data depends on the source state information of the source user and the access state information of the user nested by the requested user. That is, when the source state information of the source user is set to non-shared, all access users cannot access the target data, realizing the data source control of shared data. When the access state information of the user a is set to non-shared, only the user who does not pass through the user a in the data access process can access the target data, realizing the partial permission control of shared data. In addition, the number of nested encryption layers can determine the propagation range of the current target data, effectively avoiding the divergent propagation of data.
[0107] S4, storing the target encrypted data in a shared data block corresponding to the access user.
[0108] Specifically, the step S4 comprises:
[0109] S41, calculating the hash value of the target encrypted data, and generating a data identifier according to the data type, data name and hash value of the target encrypted data.
[0110] In some embodiments, the data identifier can be specifically {music-What you want.mp3-92fed86f2502ba48eb4eadf09811886ebad914cc}.
[0111] S42, storing the target encrypted data in a shared data block corresponding to the access user according to the data identifier.
[0112] In some embodiments, a block state identifier can be created so that target encrypted files with the same block state identifier can be stored in the same interval, facilitating data traversal access and improving search efficiency. The block state identifier is used to indicate whether the target encrypted data is shared, 1 indicating sharing and 0 indicating non-sharing. Specifically, the target encrypted data list name in the shared data block is {music-What you want.mp3-92fed86f2502ba48eb4eadf09811886ebad914cc-1}, {file-1.exe-f5785f9d76b77f604f49f881c078abec26602062-1}, and the like.
[0113] Please refer to Figure 3 Embodiment two of the present application is:
[0114] A data sharing terminal 100 based on a block chain, comprising a memory 101, a processor 102, and a computer program stored on the memory 101 and running on the processor 102, wherein the processor 102 executes the computer program to implement each step of the above-mentioned data sharing method based on a block chain.
[0115] In summary, the present application provides a data sharing method and terminal based on a block chain, which generates a corresponding access key according to the access state information of each access user, and then performs nested encryption on the target data shared by the source user based on the access key of each access user to form a data sharing ladder, so that the data propagation can be managed according to the configuration of each access user in the block chain, ensuring data security. When the access state information set by the access user is a sharing identifier, other access users can obtain shared data from the shared data block based on the access key of the access user. When the access state information set by the access user is a non-sharing identifier, other access users cannot obtain shared data from the shared data block. In this way, each access user can manage shared data in real time, avoiding the divergence of data propagation. At the same time, based on the source state information configured by the source user uploading the target data, the access rights of all access users can be directly controlled, ensuring the data security of the source user.
[0116] The above-mentioned embodiments are only examples of the present application, and do not limit the patent scope of the present application. Any equivalent transformation or direct or indirect application in related technical fields based on the content of the present application specification and drawings is also included in the patent protection scope of the present application.
Claims
1.A blockchain-based data sharing method, characterized by, The method comprises the following steps: obtaining access state information configured by at least two access users, the access state information being shared identification or non-shared identification; generating an access key corresponding to each of the access users according to the access state information; based on the data access relationship between the access users, sequentially performing nested encryption on target data uploaded by a source user according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users; storing the target encrypted data in a shared data block corresponding to the access users; before the step of obtaining the access state information configured by the at least two access users, the method further comprises the following steps: obtaining target data uploaded by a source user and source state information; generating a source key according to identification information of the target data and the source state information; encrypting the target data according to the source key to obtain source encrypted data; the step of sequentially performing nested encryption on the target data uploaded by the source user according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users comprises the following step: sequentially performing nested encryption on the source encrypted data according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users; the step of sequentially performing nested encryption on the source encrypted data according to the access key corresponding to each of the access users to obtain target encrypted data of each of the access users comprises the following steps: in response to a data access request of a target access user, determining an ith access user requested by the target access user, obtaining ith target encrypted data of the source encrypted data nested encrypted by the ith access user through the shared data block, i being an integer greater than or equal to 1; re-encrypting the ith target encrypted data according to the access key corresponding to the target access user to obtain target encrypted data corresponding to the target access user; after the step of obtaining the ith target encrypted data nested encrypted by the ith access user through the shared data block, the method further comprises the following steps: gradually decrypting the ith target encrypted data according to the access key corresponding to the ith access user; if the decryption is successful and the source state information is the shared identification, returning the target data uploaded by the source user to the target access user; if the decryption fails or the source state information is non-shared identification, prohibiting the target access user from accessing the target data. 2.The blockchain-based data sharing method of claim 1, wherein, the step of storing the target encrypted data in the shared data block corresponding to the access users comprises the following steps: calculating a hash value of the target encrypted data, and generating a data identification according to a data type, a data name and the hash value of the target encrypted data; storing the target encrypted data in the shared data block corresponding to the access users according to the data identification. 3.A blockchain-based data sharing terminal, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, when the processor executes the computer program, the following steps are implemented: obtaining access state information configured by at least two access users, the access state information being shared identification or non-shared identification; generating an access key corresponding to each of the access users according to the access state information; According to the data access relationship between the access users, the target data uploaded by the source user is sequentially nested encrypted according to the access key corresponding to each access user to obtain target encrypted data of each access user; The target encrypted data is stored in a shared data block corresponding to the access user; Before the access state information configured by the at least two access users is obtained, the method further includes: Obtaining target data uploaded by a source user and source state information; Generating a source key according to the identification information of the target data and the source state information; Encrypting the target data according to the source key to obtain source encrypted data; According to the data access relationship between the access users, the target data uploaded by the source user is sequentially nested encrypted according to the access key corresponding to each access user to obtain target encrypted data of each access user; According to the data access relationship between the access users, the target data uploaded by the source user is sequentially nested encrypted according to the access key corresponding to each access user to obtain target encrypted data of each access user; According to the data access relationship between the access users, the target data uploaded by the source user is sequentially nested encrypted according to the access key corresponding to each access user to obtain target encrypted data of each access user; In response to a data access request of a target access user, a first i access user requested by the target access user is determined, and the first i target encrypted data nested encrypted by the first i access user on the source encrypted data is obtained through the shared data block, i being an integer greater than or equal to 1; According to the access key corresponding to the target access user, the first i target encrypted data is encrypted again to obtain target encrypted data corresponding to the target access user; According to the data access relationship between the access users, the target data uploaded by the source user is sequentially nested encrypted according to the access key corresponding to each access user to obtain target encrypted data of each access user; According to the access key corresponding to the first i access user, the first i target encrypted data is decrypted level by level; If the decryption is successful and the source state information is the shared identifier, the target data uploaded by the source user is returned to the target access user; If the decryption fails or the source state information is a non-shared identifier, the target access user is prohibited from accessing the target data. 4.The blockchain-based data sharing terminal according to claim 3, wherein, The target encrypted data is stored in a shared data block corresponding to the access user; The hash value of the target encrypted data is calculated, and a data identifier is generated according to the data type, data name and hash value of the target encrypted data; The target encrypted data is stored in a shared data block corresponding to the access user according to the data identifier.
Citation Information
Patent Citations
Data transaction system and method
CN112732829A
Block chain storage scheme based on DHT and IPFS
CN116522383A