A medical data sharing method based on blockchain fusion distributed inner product encryption
By using blockchain and distributed inner product encryption in medical data sharing, the performance burden and insufficient privacy protection of the CP-ABE solution are solved, and higher data privacy protection and system security are achieved.
Patent Information
- Application Number
- CN202410684799.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-30
AI Technical Summary
The existing CP-ABE scheme has problems with performance burden, single point failure risk, access policy exposure and unauthorized decryption key sharing in medical data sharing, resulting in insufficient data privacy protection.
Adopting a distributed inner product encryption method based on the blockchain, public parameters and private keys are generated through the collaboration of authoritative agencies and tracking agencies, and the blockchain is used to record access permissions and ciphertexts to achieve complete hiding strategies and traceable revocation by malicious users. Reduce computing and storage overhead.
It improves the privacy protection security of medical data sharing, avoids centralized performance burden and single point of failure, and achieves complete hiding of access policies and high system reliability.
Smart Images

Figure CN118260787B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of blockchain and information security technology, and specifically relates to a medical data sharing method based on blockchain fusion distributed inner product encryption. Background Art
[0002] Medical services are developing rapidly in today's society, and the level of informatization is constantly improving. Among them, electronic medical records, as an important part of medical informatization, have gradually replaced paper medical records. Specifically, compared with paper medical records, electronic medical records have more powerful functions. They support more effective information sharing between medical institutions, have more robust traceability, and a higher level of data security, effectively preventing data loss. This digital medical record can not only provide real-time and long-term disease information, but also support in-depth analysis of patients and the formulation of personalized treatment plans through mutual sharing of electronic medical records. The widespread application of electronic medical records makes the management of medical information more efficient, provides new possibilities for medical services, and further promotes the pace of transformation of the medical field to digitalization and intelligence. Due to the many advantages of electronic medical records, more and more medical institutions have chosen to abandon paper medical records and adopt digital electronic medical record systems. This shift has led to an explosive growth in the number of electronic medical records, which has brought huge computing and storage burdens to hospitals. With the rise of cloud computing technology, user terminals represented by hospitals have gradually stored medical data in the cloud.
[0003] In the new era of the integration of the Internet of Things and artificial intelligence, with the popularization of digital recording methods, data security and privacy protection are facing unprecedented challenges. Medical data usually contains personal privacy information, such as ID numbers and disease diagnosis results. If this information is stored in plain text in the cloud, it may be illegally accessed by malicious users, resulting in serious data leakage. Data insecurity will seriously hinder the effective sharing of electronic medical records. Therefore, how to achieve effective medical data sharing while ensuring privacy security has become a challenging task.
[0004] In order to ensure the privacy of cloud medical data, encryption can be used before storage. Traditional symmetric encryption can only achieve one-to-one communication. With the continuous expansion of application scenarios and the continuous upgrading of privacy protection needs, people have gradually realized the limitations of this method. To solve this problem, attribute-based encryption (ABE) came into being to achieve one-time encryption and multiple sharing. In recent years, CP-ABE has been further developed on the basis of ABE, introducing the concept of access policy, which enables users to control data access rights more finely, providing a higher level of privacy protection for cloud medical data.
[0005] However, most current CP-ABE schemes still have many problems. First, existing CP-ABE schemes usually have an authorization center responsible for generating decryption keys, which brings a huge performance burden to the authorization center. Not only that, this centralized processing method may also have a single point of failure problem; secondly, explicit access policies may expose users' personal information. For example, in a medical system, malicious users can easily access electronic medical records through access policies, and then obtain patients' personal diseases and privacy information; in addition, in a CP-ABE system, there is a potential risk that unauthorized users may share decryption keys with malicious third parties in order to gain benefits, but since the decryption keys are only related to user attributes, the identity of malicious users cannot be determined.
[0006] Existing solutions use various encryption measures to protect medical data due to insecure cloud storage, but there is still a risk of attack or data leakage. Summary of the invention
[0007] In order to solve the above technical problems, the present invention provides a medical data sharing method based on blockchain integrated with distributed inner product encryption. By designing a complete hiding strategy, distributed key management and a malicious user traceable revocation mechanism, the privacy protection of the entire electronic medical record sharing solution is comprehensively improved, and the computing and storage overheads are also maintained at a low level.
[0008] In order to achieve the above object, the present invention is achieved through the following technical solutions:
[0009] The present invention is a medical data sharing method based on blockchain fusion distributed inner product encryption, and the medical data sharing method specifically includes the following steps:
[0010] Step 1: The authority AA and the tracking agency TA collaborate with each other and send public parameters to the electronic medical record owner. and public parameters , the authority AA and the tracking agency TA do not know each other's sent content, and the electronic medical record owner receives the public parameters and public parameters Then combine them to get the total public key , then the authority AA and the tracking agency TA each store a portion of the master key of the electronic medical record system , Master Key ;
[0011] Step 2: The authority AA and the tracking agency TA cooperate with each other and send some user and some user private keys , the authority AA and the tracking agency TA do not know the content of the private key sent to each other, and the electronic medical record user receives the private key and private key Then combine them to get the total private key ;
[0012] Step 3: Given the public parameters and public parameters The total public key ,The access policy P, revocation list RL and message m formulated by the electronic medical record owner,the electronic medical record owner first converts the access policy into the corresponding access policy vector, and then runs the encryption algorithm to output the ciphertext CT;
[0013] Step 4: The electronic medical record owner sends the encrypted CT to the cloud server for storage;
[0014] Step 5: After receiving the ciphertext CT, the cloud server uses the hash function to calculate the URL of the ciphertext CT = Hash(CT) and returns the URL to the electronic medical record owner. The entire operation process of the cloud server is packaged into a transaction record in the blockchain to prevent untrusted behavior of the cloud server;
[0015] Step 6: The owner of the electronic medical record uploads the URL to the blockchain for recording, using the blockchain’s tamper-proof features to prevent the data from being altered;
[0016] Step 7: The electronic medical record user decrypts the ciphertext based on the private key: First, the electronic medical record user applies for data access rights from the blockchain and obtains the URL of the corresponding ciphertext. When the blockchain receives the query request from the electronic medical record user, the blockchain calculates the intermediate parameters through the pre-decryption verification algorithm. , thereby determining whether the electronic medical record user actually has the ability to decrypt the ciphertext;
[0017] Step 8: If it is determined that the electronic medical record user has passed the pre-decryption verification algorithm and the user is not in the revocation list RL, it indicates that the electronic medical record user has the decryption capability, and the electronic medical record user obtains the URL related to the ciphertext from the blockchain;
[0018] Step 9, using the ciphertext index URL obtained in step 8 to go to the cloud server to download the original ciphertext CT for decryption: When the electronic medical record user passes the pre-decryption verification algorithm and is not in the revocation list, the electronic medical record user performs the final decryption operation;
[0019] Step 10: After the decryption operation in step 9, if there are malicious data accessors in the electronic medical record system, the private keys of those suspected users will be checked by the KeySanityCheck algorithm;
[0020] Step 11. If after the private key check, a user of the electronic medical record needs to have his access rights revoked, the tracking agency TA first calculates the update key RE of the ciphertext, and then sends the update key RE to the cloud server through the encrypted channel, and the cloud server executes the ciphertext update algorithm;
[0021] Step 12: The tracking agency TA calculates the update key of the private key , , and then sent to the electronic medical record user through a secret channel, and the electronic medical record user will calculate , Update your private key.
[0022] A further improvement of the present invention is that the step 1 specifically comprises the following steps:
[0023] Step 1.1: Safe parameters and the electronic medical record system attribute set As input, the authority AA selects and As two prime numbers, The multiplicative cyclic group of is a multiplicative cyclic group Generator, selected by the authority AA As a bilinear function and randomly selected , ,in Represents the prime order as The finite field of Represents a bilinear map, computing , , some public parameters and some master keys generated by the authority AA are: , ,middle, , for An element in , Public parameters components of;
[0024] Step 1.2: Safe parameters and the system properties collection As input, the tracking agency TA chooses and As two prime numbers, The multiplicative cyclic group of is a multiplicative cyclic group Generator, selected by the authority AA As a hash function and randomly choose ,calculate , , in addition, for each user in the system ,calculate , the other part of the public parameters and part of the master key generated by the tracking agency TA are: , ,in, , , , , All public parameters components of;
[0025] Step 1.3: When the electronic medical record owner receives the public parameters from the authority AA and public parameters from the tracking agency TA When ,in , the public parameters and public parameters Integrate into a total public key ,in, It is a component of the public key PK.
[0026] A further improvement of the present invention is that the step 2 specifically includes the following steps:
[0027] Step 2.1: The authority AA generates a partial secret key for the electronic medical record user by calling the key generation algorithm: Given the public parameters , Master Key And the attribute set R of the electronic medical record user, where R is included in the system attribute set S, and the authority AA generates the corresponding attribute vector , randomly selected ,calculate , , some user private keys generated by the authority AA are: ,in, , For private key The components of for an element of
[0028] Step 2.2, the tracking agency TA generates another part of the secret key of the electronic medical record user by calling the key generation algorithm: given the user identity uid of the electronic medical record user and the symmetric encryption algorithm AES, calculate , randomly selected ,calculate , , , some user private keys generated by the tracking agency TA are: ,in, for an element of , , , , , All are private keys components of;
[0029] Step 2.3: When the electronic medical record user receives the private key from the authority AA and the tracking agency TA and private key When ,in , all private keys are combined into a total private key ,Right now ,in, The total private key component of.
[0030] A further improvement of the present invention is that the step 3 specifically includes the following steps:
[0031] Step 3.1: Public key , revocation list RL, message m and access policy P as input, the electronic medical record owner converts the access policy P into the corresponding access policy vector ;
[0032] Step 3.2: Random selection of electronic medical record owners ,calculate , , , , ,in, for The two elements of , , , is a component of the ciphertext. is the message plaintext, is the generator;
[0033] Step 3.3: For each user not in the revocation list RL ,calculate , output the overall ciphertext , among which, among which, It is one of the components of the ciphertext and is calculated for users who are not in the revocation list RL.
[0034] A further improvement of the present invention is that the blockchain proposed in step 7 calculates the intermediate parameters through the pre-decryption verification algorithm That is, we know whether the electronic medical record user has the ability to decrypt. The intermediate parameter The calculation method is:
[0035] ;
[0036] in, is a bilinear map, For private key The components of The total private key The components of , is a component of the ciphertext. is the attribute vector, is the access strategy vector,
[0037] If and only if the attribute vector and access policy vector When the inner product is 0, it indicates that the attributes of the electronic medical record user meet the access policy.
[0038] A further improvement of the present invention is that in step 9, when the electronic medical record user passes the pre-decryption verification algorithm and is not in the revocation list, the electronic medical record user performs a final decryption operation, which specifically includes the following steps:
[0039] Step 9.1: Through intermediate parameters calculate:
[0040] ,
[0041] ;
[0042] in, and For the final decryption components, is a component of the ciphertext. , All are private keys components of;
[0043] Step 9.2: Calculate the plaintext :
[0044] ,
[0045] in, is the parameter obtained from the ciphertext.
[0046] A further improvement of the present invention is that in step 10, the KeySanityCheck algorithm is performed by the tracking agency TA, and the KeySanityCheck algorithm checks the private key of the suspected electronic medical record user, specifically including the following steps:
[0047] Step 10.1. Verification ;
[0048] Step 10.2: Verification ;
[0049] Step 10.3, Verification ,
[0050] If the electronic medical record user being tracked satisfies steps 10.1, 10.2, and 10.3 at the same time, it means that the private key of this electronic medical record user is benign. The tracking agency TA uses the decryption function in the AES algorithm to obtain the identity uid of the malicious user, and then merges it into the revocation list RL. On the contrary, if the KeySanityCheck algorithm cannot be passed, the tracking algorithm is terminated.
[0051] A further improvement of the present invention is that the step 11 specifically includes the following steps:
[0052] Step 11.1. Tracking agency TA is randomly selected ,calculate :
[0053] ,
[0054] in, For An element selected from It is a parameter in the public key PK;
[0055] Step 11.2: Use encrypted channels to Sent to the cloud server, the cloud server executes the ciphertext update algorithm:
[0056] ;
[0057] in, It is the updated component of the ciphertext;
[0058] Step 11.3. Updated ciphertext for:
[0059] .
[0060] A further improvement of the present invention is that the step 12 specifically includes the following steps:
[0061] Step 12.1. Tracking agency TA is randomly selected , calculate the update key:
[0062] ,
[0063] ;
[0064] Step 12.2: Update the key through the encrypted channel , Sent to electronic medical record users who are not on the revocation list, and then calculate:
[0065] ,
[0066] ;
[0067] in, , for and Updated components;
[0068] Step 12.3: The electronic medical record user stores the updated private key: .
[0069] The beneficial effects of the present invention are:
[0070] The present invention introduces an inner product encryption algorithm and uses vector operations. Compared with the bilinear pairing, exponential, and multiplication operations of the cyclic group, the computational overhead of vector operations is lower. Through this conversion, the present invention avoids the complex strategy matching and decryption process involved in the current solution, thereby reducing the encryption and decryption computational overhead and storage overhead; at the same time, the present invention also achieves complete hiding of the access strategy, thereby improving the security and reliability of the system.
[0071] The present invention constructs a multi-institution system in which the authoritative institutions and tracking institutions are independent of each other, and uses a distributed concept to generate public parameters and decryption keys for users. Each institution only has part of the public parameters and private keys, thereby achieving the availability but invisibility of private keys and parameters. In addition, the present invention simultaneously uses blockchain to supervise multiple authoritative institutions and cloud servers, further weakening the power of multiple authoritative institutions, strengthening supervision among authoritative institutions, preventing illegal operations, and improving the credibility of decryption keys.
[0072] After discovering a malicious user, the present invention uses a double update mechanism to revoke the malicious user's authority to ensure the security of the system to the greatest extent. This mechanism not only updates the ciphertext, but also adjusts the private key, thereby improving the security and reliability of the system through double protection; in addition, the fixed-length update key generated by the tracking agency TA , , It does not grow as the data accessor attributes grow, which keeps the storage overhead relatively stable. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 It is a schematic diagram of the process of the present invention.
[0074] Figure 2 The present invention is a schematic diagram of the inner product vector conversion process, wherein (a) indicates that the attributes of the electronic medical record user meet the access policy, can be correctly matched and have preliminary decryption qualifications, and (b) indicates that the attributes of the electronic medical record user do not meet the access policy, the attribute matching is wrong, and therefore the user is not qualified for decryption.
[0075] Figure 3 Comparison chart of computational overhead for invented encryption.
[0076] Figure 4 Comparison chart of computational overhead for invention decryption.
[0077] Figure 5 Comparison chart of storage overhead for invented ciphertext.
[0078] Figure 6 Comparison chart of storage overhead for invented keys. DETAILED DESCRIPTION
[0079] The following will disclose the embodiments of the present invention with drawings. For the purpose of clear description, many practical details will be described together in the following description. However, it should be understood that these practical details should not be used to limit the present invention. That is to say, in some embodiments of the present invention, these practical details are not necessary.
[0080] In recent years, blockchain technology has emerged in the field of cloud computing and has attracted widespread attention. It can effectively deal with the problems of centralized storage and building mutual trust. When data is added to the blockchain, all transaction-related status information is recorded and cannot be tampered with by any user. This feature makes blockchain technology a potential solution in the context of medical data sharing. Combining blockchain with cloud computing will help improve the construction of a smart medical ecosystem.
[0081] In view of the insecurity of cloud storage, various encryption measures are taken to protect medical data in existing solutions, but there is still a risk of attack or data leakage. This paper proposes a medical data sharing method based on blockchain fusion distributed inner product encryption, such as Figure 1 As shown, the specific steps include:
[0082] Step 1: The authority AA and the tracking agency TA collaborate with each other and send public parameters to the electronic medical record owner. and public parameters , the authority AA and the tracking agency TA do not know each other's sent content, and the electronic medical record owner receives the public parameters and public parameters Then combine them to get the total public key , then the authority AA and the tracking agency TA each keep a portion of the master key of the electronic medical record system , Master Key ;
[0083] The step 1 specifically comprises the following steps:
[0084] Step 1.1: Safe parameters and the electronic medical record system attribute set As input, the authority AA selects and As two prime numbers, The multiplicative cyclic group of is a multiplicative cyclic group Generator, selected by the authority AA As a bilinear function and randomly selected , ,in Represents the prime order as The finite field of Represents a bilinear map, computing , , some public parameters and some master keys generated by the authority AA are: , ,in, , for An element in , Public parameters components of;
[0085] Step 1.2: The multiplicative cyclic group and bilinear pairing function of the tracking agency TA are the same as those of the authority AA. In addition, the authority AA selects As a hash function and randomly choose ,calculate , , in addition, for each user in the system ,calculate , the other part of the public parameters and part of the master key generated by the tracking agency TA are: , ,in, , , , , All public parameters components of;
[0086] Step 1.3: When the electronic medical record owner receives the public parameters from the authority AA and public parameters from the tracking agency TA When ,in , the public parameters and public parameters Integrate into a total public key ,in, It is a component of the public key PK.
[0087] Step 2: The authority AA and the tracking agency TA cooperate with each other and send some user and some user private keys , the authority AA and the tracking agency TA do not know the content of the private key sent to each other, and the electronic medical record user receives the private key and private key Then combine them to get the total private key .
[0088] The step 2 specifically includes the following steps:
[0089] Step 2.1: Figure 2 As shown, the present invention sets the attribute sets of two electronic medical record users as , , where R is included in the system attribute set S, converting user attributes into attribute vectors , , then randomly select ,calculate , , some user private keys generated by the authority AA are: ,in, , For private key The components of for an element of Indicates that the attributes of the electronic medical record user meet the access policy and can be correctly matched and have preliminary decryption qualifications. Indicates that the attributes of the electronic medical record user do not meet the access policy, the attribute matching is incorrect, and therefore the user is not eligible for decryption.
[0090] Step 2.2, the tracking agency TA generates another part of the secret key of the electronic medical record user by calling the key generation algorithm: given the user identity uid of the electronic medical record user and the symmetric encryption algorithm AES, calculate , randomly selected ,calculate , , , some user private keys generated by the tracking agency TA are: , among which, among which, for an element of , , , , , All are private keys components of;
[0091] Step 2.3: When the electronic medical record user receives the private key from the authority AA and the tracking agency TA and private key When ,in , all private keys are combined into a total private key ,Right now , among which, among which, The total private key component of.
[0092] Step 3: Given the public parameters and public parameters The total public key , access policies set by EMR owners , revocation list RL and message m, the electronic medical record owner firstly sends the access policy Convert to Vector , and then run the encryption algorithm to output the ciphertext CT;
[0093] The step 3 specifically comprises the following steps:
[0094] Step 3.1: Public key , revocation list RL, message m and access policy As input, the EMR owner will access the policy Convert to the corresponding access policy vector ;
[0095] Step 3.2: Random selection of electronic medical record owners ,calculate , , , , i∈[1,6] ,in, for The two elements of , , , is a component of the ciphertext. is the message plaintext, is the generator;
[0096] Step 3.3: For each user not in the revocation list RL ,calculate , which will also be considered as part of the ciphertext, output the entire ciphertext , among which, among which, It is one of the components of the ciphertext and is calculated for users who are not in the revocation list RL.
[0097] Step 4: The electronic medical record owner sends the encrypted CT to the cloud server for storage;
[0098] Step 5: After receiving the ciphertext CT, the cloud server uses the hash function to calculate the URL of the ciphertext CT = Hash(CT) and returns the URL to the electronic medical record owner. The entire operation process of the cloud server is packaged into a transaction record in the blockchain to prevent untrusted behavior of the cloud server;
[0099] Step 6: The owner of the electronic medical record uploads the URL to the blockchain for recording, using the blockchain’s tamper-proof features to prevent the data from being altered;
[0100] Step 7: The electronic medical record user decrypts the ciphertext based on the private key: First, the electronic medical record user applies for data access rights from the blockchain and obtains the URL of the corresponding ciphertext. When the blockchain receives the query request from the electronic medical record user, the blockchain calculates the intermediate parameters through the pre-decryption verification algorithm. , thereby determining whether the electronic medical record user actually has the ability to decrypt the ciphertext.
[0101] In step 7, since the access policy is completely hidden, the user does not know whether he is able to successfully decrypt before completing all decryption operations. To address this problem, the present invention uses a pre-decryption verification algorithm to check whether the user can correctly decrypt the ciphertext. The blockchain calculates the intermediate parameters You can know whether the user has the decryption capability.
[0102] The intermediate parameters The calculation method is:
[0103] ;
[0104] in, is a bilinear map, For private key The components of The total private key The components of , is a component of the ciphertext. is the attribute vector, is the access strategy vector,
[0105] If and only if the attribute vector and access policy vector When the inner product is 0, it indicates that the attributes of the electronic medical record user meet the access policy.
[0106] at this time but This indicates that the attributes of electronic medical record user 1 satisfy the access policy while electronic medical record user 2 does not. However, whether decryption is possible depends on whether electronic medical record user 1 is not in the revocation list RL.
[0107] Step 8: If it is determined that the electronic medical record user 1 has passed the pre-decryption verification algorithm and the user is not in the revocation list RL, indicating that the electronic medical record user has the decryption capability, the electronic medical record user 1 will obtain the URL related to the ciphertext from the blockchain;
[0108] Step 9: Use the ciphertext index URL obtained in step 8 to download the original ciphertext CT from the cloud server for decryption: When the electronic medical record user passes the pre-decryption verification algorithm and is not in the revocation list, the electronic medical record user performs the final decryption operation, which specifically includes the following steps:
[0109] Step 9.1: Through intermediate parameters calculate:
[0110] ,
[0111] ;
[0112] in, and For the final decryption components, is a component of the ciphertext. , All are private keys components of;
[0113] Step 9.2: Calculate the plaintext :
[0114] ,
[0115] in, The parameters obtained from the ciphertext.
[0116] Step 10: After the decryption operation in step 9, if there are malicious data accessors in the electronic medical record system, the private keys of those suspected users will be checked by the KeySanityCheck algorithm. The specific steps include:
[0117] Step 10.1. Verification ;
[0118] Step 10.2: Verification ;
[0119] Step 10.3, Verification ,
[0120] If the electronic medical record user being tracked satisfies steps 10.1, 10.2, and 10.3 at the same time, it means that the private key of this electronic medical record user is benign. The tracking agency TA uses the decryption function in the AES algorithm to obtain the identity uid of the malicious user, and then merges it into the revocation list RL. On the contrary, if the KeySanityCheck algorithm cannot be passed, the tracking algorithm is terminated.
[0121] Step 11. If after the private key check, a user of the electronic medical record needs to have his access rights revoked, the tracking agency TA first calculates the update key RE of the ciphertext, and then sends the update key RE to the cloud server through the encrypted channel, and the cloud server executes the ciphertext update algorithm;
[0122] The step 11 specifically includes the following steps:
[0123] Step 11.1. Tracking agency TA is randomly selected ,calculate :
[0124] ,
[0125] in, For An element selected from It is a parameter in the public key PK;
[0126] Step 11.2: Send the update key RE to the cloud server through the encrypted channel, and the cloud server executes the ciphertext update algorithm:
[0127] ;
[0128] in, It is the updated component of the ciphertext;
[0129] Step 11.3. Updated ciphertext for:
[0130] .
[0131] Step 12: In addition to updating the ciphertext, the private keys of data accessors not in the revocation list also need to be updated to ensure that other data accessors with the same attributes in the system are not affected. The tracking agency TA calculates the update key of the private key , , and then sent to the electronic medical record user through a secret channel, and the electronic medical record user will calculate , Update your own private key. Step 12 specifically includes the following steps:
[0132] Step 12.1. Tracking agency TA is randomly selected , calculate the update key:
[0133] ,
[0134] ;
[0135] Step 12.2: Update the key through the encrypted channel , Sent to electronic medical record users who are not on the revocation list, and then calculate:
[0136] ,
[0137] ;
[0138] in, , for and Updated components;
[0139] Step 12.3: The electronic medical record user stores the updated private key: .
[0140] Attached Figure 3 , 4 , 5, and 6 provide specific performance comparisons of the present invention and other existing solutions. Figure 3 , Figure 4 It can be seen that the time overhead of the three algorithms increases linearly with the number of access strategies and the number of user attributes, but the present invention is obviously better than the other two algorithms. Figure 5 It can be concluded that the ciphertext storage overhead of the present invention is significantly lower than that of the other two solutions. Figure 6It can be clearly seen that the key storage overhead of the present invention is always kept at a low level and does not fluctuate much, which is more obvious than the other two solutions. At the same time, the present invention achieves complete hiding of access policies and improves the security and reliability of the system.
[0141] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A medical data sharing method based on blockchain fusion distributed inner product encryption, characterized by: The medical data sharing method specifically comprises the following steps: Step 1, the authority AA and the tracking agency TA cooperate with each other and send public parameters PK1 and public parameters PK2 to the electronic medical record owner respectively. The authority AA and the tracking agency TA do not know the content of the sending to each other. After receiving the public parameters PK1 and public parameters PK2, the electronic medical record owner combines them by himself to obtain the total public key PK. Then the authority AA and the tracking agency TA each save a part of the master key MSK1 and master key MSK2 of the electronic medical record system; Step 2: The authority AA and the tracking agency TA cooperate with each other and send partial user SK1 and partial user private key SK2 to the electronic medical record user respectively. The authority AA and the tracking agency TA do not know the content of the private key sent to each other. After receiving the private key SK1 and the private key SK2, the electronic medical record user combines them to obtain the total private key SK. Step 3: Given the total public key PK composed of the public parameters PK1 and PK2, the access policy P formulated by the electronic medical record owner, the revocation list RL, and the message m, the electronic medical record owner first converts the access policy into the corresponding access policy vector, and then runs the encryption algorithm to output the ciphertext CT; Step 4: The electronic medical record owner sends the encrypted CT to the cloud server for storage; Step 5: After receiving the ciphertext CT, the cloud server uses the hash function to calculate the URL of the ciphertext CT = Hash(CT) and returns the URL to the electronic medical record owner. The entire operation process of the cloud server is packaged into a transaction record in the blockchain to prevent untrustworthy behavior of the cloud server. Step 6: The owner of the electronic medical record uploads the URL to the blockchain for recording, using the blockchain’s tamper-proof features to prevent the data from being altered; Step 7: The electronic medical record user decrypts the ciphertext according to the private key: First, the electronic medical record user applies for data access rights from the blockchain and obtains the URL of the corresponding ciphertext. When the blockchain receives the query request from the electronic medical record user, the blockchain calculates the intermediate parameter D1 through the pre-decryption verification algorithm to determine whether the electronic medical record user actually has the ability to decrypt the ciphertext; Step 8: If it is determined that the electronic medical record user has passed the pre-decryption verification algorithm and the user is not in the revocation list RL, it indicates that the electronic medical record user has the decryption capability, and the electronic medical record user obtains the URL related to the ciphertext from the blockchain; Step 9, using the ciphertext index URL obtained in step 8 to go to the cloud server to download the original ciphertext CT for decryption: When the requesting electronic medical record user passes the pre-decryption verification algorithm and is not in the revocation list, the electronic medical record user performs the final decryption operation; Step 10: After the decryption operation in step 9, if there are malicious data accessors in the electronic medical record system, the private keys of those suspected users will be checked by the KeySanityCheck algorithm; Step 11. If after the private key check, a user of the electronic medical record needs to have his access rights revoked, the tracking agency TA first calculates the update key RE of the ciphertext, and then sends the update key RE to the cloud server through the encrypted channel, and the cloud server executes the ciphertext update algorithm; Step 12: The tracking agency TA calculates the updated keys RK1 and RK2 of the private key, and then sends them to the electronic medical record user through a secret channel. The electronic medical record user calculates sk′2, sk′ y Update your own private key; among them, The step 1 specifically comprises the following steps: Step 1.1: With security parameter λ and electronic medical record system attribute set S = (S1, S2, ..., S l ) as input, the authority AA selects G0 and G T As two multiplicative cyclic groups of prime order p, where g is a generator of the multiplicative cyclic group G0, the authority AA chooses e: G0×G0→G T As a bilinear function and randomly choose α1, in represents a finite field of prime order p, e represents a bilinear map, and h = g is calculated β , Some public parameters and some master keys generated by the authority AA are: MSK1=(α1,β), where β, α1 are An element in h, It is a component of the public parameter PK1; Step 1.2: With security parameter λ and system attribute set S = (S1, S2, ..., S l ) as input, the tracking mechanism TA selects G0 and G T As two multiplicative cyclic groups of prime order p, where g is a generator of the multiplicative cyclic group G0, the authority AA chooses H: As a hash function and randomly choose calculate In addition, for each user j in the system, calculate Y j =g H (j) Another part of the public parameters and part of the master key generated by the tracking agency TA are: MSK2=(α2,a=(a1,a2,...,a l+1 )),in, f i , Y j , g H(j) All are components of the public parameter PK2; Step 1.3: When the electronic medical record owner receives the public parameter PK1 from the authority AA and the public parameter PK2 from the tracking agency TA, calculate Where α = α1 + α2, the public parameters PK1 and PK2 are integrated into the total public key PK = (G0, G T ,p,g,e,h=g β , e(g, g) α , H, f i , Y j , S), where e(g, g) α It is a component of the public key PK, and g is the generator; The step 2 specifically includes the following steps: Step 2.1, the authority AA generates a partial private key of the electronic medical record user by calling the key generation algorithm: given the public parameter PK1, the master key MSK1 and the attribute set R of the electronic medical record user, where R is included in the system attribute set S, the authority AA generates the corresponding attribute vector x = (x1, x2, ..., x l+1 ), randomly selected calculate sk0=g θ , some user private keys generated by the authority AA are: in, sk0 is a component of the private key SK1, θ is an element of Step 2.2, the tracking agency TA generates another part of the secret key of the electronic medical record user by calling the key generation algorithm: given the user identity uid of the electronic medical record user and the symmetric encryption algorithm AES, calculate K = c = AES (uid), randomly select Calculate sk1 = g r , Some of the user private keys generated by the tracking agency TA are: Among them, r is An element of sk1, g r ,sk2, K and c are both components of the private key SK2; Step 2.3: When the electronic medical record user receives the private key SK1 and the private key SK2 from the authority AA and the tracking agency TA, calculate Among them, α = α1 + α2, all private keys are combined into the total private key SK, that is, SK = (K, sk0, sk1, sk2, sk y , x), where sk y It is a component of the total private key SK; The step 3 specifically comprises the following steps: Step 3.1: Taking the public key PK, revocation list RL, message m and access policy P as input, the electronic medical record owner converts the access policy P into the corresponding access policy vector y = (y1, y2, ..., y l+1 ); Step 3.2: Random selection of electronic medical record owners Calculate ct0 = g t , ct1=g s , ct m =m·e(g, g) αt , Among them, t, s are Two elements, ct0, ct1, ct m ,ct i is the component of the ciphertext, m is the message plaintext, and g is the generator; Step 3.3: For each user j that is not in the revocation list RL, calculate Output the entire ciphertext in, It is one of the components of the ciphertext and is calculated for users who are not in the revocation list RL.
2. According to claim 1, a medical data sharing method based on blockchain fusion distributed inner product encryption is characterized by: The blockchain proposed in step 7 calculates the intermediate parameter D1 through the pre-decryption verification algorithm to know whether the electronic medical record user has the decryption capability, wherein the calculation method of the intermediate parameter D1 is: Among them, e is a bilinear mapping, sk0 is a component of the private key SK1, and sk y is the component of the total private key SK, ct0 is the component of the ciphertext, x is the attribute vector, y is the access policy vector, If and only if the inner product of the attribute vector x and the access policy vector y is 0, it indicates that the attributes of the electronic medical record user meet the access policy.
3. According to claim 2, a medical data sharing method based on blockchain fusion distributed inner product encryption is characterized in that: In step 9, when the electronic medical record user passes the pre-decryption verification algorithm and is not in the revocation list, the electronic medical record user performs a final decryption operation, which specifically includes the following steps: Step 9.1, calculate through the intermediate parameter D1: B=e(sk2,R j ); Among them, D and B are the components required for the final decryption, ct1 is a component of the ciphertext, and sk1 and sk2 are both components of the private key SK2; Step 9.2: Calculate the plaintext m: Among them, ct m The parameters obtained from the ciphertext.
4. According to claim 3, a medical data sharing method based on blockchain fusion distributed inner product encryption is characterized in that: In step 10, the KeySanityCheck algorithm is performed by the tracking agency TA. The KeySanityCheck algorithm checks the private key of the suspected electronic medical record user, specifically including the following steps: Step 10.
1. Verify sk0, sk1, sk2, sk y ∈G0, Step 10.2: Verification Step 10.3, Verification If the electronic medical record user being tracked satisfies steps 10.1, 10.2, and 10.3 at the same time, it means that the private key of this electronic medical record user is benign. The tracking agency TA uses the decryption function in the AES algorithm to obtain the identity uid of the malicious user, and then merges it into the revocation list RL. On the contrary, if the KeySanityCheck algorithm cannot be passed, the tracking algorithm is terminated.
5. According to claim 4, a medical data sharing method based on blockchain fusion distributed inner product encryption is characterized in that: The step 11 specifically includes the following steps: Step 11.
1. Tracking agency TA is randomly selected Calculate RE: Among them, α′ is An element selected from , α is a parameter in the public key PK; Step 11.2: Send the RE to the cloud server through the encrypted channel, and the cloud server executes the ciphertext update algorithm: Among them, ct′ m It is the updated component of the ciphertext; Step 11.3, the updated ciphertext CT′ is:
6. A medical data sharing method based on blockchain fusion distributed inner product encryption according to claim 5, characterized in that: The step 12 specifically includes the following steps: Step 12.
1. Tracking agency TA is randomly selected Calculate the update key: RK1=g α′-α , Step 12.2: Send the update keys RK1 and RK2 to the electronic medical record users who are not in the revocation list through an encrypted channel, and then calculate: sk′ y =en y ·RK1=g α′-θ<a,x> ; Among them, sk′2, sk′ y For sk y and updated components of sk2; Step 12.3: The electronic medical record user stores the updated private key: SK = (K, sk0, sk1, sk′2, sk′ y , x).
