Disclosure of Invention
The invention aims to overcome the defects and provides a safe storage and sharing model and a safe storage and sharing method of the electronic medical record based on the block chain, which can safely store and share the medical data.
The invention firstly relates to a block chain-based electronic medical record safe storage and sharing model which is characterized by comprising a data creator, a data owner, cloud storage, an alliance block chain and a data user, wherein the data creator firstly sends an electronic medical record of a patient to the data owner; the data owner intercepts data according to an intercepting rule, encrypts the data and stores the encrypted data in the cloud; the data owner distributes the citation of the medical data stored in the cloud in the alliance block chain, and sets access authority by using an intelligent contract; after the data user obtains the access application of the alliance block chain, the data user obtains the data to be accessed after decrypting the data in the cloud storage;
the data creator is a medical institution or doctor, the data owner is a patient, and the data user is a doctor or medical institution or institute or other person desiring to obtain the data.
The invention also relates to a block chain-based electronic medical record safe storage and sharing method, which is used on the block chain-based electronic medical record safe storage and sharing model of claims 1-3, and is characterized by comprising the following steps:
(1) model initialization: a certificate issuing (certification) authority CA in the federation blockchain is responsible for issuing a certificate for each new user, the certificate comprising an account ID, a public-private key pair (PK, SK); medical data such as electronic medical record of personal information of a patient, an examination report and the like are classified according to the medical data, the medical data are refined into M (name, gender, age, identification number, medical history, physical examination or laboratory sheet and medical prescription), and the M (M) is recorded as (M)1,m2,m3,m4,m5,m6,m7};
(2) Data acquisition: the data creator (medical institution) performs the revisable signature after dividing the data M into n segments and sends the signature and the original EMRs to the data owner:
(2a) dividing the electronic medical data M of the patient into n segments, namely: m ═ Mi|i=1,2,…,n};
(2b) Randomly selecting an integer
Calculating r ═ g
k(mod p);
(2c) For each subdata M of the original data MiCalculating a hash value hi=H(MiIiiiiiiiiii) 1 ≦ i ≦ 7, where CEAS is the truncation rule for the truncatable signature and T is the CEAS marker;
(2d) calculate the subdata MiSignature of δi=(hi-ar)k-1mod(p-1),1≤i≤7;
(2e) Of the output data MGlobal signature deltaFull=(CEAS‖T‖δ1‖δ2‖…‖δ7);
(2f) The data creator combines the raw medical data MiHash value hiGlobal signature deltaFullAfter the CEAS and the mark T are cascaded, the symmetric key of a doctor is used for encryption, and then the encryption key K is used for encryptiondocUsing the public key PK of the patientpatEncrypted and then sent to the patient;
(3) data storage with intercepted signatures: after receiving the medical data sent by the doctor, the data owner (patient) uses the private key SKpatEncryption key K for decrypting medical datadocThen, the original medical data M is decryptediSecond, verify the global signature deltaFullIf the data is correct, the data owner generates a revised signature (intercepting signature) and stores the revised signature and the ciphertext of the original data into the cloud, and the steps are as follows:
(3a) for each sub-data M of the data MiCalculate hi=H(MiII T II I) of CEAS, wherein 1 ≦ i ≦ 7;
(3b) from global signatures δ
FullTo obtain delta
iAnd verify
Whether or not it is established, i.e.
If signature delta
FullIf the verification is passed, executing the following steps, otherwise, returning to failure;
(3c) intercepting the signature of the corresponding subdata by the patient according to CEAS specified by the doctor and the will of the patient;
(3d) the data owner encrypts and stores the intercepted medical data and the corresponding intercepted signature into cloud storage;
(4) data publishing with improved DPOS consensus mechanism: after the patient stores the medical data in the cloud storage, the patient needs to store the metadata, the hash value and the signature in a federation blockchain, and sets access authority by using an intelligent contract, wherein the steps are as follows:
(4a) the patient adopts a unique IDpat(independent of individual identity privacy) register and log on the blockchain;
(4b) for the subdata number i e CI (M'), the patient uses his own private key SK
patFor Metadata
iHash value of the original data h
iAnd performing common digital signature with the timestamp t to obtain
(4c) Requesting to store the medical record in the blockchain, issuing a request:
(4d) the current value in the block chain network represents that the node receives the transaction request and is responsible for generating an effective block, and block consensus is carried out by using an improved DPOS (distributed DPOS consensus) mechanism;
(5) data sharing based on smart contracts: a data user submits an access application to the blockchain, and needs to provide information such as a public key, an access object, an access purpose and the like of the data user, and the data user utilizes the urls based on CP-ABE access control, namely blockchain access authority authenticationiThe EMRs can be obtained, and the integrity and validity of the original data are verified through the hash value and the signature, and the process comprises the following steps:
(5a) CP-ABE access control;
(5b) medical data sharing in cloud storage;
(5c) data user verification signature deltaExtTo ensure the required raw medical data MiIf the intercepted signature passes verification, the fact that the original medical data are not tampered is indicated, the user can conduct access operation to obtain shared data, and if the verification fails, the user informs a cloud storage manager of the message to conduct processing.
The invention effectively realizes the control of ownership and access authority of the patient on the personal medical data and the safe storage and sharing of the sensitive medical data.
Compared with the prior art, the invention has the following advantages:
1) safety:
the medical data storage of the invention utilizes standard symmetric encryption and asymmetric encryption technologies, and has good resistance to the traditional security attack. For example, through an encryption and authentication mechanism, an attacker cannot open encrypted information through brute force cracking for a short time; the addition of the time stamp is well resistant to replay attacks; in the communication process, the communication node uses a digital signature technology to resist the attack of an attacker pretending to be a legal entity or forging false information; any entity can not forge the digital signature of other entities under the condition that the private key of the signer does not exist; a legitimate entity can verify the sender of the received message by digital signature techniques and verify that the received message has been altered. These techniques can ensure the authenticity and validity of electronic medical data.
2) Reliability:
authoritativeness: the invention is based on the alliance blockchain infrastructure, and the consensus process is controlled by part of the preselected nodes instead of all the nodes of the whole network, thereby greatly reducing the network overhead. Furthermore, with improved DPOS consensus, the selected medical institutions have influence and authority in ranking, thereby ensuring reliability of data sharing.
Tamper-proofing: all information in the federation chain is public and non-tampered, and each data block is stamped with a time stamp and arranged according to a certain time sequence. The distributed consensus mechanism enables trust to be built on the basis of cryptographic algorithms without relying on a trusted third party. Once written into the healthcare chain, the data cannot be tampered with because each tile holds the hash of its previous tile, which is almost impossible if it takes at least over 51% of the total network to modify the data of a tile. The hash of the original data of the medical record is saved in the medical chain of the invention, and any change of the original data can cause the change of the hash value, so that the non-tamper property of the medical record is directly ensured.
3) Privacy protection:
because the electronic medical record of the patient contains many sensitive information, such as name, identification card number, special illness state, etc., the electronic medical record does not need to be publicized. Due to the following technical characteristics, the privacy of the invention is well protected.
Anonymous trading: each node on the blockchain participates anonymously in transactions, and the user may use a different public and private key pair for each transaction. In addition, the consensus mechanism of the blockchain solves the trust problem in the peer-to-peer network, so that data transmission and even transaction can be anonymous, and only the blockchain address of the user needs to be known.
Secondly, cloud storage: the original data of the medical record are encrypted and stored in the cloud storage. In this way, the problem of limited blockchain storage capacity is solved while also greatly reducing the disclosure of raw medical data in the blockchain and securely storing the data.
Third, the signature can be intercepted: the invention adopts the signature which can be intercepted when a doctor signs medical data, and aims to facilitate the patient to intercept the sensitive data of the patient and obtain the effective signature without multiple interactions. The introduction of the signature can be intercepted, reducing the transmission of sensitive data from the beginning. Like ordinary digital signatures, any entity cannot forge the digital signatures of other entities without the private key of the signer.
4) And (4) safe storage:
the security of the storage of data is an important feature of the chain of the medical alliance, in which case the user has ownership of his own medical record and has full control over its use. The process from the production of the data to the use of the data is secure.
The patient encrypts and stores the original data and the signature in the cloud storage under the chain, and the distributed characteristic of the cloud storage ensures the safety of data storage.
And secondly, public information (metadata, hash values and access authority) of the medical records is stored in the block chain and cannot be modified by public. The blockchain is a safe and reliable distributed database, so that the risk that a centralized mechanism is easily attacked to cause data leakage is avoided. And each node on the blockchain stores the same data, so that the single-point attack cannot influence the whole system. The decentralized storage system has good expandability and reliability.
The data sharing authority is predefined in the intelligent contract by the user, only authorized users or mechanisms can access the data, and the access transaction can be recorded. Due to the presence of the time stamp, violations of rules or malicious use of the data can be traced. The user has the right to revoke his access rights and have him accept the audit.
Detailed Description
Embodiments and effects of the present invention will be described in detail below with reference to the accompanying drawings.
Example 1
At present, paper medical records are mainly used and stored by a medical institution with centralized characteristics, so that patients are difficult to obtain required medical records and medical history conditions, and the medical quality is influenced; data cannot be shared among medical institutions, which is not beneficial to medical research; traditional centralized networks are vulnerable to attacks, resulting in data leakage; the case history data is tampered by people randomly and frequently; the privacy protection of the sensitive information of the patient can not be obtained, and the like. To this end, the invention provides a model for safe storage and sharing of electronic medical records based on a block chain.
The invention relates to a safe storage and sharing model of electronic medical records based on a block chain, which comprises a data creator, a data owner, cloud storage, an alliance block chain and a data user, wherein the data creator firstly sends the electronic medical records of a patient to the data owner; the data owner intercepts data according to an intercepting rule, encrypts the data and stores the encrypted data in a cloud end, namely cloud storage; the data owner distributes the citation of the medical data stored in the cloud in the alliance block chain, and sets access authority by using an intelligent contract; and after the data user receives the access application of the alliance block chain, the data user decrypts the data in the cloud storage to obtain the data to be accessed.
The data creator is a medical institution or doctor, the data owner is a patient, and the data user is a doctor or medical institution or institute or other person desiring to obtain the data.
From the structure of the model, a data creator serves as a data source of the whole model and has a unidirectional data flow direction pointing to a data owner; as a block chain of the alliance of the whole model control center, the block chain has close relation with other four important nodes, namely other four components of the model: the data owner sends a release request and an intelligent contract access authority of the medical record data to the block chain of the alliance, after the block chain of the alliance passes the request, an intelligent contract is set, and a one-way relation that the data owner points to the block chain of the alliance exists between the block chain of the alliance and the intelligent contract; and the data user (including a data creator) sends a data stream of the information requested to be accessed to the alliance block chain, the alliance block chain feeds back the link of the data at the cloud end to the data user after being checked, and the data user and the alliance block chain are in a bidirectional link relationship. The cloud stores medical data of patients, references of the medical data of the patients stored in the block chain of the alliance and other control information, and the cloud and the data link layer of the block chain of the alliance have no direct data flow direction, but have reference connection on the network layer. The cloud end is used as the cloud end of the whole model storage center, the data owner points the encrypted medical data to the cloud end, the cloud end can return the link of the medical data to the data owner, and the data user and the cloud end are in a bidirectional link relation; the data user accesses the cloud end through the data access link returned by the block chain of the alliance, the cloud end can return the medical data to the data user, and the data user and the cloud end are in a bidirectional link relationship.
Example 2
The overall structure of the model for the safe storage and sharing of the electronic medical records based on the block chain is the same as that of the embodiment 1, in the invention, the block chain of the alliance is a control center of the whole model, wherein a certificate issuing (certification) authority CA is responsible for issuing a certificate for each new user (a data creator or a data owner), the certificate comprises an account ID and a public and private key pair (PK, SK), and in order to realize the sharing of the medical data, the data owner firstly needs to register and log in on the block chain of the alliance by adopting a unique identity account number of the data owner; because the storage capacity of the block chain of the alliance is limited, the personal medical records are stored in the cloud storage in an encrypted manner, only references of the data in the cloud storage, namely metadata, hash values and signatures, are reserved in the block chain, and a patient uses the private key SK of the patientpatFor MetadataiHash value of the original data hiAnd a timestamp t, generating a request to store the medical record in the blockchain. The invention adopts an improved DPOS consensus mechanism to carry out block consensus, wherein a current value represents a node RPN to verify each transaction, the current value represents the node RPN in the invention refers to a representative of an authoritative medical institution with high medical level and good credit, the current value represents the node RPN and integrates all collected effective data in the period of time into a data set, then a digital signature of the current value and a hash value of a new data block are attached to form a new data block, and a newly generated data block is broadcasted to other auditing nodes ATNs to be verified, the auditing nodes ATNs in the invention refer to other authoritative medical institutions with high medical level, good credit and being capable of being represented, after each ATN receives the data block, the validity and correctness of the data block are verified through information such as block hash value and digital signature sent by the RPN, and the result of the auditing is attached to the digital signature of the current value and encrypted by a public key of the RPN and sent back to the current value representing point, and the RPN checks the audit replies of all ATNs, and if the number of tickets passing the audit exceeds 51%, the block generation is considered to be successful. The RPN integrates the data block with the public key set of the ATNs of the audit node and the corresponding digital signature and sends the integrated data block to all nodes, and all nodes update data to form an effective block; and setting an intelligent contract according to the access authority set by the data creator.Based on CP-ABE access control, namely block chain access authority authentication, when a data user wants to obtain medical data of a patient, an access application is submitted to a block chain of a alliance, the access application comprises information of a public key of the data user, an access object, an access purpose and the like, if the access application passes, whether preset access conditions of the patient are met is judged according to identity information of a data visitor, if the preset access conditions are met, an intelligent contract is triggered to decrypt metadata by using a private key provided by the patient, ciphertext information of the metadata encrypted by the public key of the data user is returned, medical record data are obtained by using a link of data storage, and the integrity and the validity of original data are verified through a hash value and a signature.
Example 3
The overall structure of the model for safe storage and sharing of the electronic medical record based on the blockchain is the same as that of the embodiment 1-2, and all the quotes of the medical record data on the alliance blockchain contain different time stamps and encryption keys, namely, for the medical subdata, a patient uses the private key SK of the patient
patFor Metadata
iHash value of the original data h
iAnd performing common digital signature with the timestamp t to obtain
And then issuing a request to the alliance blockchain, and adopting an improved DPOS consensus mechanism to accept the transaction request and carry out blockchain consensus on the current value representative nodes in the blockchain network. When the value represents the node RPN, each transaction is verified, and all the collected effective data in the period is integrated into a data set (denoted as M)
setAnd { Req | t }), the new data block is formed by attaching the digital signature of the new data block and the hash value of the new data block, and the newly generated data block is broadcasted to other auditing nodes ATNs to be verified. After each ATN receives the data block, the validity and the correctness of the data block are verified through information such as the block hash value, the digital signature and the like sent by the RPN, the audit Result (Result) of the ATN is attached to the digital signature of the ATN, and the audit Result (Result) is encrypted by the public key of the RPN and then is sent to the current value representative node as a Reply (Reply). The RPN checks the audit replies of all ATNs, and if the number of tickets passing the audit exceeds 51 percent, the RPN considers that the tickets pass the audit repliesThe block generation is successful. And the RPN integrates the data block with the public key set of the ATNs of the audit node and the corresponding digital signature and sends the integrated data block to all nodes, and all nodes update data. Thereafter, the data blocks will be stored in the federation chain in chronological order, with the value representing the reward that both the node and the node participating in the audit will receive credit. After the request is passed, the patient stores a reference to the medical data on a distributed server. Because the accounting process adopts a series of data encryption, signature and integrity verification, the medical record data stored in a distributed mode cannot be tampered randomly, and therefore the model has the characteristics of decentralization, tamper resistance, high safety and the like.
Example 4
The overall construction of the model for secure storage and sharing of electronic medical records based on blockchains is the same as in examples 1-3,
the invention is also a block chain based method for secure storage and sharing of electronic medical records. The method is used on the model of safe storage and sharing of the electronic medical record based on the block chain, and referring to fig. 1, comprises the following steps:
(1) model initialization: a certificate authority CA in the block chain of the alliance is responsible for issuing a certificate for each new user, wherein the certificate comprises an account ID and a public and private key pair (PK, SK), each new user with encryption and decryption requirements, namely a data creator, a data owner and a data user, needs to be initialized to obtain the own public and private key pair (PK, SK), and in addition, a symmetric encryption key may be needed. The invention adopts the existing signature algorithm capable of intercepting to design the signature, and the use of the digital signature technology can resist the attack of an attacker pretending to be a legal entity or forging false information. The data creator performs the following operations: key generation algorithm GK: let p be one such that in the multiplication loop group Z
pThe prime numbers that are difficult to handle by the discrete logarithm problem,
is a primitive element, H is a hash function, and an integer is randomly selected
Calculating v ═ g
a(mod p), the public key PK of the signer
docPrivate key SK { p, g, v }, and
doc=a。
(2) data creator obtains data: the data creator (medical institution) divides the medical data M into n segments and executes the revisable signature and sends the signature and the original electronic medical record EMRs to the data owner:
(2a) when a patient sees a doctor in a hospital or is examined in medical institutions such as the hospital, a doctor can generate medical data such as an electronic medical record containing personal information of the patient, an examination report and the like for the patient, and a data creator divides the electronic medical data M of the patient into n sections, namely: m ═ Mi1,2, …, n }, including name, sex, age, identification number, medical history, physical examination or laboratory sheet, medical prescription, similar medical record and other medically important information. N here can be flexibly designed according to actual situations and requirements.
(2b) The data creator randomly selects an integer
Calculating r ═ g
k(mod p)。
(2c) Data creator for each sub-data M of original data MiCalculating a hash value hi=H(MiIiiiiiiii) 1 ≦ i ≦ 7, where CEAS is the truncation rule for the truncatable signature, T is the CEAS flag, and the truncation rule is the rule that the physician maximally preserves the validity of the patient medical data without removing the patient's privacy, such as: the sex and age of a patient are important reference factors influencing a part of pathology, so that a data creator needs to set the sex and age as an object to be intercepted, and the contact way of the name, identification card information, a telephone and the like of the patient is privacy of the patient, and the contact way has no great relation to medical data and can be set as a non-intercepted object. The interception signature of the CEAS can maximally protect the privacy of the patient on the premise of ensuring the validity of the medical data.
(2d) The data creator calculates each sub-data MiThe signature of (a), namely: deltai=(hi-ar)k-1mod(p-1),1≤i≤7。
(2e) The data creator obtains the global signature δ of the complete data MFull=(CEAS‖T‖δ1‖δ2‖…‖δ7)。
(2f) The data creator combines the raw medical data MiHash value hiGlobal signature deltaFullAfter the CEAS and the mark T are cascaded, the symmetric key of a doctor is used for encryption, and then the encryption key K is used for encryptiondocUsing the public key PK of the patientpatAfter encryption, the data are sent to the patient together, namely:
the medical data is symmetrically encrypted, and the key for symmetric encryption is asymmetrically encrypted. An attacker cannot open the encrypted information through brute force cracking in a short time, so that the medical data has good resistance to the traditional security attack.
(3) Data storage with intercepted signatures: after receiving the medical data and encrypted key from the data creator, the data owner (patient) uses its own private key SKpatEncryption key K for decrypting medical datadocThen, the original medical data M is decryptediSecond, verify the global signature deltaFullIf the data is correct, the data owner generates a revised signature (an intercepted signature) and stores the intercepted signature and the ciphertext of the original data into the cloud, and the steps are as follows:
(3a) decrypting each subdata M of the data M by the data owneriThen, the hash value h of each subdata is calculatedi=H(MiII | T | i) of CEAS, wherein 1 ≦ i ≦ 7.
(3b) From global signatures δ
FullEach subdata M is obtained
iIs a signature delta
iAnd verify
Whether or not the above-mentioned conditions are satisfied,
namely, it is
If signature delta
FullIf the verification is passed, the following steps are executed, otherwise, failure is returned. The data owner can verify the identity of the sender of the received medical data and verify whether the obtained medical data is modified through a digital signature technology, and the technology can guarantee the authenticity and validity of the electronic medical data.
(3c) The patient follows the interception rules CEAS prescribed by the doctor and his privacy protection will, such as: the patient wants to protect his name and address, which in turn satisfies the interception rules CEAS, so he can hide this part of the data. The signature of the corresponding subdata is intercepted, so that the patient can conveniently protect the sensitive data of the patient, and the effective signature can be obtained without multiple interactions. The introduction of the signature can be intercepted, reducing the transmission of patient sensitive data from the outset.
(3d) The data owner encrypts and stores the intercepted medical data and the corresponding intercepted signature into cloud storage, and the original medical data are encrypted and stored in the cloud storage under the link, so that a foundation is laid for sharing the medical data. In this way, the problem of limited blockchain storage capacity is solved, meanwhile, the disclosure of original medical data in the blockchain is greatly reduced, the data is stored safely, and the safety of data storage is ensured due to the distributed characteristic of cloud storage.
(4) Data publishing with improved DPOS consensus mechanism: after the medical data is stored in the cloud by the patient, in order to really realize the sharing of the medical data safely and reliably, the patient needs to store the quote of the medical data, namely metadata, a hash value and a signature in a federation block chain, and set the access right by using an intelligent contract. All information in the federation chain is public and non-tampered, and each data block is stamped with a time stamp and arranged according to a certain time sequence. The distributed consensus mechanism enables trust to be built on the basis of cryptographic algorithms without relying on a trusted third party. Once written into the federation blockchain, data cannot be tampered with because each chunk holds the hash of its previous chunk, which is almost impossible if at least over 51% of the network effort is required to modify the data of a chunk. The hash of the original data of the medical record is saved in the medical chain of the invention, and any change of the original data can cause the change of the hash value, so that the non-tamper property of the medical record is directly ensured. The steps of data publishing in the model are as follows:
(4a) the data owner adopts the unique ID after registering on the block chain of the alliancepat(independent of privacy of individual identity) logs on to the federation blockchain.
(4b) The data owner has the sub-data number i e CI (M'), and the patient uses the private key SK of the patient
patFor Metadata
iHash value of the original data h
iDigitally signing with the timestamp t to obtain
Wherein the addition of the time stamp is well resistant to replay attacks.
(4c) The data owner requests that a reference to the medical data be stored in the blockchain, issues a request Req:
the block chain is a safe and reliable distributed database, and the risk of data leakage caused by the fact that a centralized mechanism is easily attacked is avoided. And each node on the block chain stores the same data, so that the single-point attack does not influence the whole system, and the decentralized storage system has good expandability and reliability.
(4d) The present invention is based on the alliance blockchain infrastructure, and the consensus process is controlled by part of the preselected nodes, not all nodes of the whole network, thereby greatly reducing the network overhead. The consensus mechanism of the blockchain solves the trust problem in the peer-to-peer network, so that data transmission and even transaction can be anonymous, and only the blockchain address of the user needs to be known. The invention adopts an improved DPOS consensus mechanism to carry out block consensus, and the selected medical institution has influence and authority on ranking, thereby ensuring the reliability of data sharing
(5) Data sharing based on smart contracts: along with the social progress, people pay more and more attention to their health, and besides the progress of medical technology, the improvement of the medical level of the society is also the sharing of medical data which cannot be ignored. The medical data is the record of pathological conditions, treatment conditions and treatment history of the patient, and has important reference value for further treatment of the patient, medical research of the pathological conditions by scientific research institutions and treatment of other patients with the same pathological conditions or similar pathological conditions, so that the importance of data sharing is self-evident. A data user needs to acquire medical data of a patient, submits an access application to a blockchain, provides information such as a public key, an access object and an access purpose of the data user, authenticates access authority of the blockchain based on CP-ABE access control, and utilizes a data access link urliThe EMRs of the electronic medical record data can be obtained, and the integrity and the validity of the original data are verified through the hash value and the signature, and the process comprises the following steps:
(5a) the block chain access authority is authenticated, the data sharing authority is completely predefined in an intelligent contract by a data owner, only authorized users or organizations can access the data, and each access transaction is recorded. Due to the existence of the time stamp, the behavior of violating the rules or maliciously using the data can be traced, and the user has the right to revoke the access right and accept the audit.
(5b) Medical data sharing in cloud storage, the identity of the data user may be the doctor or nurse responsible for the treatment of the data creator, a scientific research institution for medical research, and a patient with the same or similar pathology in order to assist in their treatment.
(5c) The data user needs to verify the signatureδExtTo ensure the required raw medical data MiIf the intercepted signature passes verification, the original medical data M is indicated to be not tampered, the user can carry out access operation to obtain shared data, and if the intercepted signature fails verification, the original medical data M is indicated to be not tamperediThe validity and integrity of the data are destroyed, and the data user informs the cloud storage manager of the message for processing.
The medical data is sent and stored, the reference of the medical data is stored in the alliance block chain and other processes, and the symmetric encryption technology and the asymmetric encryption technology are utilized, so that the traditional security attack resistance is good. During data transmission, the communication node uses a digital signature technology to resist the attack of an attacker pretending to be a legal entity or forging false information. Because the accounting process of the block chain of the alliance adopts a series of data encryption, signature and integrity verification, the medical record data stored in a distributed mode cannot be tampered randomly. These techniques can ensure the authenticity and validity of electronic medical data. In addition, the implementation of the intelligent contract effectively guarantees the access ownership of the data owner to the medical data of the data owner. In a word, the safe storage and sharing model of the electronic medical record based on the block chain can effectively ensure the safe storage and sharing of the data medical treatment.
Example 5
The overall structure of the model for safe storage and sharing of the electronic medical record based on the block chain is the same as that of the embodiment 1-4, in the step (3c), the patient intercepts the signature of the corresponding subdata according to the CEAS specified by the doctor and the will of the patient, and the process is carried out according to the following steps:
(3c1) the interception subset CI (M') is constructed according to the CEAS specified by the physician.
(3c2) Generating an intercepted sub data set M '{ M ═ according to the intercepted subset CI (M')i|i∈CI(M′)}。
(3c3) For each i ∈ CI (M'), from δFullTo take out deltai。
(3c4) Generating a truncated signature deltaExt=(CEAS‖CI(M′)‖T‖δ1‖δ2‖…‖δf) Wherein δiAnd (i ═ 1,2, …, f) is the signature of the corresponding child data in CI (M').
The patient intercepts the signature of the corresponding subdata according to the intercepting rule CEAS specified by the doctor and the intention of the patient, and the protection of the sensitive data of the patient on the patient is realized to the maximum extent on the premise of meeting the intercepting rule CEAS.
Example 6
The overall structure of the model for safe storage and sharing of electronic medical records based on the block chain is the same as that of the embodiment 1-5, an improved DPOS consensus mechanism is adopted in the step (4d) for block consensus, and the original DPOS adopting the share authorization certification mechanism is improved into the DPOS consensus mechanism aiming at the medical field. The method comprises the following specific steps:
(4d1) when the value represents the node RPN, each transaction is verified, and all the collected effective data in the period is integrated into a data set (denoted as M)setAnd (Req | t }), attaching the digital signature of the node and the hash value of the new data block to form a new data block, and broadcasting the newly generated data block Records to other auditing nodes ATNs to be verified, wherein the process is specifically expressed as follows:
(4d2) after each ATN receives the data block, the validity and the correctness of the data block are verified through information such as a block hash value, a digital signature and the like sent by the RPN, an audit Result (Result) of the ATN is attached to a digital signature of the ATN, and the audit Result (Result) is encrypted by a public key of the RPN and then sent to a current value representative node as a Reply (Reply), wherein the process is specifically expressed as follows:
(4d3) the RPN checks the audit replies of all ATNs, if the number of tickets passing the audit exceeds 51%, the block is considered to be successfully generated, the RPN integrates the data block together with the public key set of the ATNs of the audit node and the corresponding digital signature and sends the integrated data block to all nodes, all the nodes update data, and then the data block is stored in a alliance chain in time sequence, the value represents that the nodes and the nodes participating in the audit all obtain the reward of credit points, and the process is specifically expressed as follows:
the invention adopts an improved DPOS consensus mechanism to carry out block consensus, and improves the original DPOS adopting a share authorization certification mechanism into a DPOS consensus mechanism aiming at the medical field. The medical institutions selected by the invention have influence and authority in ranking, and the reliability of data sharing is ensured.
Example 7
The overall structure of the model for safe storage and sharing of electronic medical records based on the blockchain is the same as that in embodiments 1 to 6, and the access authority authentication of the blockchain in the step (5a) specifically comprises the following steps:
(5a1) a node N initiates a medical data sharing request transaction Req to a block chain, wherein the request contains a public key PK of the node NNObject account IDpatData access destination obj, access content MiAnd the time t, when the node N identity is checked by the value node, the transaction information is recorded into the block chain after the verification is passed, and the process is specifically expressed as follows:
N→RPN:Req=(PKN||IDpat‖obj‖Mi‖t),
note that: here MiM representing node N requesting access to patient onlyiData, if part of the data is accessed, is represented as (M)i1,2, …), denoted by M if a node wants to access all the data for that patient.
(5a2) Executing an intelligent contract: the intelligent contract is automatically executed, whether preset access conditions of patients are met is judged according to the identity information of the node N, and if the preset access conditions are met, the patient ID for the intelligent contract is triggeredpatThe provided private key decrypts the metadata and returns it to the secret that encrypted the metadata using the public key of node NText information:
(5a3) extracting data storage positions: after receiving the ciphertext information, the node N decrypts the ciphertext information by using the private key thereof to obtain the MetadataiAnd extracting the storage location urls thereiniAnd cloud removing, storing and searching the required original data.
According to the block chain access authority authentication method, the block chain access authority authentication, namely the data sharing authority, is predefined in an intelligent contract by a data owner, and only a user or an organization (a doctor, a nurse, a patient or a medical organization) authorized by the data owner can access data, so that the protection of the data owner on the medical privacy of the owner and the control of the data access authority are effectively guaranteed.
Example 8
The overall structure of the block chain-based electronic medical record secure storage and sharing model is the same as that in embodiments 1 to 7, and the specific implementation steps of the process of encrypting and storing the medical data and the corresponding intercepted signature to the cloud storage by the data owner in the step (3d) are as follows:
(3d1) user randomly generating document key Kpat。
(3d2) Running a symmetric encryption algorithm E, and using a secret key K for the subdata number i epsilon CI (M
patEncryption (M)
i‖h
iII) t), wherein t is a time stamp, and the sub-data ciphertext is obtained
(3d3) Running symmetric encryption algorithm E, K is encrypted using master key UMKpatObtain a key ciphertext EUMK(Kpat)。
(3d4) Cipher text of data
The signature delta can be intercepted
ExtAnd key ciphertext E
UMK(K
pat) By medical data categoryUploading the data to cloud storage, and returning the data to a storage position urls and a time stamp t corresponding to the patient, wherein the two form Metadata
i(t | urls), that is, the data uploaded by the user to the cloud storage is:
the invention uses the symmetric encryption algorithm and the asymmetric encryption algorithm, and can effectively ensure that the medical data is safely protected in the storage process.
Example 9
The overall structure of the model for safe storage and sharing of the electronic medical record based on the blockchain is the same as that of the embodiment 1-8, and the specific steps of sharing the medical data in the cloud storage in the step (5b) are as follows:
(5b1) data consumers passing through storage locations urls
iRetrieve
E
UMK(K
pat)、δ
Ext。
(5b2) The data consumer runs symmetric algorithm E, decrypts E using master key UMKUMK(Kpat) To solve the encryption key Kpat。
(5b3) The data consumer runs a symmetric algorithm E, using a secret key K
patDecryption
Obtaining raw medical data (M)
i‖h
iT) and truncated signature δ
Ext。
The invention uses the symmetric encryption algorithm, and can effectively ensure that the medical data is safely protected in the reading process.
Example 10
The overall structure of the model for safe storage and sharing of electronic medical record based on block chain is the same as that of the embodiment 1-9, and the signature delta for verifying the data user in the step (5c)ExtTo ensure the required raw medical data MiThe specific steps of effectiveness and completeness are as follows:
(5c1) The verifier verifies first
If yes, executing the following steps, otherwise, returning failure, and indicating the medical data M
iThe effectiveness and integrity of the system is compromised.
(5c2) For each medical subdata sequence number i belongs to CI (M'), h is calculated
i=H(M
iIiiiiiiii) of CEAS by verifying
If true, to verify the truncated signature delta
ExtThe correctness of the operation.
The invention uses the digital signature, and can effectively verify the validity and the integrity of the read medical data.
Embodiments and effects of the present invention will be further described below with reference to the accompanying drawings.
Example 11
The overall construction of the model for secure storage and sharing of electronic medical records based on blockchains is the same as in examples 1-10,
referring to fig. 1, the implementation steps of the invention are as follows:
step 1, system initialization: the certificate authority CA is responsible for issuing certificates for each new user, including an account ID, a public and private key pair (PK, SK). When a patient is seen in a hospital or examined in a medical institution such as a hospital, a doctor generates medical data such as an electronic medical record and an examination report containing personal information of the patient for the patient, classifies the medical data according to the medical data, and refines the medical data into M ═ name, gender, age, identification number, medical history, physical examination or laboratory sheet and medical prescription }, wherein the medical data are divided into 7 types, namely n is 7 and M is { M ═ 7 in the example1,m2,m3,m4,m5,m6,m7}。
The invention adopts the existing signature algorithm capable of intercepting to design the signature, and a data creator executes the following operations: key generation algorithm GK: let p be one such that in a multiplication loop groupZ
pThe prime numbers that are difficult to handle by the discrete logarithm problem,
is a primitive element. Randomly selecting integers
Calculating v ═ g
a(mod p), the public key PK of the signer
docPrivate key SK { p, g, v }, and
doc=a。
step 2, data acquisition: the data creator performs the revisable signature after dividing the data M into 7 segments.
Referring to fig. 2, the data acquisition is specifically implemented as follows:
(2a) randomly selecting an integer
Calculating r ═ g
k(mod p)。
(2b) For each subdata M of the original data MiCalculating a hash value hi=H(Mi‖CEAS‖T‖i),1≤i≤7。
(2c) Calculate the subdata MiSignature of δi=(hi-ar)k-1mod(p-1),1≤i≤7。
(2d) Global signature delta of output data MFull=(CEAS‖T‖δ1‖δ2‖…‖δ7)。
And 3, data storage: and the data owner generates a revised signature and stores the revised signature and the original data ciphertext into the cloud. After receiving the medical data sent by the doctor, the patient uses the private key SKpatEncryption key K for decrypting medical datadocThen, the original medical data M is decryptediFirst, the global signature δ is verifiedFullThe correctness of (2):
referring to fig. 3, the specific implementation steps of the signature verification of the received data are as follows:
(3a) for each sub-data M of the data MiCalculate hi=H(MiII | T | i) of CEAS, wherein 1 ≦ i ≦ 7.
(3b) From global signatures δ
FullTo obtain delta
iAnd verify
Whether or not the above-mentioned conditions are satisfied,
If signature deltaFullIf the verification is passed, the following steps are executed, otherwise, failure is returned.
(3c) The patient intercepts the signature of the corresponding subdata according to CEAS specified by the doctor and the will of the patient.
Referring to fig. 4, the specific implementation steps of the data interception signature process are as follows:
(3c1) the interception subset CI (M') is constructed according to the CEAS specified by the physician.
(3c2) Generating an intercepted sub data set M '{ M ═ according to the intercepted subset CI (M')i|i∈CI(M′)}。
(3c3) For each i ∈ CI (M'), from δFullTo take out deltai。
(3c4) Generating a truncated signature deltaExt=(CEAS‖CI(M′)‖T‖δ1‖δ2‖…‖δf) Wherein δiAnd (i ═ 1,2, …, f) is the signature of the corresponding child data in CI (M').
(3d) And the data owner encrypts and stores the intercepted medical data and the corresponding intercepted signature into a cloud storage, respectively stores the medical data and the corresponding intercepted signature into corresponding folders according to categories, and adopts a basic ciphertext access control scheme (BCAC).
Referring to fig. 5, the specific implementation steps of data storage are as follows:
(3d1) user randomly generating document key Kpat。
(3d2) Running a symmetric encryption algorithm E, and using a secret key K for the subdata number i epsilon CI (M
patEncryption (M)
i‖h
iIit), where t is the time stamp, resulting in the ciphertext
(3d3) Running symmetric encryption algorithm E, K is encrypted using master key UMKpatObtain the ciphertext EUMK(Kpat)。
(3d4) Will be provided with
δ
Ext,E
UMK(K
pat) Sequentially uploading the medical data to cloud storage according to the medical data category, returning the medical data to a corresponding storage position urls and a time stamp t of a patient, and forming Metadata
i═ t (urls |). Namely, the data uploaded to the cloud storage by the user is as follows:
and 4, data release: after the intercepted medical data is stored in the cloud storage by the patient, in order to realize the sharing of the medical data, the patient only needs to store the metadata, the hash value and the signature into the union block chain, and set the access right by using the intelligent contract.
(4a) The patient adopts a unique IDpat(independent of privacy of personal identity) is registered and logged on the blockchain.
(4b) For the subdata number i e CI (M'), the patient uses his own private key SK
patFor Metadata
iHash value of the original data h
iAnd performing common digital signature with the timestamp t to obtain
(4c) The medical record is requested to be stored in the blockchain. Issuing a request:
(4d) the present invention adopts an improved DPOS consensus mechanism to carry out block consensus, and the specific steps are as follows:
(4d1) when the value represents the node RPN, each transaction is verified, and all the collected effective data in the period is integrated into a data set (denoted as M)setAnd { Req | t }), the new data block is formed by attaching the digital signature of the new data block and the hash value of the new data block, and the newly generated data block is broadcasted to other auditing nodes ATNs to be verified. The above process is specifically described as follows:
(4d2) after each ATN receives the data block, the validity and the correctness of the data block are verified through information such as the block hash value, the digital signature and the like sent by the RPN, the audit Result (Result) of the ATN is attached to the digital signature of the ATN, and the audit Result (Result) is encrypted by the public key of the RPN and then is sent to the current value representative node as a Reply (Reply). The above process is specifically described as follows:
(4d3) and the RPN checks the audit replies of all ATNs, and if the number of tickets passing the audit exceeds 51%, the block generation is considered to be successful. And the RPN integrates the data block with the public key set of the ATNs of the audit node and the corresponding digital signature and sends the integrated data block to all nodes, and all nodes update data. Thereafter, the data blocks will be stored in the federation chain in chronological order, with the value representing the reward that both the node and the node participating in the audit will receive credit. The above process is specifically described as follows:
step 5, data sharing: the data user submits an access application to the blockchain, and the public key, the access object, the access destination and other information of the data user are provided. Utilizing urls based on CP-ABE access controliThe EMRs are obtained and passedThe hash value and signature verify the integrity and validity of the original data. The process comprises the following steps:
(5a) blockchain access rights authentication (CP-ABE access control):
(5a1) a node N initiates a medical data sharing request transaction Req to a block chain, wherein the request contains a public key PK of the node NNAccess object account IDpatData access destination obj, access content MiAnd the time t, when the node N identity is checked by the value node, the transaction information is recorded into the block chain after the verification is passed. The above process is specifically described as follows:
N→RPN:Req=(PKN||IDpat||Metadatai||Mi||t)
note that: here MiM representing node N requesting access to patient onlyiData; if part of the data is accessed, the data is expressed as (M)i1,2, …); if the node wants to access all the data of the patient, it is denoted by M.
(5a2) Executing an intelligent contract: the intelligent contract is automatically executed, whether preset access conditions of patients are met is judged according to the identity information of the node N, and if the preset access conditions are met, the patient ID for the intelligent contract is triggeredpatThe provided private key decrypts the metadata and returns to the ciphertext information that encrypted the metadata using the public key of node N:
(5a3) extracting data storage positions: after receiving the ciphertext information, the node N decrypts the ciphertext information by using the private key thereof to obtain MetadataiAnd extracting the storage location urls thereiniAnd cloud removing, storing and searching the required original data.
(5b) Medical data sharing in cloud storage:
(5b1) by storing the locations urls
iRetrieve
E
UMK(K
pat)、δ
Ext。
(5b2) Running symmetric algorithm E, decrypting E using master key UMKUMK(Kpat) To solve the encryption key Kpat。
(5b3) Running symmetric algorithm E, using secret key K
patDecryption
Obtaining raw medical data (M)
i‖h
iT) and truncated signature δ
Ext。
(5c) Data user verification signature deltaExtTo ensure the required raw medical data MiEffectiveness and integrity of (c):
(5c1) the verifier verifies first
And if so, executing the following steps, otherwise, returning to failure.
(5c2) For each i ∈ CI (M'), calculate h
i=H(M
iIiiiiiiii) of CEAS by verifying
If true, to verify the truncated signature delta
ExtThe correctness of the operation.
If the intercepted signature is verified, indicating that the original medical data has not been tampered with, the user may perform his specific access operation. If the verification fails, the user may notify the cloud storage manager of the message for processing.
In summary, the model and the method for safely storing and sharing the electronic medical record based on the blockchain disclosed by the invention mainly solve the problems that the patient can control the access authority of the personal medical data and the sensitive medical data can not be safely stored and shared at the present stage. The model comprises a data creator, a data owner, cloud storage, a block chain of alliances and a data user, wherein the block chain is a control center. The scheme comprises the following steps: 1) initializing a system: the CA authority is responsible for issuing certificates for each new user, including account ID, public and private key pair (PK, SK); 2) data acquisition: the data creator divides the data M into n segments, then executes the revisable signature and sends the signature and the original EMRs to the data owner; 3) data storage: the data owner generates a revised signature and stores the revised signature and the original data ciphertext into the cloud; 4) data release: the data owner uploads information such as index ciphertext, a hash value, a signature and the like to obtain an effective block after the linkage block chain is approved; 5) data sharing: the data user submits an access application to the blockchain, and the public key, the access object, the access destination and other information of the data user are provided. And after the verification is passed, based on block chain access authority authentication, obtaining an access link of the medical data and reading the medical data at the cloud end. And verifies the integrity and validity of the original data by the hash value and the signature. The invention meets basic security requirements, reliability, privacy protection and secure storage capability, combines the cloud storage technology and the interceptable signature, realizes the secure and effective shared access of data by setting the sharing conditions through the intelligent contract by the user in the block chain of the alliance, and has strong practicability.