# MedChain: Efficient Healthcare Data Sharing via Blockchain
## 5 Evaluations
### Security Analysis
\]  
Without \(K_{scc}\), \(SK_{sp}\), \(SK_{nq}\), and \(SK_{pat}\), \(C\) can only get a piece of encrypted information without the decryption method. Thus, \(C\) cannot access the content of the session. The similar inference can be applied to the same replay attack between a user or a healthcare provider and a directory server. _Forward Secrecy_: An adversary may have compromised the secret key of one session section \(K_{scc}\) and tries to use it to access other sections and sessions. However, different sections share different \(K_{scc}\). Thus, the adversary cannot use the same section key to access other sections and sessions. The similar inference can be applied to the forward secrecy of \(S_{data}\). _Data Integrity_: The data in integrity analysis can be classified into on-chain data and off-chain data. The on-chain data integrity is ensured by the immutability of the blockchain [8]. The off-chain data can be further divided into healthcare data and directory information. The integrity of healthcare data is verified with the data digest stored on the blockchain. Since the data storage on blockchain is tamper-proof, users can trust the healthcare data if they pass the integrity check. On the other hand, malicious servers could tamper the directory information from an internal attack. Yet, it will not be a disaster for two reasons. First, all sensitive information is encrypted before storage. Thus, they will not be leaked out even if the directory information is tampered with. Most likely, it will result in data not found (due to ID corruption) or decryption failure (due to content corruption), and users will then be informed of it. Second, once data corruption occurs, the healthcare provider (for inventory) or the patient (for session) can easily recover the directory information. The healthcare provider can reconstruct an inventory with the data from the local legacy system, while the patient can reconstruct the corrupted session with the data from his/her inventory. Directory information reconstruction may bring additional overhead, since \(Ref\) / \(Ref_{L}\) could be lost and only be reconstructed by traversing the blockchain for the event search. Without a single point of failure, fortunately, the decentralized network structure can minimize the chance of directory information recovery by storage redundancy [41]. _Privacy protection_: Privacy protection is achieved from information encryption. In terms of P2P storage, an adversary can retrieve some directory files. However, the adversary cannot access the content of the inventories without \(S_{data}\). An adversary can also intercept some messages between healthcare providers and directory servers, learning the \(InvID\), \(PK_{pat}\), and \(PK_{sp}\). Without \(S_{data}\), however, the adversary cannot derive \(InvID\) with \(H(PK_{pat}\parallel S_{data})\), unable to associate a patient with a healthcare provider. Therefore, the location of the actual data is not exposed. Similarly, an adversary cannot learn the content of a section without \(K_{key}\), which can only be retrieved with \(SK_{sp}\), \(SK_{rq}\), and \(SK_{pat}\). In terms of blockchain, an adversary cannot access the encrypted content of the events without \(SK_{pat}\), including the patient identity \(PK_{user}\), \(PK_{rq}\), and the \(DID\)s. Therefore, the adversary cannot identify a patient from an \(Event_{DG}\) or a requester from an \(Event_{SC}\), which is unable to associate a patient with any healthcare record or diagnosis. _Non-Repudiation of Unauthorized Data Access_: In one case, an adversary may successfully retrieve and abuse some patient data without authorization. The digest in a block and the immutability property of blockchain can provide the evidence that a session, which authorizes the adversary the data access, does not exist, proving the illegality of the behavior. In another case, an adversary may access the data out of the authorized access range and deny it.