A blockchain privacy data sharing method and system
By adopting multi-layer encryption policy, dynamic key update and zero-knowledge proof technology in data security solutions, combined with blockchain privacy data sharing methods, a single encryption level, static key management and user privacy protection in traditional data security solutions is solved. The challenge of achieving higher data security and privacy protection.
Patent Information
- Application Number
- CN202410817262.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing data security solutions have limitations of a single encryption level, insufficient security of static key management, and challenges in user privacy protection.
Multi-layer encryption strategies are adopted, including symmetric encryption, asymmetric encryption and ring signature technology, combined with dynamic key update mechanism and zero-knowledge proof technology, and these problems are solved through blockchain privacy data sharing methods.
Improve the depth and strength of data protection through multi-layer encryption technology, dynamic key update mechanism reduces key leakage and cracking risks, zero-knowledge proof technology ensures the privacy and legality of user identity verification, and reduces off-chain computing and data sharding methods The burden of blockchain network improves computing efficiency.
Smart Images

Figure CN118869243B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data security, and in particular to a blockchain privacy data sharing method. Background Art
[0002] In recent years, with the rapid development of information technology, data security has become one of the core challenges of the Internet era. Traditional single encryption technology is often difficult to resist complex security threats such as data leakage, tampering, and unauthorized access. In order to improve the security and privacy protection of data, researchers have extensively explored innovative applications in the fields of multi-layer encryption, dynamic key management, zero-knowledge proof, and blockchain technology.
[0003] However, the existing data security solutions still have the following technical problems: Limitations of a single encryption layer: Traditional single-layer encryption technology is difficult to cope with increasingly complex security threats and is vulnerable to various attack methods;
[0004] Insufficient security of static key management: Static key management is prone to key leakage and cracking, which exposes long-term stored data to security risks;
[0005] Challenges in protecting user privacy: Traditional verification technologies may leak user privacy information and are difficult to perform effective verification without exposing data content.
[0006] To this end, we proposed a blockchain privacy data sharing method and system to solve the above problems; Summary of the invention
[0007] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0008] In view of the above-mentioned problems existing in the existing blockchain privacy data sharing method, the present invention is proposed.
[0009] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0010] A blockchain privacy data sharing method, the method comprising the following steps:
[0011] S1: Formulate a multi-layer data encryption strategy, use a symmetric encryption algorithm to perform the first layer of data encryption; use the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption; and use the ring signature technology to sign the data after the second layer of encryption to form the third layer of encryption;
[0012] S2: Establish a dynamic key update mechanism to automatically generate new encryption keys regularly or based on specific events, divide the encrypted data into several data shards, and store each shard on different blockchain nodes;
[0013] S3: The user initiates a data request. The system uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request. If the verification is successful, a temporary authorization token is generated.
[0014] S4: Off-chain computing and data decryption; After receiving the computing task, the off-chain computing node obtains the required data shards from the blockchain node and decrypts the data using a temporary authorization token. The off-chain computing node uses multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data.
[0015] As a preferred solution of the blockchain privacy data sharing method described in the present invention, the multi-layer data encryption strategy includes the following steps:
[0016] S11: Use the symmetric encryption algorithm to perform the first layer encryption on the original data D, and obtain the encrypted data E1(D)=AES(D, K sym ), K sym Represented as a symmetric key;
[0017] S12: Use the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption, and obtain: E2(E1(D))=RSA(K sym , K pub ), K pub Represents an asymmetric key;
[0018] S13: Use the ring signature technology to sign the second layer of encrypted data to form the third layer of encryption, and obtain E3(E2(E1(D)))=RingSing(E2(K sym ), K priv ), K priv Represents a ring signature key.
[0019] As a preferred solution of the blockchain privacy data sharing method described in the present invention, the key update process is:
[0020] Key updates in the time dimension;
[0021] Use the integral function to express it:
[0022] Where τ represents the time variable, β represents the time decay coefficient, and f(t) represents the dynamic key update mechanism that changes with time t, taking into account the effects of time decay and log growth;
[0023] Key updates based on the transaction count dimension;
[0024] The key is dynamically updated with the number of transactions n, using the sum function:
[0025]
[0026] Where, Γ represents the Gamma function, g(n) represents the dynamic key update mechanism that changes with the number of transactions n, and takes into account the impact of the number of transactions on key update;
[0027] Combining the number of transactions and the time period, the new encryption key is expressed as:
[0028] K new =f(T,N)=(f(t)+g(n)).
[0029] As a preferred solution of the blockchain privacy data sharing method described in the present invention, the specific method for a user to initiate a data request and verify is:
[0030] The user initiates a data request Q, and uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request;
[0031] The zero-knowledge proof function ZKP(Q) verifies the user's request;
[0032] ZKP(Q)=(f(t)+g(n)+H(Q,U));
[0033] Wherein, H(Q, U) represents a hash function, which is used to verify user requests and identity information;
[0034] After verification, the system generates a temporary authorization token T auth .
[0035] As a preferred solution of the blockchain privacy data sharing method described in the present invention, the method of off-chain calculation and data decryption is:
[0036] S41: Computation tasks involving sensitive data are distributed to off-chain computing nodes;
[0037] S42: The off-chain computing node obtains the required data shards from the blockchain node (F i );
[0038] S43: Use the temporary authorization token to decrypt the data. The off-chain computing node uses multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data. The decrypted original data is represented by D orig :
[0039]
[0040] in, Represents the first decryption function, corresponding to the decryption process of the symmetric encryption algorithm, represents the second decryption function, corresponding to the decryption process of the asymmetric encryption algorithm; Represents the third decryption function, corresponding to the ring signature decryption process.
[0041] As a preferred solution of the blockchain privacy data sharing method described in the present invention, the SHA-256 hash function is used to implement H(Q, U), which is expressed as:
[0042] H(Q, U) = SHA-256(Q||U);
[0043] The symbol “||” indicates connecting the user request Q and the user identity U.
[0044] As a preferred solution of the blockchain privacy data sharing method described in the present invention, a verification threshold is set. When the ZKP(Q) verification value ≥ the threshold, it means that the verification is passed, and a temporary token T is generated normally. auth When the ZKP(Q) verification value is less than the threshold, it means that the verification fails, the request is rejected, and an error message is returned to the user.
[0045] The present invention also discloses a blockchain privacy data sharing system, which is based on the above-mentioned blockchain privacy data sharing method and includes the following functional modules:
[0046] The data multi-layer encryption module performs multi-layer encryption on private data, that is, using a symmetric encryption algorithm to perform the first layer of encryption on the data; using the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption; and using the ring signature technology to sign the data after the second layer of encryption to form the third layer of encryption;
[0047] The key dynamic update module automatically generates new encryption keys periodically or based on specific events, and divides the encrypted data into several data shards, each of which is stored on a different blockchain node;
[0048] User verification module, which uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request. If the verification is successful, a temporary authorization token is generated;
[0049] The data decryption module uses a temporary authorization token to decrypt the data. The off-chain computing nodes use multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data.
[0050] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the above-mentioned blockchain privacy data sharing method are implemented; a computer-readable storage medium stores a computer program, and is characterized in that when the computer program is executed by the processor, the steps of the above-mentioned blockchain privacy data sharing method are implemented.
[0051] Beneficial effects of the present invention:
[0052] 1. The present invention increases the depth and strength of data protection through multi-layer encryption technology to prevent unauthorized access and tampering; through a dynamic key update mechanism, it reduces the risk of key leakage and cracking, ensuring the security of data at different times and conditions;
[0053] 2. Through zero-knowledge proof technology, the user identity can be verified without leaking the data content to ensure the legitimacy of the request; through off-chain computing and data sharding, the burden on the blockchain network can be reduced, computing efficiency can be improved, and data security and privacy can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0055] Figure 1 This is a schematic diagram of the overall structure of a blockchain privacy data sharing method proposed by the present invention;
[0056] Figure 2 This is a schematic diagram comparing the encryption time and decryption time of multi-layer encryption and single-layer encryption in a blockchain privacy data sharing method proposed in the present invention. DETAILED DESCRIPTION
[0057] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0058] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0059] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0060] Reference Figure 1 , as an embodiment of the present invention, provides a blockchain privacy data sharing method, the method comprising the following steps:
[0061] S1: Formulate a multi-layer data encryption strategy, use a symmetric encryption algorithm to perform the first layer of data encryption; use the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption; and use the ring signature technology to sign the data after the second layer of encryption to form the third layer of encryption;
[0062] Specifically, the multi-layer data encryption strategy includes the following steps:
[0063] S11: Use the symmetric encryption algorithm to perform the first layer encryption on the original data D, and obtain the encrypted data E1(D)=AES(D, K sym ), K sym Represented as a symmetric key;
[0064] S12: Use the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption, and obtain: E2(E1(D))=RSA(K sym , K pub ), K pub Represents an asymmetric key;
[0065] S13: Use the ring signature technology to sign the second layer of encrypted data to form the third layer of encryption, and obtain E3(E2(E1(D)))=RingSing(E2(K sym ), K priv ), K priv Represents the ring signature key; ensures multi-level protection of data and improves data security and tamper-proof capabilities.
[0066] S2: Establish a dynamic key update mechanism to automatically generate new encryption keys regularly or based on specific events, divide the encrypted data into several data shards, and store each shard on a different blockchain node. Record the hash value and storage location of each data shard on the blockchain to ensure data integrity and traceability;
[0067] Specifically, the key update process is:
[0068] Key updates in the time dimension;
[0069] Use the integral function to express it:
[0070] Where τ represents the time variable, β represents the time decay coefficient, and f(t) represents the dynamic key update mechanism that changes with time t, taking into account the effects of time decay and log growth;
[0071] Key updates based on the transaction count dimension;
[0072] The key is dynamically updated with the number of transactions n, using the sum function:
[0073]
[0074] Where, Γ represents the Gamma function, g(n) represents the dynamic key update mechanism that changes with the number of transactions n, and takes into account the impact of the number of transactions on key update;
[0075] Combining the number of transactions and the time period, the new encryption key is expressed as:
[0076] K new =f(T,N)=(f(t)+g(n)).
[0077] S3: The user initiates a data request. The system uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request. If the verification is successful, a temporary authorization token is generated.
[0078] Specifically, the specific method for users to initiate data requests and verify them is:
[0079] The user initiates a data request Q, and uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request;
[0080] The zero-knowledge proof function ZKP(Q) verifies the user's request;
[0081] ZKP(Q)=(f(t)+g(n)+H(Q,U));
[0082] Among them, H(Q,U) represents a hash function, which is used to verify user requests and identity information;
[0083] After verification, the system generates a temporary authorization token T auth The reconstructed zero-knowledge proof function combines the key update mechanism of the time dimension and the transaction number dimension, as well as hash verification, to ensure that the system takes into account both the time effect and the impact of the transaction number during the verification process, thereby enhancing the security and privacy protection capabilities during data sharing.
[0084] Using the SHA-256 hash function to implement H(Q,U), it is expressed as:
[0085] H(Q,U)=SHA-256(Q∥U);
[0086] The symbol “∥” indicates that the user request Q and the user identity U are connected.
[0087] S4: Off-chain computing and data decryption; After receiving the computing task, the off-chain computing node obtains the required data shards from the blockchain node and decrypts the data using a temporary authorization token. The off-chain computing node uses multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data.
[0088] Furthermore, the method of off-chain calculation and data decryption is:
[0089] S41: Computation tasks involving sensitive data are distributed to off-chain computing nodes;
[0090] S42: The off-chain computing node obtains the required data shards from the blockchain node (F i );
[0091] S43: Use the temporary authorization token to decrypt the data. The off-chain computing node uses multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data. The decrypted original data is represented by D orig :
[0092]
[0093] in, Represents the first decryption function, corresponding to the decryption process of the symmetric encryption algorithm, represents the second decryption function, corresponding to the decryption process of the asymmetric encryption algorithm; Represents the third decryption function, corresponding to the ring signature decryption process.
[0094] Reference Figure 2 ,We will perform multi-layer encryption (the method in the embodiment) and single-layer encryption (the traditional method) on a fixed-size data set, and then measure and compare these indicators.
[0095] Dataset: Random data of size 1MB.
[0096] Implementation method: AES+RSA+ring signature multi-layer encryption.
[0097] Traditional method: only AES single-layer encryption is used; the comparison results are shown in the following table:
[0098] method Encryption time (seconds) Decryption time (seconds) AES 0.0030 0.0040 Multi-layer encryption 0.0469 0.0456
[0099] It can be seen from the above table that the encryption time of the single-layer encryption method (AES) is 0.0030 seconds and the decryption time is 0.0040 seconds. AES is a symmetric encryption algorithm with a fast encryption and decryption speed, which is suitable for processing large amounts of data. The multi-layer encryption of the present invention: The encryption time of the multi-layer encryption method is 0.0469 seconds and the decryption time is 0.0456 seconds. Multi-layer encryption combines symmetric encryption (AES), asymmetric encryption (RSA) and ring signature technology. Although the encryption and decryption time is longer than the single-layer encryption method, this method provides higher security and data protection.
[0100] The present invention also discloses a blockchain privacy data sharing system. Based on the above blockchain privacy data sharing method, the system includes the following functional modules:
[0101] The data multi-layer encryption module performs multi-layer encryption on private data, that is, using a symmetric encryption algorithm to perform the first layer of encryption on the data; using the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption; and using the ring signature technology to sign the data after the second layer of encryption to form the third layer of encryption;
[0102] The key dynamic update module automatically generates new encryption keys periodically or based on specific events, and divides the encrypted data into several data shards, each of which is stored on a different blockchain node;
[0103] User verification module, which uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request. If the verification is successful, a temporary authorization token is generated;
[0104] The data decryption module uses a temporary authorization token to decrypt the data. The off-chain computing nodes use multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data.
[0105] In summary, the present invention increases the depth and strength of data protection through multi-layer encryption technology to prevent unauthorized access and tampering; reduces the risk of key leakage and cracking through a dynamic key update mechanism to ensure the security of data at different times and conditions; through zero-knowledge proof technology, it can verify the identity of the user without leaking the data content to ensure the legitimacy of the request; through off-chain computing and data sharding, it can reduce the burden on the blockchain network, improve computing efficiency, and ensure data security and privacy.
[0106] This embodiment also provides a computer device, which is applicable to a blockchain privacy data sharing method, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement a blockchain privacy data sharing method proposed in the above embodiment.
[0107] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0108] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, a blockchain privacy data sharing method proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, disk or optical disk.
[0109] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A blockchain privacy data sharing method, characterized in that: The method comprises the following steps: S1: Formulate a multi-layer data encryption strategy, use a symmetric encryption algorithm to perform the first layer of data encryption; use the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption; and use the ring signature technology to sign the data after the second layer of encryption to form the third layer of encryption; S2: Establish a dynamic key update mechanism to automatically generate new encryption keys regularly or based on specific events, divide the encrypted data into several data shards, and store each shard on different blockchain nodes; The key update process is: Key updates in the time dimension; Use the integral function to express it: ; in, represents the time variable, represents the time attenuation coefficient, represents a dynamic key update mechanism that changes with time t; Key updates based on the transaction count dimension; The key is dynamically updated with the number of transactions n, using the sum function: ; Where, Γ represents the Gamma function, g(n) represents the dynamic key update mechanism that changes with the number of transactions n, and takes into account the impact of the number of transactions on key update; Combining the number of transactions and the time period, the new encryption key is expressed as: S3: The user initiates a data request. The system uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request. If the verification is successful, a temporary authorization token is generated. The specific method for users to initiate data requests and verify them is: The user initiates a data request Q and uses zero-knowledge proof technology to verify the user's identity U and the legitimacy of the request; The zero-knowledge proof function Verify the user's request; ; in, Represents a hash function used to verify user requests and identity information; After verification, the system generates a temporary authorization token ; S4: Off-chain computing and data decryption; After receiving the computing task, the off-chain computing node obtains the required data shards from the blockchain node and decrypts the data using a temporary authorization token. The off-chain computing node uses multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data.
2. A blockchain privacy data sharing method according to claim 1, characterized in that: The data multi-layer encryption strategy includes the following steps: S11: Use the symmetric encryption algorithm to perform the first layer of encryption on the original data D to obtain the encrypted data , Represented as a symmetric key; S12: Use the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption, and obtain: =RSA , Represents an asymmetric key; S13: Use the ring signature technology to sign the second layer of encrypted data to form the third layer of encryption, and obtain =RingSing , Represents a ring signature key.
3. A blockchain privacy data sharing method according to claim 2, characterized in that: The method of off-chain calculation and data decryption is: S41: Computation tasks involving sensitive data are distributed to off-chain computing nodes; S42: Off-chain computing nodes obtain the required data shards from blockchain nodes S43: Use the temporary authorization token to decrypt the data. The off-chain computing node uses multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data. The decrypted original data is represented as : = in, Represents the first decryption function, corresponding to the decryption process of the symmetric encryption algorithm, represents the second decryption function, corresponding to the decryption process of the asymmetric encryption algorithm; Represents the third decryption function, corresponding to the ring signature decryption process.
4. A blockchain privacy data sharing method according to claim 3, characterized in that: Use the SHA-256 hash function to implement , then it is expressed as: = ; Among them, the symbol " " means connecting the user request Q and the user identity U.
5. A blockchain privacy data sharing method according to claim 4, characterized in that: Set the verification threshold when When the verification value ≥ the threshold, it means the verification is passed, and a temporary token is generated normally. ,when When the verification value is less than the threshold, it means that the verification fails, the request is rejected, and an error message is returned to the user.
6. A blockchain privacy data sharing system, based on the blockchain privacy data sharing method according to any one of claims 1 to 5, characterized in that: The system includes the following functional modules: The data multi-layer encryption module performs multi-layer encryption on private data, that is, uses a symmetric encryption algorithm to perform the first layer of encryption on the data; uses the generated asymmetric encryption key to encrypt the symmetric key to form the second layer of encryption; And use ring signature technology to sign the second layer of encrypted data to form the third layer of encryption; The key dynamic update module automatically generates new encryption keys periodically or based on specific events, and divides the encrypted data into several data shards, each of which is stored on a different blockchain node; User verification module, which uses zero-knowledge proof technology to verify the user's identity and the legitimacy of the request. If the verification is successful, a temporary authorization token is generated; The data decryption module uses a temporary authorization token to decrypt the data. The off-chain computing nodes use multiple layers of encryption keys to decrypt the data shards in sequence and combine them into the complete original data.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of a blockchain privacy data sharing method described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a blockchain privacy data sharing method described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Data sharing encryption and decryption method based on block chain
CN117499085A