Blockchain privacy data sharing method and system based on chameleon hash

By generating encryption keys using the Chameleon Hash algorithm and utilizing hash trapdoors and obfuscated information, the problem of encryption key exposure in privacy data sharing on the blockchain is solved, achieving secure data sharing and fine-grained privacy control.

CN114936380BActive Publication Date: 2026-02-24SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210506984.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-11
Publication Date
2026-02-24
Estimated Expiration
2042-05-11

AI Technical Summary

Technical Problem

On the blockchain, how to grant access to individual users for private data sharing without exposing encryption keys is a challenge that current technologies struggle to achieve fine-grained privacy control.

Method used

The chameleon hash algorithm is used to generate the encryption key. Hash collisions are found through hash trapdoors. A symmetric encryption key is generated using obfuscation information and random numbers. User A uses the private key to generate a hash collision random number and sends it to user B. User B uses the public key to decrypt the data.

Benefits of technology

It enables user b to decrypt data without transmitting the encryption key, ensuring the security and privacy of data sharing, preventing key leakage, and supporting fine-grained control over the scope of privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114936380B_ABST
    Figure CN114936380B_ABST
Patent Text Reader

Abstract

The application discloses a blockchain privacy data sharing method and system based on chameleon hash, and belongs to the technical fields of blockchain, data encryption and key negotiation. The technical problem to be solved by the application is privacy protection and sharing of transaction data on a blockchain. The technical solution is as follows: a blockchain network is built: a blockchain network is deployed based on a blockchain framework; a user registers a blockchain identity, generates a user public key and a private key, and the user public key and the private key are respectively denoted as P and S; the user generates a chameleon hash public key pk and a private key sk by using a chameleon hash key generation algorithm, and a security constant lambda is freely selected to generate the chameleon hash public key pk and the private key sk; the private key sk is a chameleon hash trapdoor; external storage is established; a user a stores privacy data D1, selects a random number K, generates a chameleon hash h, and uses the chameleon hash h as an encryption key; the user a stores the privacy data D1 to the blockchain, encrypts the privacy data by using the chameleon hash h as a symmetric encryption key, obtains a result ED1, and writes the result ED1 to the blockchain; and a user b applies for accessing the privacy data ED1, and obtains the privacy data D.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of blockchain, data encryption and key negotiation technology, specifically a blockchain privacy data sharing method and system based on chameleon hashing. Background Technology

[0002] In public blockchains like Bitcoin and Ethereum, user transaction data is unencrypted, relying solely on account anonymity for privacy. In permissioned blockchains like Hyperledger Fabric, multiple channels can be created, each with its own independent ledger. Only members within a channel can see the ledger data, achieving data isolation between different channels and thus maintaining privacy among channel members. However, channel technology offers relatively coarse privacy control, allowing channel members to see all of each other's transaction data. Since version 1.2, Fabric has supported private data. Private data allows for finer-grained privacy control within channels, authorizing transaction data to be visible to specific channel members, while unauthorized members can only see the transaction hash. Addressing the issue of sharing private data, how to grant access to individual users without exposing encryption keys is a pressing technical challenge. Summary of the Invention

[0003] The technical objective of this invention is to provide a blockchain privacy data sharing method and system based on chameleon hashing to solve the problem of privacy protection and sharing of transaction data on the blockchain.

[0004] The technical objective of this invention is achieved as follows: a blockchain privacy data sharing method based on chameleon hashing, the specific method of which is as follows:

[0005] Building a blockchain network: Deploying a blockchain network based on a blockchain framework;

[0006] Users register a blockchain identity and generate a user public key and a private key, denoted as P and S respectively;

[0007] Users generate a Chameleon hash public key pk and a private key sk using the Chameleon hash key generation algorithm, with the security constant λ being the freely chosen generation method; the private key sk is the Chameleon hash trapdoor, which makes it easy to find hash collisions, i.e., different data have the same hash.

[0008] Establish external storage;

[0009] User a stores private data D1, selects a random number K (the random number generation rule can be freely chosen), generates a chameleon hash h, and uses it as the encryption key;

[0010] User a stores private data D1 into the blockchain, uses h as a symmetric encryption key to encrypt the private data, and writes the result ED1 onto the blockchain.

[0011] User b requests access to privacy data ED1 and receives privacy data D.

[0012] As a preferred option, user b requests access to privacy data ED1 and obtains privacy data D as follows:

[0013] User b requests access to privacy data ED1, and sends the current timestamp (or other random number) as obfuscated information m′;

[0014] After user A agrees to the application, using the obfuscation information m′, and according to the hash collision algorithm, the inputs are user A's private key sk (trapdoor), encryption key K, obfuscation information m′, hash value h, and random number p, and the output is a corresponding new random number r′, such that:

[0015] Ch_Ver(pk,K,(h,p),r)=Ch_Ver(pk,m′,(h,p),r′)=1;

[0016] Right now:

[0017] ch_Hash(pk,K,r)=ch_Hash(pk,m′,r′);

[0018] User A stores the user information corresponding to user B, the obfuscation information m′, the newly added random number r′, and the corresponding access privacy data ID in an external database for access control purposes.

[0019] User A sends a new random number r′ to user B. User B obtains user A's chameleon hash public key pk, and uses the obfuscation information m′ and the random number r′ sent by user A to obtain the chameleon hash h, which is the privacy data encryption key, as follows:

[0020] ch_Hash(pk,m′,r′)=(h,p);

[0021] User b obtains the private data ED1 that they want to access, and decrypts it using h to obtain data D1.

[0022] More preferably, external storage is used to store the user's chameleon hash public key pk and private key sk, along with the corresponding data information; when storing privacy data, a corresponding data ID is created for each privacy data, and the corresponding random number K and r are stored to facilitate subsequent chameleon hash operations.

[0023] More preferably, the random number K is used as the message content m of the chameleon hash operation. Another random number r is selected (the random number generation rule can be freely chosen). Using user a's chameleon hash public key pk, the chameleon hash algorithm is used to generate the chameleon hash h and the corresponding random number p, as shown in the following formula:

[0024] Ch_Hash(pk,K,r)=(h,p);

[0025] Using chameleon hashing to generate encryption keys ensures that the same encryption key can be generated in the future without revealing K, and also avoids the security risks of transmitting encryption keys over the network.

[0026] Preferably, the symmetric encryption key is obtained through a symmetric encryption algorithm. The encryption and decryption of the symmetric encryption algorithm rely on the same symmetric key. That is, the plaintext is encrypted using the symmetric key to obtain the ciphertext, and the ciphertext is decrypted using the same symmetric key to obtain the plaintext.

[0027] More preferably, user b uses obfuscation information and random numbers to generate a chameleon hash h, which is a symmetric encryption key; the interaction information between user a and user b is used to exchange obfuscation information and corresponding random numbers, and the obfuscation information and corresponding random numbers are not transmitted in the network at the same time to ensure computational security and prevent privacy leakage.

[0028] When users other than user b request access to privacy data ED1, they obtain obfuscation information and the corresponding random number, and use user a's chameleon hash public key to obtain the chameleon hash, which is then used to decrypt the privacy data.

[0029] A blockchain-based privacy data sharing system based on chameleon hashing, comprising:

[0030] The deployment module is used to deploy blockchain networks based on a blockchain framework.

[0031] The registration module is used for users to register their blockchain identity and generate user public and private keys, denoted as P and S respectively.

[0032] The generation module is used by users to generate a Chameleon hash public key pk and a private key sk using the Chameleon hash key generation algorithm. The security constant λ can be freely selected in terms of the generation method. The private key sk is the Chameleon hash trapdoor. Using the hash trapdoor, hash collisions can be easily found, that is, different data have the same hash.

[0033] Create a module for establishing external storage;

[0034] The selection module is used by user a to store private data D1, select a random number K (the random number generation rule can be freely selected), generate a chameleon hash h, and use it as an encryption key;

[0035] The encryption module is used by user a to store private data D1 to the blockchain, use h as a symmetric encryption key to encrypt the private data, and write the result ED1 to the chain.

[0036] The access module is used by user b to request access to privacy data ED1 and obtain privacy data D.

[0037] As a preferred option, the system operates as follows:

[0038] (1) User a selects a random number, uses the Chameleon hash operation to obtain a hash value, and uses the hash value as the symmetric encryption key h to encrypt privacy data and write it to the chain.

[0039] (2) User B requests access to private data and obtains the current timestamp, and sends the request to User A;

[0040] (3) After user a agrees to the application, it obtains user b's public key, concatenates it with a timestamp (or other random number) as obfuscation information, uses the Chameleon Hash private key to obtain the hash collision of h, and sends the corresponding random number to user b;

[0041] (4) After receiving the returned random number, user b uses user a's chameleon hash public key to calculate the chameleon hash h, obtains the encrypted private data, and decrypts it; the details are as follows:

[0042] ① User a, who holds the privacy data, uses the Chameleon Hash private key sk to obtain the corresponding hash collision random number r′ based on the obfuscated information m′ sent by user b;

[0043] ② User b uses the obfuscation information m′ and the collision random number r′, and uses user a's chameleon hash public key pk to calculate the chameleon hash value h and decrypt the data.

[0044] An electronic device includes: a memory and at least one processor;

[0045] The memory stores computer-executed instructions;

[0046] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the blockchain privacy data sharing method based on chameleon hash as described above.

[0047] A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the blockchain privacy data sharing method based on chameleon hashing as described above.

[0048] The blockchain privacy data sharing method and system based on chameleon hashing of the present invention have the following advantages:

[0049] (I) This invention mainly utilizes the characteristic of hash collision that the Chameleon hash function can obtain. User A encrypts and stores private data on the blockchain. When other users apply for access, user A can use the Chameleon hash algorithm private key to find the key collision, so that the accessing user can obtain the key and decrypt the encrypted data to achieve the purpose of data sharing.

[0050] (ii) Data is encrypted and stored on the blockchain, and data sharing can be achieved without transmitting the encryption key; This invention utilizes the trapdoor operation of the Chameleon Hash algorithm to calculate the corresponding random number based on the obfuscation information sent by the applicant user without transmitting the encryption key, and sends it to the applicant user; The applicant user can obtain the encryption key and decrypt the data using the user's Chameleon public key based on the obfuscation information and the random number, thereby achieving privacy data sharing;

[0051] (iii) When users encrypt their private data and write it to the blockchain, there is no need to consider the issue of other users requesting access later; when users request access, there is no need to change the data already written to the blockchain, only to perform calculations on the encryption key to grant the requesting user access rights; when multiple users request access to their private data, there is no need to generate additional data to prevent data bloat.

[0052] (iv) Each piece of privacy data is encrypted and written to the chain using a different random number-generated key. When a user requests access to a certain piece of data, it will not cause the leakage of other data. Data encryption uses random number encryption and does not involve the user's public and private keys, ensuring the security of the user's key. Furthermore, data transmission between users is done by obfuscating information and random numbers, which will not cause key leakage.

[0053] (v) When a user applies to access privacy data, there is no need to change the existing privacy data or add new data, thus enabling the sharing of privacy data;

[0054] (vi) Each piece of privacy data corresponds to a different encryption key. When a user applies to access a piece of privacy data and obtains the encryption key, it will not affect other privacy data.

[0055] (vii) The interaction process between the user requesting access and the data holder is only to send obfuscated information or random numbers, and the obfuscated information and random numbers will not be transmitted together in the network, so as not to cause key leakage;

[0056] (viii) This invention does not directly send the data encryption key. Instead, it uses the characteristic of Chameleon hash to obtain hash collisions using the private key. The encryption key is calculated by the user who requests access, thus preventing key leakage.

[0057] (ix) This invention solves the problem of privacy protection and sharing of transaction data on the blockchain; it enables encrypted sharing of privacy data, allows fine-grained privacy scope control at the user level, and allows authorization for transaction data to be visible to certain members, while unauthorized members can only see the encrypted transaction hash value. Attached Figure Description

[0058] The invention will be further described below with reference to the accompanying drawings.

[0059] Appendix Figure 1 A flowchart illustrating the working process of a blockchain privacy data sharing system based on chameleon hashing;

[0060] Appendix Figure 2 Flowchart for the process of requesting access to privacy data ED1 for user b and obtaining privacy data D;

[0061] Appendix Figure 3 This is a flowchart of a symmetric encryption algorithm. Detailed Implementation

[0062] The following detailed description of the blockchain privacy data sharing method and system based on chameleon hashing of the present invention is provided with reference to the accompanying drawings and specific embodiments.

[0063] Example 1:

[0064] This embodiment provides a blockchain privacy data sharing method based on chameleon hashing, as detailed below:

[0065] S1. Building a blockchain network: Deploying a blockchain network based on a blockchain framework; the blockchain framework can be any blockchain framework capable of implementing the corresponding functions of this embodiment, such as Bitcoin, Ethereum, Fabric, Corda, etc.

[0066] S2. Users register blockchain identities and generate user public and private keys, denoted as P and S respectively;

[0067] S3. Users use the Chameleon Hash Key Generation Algorithm to generate a Chameleon Hash public key pk and a private key sk, and the security constant λ can be freely selected in the generation method; among them, the private key sk is the Chameleon Hash Trapdoor. Using the hash trapdoor, hash collisions can be easily found, that is, different data have the same hash.

[0068] S4. Establish external storage;

[0069] S5. User a stores private data D1, selects a random number K (the random number generation rule can be freely selected), generates a chameleon hash h, and uses it as the encryption key;

[0070] S6. User a stores privacy data D1 to the blockchain, uses h as a symmetric encryption key to encrypt the privacy data, and writes the result ED1 to the blockchain.

[0071] S7. User b requests access to privacy data ED1 and obtains privacy data D.

[0072] As attached Figure 2 As shown, in step S7 of this embodiment, user b requests access to privacy data ED1 and obtains privacy data D as follows:

[0073] S701, User b requests access to privacy data ED1, and sends the current timestamp (or other random number) as obfuscating information m′;

[0074] S702. After user a agrees to the application, using the obfuscation information m′, according to the hash collision algorithm, input user a's private key sk (trapdoor), encryption key K, obfuscation information m′, hash value h, and random number p, and output the corresponding new random number r′, such that:

[0075] Ch_Ver(pk,K,(h,p),r)=Ch_Ver(pk,m′,(h,p),r′)=1;

[0076] Right now:

[0077] ch_Hash(pk,K,r)=ch_Hash(pk,m′,r′);

[0078] S703. User a stores the user information corresponding to user b, the obfuscation information m′, the newly added random number r′, and the corresponding access privacy data id in an external database for access control purposes.

[0079] S704. User a sends a newly added random number r′ to user b. User b obtains user a's chameleon hash public key pk, and uses the obfuscation information m′ and the random number r′ sent by user a to obtain the chameleon hash h, which is the privacy data encryption key, as follows:

[0080] ch_Hash(pk,m′,r′)=(h,p);

[0081] S705. User b obtains the private data ED1 to be accessed, decrypts it using h, and obtains data D1.

[0082] In step S4 of this embodiment, the external storage is used to store the user's Chameleon Hash public key pk and private key sk, as well as the corresponding data information. When storing privacy data, a corresponding data id is created for each piece of privacy data, and the random number K and r corresponding to the privacy data are stored to facilitate subsequent Chameleon Hash operations.

[0083] In this embodiment, the random number K is used as the message content m of the Chameleon hash operation. Another random number r is selected (the random number generation rule can be freely chosen). Using user a's Chameleon hash public key pk, the Chameleon hash algorithm is used to generate the Chameleon hash h and the corresponding random number p, as shown in the following formula:

[0084] Ch_Hash(pk,K,r)=(h,p);

[0085] Using chameleon hashing to generate encryption keys ensures that the same encryption key can be generated in the future without revealing K, and also avoids the security risks of transmitting encryption keys over the network.

[0086] As attached Figure 3 As shown, the symmetric encryption key in step S6 of this embodiment is obtained through a symmetric encryption algorithm. The encryption and decryption of the symmetric encryption algorithm rely on the same symmetric key, that is: the plaintext is encrypted using the symmetric key to obtain the ciphertext, and the ciphertext is decrypted using the same symmetric key to obtain the plaintext.

[0087] Different privacy-preserving data corresponds to different chameleon hashes generated by random number K. This prevents privacy leaks; for example, if user b gains access to data D1, they will not decrypt data D2.

[0088]

[0089] In this embodiment, user b uses obfuscation information and random numbers to generate a chameleon hash h, which is a symmetric encryption key; the interaction information between user a and user b is used to exchange obfuscation information and corresponding random numbers, and the obfuscation information and corresponding random numbers are not transmitted in the network at the same time to ensure computational security and prevent privacy leakage.

[0090] When users other than user b request access to privacy data ED1, they obtain obfuscation information and the corresponding random number, and use user a's chameleon hash public key to obtain the chameleon hash, which is then used to decrypt the privacy data.

[0091] Example 2:

[0092] This embodiment provides a blockchain privacy data sharing system based on chameleon hashing, the system comprising:

[0093] The deployment module is used to deploy blockchain networks based on a blockchain framework.

[0094] The registration module is used for users to register their blockchain identity and generate user public and private keys, denoted as P and S respectively.

[0095] The generation module is used by users to generate a Chameleon hash public key pk and a private key sk using the Chameleon hash key generation algorithm. The security constant λ can be freely selected in terms of the generation method. The private key sk is the Chameleon hash trapdoor. Using the hash trapdoor, hash collisions can be easily found, that is, different data have the same hash.

[0096] Create a module for establishing external storage;

[0097] The selection module is used by user a to store private data D1, select a random number K (the random number generation rule can be freely selected), generate a chameleon hash h, and use it as an encryption key;

[0098] The encryption module is used by user a to store private data D1 to the blockchain, use h as a symmetric encryption key to encrypt the private data, and write the result ED1 to the chain.

[0099] The access module is used by user b to request access to privacy data ED1 and obtain privacy data D.

[0100] As attached Figure 1 As shown, the specific working process of this system is as follows:

[0101] (1) User a selects a random number, uses the Chameleon hash operation to obtain a hash value, and uses the hash value as the symmetric encryption key h to encrypt privacy data and write it to the chain.

[0102] (2) User B requests access to private data and obtains the current timestamp, and sends the request to User A;

[0103] (3) After user a agrees to the application, it obtains user b's public key, concatenates it with a timestamp (or other random number) as obfuscation information, uses the Chameleon Hash private key to obtain the hash collision of h, and sends the corresponding random number to user b;

[0104] (4) After receiving the returned random number, user b uses user a's chameleon hash public key to calculate the chameleon hash h, obtains the encrypted private data, and decrypts it; the details are as follows:

[0105] ① User a, who holds the privacy data, uses the Chameleon Hash private key sk to obtain the corresponding hash collision random number r′ based on the obfuscated information m′ sent by user b;

[0106] ② User b uses the obfuscation information m′ and the collision random number r′, and uses user a's chameleon hash public key pk to calculate the chameleon hash value h and decrypt the data.

[0107] Example 3:

[0108] This embodiment also provides an electronic device, including: a memory and a processor;

[0109] The memory stores computer-executed instructions;

[0110] The processor executes computer execution instructions stored in the memory, causing the processor to perform a blockchain privacy data sharing method based on chameleon hashing according to any embodiment.

[0111] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can be a microprocessor or any conventional processor.

[0112] Memory is used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of the terminal, etc. In addition, memory can also include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart memory cards (SMC), secure digital cards (SD cards), flash memory cards, at least one disk storage device, flash memory devices, or other volatile solid-state storage devices.

[0113] Example 4:

[0114] This embodiment also provides a computer-readable storage medium storing multiple instructions, which are loaded by a processor to cause the processor to execute the blockchain privacy data sharing method based on chameleon hashing according to any embodiment of the present invention. Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the above embodiments is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0115] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0116] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0117] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0118] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A blockchain privacy data sharing method based on chameleon hashing, characterized in that, The method is as follows: Building a blockchain network: Deploying a blockchain network based on a blockchain framework; Users register a blockchain identity and generate a user public key and a private key, denoted as P and S respectively; Users generate a Chameleon hash public key pk and a private key sk using the Chameleon hash key generation algorithm, with the security constant λ being the freely chosen generation method; the private key sk is the Chameleon hash trapdoor. Establish external storage; User a stores private data D1, selects a random number K, generates a chameleon hash h, and uses it as the encryption key; User a stores private data D1 into the blockchain, uses h as a symmetric encryption key to encrypt the private data, and writes the result ED1 onto the blockchain. User B requests access to privacy data ED1 and receives privacy data D; User B requested access to privacy data ED1 and obtained privacy data D as follows: User b requests access to privacy data ED1 and sends the current timestamp as obfuscated information m′. After user A agrees to the application, using obfuscation information m′, and according to the hash collision algorithm, the inputs are user A's private key sk, encryption key K, obfuscation information m′, hash value h, and random number p, and the output is a corresponding new random number r′, such that: Ch_Ver(pk,K,(h,p),r)=Ch_Ver(pk,m′,(h,p),r′)=1; Right now: ch_Hash(pk,K,r)=ch_Hash(pk,m′, r′); User A stores the user information corresponding to user B, the obfuscation information m′, the newly added random number r′, and the corresponding access privacy data ID in an external database. User A sends a new random number r′ to user B. User B obtains user A's chameleon hash public key pk, and uses the obfuscation information m′ and the random number r′ sent by user A to obtain the chameleon hash h, which is the privacy data encryption key, as follows: ch_Hash(pk,m′, r′)=(h,p); User b obtains the private data ED1 that they want to access, and decrypts it using h to obtain data D1; External storage is used to store the user's chameleon hash public key pk and private key sk, along with their corresponding data information. When storing privacy data, each piece of privacy data is assigned a corresponding data ID, and the corresponding random number K and r are stored. The random number K serves as the message content m for the chameleon hash operation. Another random number r is selected, and using user a's chameleon hash public key pk, the chameleon hash h and its corresponding random number p are generated using the chameleon hash algorithm, as shown in the following formula: Ch _ Hash ( pk , K , r )=( h , p ); Symmetric encryption keys are obtained through symmetric encryption algorithms. Encryption and decryption of symmetric encryption algorithms rely on the same symmetric key. That is, plaintext is encrypted using the symmetric key to obtain ciphertext, and the same symmetric key is used to decrypt the ciphertext to obtain plaintext. User B uses obfuscation information and random numbers to generate a chameleon hash h, which is a symmetric encryption key; the interaction information between user A and user B is used to exchange obfuscation information and corresponding random numbers, and the obfuscation information and corresponding random numbers are not transmitted in the network at the same time. When users other than user b request access to privacy data ED1, they obtain obfuscation information and the corresponding random number, and use user a's chameleon hash public key to obtain the chameleon hash, which is then used to decrypt the privacy data.

2. A blockchain privacy data sharing system based on chameleon hashing, characterized in that, The system includes, The deployment module is used to deploy blockchain networks based on a blockchain framework. The registration module is used for users to register their blockchain identity and generate user public and private keys, denoted as P and S respectively. The generation module is used by users to generate a Chameleon hash public key pk and a private key sk using the Chameleon hash key generation algorithm. The security constant λ can be freely selected in terms of the generation method. The private key sk is the Chameleon hash trapdoor. Create a module for establishing external storage; The selection module is used by user a to store private data D1, select a random number K, generate a chameleon hash h, and use it as the encryption key; The encryption module is used by user a to store private data D1 to the blockchain, use h as a symmetric encryption key to encrypt the private data, and write the result ED1 to the chain. The access module is used by user b to request access to privacy data ED1 and obtain privacy data D; User B requested access to privacy data ED1 and received privacy data D as follows: User b requests access to privacy data ED1 and sends the current timestamp as obfuscated information m′. After user A agrees to the application, using the obfuscation information m′, and according to the hash collision algorithm, the inputs are user A's private key sk (trapdoor), encryption key K, obfuscation information m′, hash value h, and random number p, and the output is a corresponding new random number r′, such that: Ch_Ver(pk,K,(h,p),r)=Ch_Ver(pk,m′,(h,p),r′)=1; Right now: ch_Hash(pk,K,r)=ch_Hash(pk,m′, r′); User A stores the user information corresponding to user B, the obfuscation information m′, the newly added random number r′, and the corresponding access privacy data ID in an external database. User A sends a new random number r′ to user B. User B obtains user A's chameleon hash public key pk, and uses the obfuscation information m′ and the random number r′ sent by user A to obtain the chameleon hash h, which is the privacy data encryption key, as follows: ch_Hash(pk,m′, r′)=(h,p); User b obtains the private data ED1 that they want to access, and decrypts it using h to obtain data D1; External storage is used to store the user's Chameleon Hash public key pk and private key sk, along with the corresponding data information; when storing privacy data, a corresponding data ID is created for each piece of privacy data, and the corresponding random number K and r are stored. A random number K is used as the message content m in the Chameleon hash operation. Another random number r is selected, and user a's Chameleon hash public key pk is used to generate a Chameleon hash h and its corresponding random number p using the Chameleon hash algorithm, as shown in the following formula: Ch _ Hash ( pk , K , r )=( h , p ); Symmetric encryption keys are obtained through symmetric encryption algorithms. Encryption and decryption of symmetric encryption algorithms rely on the same symmetric key. That is, plaintext is encrypted using the symmetric key to obtain ciphertext, and the same symmetric key is used to decrypt the ciphertext to obtain plaintext. User B uses obfuscation information and random numbers to generate a chameleon hash h, which is a symmetric encryption key; the interaction information between user A and user B is used to exchange obfuscation information and corresponding random numbers, and the obfuscation information and corresponding random numbers are not transmitted in the network at the same time. When users other than user b request access to privacy data ED1, they obtain obfuscation information and the corresponding random number, and use user a's chameleon hash public key to obtain the chameleon hash, which is then used to decrypt the privacy data.

3. An electronic device, characterized in that, include: Memory and at least one processor; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the blockchain privacy data sharing method based on chameleon hash as described in claim 1.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the blockchain privacy data sharing method based on chameleon hash as described in claim 1.

Citation Information

Patent Citations

  • Digital identity management method and device

    CN114444125A

  • Implementation method of data encryption sharing based on block chain and chameleon hash algorithm

    CN114462065A