Blockchain-based ehr data fine-grained access control method, system and terminal

By using token splitting and encryption, combined with key encapsulation of reverse hash chains and pseudo-random functions, the problem of low efficiency in generating permission tokens in the field of smart healthcare has been solved, enabling more granular and flexible permission management and improving data access efficiency and security.

CN116471089BActive Publication Date: 2026-04-14UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNIV OF ELECTRONICS SCI & TECH OF CHINA
Filing Date
2023-04-21
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In the existing smart healthcare field, blockchain-based electronic medical record systems have low efficiency in generating permission tokens in multi-party consultation scenarios, resulting in inefficient data access control and an inability to achieve flexible and fine-grained permission management.

Method used

Sub-tokens are generated through a token splitting algorithm and encrypted. These sub-tokens are then delegated to other data users to obtain EHR data. Meanwhile, a reverse hash chain and a pseudo-random function are used to implement key encapsulation processing, thereby improving data access efficiency and security.

Benefits of technology

It achieves finer-grained and more flexible access control, improves data access efficiency, and ensures data access security through the image front resistance property of hash functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116471089B_ABST
    Figure CN116471089B_ABST
Patent Text Reader

Abstract

The application discloses a blockchain-based EHR data fine-grained access control method, system and terminal, and belongs to the technical field of blockchains, and comprises the following steps: a current data user end executes a token segmentation algorithm to obtain a subtoken, the subtoken is subjected to encryption processing, and the encrypted subtoken is entrusted to other data user ends, so that the other data user ends acquire EHR data from a distributed database on a blockchain according to the subtoken; the current data user end segments the token, and then distributes the subtoken to corresponding other data user ends to acquire EHR data corresponding to the subtoken, more fine-grained and more flexible permission management is realized, the whole process does not need to wait for a central organization to process, and the data access efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a blockchain-based method, system, and terminal for fine-grained access control of EHR data. Background Technology

[0002] With the increasing aging population, traditional elderly care faces increasingly severe challenges, such as difficulty in obtaining timely health information for the elderly and the leakage of medical data. As one of the emerging smart technologies, the Internet of Things (IoT) has brought about tremendous changes to people's lives and work by leveraging information security technologies. When IoT is combined with elderly care and healthcare, smart healthcare can provide comprehensive healthcare services for the elderly in a near-revolutionary way, making age-centered healthcare a reality.

[0003] In the field of smart elderly care, electronic health records (EHRs) include historical electronic medical records, regular physical examination data, and daily physical examination data. These data play a crucial and important role in health status prediction, clinical diagnosis, and treatment. EHR data is continuously generated in the form of a data stream in smart elderly care. For example, the elderly's physical data is measured daily by professional caregivers and recorded by smart wearable devices (such as fitness trackers and wearable medical devices). Therefore, EHR data is typically a continuous data stream. If EHR data is leaked, user privacy will be seriously threatened. Therefore, how to effectively store and manage EHR data, especially achieving flexible and fine-grained access control, has become a critical issue.

[0004] To address the aforementioned issues, blockchain-based solutions have emerged as a new research direction in recent years, offering solutions for data access control, privacy protection, and data sharing in healthcare systems. A blockchain network connects various entities, with EHR data stored in a distributed database (e.g., the databases of smart healthcare institutions like SHI and hospitals). Doctors can only provide diagnostic services to the elderly after meeting access control policies and obtaining data access tokens. Government agencies and insurance companies can also apply for data access permissions if necessary. However, current blockchain-based electronic medical record systems in the smart healthcare field also have certain shortcomings. For example, in multi-party consultation scenarios, a new token needs to be generated for each doctor through a central institution, and the associated request and confirmation communications are time-consuming, resulting in low token generation efficiency. Summary of the Invention

[0005] The purpose of this invention is to overcome the problems of the prior art and provide a blockchain-based method, system and terminal for fine-grained access control of EHR data.

[0006] The objective of this invention is achieved through the following technical solution: a blockchain-based fine-grained access control method for EHR data, which, when the data user terminal is the executing entity, includes the following steps:

[0007] The current data user terminal executes a token splitting algorithm to obtain a sub-token, encrypts the sub-token, and delegates the encrypted sub-token to other data user terminals so that the other data user terminals can obtain EHR data from the distributed database on the blockchain based on the sub-token;

[0008] Token splitting algorithms include:

[0009] A copy of token T i Modify T according to the range of the T attribute i Attributes, obtain the sub-token; attributes include the token's validity period and the number of times the token can be used.

[0010] In one example, the encryption of the sub-token includes:

[0011] Select random number Cryptographic Sub-Token T i :

[0012]

[0013] Where l represents the length of parameter r; C tk It is the ciphertext of an element tk in the CP-ABE operation space; Therefore The RSA-OAEP encryption scheme uses a public key; Therefore The AES encryption scheme for the key.

[0014] ENC indicates encryption processing; This indicates that the current data user client has access to token T. i The signature.

[0015] In one example, other data clients retrieve EHR data based on the sub-token, including:

[0016] Send a request to the blockchain to access data;

[0017] Receive the storage location information of the EHR data returned by the blockchain;

[0018] Based on the storage location information of the EHR data, the sub-token and sub-token signature are submitted to the corresponding database server so that the database server can verify the sub-token to obtain the ciphertext stream;

[0019] The ciphertext stream is decrypted using the sub-token to obtain plaintext EHR data.

[0020] In one example, other data clients obtain the time interval (t) based on the sub-token. i ,t j Following the EHR data, the process also includes a key update step executed by the healthcare service provider:

[0021] For each ε∈{i,…,j}, a key is randomly and uniformly selected. The key sequence is now... Update EHR data according to encryption algorithm ε key

[0022] In one example, the method further includes EHR data encryption processing performed by the healthcare service provider, including:

[0023] The EHR data is encrypted using a data encryption algorithm.

[0024] The key is encapsulated according to the key encapsulation algorithm. During the encapsulation process, two different random numbers are used to generate two reverse hash chains. The key encapsulation process is achieved based on the two reverse hash chains combined with a pseudo-random function.

[0025] In one example, the encryption process for the EHR data includes:

[0026] For each time interval t i Uniformly and randomly selected As the symmetric key for encrypting EHR, the symmetric key forms a key sequence.

[0027] In each time interval t i The hash digest and ciphertext calculation formulas for EHR data are as follows:

[0028]

[0029] in, Indicates time interval t i The corresponding data is EHR. i Hash digest; H1(EHR) i ) indicates data EHR i The hash value; Representing data EHR i The encrypted text; This indicates that the DataEnc data encryption algorithm is used to encrypt the EHR data. i Encryption processing is performed;

[0030] Encapsulating the key includes:

[0031] Two distinct random numbers s1, s2 ∈ {0, 1} are uniformly and randomly selected.2l s1 and s2 are two different random numbers used to generate the seeds for the reverse first hash chain and the second hash chain;

[0032] Uniformly and randomly select random numbers γ∈{0,1} 2l ;

[0033] For each time t i Hash tokens h are generated on the first and second hash chains respectively using a collision-resistant function H1. i and h i All hash tokens will be recorded in the hash token list. Then, the pseudo-random function F is used to calculate the key SEK. i :

[0034]

[0035] Wrap the symmetric key with the AES encryption algorithm:

[0036]

[0037] in, Indicates key k i The encrypted text; The key k represents the key for the encrypted symmetric key. i Encryption is performed; N represents the maximum time length;

[0038] Finally, the ciphertext will be... Send to the distributed database server.

[0039] In one example, the first hash chain expression is:

[0040] h1=H(s1), h2=H(h1=H 2 (s1),…,h i =H(h) i-1 )=H i (s1)

[0041] The second hash chain expression is:

[0042] h′ N =H(s2),h′ N-1 =H(h′) N )=H 2 (s2)…,h′ i =H(h′) i+1 )=H N-i+1 (s2)

[0043] Where h represents the hash token; H(*) represents the hash function;

[0044] Each time interval t i The key SEK for encrypting symmetric keys i The calculation formula is:

[0045] SEK i =KDF(h i ||h′ i )

[0046] KDF is the key derivation function.

[0047] It should be further noted that the technical features corresponding to the above examples can be combined or replaced to form new technical solutions.

[0048] The present invention also includes a blockchain-based fine-grained access control system for EHR data, which performs access control based on the control method formed by any or more of the above examples. The system includes a healthcare service provider, a globally trusted certificate authority, a blockchain, a user terminal, and a distributed database that are communicatively connected to the healthcare service provider, and the user terminal is connected to the globally trusted certificate authority, the blockchain, and the distributed database.

[0049] The healthcare provider encrypts the collected EHR data.

[0050] Globally trusted certificate authorities are used to generate system public parameters, global public keys, master keys, public-private key pairs for legitimate users, and private keys closely related to user attributes;

[0051] The blockchain is used to store the hash digest of EHR data, the storage location of the EHR ciphertext, and the list of tokens obtained from token splitting; the distributed database server is used to store the encrypted EHR data and provide data access services to data users;

[0052] The current data user terminal executes a token splitting algorithm to obtain a sub-token, encrypts the sub-token, and delegates the encrypted sub-token to other data user terminals; the other data user terminals retrieve EHR data from the distributed database on the blockchain based on the sub-token.

[0053] In one example, the medical service provider includes a data encryption processing unit and a key encapsulation unit;

[0054] The data encryption processing unit is used to encrypt EHR data;

[0055] The key encapsulation unit is used to encapsulate the key according to the key encapsulation algorithm. During the encapsulation process, two different random numbers are used to generate two reverse hash chains. The key encapsulation process is achieved based on the two reverse hash chains combined with a pseudo-random function.

[0056] It should be further noted that the technical features corresponding to the above system examples can be combined or replaced to form new technical solutions.

[0057] The present invention also includes a storage medium storing computer instructions that, when executed, perform the steps of the blockchain-based EHR data fine-grained access control method formed by any or more of the above examples.

[0058] The present invention also includes a terminal comprising a memory and a processor, wherein the memory stores computer instructions executable on the processor, and the processor executes the steps of the blockchain-based EHR data fine-grained access control method formed by any or more of the above examples when executing the computer instructions.

[0059] Compared with the prior art, the beneficial effects of the present invention are:

[0060] 1. In one example, the present invention divides the token by the current data user terminal, and then distributes the sub-tokens to other corresponding data user terminals to obtain the EHR data corresponding to the sub-tokens. This achieves more granular and flexible permission management. The whole process does not need to wait for the central institution to process, which greatly improves the efficiency of data access.

[0061] 2. In one example, the present invention defines the start and end times using two inverse hash functions to limit the data range. Since hash functions have significant image front resistance characteristics, it is very difficult to compute hash tokens outside the data range, thus ensuring the security of data access. Attached Figure Description

[0062] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, which are used to provide a further understanding of the present application and constitute a part of the present application. The same reference numerals are used in these drawings to denote the same or similar parts. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application.

[0063] Figure 1 This is a flowchart of a method in an example of the present invention;

[0064] Figure 2 This is a diagram of the encrypted data structure in an example of the present invention;

[0065] Figure 3 This is a diagram of two reverse hash chains in an example of the present invention;

[0066] Figure 4 This is a token structure diagram in one example of the present invention;

[0067] Figure 5 This is a system framework diagram in an example of the present invention. Detailed Implementation

[0068] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0069] In the description of this invention, it should be noted that the directions or positional relationships indicated by terms such as "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer" are based on the directions or positional relationships shown in the accompanying drawings. They are used only for the convenience of describing this invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention. Furthermore, the use of ordinal numbers (e.g., "first and second," "first to fourth," etc.) is for distinguishing objects and is not limited to this order, and should not be construed as indicating or implying relative importance.

[0070] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0071] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0072] First, the parameters involved in the method of this invention are defined as shown in Table 1:

[0073] Table 1. Symbols and their definitions

[0074]

[0075] In one example, such as Figure 1As shown, a blockchain-based fine-grained access control method for EHR data is illustrated using a medical consultation scenario. When Doctor A (the current data user) encounters difficulties diagnosing an elderly patient, he needs to request assistance from Doctor B1, Doctor B2 (other data users), etc. However, the central institution, i.e., the medical service provider, generates a new token for each doctor, which involves a series of requests and confirmation communications, consuming a significant amount of time. To improve diagnostic efficiency, reduce the burden on the medical service provider, and centralize the system, Doctor A can delegate his permissions to other doctors. Therefore, this example proposes a token splitting algorithm to achieve more fine-grained and flexible permission management. This method uses the terminal corresponding to Doctor A as the execution subject and includes the following steps:

[0076] S1: Execute the token splitting algorithm: Make a copy T of token T. i Modify T according to the range of the T attribute i Attributes, obtain child tokens;

[0077] S2: Encrypt the sub-token and delegate the encrypted sub-token to other data users so that they can obtain EHR data from the distributed database on the blockchain based on the sub-token.

[0078] Specifically, for any i∈{1,2,…,τ}, a copy T of the token T is made. i Modify T i The attributes include the token's validity period, the number of times the token can be used, and T. i The attribute range must not exceed the range of token T; finally, based on the token splitting relationship, fill the parent (identifier ID of the parent token) and son (identifier ID of the child token) fields of each token with the corresponding token ID, such as child token T. i The `parent` field is the unique identifier of token T. If subtotal T2 is obtained by splitting subtotal T1, then the `son` field of subtotal T2 is the unique identifier of token T1. This is to ensure that doctor B... i To better collaborate with Doctor A, we allow Doctor B... i Possessing tokens T i The token splitting can overlap with the time of token T. After the token splitting is complete, Doctor A signs each new token using their private key, and then the doctor sends the token splitting information. The token is sent to the blockchain platform, which stores the token split information (TSM).

[0079] Preferably, the token splitting algorithm TokenSeg(T,S) is executed. T ,PP,uid i → (T,T) iBefore proceeding, Doctor A (whose ID is uid0) will first verify the token signature. If the token signature is valid, the doctor will divide the token into several sub-tokens. Let uid1, uid2, ..., uid τ The ID of the entrusted doctor is used, and then step S1 is performed to split the token.

[0080] Furthermore, after token splitting, the sub-tokens can be encrypted using existing encryption algorithms such as AES or symmetric encryption algorithms. Collaborating doctor B then uses the sub-tokens to obtain the storage address of the corresponding patient's HER data from the blockchain, and then uses that storage address to obtain the HER data with the corresponding permissions from the distributed database, thus enabling multi-doctor consultations without a central institution.

[0081] In one example, after token splitting is completed, sub-token delegation is performed:

[0082] Specifically, only after the token splitting is completed can Doctor A execute the TokenDel token delegation algorithm to transfer the sub-token T. i Entrusted to Doctor B i First, select a random number. Cryptographic Sub-Token T i :

[0083]

[0084] Where l represents the length of parameter r; C tk It is the ciphertext of an element tk in the CP-ABE operation space; Therefore The RSA-OAEP encryption scheme uses a public key; Therefore The key is the AES encryption scheme, and ENC indicates encryption processing; This indicates that the current data user client has access to token T. i The signature. Finally, Doctor A gave the encrypted message. Send to Doctor B i Obviously, only when Doctor B... i It was the doctor invited by doctor A and doctor B i The attributes satisfy the access control policy, Doctor B i Only then can you decrypt and obtain the token.

[0085] In one example, the steps doctor B takes to retrieve EHR data based on a sub-token include:

[0086] S31: Send a request to the blockchain to access data;

[0087] S32: Receive the storage location information of the EHR data returned by the blockchain;

[0088] S33: Based on the storage location information of the EHR data, submit the sub-token and sub-token signature to the corresponding database server so that the database server can verify the sub-token to obtain the ciphertext stream;

[0089] S34: Decrypt the ciphertext stream based on the sub-token to obtain plaintext EHR data.

[0090] Specifically, when a data user B obtains a data access token T (assuming his token is a sub-token authorized by doctor A), data user B will send a request R = (uid, DO) uid ,(t i ,t j User B requests access to data through the blockchain platform. Upon receiving User B's request, the blockchain returns a response. (ε = i, ..., j). Based on position L, doctor B will assign token T and its signature S. T The token is submitted to the corresponding database server. The database server verifies the token using the following logic:

[0091]

[0092] in, This represents the signature public key of SHI, a smart healthcare and elderly care institution that provides medical services to the elderly; α is the signature public key for Doctor B; α is the random number generated for the key, which is part of the master key MK; Do uid Represents identity; γ represents a random number; i, j, and ε are used to mark data generated at different time points; h i and h j H0 represents the hash token; H0 represents the hash value. If the above formula is satisfied, the token verification is successful, and the database server will send the data at time t. i and time t j Corresponding ciphertext streams between Send to Doctor B. Received encrypted message. Doctor B executes the algorithm To obtain EHR data, the specific steps include:

[0093] 1) Extract h from token T i h j ′ and γ;

[0094] 2) To calculate

[0095] 3) To Through calculation Obtain plaintext EHR data.

[0096] Then doctor B first calculates dig′ EHR =H1(EHR), if dig EHR =dig′ EHR This indicates that the EHR data has not been tampered with and is authentic and valid, at which point doctors can conduct a consultation for the elderly patient.

[0097] In one example, doctor B obtains the time interval (t) based on the sub-token. i ,t j Following the EHR data, the process also includes a key update step with SHI as the execution entity:

[0098] For each ε∈{i,…,j}, a key is randomly and uniformly selected. The key sequence is now... Then, for each ε∈{i,…,j}, SHI updates the data EHR according to an encryption algorithm such as AES. ε key The specific calculation formula is: Calculate Finally, SHI executes the key encapsulation algorithm again. In this example, the key update algorithm does not involve unaccessed EHR data, but only revokes accessed HER data, which greatly saves system overhead.

[0099] In one example, after an elderly person registers with a smart senior care facility (SHI), they first authorize SHI to manage their EHR data. In the initial phase, SHI and the elderly person negotiate the unit time interval t at which the data will be stored. unit For example, a week, a month, a day, etc. Then SHI sets the start time t for data storage. start and the end time t when the data is stored end , such that t end =t start +N·t unit , record (t) start ,t end ,t unit )for After successfully collecting the aforementioned HER data, the corresponding SHI terminal will encrypt the data, including:

[0100] The EHR data is encrypted using a data encryption algorithm.

[0101] The key is encapsulated according to the key encapsulation algorithm. During the encapsulation process, two different random numbers are used to generate two reverse hash chains. The key encapsulation process is achieved based on the two reverse hash chains combined with a pseudo-random function.

[0102] Furthermore, the SHI execution algorithm Encryption processing of EHR data includes:

[0103] For each time interval t i Uniformly and randomly selected As the symmetric key for encrypting EHR, the symmetric key forms a key sequence. Naturally, EHR data is based on time t i It was also packaged into an EHR accordingly. i ; in each time interval t i The hash digest and ciphertext calculation formulas for EHR data are as follows:

[0104]

[0105] in, Indicates time interval t i The corresponding data is EHR. i Hash digest; H1(EHR) i ) indicates data EHR i The hash value; Representing data EHR i The encrypted text; This indicates that the DataEnc data encryption algorithm is used to encrypt the EHR data. i Encryption processing is performed;

[0106] Then, SHI executes the algorithm. Encapsulating the key includes:

[0107] Two distinct random numbers s1, s2 ∈ {0, 1} are uniformly and randomly selected. 2l s1 and s2 are two different random numbers used to generate the seeds for the reversed first and second hash chains; then, a random number γ∈{0,1} is selected uniformly and randomly. 2l For each time t i Hash tokens h are generated on the first and second hash chains respectively using a collision-resistant function H1. i and h i All hash tokens will be recorded in the hash token list. Then, the pseudo-random function F is used to calculate the key SEK. i :

[0108]

[0109] Wrap the symmetric key with the AES encryption algorithm:

[0110]

[0111] in, Indicates key ki The encrypted text; The key k represents the key for the encrypted symmetric key. i Encryption is performed; N represents the maximum length of the system time; finally, the ciphertext is encrypted. The data is sent to a distributed database server, and its data structure is as follows: Figure 2 As shown; after the database server stores the ciphertext, the server will return the ciphertext location L to SHI. i (such as a URL); finally, SHI will Send to the blockchain platform.

[0112] In one example, the two hash chain structures are as follows: Figure 3 As shown, by using s1 as a random seed and N as the length of the hash chain, the hash function H generates hash tokens sequentially to form the following first hash chain (hash chain 1):

[0113] h1=H(s1), h2=H(h1=H 2 (s1),…,h i =H(h) i-1 )=H i (s1)

[0114] Where h represents the hash token; H(*) represents the hash function; the second hash chain (hash chain 2) structure is similar to the first hash chain structure, but generated in the reverse order. The expression for the second hash chain is:

[0115] h′ N =H(s2),h′ N-1 =H(h′) N )=H 2 (s2)…,h′ i =H(h′) i+1 )=H N-i+1 (s2)

[0116] Start and end times are defined using two opposite hash chains to limit the range of data. For example, given a time interval (t3, t5) and two corresponding hash tokens h3 and h′5, it is easy to compute the hash tokens between time t3 and time t5 due to the significant image-front resistance property of the hash function, but it is extremely difficult to compute other hash tokens outside of time t3 and t5. Each time interval t... i The key SEK for encrypting symmetric keys i The calculation formula is:

[0117] SEK i =KDF(h i ||h′ i )

[0118] Where KDF is the key derivation function; utilizing time t i and time t j The corresponding hash token (h) i ,h′ j It is easy to calculate from time t i By time t j All hash tokens and SEK.

[0119] In one example, the method of the present invention further includes a token generation step. Specifically, when a data user requests access at time t... i to t j When sending EHR data between them, he sends a request message R = (uid, DO) uid ,(t i ,t j Give SHI, and SHI will execute the algorithm. Generate a token T. The token consists of two parts: a token header and a token body, with the following structure: Figure 4 As shown, the token header consists of six fields: id, time, num, user, parent, and son. id is a unique identifier for each token; time represents the token's validity period; num represents the number of times the token can be used; user indicates the user of the token; parent indicates the ID of the parent token; and son indicates the ID of the child token. The token body contains a random number γ and the data owner's identifier DO. uid Hash token h i and h′ j And the signature sig for these four components. The signing process includes the following steps:

[0120] 1) Randomly select a number

[0121] 2) Calculate r′=H0(g) π ,γ||DO uid ||h i ||h′ j );

[0122] 3) Calculation

[0123] 4) Output the signature sig = (r′, σ′).

[0124] The data access token of this invention is T = (head, (r, DO) uid ,h i ,h′ j Similarly, SHI executes the algorithm. Sign the entire token, where S T = (r, σ). With the help of SHI, the elderly can set their EHR access policy to determine who can access their EHR data. In this invention, the access control policy is represented by (M, ρ), where M is an θ1×θ2 matrix, θ1 represents the total number of all attributes in the access control policy, and ρ is the matrix M whose values ​​are M1, θ2, and σ2. i A function is mapped to each attribute; finally, SHI executes the algorithm TokenEnc(PP,GK,(M,ρ),T)→C to encrypt the entire token. The algorithm details are as follows:

[0125] 1) Select an element uniformly and randomly.

[0126] 2) Use the symmetric key H2(tk) to encrypt the token T:

[0127] 3) Randomly select s, remember

[0128] 4) Calculate from i = 1 to θ1. Where M i Represents the i-th row of matrix M;

[0129] 5) Select uniformly and randomly

[0130] 6) Calculate C′=tk·e(g,g) αs ,C″=g s ,

[0131] 7) Output tk's ciphertext

[0132] Finally, SHI sends C=C tk ||C T For data users.

[0133] If a data user's attribute set S satisfies the access control policy, he / she can use the attribute private key SK′ to execute the algorithm TokenDec(C,SK′)→T to decrypt the ciphertext C and obtain the token T. The algorithm is described as follows:

[0134] Define the subscript set sum matrix in yes The cardinality of θ. Define a 2×1 matrix Θ0 = [1, 0, ..., 0]. T By solving the system of linear equations The roots of this system of equations are: in count Calculated Next, the data user calculates...

[0135]

[0136] Then the data user calculates tk = C′ / e(g,g) αs The user obtains tk; finally, the user decrypts C using the symmetric key H2(tk). T Obtain token T.

[0137] In one example, the method also includes an initialization step with a globally trusted Certificate Authority (CA) as the execution entity:

[0138] First, the CA executes the algorithm Setup(u)→(PP,GK,MK) to generate the system public parameters PP, the global public key GK, and the master key MK, including the following steps:

[0139] 1) Choose two multiplicative cyclic groups of order p. and in The generator is g;

[0140] 2) Choose linear mapping e:

[0141] 3) Select three hash functions H0: H1:{0,1} * →{0,1} l H2: And a pseudo-random function F: H1 is a collision-resistant hash function;

[0142] 4) Select u elements that are uniformly and randomly associated with u attributes.

[0143] 5) Select elements uniformly and randomly

[0144] 6) The system's public parameters PP, global public key GK, and master key MK are as follows:

[0145]

[0146] GK={h x |x∈[1,u]}

[0147] MK=(β,g α )

[0148] In one example, the method of the present invention further includes a key generation step. Specifically, key generation comprises three parts: generating a public-private key pair (PSkeyGen), generating a signature public-private key pair (SignKeyGen), and generating a user attribute private key (SKGen).

[0149] Specifically, CA executes the algorithm PSkeyGen(1 λ → (PK, SK), generating public and private key pairs for each SHI and user, specifically including:

[0150] 1) Choose two large prime numbers q1 and q2 that are similar in size, and calculate n = q1q2 and n = q1q2.

[0151] 2) Uniformly and randomly from Choose an integer b such that it satisfies And calculate

[0152]

[0153] 3) PK = (n, b), SK = (n, a), send (PK, SK) to the corresponding SHI or user.

[0154] CA Execution Algorithm Generate a public / private key pair for each SHI and user, as follows: The CA is randomly selected. And calculate g x Then Send to the corresponding SHI or user, where

[0155] The CA executes the algorithm SKGen(MK,S)→SK′, generating a private key SK′ for each data user based on each user's attribute set S, including the following steps:

[0156] 1) Verify the legitimacy of the data user's identity and distribute attribute set S to them;

[0157] 2) Select uniformly and randomly

[0158] 3) Calculate K = g α+βt L = g t ,

[0159] 4) Output attribute private key SK′=(K,L,{K x} x∈S ).

[0160] Combining the above methods yields a preferred example of the present invention, in which the preparatory steps corresponding to the method of the present invention include:

[0161] S1': CA executes the algorithm Setup(u)→(PP,GK,MK) to generate the system public parameter PP, the global public key GK, and the master key MK;

[0162] S2': CA execution algorithm PSkeyGen(1 λ → (PK, SK), generating public-private key pairs for each SHI and user; row algorithm Generate a signed public-private key pair for each SHI and user; execute the algorithm SKGen(MK,S)→SK′ to generate a private key SK′ for each user based on their attribute set S.

[0163] S3': SHI execution algorithm The data is encrypted and the algorithm is executed. Perform key encapsulation processing;

[0164] S4': SHI execution algorithm Generate token T and execute the algorithm. The entire token is signed, and the algorithm TokenEnc(PP,GK,(M,ρ),T)→C is executed to encrypt the entire token.

[0165] When multiple doctors need to consult, the preferred methods include:

[0166] S1”: The data user terminal executes the token splitting algorithm to obtain a sub-token, encrypts the sub-token, and delegates the encrypted sub-token to other data user terminals;

[0167] S2”: Other data users send a request to the blockchain to access the data and receive the storage location information of the EHR data returned by the blockchain. Then, based on the storage location information of the EHR data, they submit the sub-token and the sub-token signature to the corresponding database server so that the database server can verify the sub-token to obtain the ciphertext stream. Finally, the ciphertext stream is decrypted based on the sub-token to obtain the plaintext EHR data.

[0168] S3”: For data accessed by the user client, SHI performs a key update step to ensure data access security.

[0169] This embodiment provides a storage medium that has the same inventive concept as the blockchain-based EHR data fine-grained access control method formed by any or more of the above examples, and stores computer instructions thereon. When the computer instructions are executed, they perform the steps of the blockchain-based EHR data fine-grained access control method formed by any or more of the above examples.

[0170] Based on this understanding, the technical solution of this embodiment, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0171] This application also includes a terminal having the same inventive concept as any or a combination of examples corresponding to the above-described blockchain-based fine-grained access control method for EHR data, including a memory and a processor. The memory stores computer instructions executable on the processor, which, when executing the computer instructions, performs the steps of the above-described blockchain-based fine-grained access control method for EHR data. The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.

[0172] In one example, the terminal, i.e., the electronic device, is manifested in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit (processor) mentioned above, at least one storage unit mentioned above, and a bus connecting different system components (including storage units and processing units).

[0173] The storage unit stores program code that can be executed by the processing unit, causing the processing unit to perform the steps described in the "Exemplary Methods" section above, based on various exemplary embodiments of the present invention. For example, the processing unit can execute the aforementioned blockchain-based fine-grained access control method for EHR data.

[0174] The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 3201 and / or a cache storage unit, and may further include a read-only memory (ROM).

[0175] The storage unit may also include a program / utility having a set (at least one) of program modules, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0176] A bus can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus that uses any of the various bus structures.

[0177] The electronic device can also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be understood that other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0178] Through the above description, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to this exemplary embodiment can be embodied in the form of a software product, which can be stored on a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method of the exemplary embodiment of this application.

[0179] This invention also includes a blockchain-based fine-grained access control system for EHR data, which performs access control according to a control method formed by any or more of the above examples, such as... Figure 5 As shown, the system includes a medical service provider, a globally trusted Certificate Authority (CA), a blockchain, a user terminal (data user), and a distributed database that are connected to the medical service provider. The user terminal is connected to the globally trusted CA, the blockchain, and the distributed database.

[0180] SHI, a smart elderly care institution providing medical services to seniors, collects daily health data (such as weight, temperature, blood pressure, and heart rate) and manages seniors' EHR data, including electronic medical records, regular health check-up data, and daily health data. Furthermore, SHI also encrypts the collected EHR data, i.e., it executes algorithms. The data is encrypted and the algorithm is executed. SHI is used for key encapsulation; furthermore, it is also used to execute algorithms. Generate token T and execute the algorithm. The entire token is signed, and the algorithm TokenEnc(PP,GK,(M,ρ),T)→C is executed to encrypt the entire token.

[0181] The data owner is an elderly person in SHI. When an elderly person registers in SHI, they will automatically authorize SHI to manage their EHR data; therefore, the data owner only needs to define access control policies for attributes; users will only have the opportunity to access the elderly person's EHR data when their attributes meet the access policies.

[0182] Data users are doctors who need to access the EHR data of elderly people in SHI to diagnose their illnesses. A doctor can only decrypt the encrypted permission token generated by SHI if their attributes meet the access control policy. When doctor A needs assistance from other doctors for diagnosis, doctor A can delegate the corresponding permissions of their token to those other doctors.

[0183] A globally trusted Certificate Authority (CA) is used to determine a user's attributes based on system public parameters, a global public key, a master key, public and private key pairs for each SHI and legitimate user, and private keys closely related to user attributes.

[0184] The blockchain is used to store the hash digest of EHR data, the storage location of the EHR ciphertext, and the token list obtained from token splitting; due to the huge cost of uploading all the original EHR data, the blockchain only stores the digest of the EHR.

[0185] A distributed database server stores encrypted EHR data and provides data access services to users. Each time ciphertext is successfully stored, it returns the storage address to SHI. SHI then transmits the EHR data digest and storage address on the blockchain. When a user submits a token to the server and requests access to the EHR data, the database server first verifies the token. After successful token verification, the server then sends the EHR ciphertext to the user.

[0186] The current data user terminal executes a token splitting algorithm to obtain a sub-token, encrypts the sub-token, and delegates the encrypted sub-token to other data user terminals; the other data user terminals retrieve EHR data from the distributed database on the blockchain based on the sub-token.

[0187] In one example, the healthcare service provider includes a data encryption processing unit and a key encapsulation unit. The data encryption processing unit is used to encrypt the EHR data. The key encapsulation unit is used to encapsulate the key according to the key encapsulation algorithm. During the encapsulation process, two different random numbers are used to generate two reverse hash chains. The key encapsulation process is achieved based on the two reverse hash chains combined with a pseudo-random function.

[0188] This invention segments tokens at the current data user terminal and then distributes sub-tokens to other corresponding data user terminals to obtain the corresponding EHR data. This achieves finer-grained and more flexible access control. The entire process does not require waiting for central processing, greatly improving data access efficiency. Furthermore, by defining start and end times using two inverse hash functions, the data range is limited. Due to the significant forward resistance characteristic of hash functions, calculating hash tokens outside the data range is extremely difficult, ensuring the security of data access.

[0189] The above detailed embodiments are a description of the present invention. It should not be considered that the specific embodiments of the present invention are limited to these descriptions. For those skilled in the art, several simple deductions and substitutions can be made without departing from the concept of the present invention, and all of these should be considered to fall within the protection scope of the present invention.

Claims

1. A blockchain-based fine-grained access control method for EHR data, characterized in that: When the method uses the data user terminal as the execution subject, it includes the following steps: The current data user terminal executes a token splitting algorithm to obtain a sub-token, encrypts the sub-token, and delegates the encrypted sub-token to other data user terminals so that the other data user terminals can obtain EHR data from the distributed database on the blockchain based on the sub-token; Token splitting algorithms include: Copy token T Modify according to the range of the T attribute Attributes, to obtain the child token; attributes include the token's validity period and the number of times the token can be used; Other data that users can obtain EHR data based on sub-tokens include: Send a request to the blockchain to access data; Receive the storage location information of the EHR data returned by the blockchain; Based on the storage location information of the EHR data, the sub-token and sub-token signature are submitted to the corresponding database server so that the database server can verify the sub-token to obtain the ciphertext stream; The ciphertext stream is decrypted using the sub-token to obtain plaintext EHR data.

2. The blockchain-based fine-grained access control method for EHR data according to claim 1, characterized in that: The encryption process for the sub-token includes: Select random number Cryptographic subtotal : ; Where l represents the length of parameter r; It is the ciphertext of an element tk in the CP-ABE operation space; Therefore The RSA-OAEP encryption scheme uses a public key; Therefore The key is the AES encryption scheme, and ENC indicates encryption processing; This indicates the current data client's use of the token. The signature.

3. The blockchain-based fine-grained access control method for EHR data according to claim 1, characterized in that: After other data users obtain EHR data based on the sub-token, the process also includes a key update step executed by the healthcare service provider: For each i and j are used to mark data generated at different time points, and keys are randomly and uniformly selected. At this time, the key sequence is Update EHR data according to encryption algorithm ε key .

4. The blockchain-based fine-grained access control method for EHR data according to claim 1, characterized in that: The method also includes EHR data encryption processing with the healthcare service provider as the executing entity, including: The EHR data is encrypted using a data encryption algorithm. The key is encapsulated according to the key encapsulation algorithm. During the encapsulation process, two different random numbers are used to generate two reverse hash chains. The key encapsulation process is achieved based on the two reverse hash chains combined with a pseudo-random function.

5. The blockchain-based fine-grained access control method for EHR data according to claim 4, characterized in that: The encryption process for the EHR data includes: For each time interval Uniformly and randomly selected As the symmetric key for encrypting EHR, the symmetric key forms a key sequence. ; In each time interval The hash digest and ciphertext calculation formulas for EHR data are as follows: ; in, Indicates time interval The corresponding data is EHR. i The hash digest; Represents data EHR i The hash value; Representing data EHR i The encrypted text; This indicates the use of a data encryption algorithm. For data EHR i Encryption processing is performed; Encapsulating the key includes: Two distinct random numbers are selected uniformly and randomly. , and These are two different random numbers used as seeds for generating the reverse first hash chain and the second hash chain; Uniformly and randomly select random numbers ; For each time The first hash chain and the second hash chain are protected by collision-resistant functions. Generate hash tokens respectively and All hash tokens will be recorded in the hash token list. Then, a pseudo-random function F is used to calculate the key. : ; Wrap the symmetric key with the AES encryption algorithm: ; in, Key The encrypted text; The key representing the symmetric key for encryption. Encryption is performed; N represents the maximum time length; Finally, the ciphertext will be... Send to the distributed database server.

6. The blockchain-based fine-grained access control method for EHR data according to claim 5, characterized in that: The first hash chain expression is: h1=H(s1),h2=H(h1)=H 2 (s1),…,h i =H(h i−1 )=H i (s1) The second hash chain expression is: h′ N =H(s2) ,h′ N−1 =H(h′ N )=H 2 (s2)…,h′ i =H(h′ i+1 )=H N−i+1 (s2); Where h represents the hash token; H(*) represents the hash function; Each time interval t i The key SEK for encrypting symmetric keys i The calculation formula is: SEK i =KDF(h i ||h′ i ) KDF is the key derivation function.

7. A blockchain-based fine-grained access control system for EHR data, performing access control according to the control method described in any one of claims 1-6, characterized in that: This includes the healthcare service provider, a globally trusted certificate authority, blockchain, user terminal, and distributed database that communicate with the healthcare service provider, and the user terminal is connected to the globally trusted certificate authority, blockchain, and distributed database. The healthcare provider encrypts the collected EHR data. Globally trusted certificate authorities are used to generate system public parameters, global public keys, master keys, public-private key pairs for legitimate users, and private keys closely related to user attributes; The blockchain is used to store the hash digest of EHR data, the storage location of the EHR ciphertext, and the list of tokens obtained by token splitting; Distributed database servers are used to store encrypted EHR data and provide data access services to data users; The current data user terminal executes a token splitting algorithm to obtain a sub-token, encrypts the sub-token, and delegates the encrypted sub-token to other data user terminals; Other data users retrieve EHR data from a distributed database on the blockchain based on the sub-token.

8. The blockchain-based fine-grained access control system for EHR data according to claim 7, characterized in that: The medical service provider includes a data encryption processing unit and a key encapsulation unit; The data encryption processing unit is used to encrypt EHR data; The key encapsulation unit is used to encapsulate the key according to the key encapsulation algorithm. During the encapsulation process, two different random numbers are used to generate two reverse hash chains. The key encapsulation process is achieved based on the two reverse hash chains combined with a pseudo-random function.

9. A terminal comprising a memory and a processor, wherein the memory stores computer instructions executable on the processor, characterized in that: When the processor executes the computer instructions, it performs the steps of the blockchain-based EHR data fine-grained access control method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Positional information based dynamic token and encryption method thereof

    CN103401689A

  • Method and device for processing reverse hash link of block chain

    CN108512649A