A data security sharing method, system and device
By separating the search and stored procedures in the electronic medical record system, and using an optimized inverted index structure and confusing trapped gate collection, the shortcomings of the electronic medical record system in terms of data sharing, efficiency and security are solved, and efficient and secure data sharing and retrieval are achieved.
Patent Information
- Application Number
- CN202411645884.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2044-11-18
AI Technical Summary
The existing electronic medical record system has shortcomings in data sharing, efficiency and security, making it difficult to achieve efficient and secure data sharing, and the efficiency of ciphertext data retrieval is low.
By separating searchable encryption from stored procedures, an optimized inverted index structure is proposed, and a confusing trapped gate collection is generated on the blockchain, efficient retrieval and decryption of encrypted electronic medical records is achieved.
It realizes the efficiency of efficient querying electronic medical records on blockchain, solves the problem of low efficiency in ciphertext data retrieval, realizes efficient and secure sharing of medical data, and improves user experience.
Smart Images

Figure CN119580911B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data security, and in particular to a data security sharing method, system and device. Background Art
[0002] With the demand for the informatization construction and development of our country, the informatization construction of the medical industry is an important part. Under the background of the development of the Internet, the medical scenario is changing faster and faster. The diversification of demands and terminals requires the medical information system to be able to respond to changes quickly.
[0003] In the current electronic medical record sharing solution, the third-party cloud server is semi-trusted, and there are internal attack behaviors such as attempting to crack, monitor or guess trapdoor information of the encrypted electronic medical records. At the same time, there may be external attackers who may illegally obtain, intercept, tamper with or forge the transmitted information during the trapdoor and file transmission process, and statistically analyze the trapdoor and the returned files through some technical means, attempt to find the internal connections contained therein or guess relevant information, and conduct keyword guessing attacks. With the increasing storage and sharing requirements of electronic medical records, the problems of large system overhead and difficult data retrieval due to the growth of data on the blockchain system are gradually revealed. If the function of ciphertext retrieval is added, it will further reduce the data retrieval efficiency, undoubtedly resulting in a poor user experience. At present, the searchable encryption technology can allow direct search of encrypted data while ensuring data encryption, effectively improving the data retrieval efficiency and playing an important role in protecting data privacy.
[0004] However, the currently adopted methods are difficult to achieve efficient and secure data sharing between different medical institutions, with low data processing efficiency and unable to meet the requirements of rapid retrieval. Summary of the Invention
[0005] Aiming at the deficiencies of the existing electronic medical record system in terms of data sharing, efficiency and security, the present invention proposes a data security sharing method, system, device and storage medium. By separating the retrieval and storage processes of searchable encryption and proposing an optimized inverted index structure, the problems existing in the prior art are solved.
[0006] A data security sharing method, the scenario of the data security sharing includes a doctor client, a patient client, a third-party user client, a cloud server and a blockchain. The blockchain generates public parameters according to given security parameters, and the doctor client and the patient client generate their respective corresponding public keys and private keys according to the public parameters. The method includes the following steps:
[0007] Encrypt the medical data of the patient client; the encryption process specifically includes: The doctor client creates an EMR for the patient client after the visit, extracts the keyword C, encrypts the keyword C using the public key generated by the patient client to obtain C w ; at the same time, encrypt the EMR using the public key generated by the patient client to generate C f , and calculate the hash value Hash(C f ); send C f to the cloud server to obtain the storage index Index f ; the local server generates an inverted index table based on C w , Hash(C f ), Index f and uploads it to the blockchain through a transaction;
[0008] The doctor client generates a set of confused trapdoors through the medical record number and keyword generated by the patient client and sends them to the blockchain for retrieval, and decrypts the medical data of the patient client according to the confused trapdoors; after obtaining the authorization of the patient client, the third-party user client obtains the decrypted EMR data through the doctor client.
[0009] Further, the generation process of the confused trapdoor includes the following steps:
[0010] The doctor client authorized by the patient client uses the private key to calculate the correct trapdoor, and generates multiple incorrect trapdoors by performing an exclusive OR operation on the correct trapdoor and a random number;
[0011] Encrypt the medical record number with the correct trapdoor and incorrect trapdoors using the private key of the doctor to generate the correct medical record number and incorrect medical record numbers;
[0012] The correct trapdoor, incorrect trapdoors, correct medical record number, and incorrect medical record numbers form a set of confused trapdoors;
[0013] Locate the position of the correct trapdoor through Tag, encrypt Tag using the homomorphic encryption algorithm Paillier, and send the set of confused trapdoors to the blockchain for retrieval.
[0014] Further, the doctor client generates a set of confused trapdoors through the medical record number and keyword generated by the patient client and sends them to the blockchain for retrieval, and decrypts the medical data of the patient client according to the confused trapdoors, specifically including the following steps:
[0015] The doctor client generates a set of confused trapdoors through the medical record number and keyword of the patient client and sends them to the blockchain for retrieval;
[0016] After receiving the set of confused trapdoors, the blockchain calculates the Tag value through Paillier and selects the correct trapdoor;
[0017] Decrypt the encrypted medical record number, and preliminarily screen in the inverted index table whether there is EMR data of the patient client. If it exists, execute the trapdoor matching algorithm. If the match is successful, obtain the encrypted EMR data C f Index address Index on the cloud server f , according to Index f Calculate the hash value of C f and Hash(C f ) to verify the integrity of C f . The doctor client decrypts C p through the private key SK f .
[0018] Furthermore, the blockchain generates public parameters according to given security parameters, specifically including the following steps:
[0019] Given a security parameter λ, construct two finite cyclic groups G1 and G2, and a bilinear mapping e: G1×G1→G2;
[0020] Select a generator g of G1, and at the same time define two national cipher SM3 hash functions: H1: {0,1} * →G1, H2: G2→{0,1} logλ ; Then the public parameters Params = {G1, G2, e, g, H1, H2}, and G1, G2, e, g, H1, H2 are all intermediate variables.
[0021] Furthermore, the doctor client and the patient client generate their respective public and private keys according to the public parameters, specifically including: When the patient client visits, according to the input public parameters Params, randomly select as the private key SK p and the public key PK p = g α ; The doctor client randomly selects as the private key SK d and the public key PK d = g x , is the set of all positive integers less than q and relatively prime to q, and ɑ and x are random numbers.
[0022] Furthermore, the inverted index table includes a quick reference table and a position table; The quick reference table is represented as T = {ID i , C(w i , PK p )}, ID i represents the medical record number of the patient client's EMR, and C(w i , PK p ) represents the keyword ciphertext in PEKS, where w is the keyword plaintext, and PKp PK is the public key of the patient client, C is the keyword encryption algorithm, and i is an index number;
[0023] The position table L is composed of the position array A wi which contains the transaction hash addresses on the blockchain of all documents corresponding to a certain keyword ciphertext.
[0024] Furthermore, for the EMR data of each patient client, through the public key PK of the patient client p the EMR data is encrypted using the asymmetric encryption algorithm RSA to generate C f .
[0025] Furthermore, when the patient client visits the doctor, according to the department or other attributes of the visit as the keyword C, the doctor client randomly selects one through the public key PK of the patient client p to calculate C w =(g α , H2(e(H1(W), g αz ))), and upload C f and C w to the local server. z is a random variable, and g az is the public key calculated from the public key of the patient client and the random variable z.
[0026] The present invention also includes a data security sharing system. The scenarios of the data security sharing include the doctor client, the patient client, the third-party user client, the cloud server, and the blockchain. The blockchain generates public parameters according to the given security parameters. The doctor client and the patient client generate their respective public and private keys according to the public parameters, including:
[0027] An encryption module for encrypting the medical data of the patient client; the encryption process specifically includes: the doctor client establishes an EMR for the patient client after the visit, extracts the keyword C, encrypts the keyword C using the public key of the patient client to obtain C w ; at the same time, encrypts the EMR using the public key of the patient client to generate C f , and calculates the hash value Hash(C f ); sends C f to the cloud server to obtain the storage index Index f ; the local server generates an inverted index table according to C w , Hash(C f ), Index f and uploads it to the blockchain through a transaction;
[0028] A query module is used for the doctor client to generate a set of confused trapdoors based on the medical record number and keywords of the patient client and send them to the blockchain for retrieval, and decrypt the medical data of the patient client according to the confused trapdoors. After obtaining the authorization of the patient client, the third-party user can obtain the decrypted EMR data through the doctor client.
[0029] The present invention further includes a data security sharing computer device, including: a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, the steps of the data security sharing method are implemented.
[0030] The present invention provides a data security sharing method, system and device, having the following beneficial effects:
[0031] By separating the retrieval and storage processes of searchable encryption in the present invention, the doctor client encrypts the generated EMR using the public key of the patient client and stores the EMR ciphertext on the cloud server. At the same time, an optimized inverted index structure is proposed, which can effectively ensure the efficiency of querying electronic medical records on the blockchain and solve the problem of low retrieval efficiency of ciphertext data. When the patient client visits a doctor for the second time or undergoes examinations in other hospitals, the doctor client can retrieve the relevant cases of the patient client on the blockchain and query them on the cloud. When the third-party user client wants to query the data of the patient client, it can obtain the relevant data through the authorization of the patient client. This method realizes efficient medical data retrieval and can also achieve efficient and secure data sharing between different medical institutions, thus comprehensively improving the deficiencies of the existing electronic medical record system in terms of data sharing, efficiency and security. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a data security sharing technology framework diagram based on the blockchain and searchable encryption in an embodiment of the present invention;
[0033] Figure 2 It is an inverted index structure diagram in an embodiment of the present invention;
[0034] Figure 3 It is a confused trapdoor set diagram in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.
[0036] The present invention proposes a method for secure data sharing, in which medical institutions negotiate to construct a blockchain system and subscribe to a cloud server as a medical cloud. Each medical institution has a local server to handle business, and the keys in the model are all stored in a third-party trusted key management center. The blockchain stores transaction information such as keyword ciphertext, medical record number, and case hash, and the cloud server stores the electronic medical record ciphertext. The main body of the present invention includes a doctor client, a patient client, a third-party user client, a cloud server, and a blockchain.
[0037] Doctor client: After diagnosing and examining the patient, an EMR is established for the patient, which includes the patient's basic information, diagnosis information, medical record number, etc. The EMR is encrypted and uploaded to the cloud server. At the same time, the hash value of the EMR is calculated, keywords are extracted from the EMR and encrypted, and the keyword ciphertext, medical record number, case hash, case index, and doctor identity information are uploaded as a transaction to the blockchain system for storage. During the diagnosis process, if a doctor needs to know about a patient, they can send a trapdoor to the blockchain to query the patient's medical record to provide an accurate diagnosis result.
[0038] Patient client: When a patient visits a hospital, they should first register their identity according to the patient information or some way, and at the same time generate a public-private key pair exclusive to the patient client. The doctor client encrypts the generated EMR using the public key of the patient client and stores the EMR ciphertext on the cloud server. When the patient visits the doctor again or undergoes examinations in other hospitals, the doctor can retrieve the relevant cases of the patient client on the chain and query them on the cloud. When a third-party user client other than the doctor client wants to use the data, they need to obtain authorization from the patient client to access it.
[0039] Third-party user client: Third-party data users such as pharmaceutical companies, insurance companies, and health commissions need to obtain authorization from the patient client when they need to use the medical data of the patient client, and then obtain the relevant data through the doctor client.
[0040] Cloud server: The cloud server stores the EMR ciphertext of the patient client and provides a secure and reliable retrieval service when retrieving the file ciphertext through the index of the EMR.
[0041] Blockchain: The blockchain is the core of the cloud-chain model and also the bridge between users and the cloud server. Since the consortium blockchain has the advantages of high efficiency, security, and easy expansion, the blockchain in this model adopts the consortium blockchain method. The blockchain stores information such as keywords, hash values, and logs of the patient client's EMR, provides a retrieval service using the keywords, returns information such as the hash value and index of the EMR, and then retrieves the EMR ciphertext on the cloud server.
[0042] As Figure 1 shown, the method specifically includes the following steps:
[0043] S1. Build a scenario for data security sharing, including a doctor client, a patient client, a third-party user client, a cloud server, and a blockchain. The blockchain generates public parameters according to given security parameters, and the doctor client and the patient client generate their respective public keys and private keys based on the public parameters.
[0044] The system will execute generating public parameters Params from security parameters. The doctor client and the patient client generate their respective public and private keys for encrypting and decrypting electronic medical record data. The third-party user client does not participate in the ciphertext search algorithm, obtains the authorization of the patient through other authentication methods, and is retrieved by the doctor client on behalf of it.
[0045] Initialize variables: Given a security parameter λ, construct two finite cyclic groups G1 and G2, and a bilinear mapping e: G1×G1→G2. Select a generator g of G1, and at the same time define two national cipher SM3 hash functions: H1: {0,1} * →G1, H2: G2→{0,1} logλ Public parameters Params = {G1, G2, e, g, H1, H2}.
[0046] n = p×q (1)
[0047] φ(n) = (p - 1)×(q - 1) (2)
[0048] Calculate the public key exponent e and the private key exponent d:
[0049] gcd(e, φ(n)) = 1, 1 < e < φ(n) (3)
[0050] d ≡ e -1 (mod φ(n)) (4)
[0051] Calculate λ:
[0052] λ = lcm(p - 1, q - 1) (5)
[0053] Calculate μ:
[0054] μ = (λ -1 mod n) (6)
[0055] Public parameters Params = {G1, G2, e, g, H1, H2, p, q, σ, λ, μ}.
[0056] Among them, G1, G2, e, g, H1, H2, p, q, σ, λ, μ are all intermediate variables.
[0057] When seeing a doctor, the patient client inputs the public parameters Params and randomly selects as the private key SKp , the public key PK p = g α ; The doctor client randomly selects as the private key SK d , the public key PK d = g x ; Select the RSA public key PK1 = (e, n), the RSA private key SK1 = (d, n); Select the Paillier homomorphic encryption public key PK2 = n, the private key SK2 = (λ, μ). PK1 and SK1 represent the public and private keys of RSA. Use the RSA public key to encrypt the electronic medical record data and store it on the cloud server. After the searchable encryption retrieval is completed, use the RSA private key to decrypt; PK2 and SK2 represent the public and private keys of Paillier homomorphic encryption. Use the public key when encrypting several trapdoors to form a confused trapdoor set in the trapdoor generation stage, and use the private key when the server verifies the correct trapdoor.
[0058] S2. Encrypt the medical data of the patient client; the specific encryption process includes: The doctor client creates an EMR for the patient client after the visit and extracts the keyword C, encrypts the keyword C using the public key of the patient client to obtain C w ; At the same time, encrypt the EMR using the public key of the patient client to generate C f , and calculate the hash value Hash(C f ); Send C f to the cloud server to obtain the storage index Index f ; The local server generates an inverted index table based on C w , Hash(C f ), and Index f and uploads it to the blockchain through a transaction.
[0059] Index table construction; Build an index table based on the inverted index locally to accelerate the search efficiency of the EMR. The index table can be synchronized to other nodes through the characteristics of the blockchain distributed system to avoid leakage. The structure of the constructed index table is as Figure 2 shown. The inverted index table I consists of two parts. One part is the quick reference table, and the other part is the position table.
[0060] The quick reference table T = {ID i , C(w i , PK p )}, ID i represents the medical record number of the patient client's EMR, C(w i , PK p ) represents the keyword ciphertext in PEKS, where w is the keyword plaintext, PK p is the public key of the patient, and C is the keyword encryption algorithm; First, for each keyword wi Generate an identification IDi, and then encrypt the keyword w i Produce the keyword ciphertext, add IDi and the keyword ciphertext to the quick reference table T. When querying, decrypt the keyword for each transaction, and after decryption, it is equal to w i , and add the hash value of the transaction, w i and the hash of IDi to the list L.
[0061] The position table L is composed of the position array A wi which contains the transaction hash addresses on the blockchain of all documents corresponding to a certain keyword ciphertext. The blockchain initially filters by the medical record number ID of the EMR in the quick reference table i , and then uses the verification algorithm in PEKS to check whether the keyword is valid. After obtaining the transaction hash, directly query the result to avoid wasting computing power for PEKS to verify irrelevant transactions on the blockchain.
[0062] Initialize the inverted index structure I using the quick reference table T and the position table L.
[0063] By constructing a national ciphertext search algorithm based on the inverted index, the efficiency of querying electronic medical records on the blockchain can be effectively guaranteed, and a trapdoor confusion strategy is added to ensure that attackers cannot obtain the association between the trapdoor and the result.
[0064] S2.1. For the EMR data of each patient's client, use RSA to encrypt the EMR data to generate C p through the public key PK of the patient's client f :
[0065] C f = f e (mod n)(7).
[0066] S2.2. When the patient visits the doctor, use a certain department or other attributes of the visit as the keyword C. The doctor's client randomly selects one through the public key PK of the patient's client p to calculate C w = (g α , H2(e(H1(W), g αz )), and upload C f and C w to the local server.
[0067] S2.3. The local server uploads C f to the cloud server, and the cloud server returns the data storage index Index f . The local server, according to C w , Hash(C f ), Index fGenerate an inverted index table I and upload it to the blockchain through a transaction. After passing through the consensus mechanism, the blockchain uploads the transaction to the chain.
[0068] S3. Generate a trapdoor.
[0069] When the doctor's client wants to view the EMR data containing a specific keyword of a patient's client, it first requests authorization from the patient's client, and then uses the private key SK of the doctor's client d to calculate the trapdoor TD a = H1(C) x , and perform an exclusive OR operation on the correct trapdoor TD a with a random number s to generate i error trapdoors TD'=(TD1, TD2,..., TD i ) that meet the trapdoor format. Encrypt the medical record number using the private key SK a for TD d and TD' to generate the correct medical record number Enc a (ID) and the incorrect medical record number Enc i (ID). Combine the above trapdoors with the encrypted medical record numbers to form a set of confused trapdoors. As Figure 3 shown, initialize the array Tag=(0, 0,..., 1, 0,... i) so that the index position of the correct trapdoor in the set of confused trapdoors is 1, and the rest are 0. Select a random number and use the Paillier homomorphic encryption algorithm to encrypt each element to obtain C tag :
[0070]
[0071] C tag = [C tag1 , C tag2 ,... C tagi (9)
[0072] Finally, send the set of confused trapdoors to the blockchain for retrieval.
[0073] When a third-party user client user wants to obtain relevant data, it needs to obtain authorization from the patient's client and generate a trapdoor through the doctor's client to send to the blockchain for query.
[0074] S4. Ciphertext retrieval and decryption.
[0075] When the patient's client visits the doctor for the second time, if the doctor's client needs to query the patient's client's previous EMR data to provide higher-quality medical treatment, the doctor's client generates a set of confused trapdoors based on the patient's client's medical record number and the keyword to be searched and sends it to the blockchain for retrieval. After receiving the set of confused trapdoors, the blockchain initializes the array Tag0=(0, 0,..., i), and selects a random number Encrypt each element using the Paillier homomorphic encryption algorithm to obtain C tag0 :
[0076]
[0077] Multiply C tag and C tag0 to obtain C m :
[0078]
[0079] Decrypt each ciphertext to obtain m:
[0080]
[0081] where the function:
[0082]
[0083] Calculate the Tag value, select the correct trapdoor, decrypt the encrypted medical record number, and preliminarily screen in the inverted index table to check if there is the patient's EMR data. If it exists, execute the trapdoor matching algorithm and test:
[0084] H2(e(T w , S1)) = S2(15)
[0085] where T w represents the trapdoor, and S1 and S2 represent the elements in C w . If the match is successful, obtain the index address Index f of the encrypted EMR data C f on the cloud server, calculate the hash value of C f and verify the integrity of the data with Hash(C f ). Finally, the doctor decrypts C f using SK1 to obtain the EMR data:
[0086]
[0087] The main computational overheads in the present invention are shown in Table 1, where the execution time of the basic operations is sorted as T q > T p > T e > T h , and the computational overheads of other basic operations are much smaller than these four calculations. The following comparative analysis only considers these four computational overheads.
[0088] Table 1 Basic operation overhead table
[0089]
[0090] Compare the execution times of the proposed searchable encryption data sharing scheme based on inverted index in the prior art with those of the present invention in the encryption and search phases. As can be seen from Table 2, although the present invention involves obfuscation strategies and homomorphic encryption, the computational overhead in both the encryption and search phases is smaller than that of the prior art solution. In the encryption phase, the computational overhead of the prior art solution is 3T q +4T e +3T p while the present invention only requires 3T q +3T e +2T p which is two fewer exponentiation operations and one fewer bilinear pairing operation than it. In the search phase, the computational overhead of the prior art solution is T q +2T e +2T p while the present invention only requires T q +T p +T h which is two fewer exponentiation operations and one fewer bilinear pairing operation than it. Although one more homomorphic operation is added, its consumption time is less, and the overall search phase time is better than that of the prior art solution. The prior art solution adopts a double-chain structure and also requires a large amount of system overhead when verifying the data consistency between the private chain and the consortium chain. The cloud-chain collaboration model adopted by the present invention is more suitable for scenarios with a large amount of electronic medical record data.
[0091] Table 2 Comparison Table of Computational Overhead
[0092]
[0093] Conduct numerical simulation experiments on the algorithm in the present invention, and analyze the computational efficiency of the present invention by changing the number of keywords. The number of keywords is set to 10, 20, 30, 40, and 50 respectively. The experimental results are the average values of the algorithm running 50 times, and the results are shown in Table 3.
[0094] Table 3 Execution Time Table of the Algorithm in the Present Invention
[0095]
[0096] The system construction phase simulates the initialization of the system and various parameters. The data encryption phase simulates the encryption of the patient's EMR data and keywords. The trapdoor generation phase simulates the generation of search trapdoors when the data user searches. The ciphertext retrieval phase simulates the process of using the trapdoor and keyword matching on the blockchain after receiving the set of confused trapdoors, and finally returning the EMR data from the cloud server. The decryption phase simulates the decryption of the EMR ciphertext data on the patient's client. As can be seen from the table, the computational consumption in the system construction phase and the data decryption phase does not change with the change in the number of keywords. The data encryption phase, the trapdoor generation phase, and the ciphertext retrieval phase are all related to the keywords and are proportional to the number of keywords. Since these three phases involve multiple bilinear pairing operations, exponential operations, and hash mapping to group operations, the computational consumption increases slowly.
[0097] Based on the same inventive concept, the present invention also proposes a data security sharing system. The scenarios of data security sharing include doctor clients, patient clients, third-party user clients, cloud servers, and blockchains. The blockchain generates public parameters according to given security parameters, and doctor clients and patient clients generate their respective public and private keys according to the public parameters. The system includes:
[0098] An encryption module for encrypting the medical data of the patient client. The specific encryption process includes: the doctor client creates an EMR for the patient client after the visit and extracts the keyword C, encrypts the keyword C using the public key of the patient client to obtain C w ; at the same time, encrypts the EMR using the public key of the patient client to generate C f , and calculates the hash value Hash(C f ); sends C f to the cloud server to obtain the storage index Index f ; the local server generates an inverted index table according to C w , Hash(C f ), and Index f and uploads it to the blockchain through a transaction.
[0099] A query module for the doctor client to generate a set of confused trapdoors through the medical record number and keyword of the patient client and send them to the blockchain for retrieval, and decrypt the medical data of the patient client according to the confused trapdoors. After obtaining the authorization of the patient client, the third-party user obtains the decrypted EMR data through the doctor client.
[0100] The present invention also proposes a data security sharing computer device, including: a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, it implements the steps of the data security sharing method.
[0101] As described above, it is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution of the present invention and its inventive concept, makes equivalent substitutions or changes, and should be covered within the protection scope of the present invention.
Claims
1. A data security sharing method, wherein the scenario of data security sharing includes a doctor client, a patient client, a third-party user client, a cloud server and a blockchain, wherein the blockchain generates a public parameter according to a given security parameter, and the doctor client and the patient client generate their respective corresponding public key and private key according to the public parameter, characterized in that: The method comprises the following steps: Encrypt the medical data of the patient client; the encryption process specifically includes: the doctor client creates an EMR for the patient client after the consultation and extracts keywords , use the public key generated by the patient client to Encrypt and get ; At the same time, the public key generated by the patient client is used to encrypt the EMR and generate , and calculate the hash value of EMR ;Will Send to the cloud server to obtain the storage index of the data ; The local server is based on , , Generate an inverted index table and upload it to the blockchain through transactions; The doctor client generates an obfuscation trapdoor set through the medical record number and keywords generated by the patient client, sends it to the blockchain for retrieval, and decrypts the medical data of the patient client according to the obfuscation trapdoor; after obtaining the authorization of the patient client, the third-party user client obtains the decrypted EMR data through the doctor client; wherein, the doctor client generates an obfuscation trapdoor set through the medical record number and keywords generated by the patient client, sends it to the blockchain for retrieval, and decrypts the medical data of the patient client according to the obfuscation trapdoor, specifically including the following steps: the doctor client, after being authorized by the patient client, uses the private key to calculate the correct trapdoor, and generates multiple error trapdoors according to the correct trapdoor and the random number by XOR; The correct trapdoor and the wrong trapdoor are used to encrypt the medical record number with the doctor's private key to generate the correct medical record number and the wrong medical record number; the correct trapdoor and the wrong trapdoor are combined with the correct medical record number and the wrong medical record number to form a confusion trapdoor set; the position of the correct trapdoor is located through the Tag, and the Tag is encrypted using the homomorphic encryption algorithm Paillier, and the confusion trapdoor set is sent to the blockchain for retrieval; after receiving the confusion trapdoor set, the blockchain calculates the Tag value through Paillier and selects the correct trapdoor; the encrypted medical record number is decrypted, and the inverted index table is preliminarily screened to see whether there is EMR data of the patient client. If so, the trapdoor matching algorithm is executed, and if the match is successful, the encrypted EMR data is obtained Index address on the cloud server ,according to calculate The hash value of verify The doctor client uses the private key Will Decryption.
2. A data security sharing method according to claim 1, characterized in that: The blockchain generates public parameters according to given security parameters, specifically including the following steps: Given a security parameter , construct two finite cyclic groups and , and the bilinear map ; choose Generators of , and define two national secret SM3 hash functions: , ; then the public parameters , All are intermediate variables.
3. A data security sharing method according to claim 2, characterized in that: The doctor client and the patient client generate their own corresponding public and private keys according to the public parameters, specifically including: when the patient client visits the doctor, according to the input public parameters , randomly selected As a private key and the public key ; Doctor client randomly selects As a private key and the public key , To include all less than q And with q Coprime positive integers, ɑ、x Is a random number.
4. A data security sharing method according to claim 3, characterized in that: The inverted index table includes a quick lookup table and a position table; the quick lookup table is represented as , Indicates the patient's client EMR medical record number, Represents the keyword ciphertext in PEKS, where is the keyword plaintext, is the patient client's public key, is the keyword encryption algorithm, i is an index number; The location table By position array It consists of the transaction hash addresses of all documents corresponding to a certain keyword ciphertext on the blockchain.
5. A data security sharing method according to claim 4, characterized in that: For each patient client’s EMR data, use the patient client’s public key EMR data generation encrypted using asymmetric encryption algorithm RSA .
6. A data security sharing method according to claim 4, characterized in that: When a patient client visits a doctor, the department or other attributes they visit are used as keywords , doctor client for keywords Select a random , through the patient client's public key calculate ,Will and Upload to a local server, z is a random variable, g az is the patient client's public key and a random variable z The calculated public key.
7. A data security sharing system, wherein the scenarios of data security sharing include a doctor client, a patient client, a third-party user client, a cloud server and a blockchain, wherein the blockchain generates a public parameter according to a given security parameter, and the doctor client and the patient client generate their respective corresponding public and private keys according to the public parameter, characterized in that: include: An encryption module, used to encrypt patient client medical data; The encryption process specifically includes: the doctor client creates an EMR for the patient client after the consultation and extracts keywords , use the patient client's public key to pass the keyword Encrypt and get ; At the same time, the patient client's public key is used to encrypt the EMR and generate , and calculate the hash value of EMR ;Will Send to the cloud server to obtain the storage index of the data ; The local server is based on , , Generate an inverted index table and upload it to the blockchain through transactions; The query module is used for the doctor client to generate an obfuscation trapdoor set through the medical record number and keywords generated by the patient client and send it to the blockchain for retrieval, and decrypt the medical data of the patient client according to the obfuscation trapdoor; after the third-party user client obtains the authorization of the patient client, it obtains the decrypted EMR data through the doctor client; wherein, the doctor client generates an obfuscation trapdoor set through the medical record number and keywords generated by the patient client and sends it to the blockchain for retrieval, and decrypts the medical data of the patient client according to the obfuscation trapdoor, which specifically includes the following steps: the doctor client after authorization by the patient client uses the private key to calculate the correct trapdoor, and generates multiple error codes according to the correct trapdoor and the random number. Trapdoors; encrypt the medical record number with the correct trapdoor and the wrong trapdoor using the doctor's private key to generate the correct medical record number and the wrong medical record number; form a confusion trapdoor set with the correct medical record number and the wrong medical record number; locate the position of the correct trapdoor through the Tag, encrypt the Tag using the homomorphic encryption algorithm Paillier, and send the confusion trapdoor set to the blockchain for retrieval; after receiving the confusion trapdoor set, the blockchain calculates the Tag value through Paillier and selects the correct trapdoor; decrypt the encrypted medical record number, and preliminarily screen whether there is EMR data of the patient client in the inverted index table. If so, execute the trapdoor matching algorithm. If the match is successful, the encrypted EMR data is obtained. Index address on the cloud server ,according to calculate The hash value of verify The doctor client uses the private key Will Decryption.
8. A data security sharing computer device, characterized in that: include: A memory, a processor, and a computer program stored in the memory, wherein the processor implements the steps of the data security sharing method according to any one of claims 1 to 6 when executing the computer program.
Citation Information
Patent Citations
Electronic medical record security sharing system and method combining quantum key and block chain
CN116527709A
KR20200016458A
Cited By
Block chain-based gynaecology and obstetrics emergency medical data security sharing system
CN121173607A
Blockchain-based gynecological and obstetric emergency medical data security sharing system
CN121173607B