In blockchain-based medical applications,patient data is stored in the chain.When users access the data,data privacy and security can be guaranteed by setting data access permissions.The existing access control schemes have the following disadvantages: the granularity of access control structure is not enough,the access control structure cannot be changed dynamically when attributes are revoked,and the storage capacity on the chain is limited.In view of the above problems,this thesis proposes an improved algorithm and realizes the specific application.The HRCP-ABE algorithm is proposed,which combines the attribute-based encryption algorithm(CP-ABE)with the Advanced Encryption standard algorithm(AES),and is applied to data access control.The data is divided into high privacy data and low privacy data,and the two data are encrypted by AES algorithm respectively.Then CP-ABE algorithm is used to generate two keys to encrypt AES to generate ciphertext.In the encryption process,a prime field and four mapping tables are added to record the revocation of attributes.Reduce access control structure granularity and computing overhead.Experimental results show that HRCPABE algorithm has better encryption and decryption time,computing cost and storage cost than CP-ABE algorithm.A block chain patient data access control system based on HRCP-ABE was designed and implemented,and patient data was stored in a combination of on-chain and off-chain.The patient detailed data is stored in the interstar file system(IPFS)under the link,and the HRCPABE algorithm is used to encrypt the Hash address returned by IPFS and save it on the chain,so as to reduce the storage pressure on the chain and protect the privacy data. |