BlockChain Authenticator

Overview: 3-4 minute read

This project was developed in combination with my next project Disease Predictor and Recommender System

The biggest concern in this era is trust; No one is willing to trust anyone. The latest trend in development of trust is the BlockChain technology and we now introduce it to the medical branch. EHRs (Electronic Health Records) are the basis of storing the health records for the patients these days; however, they are not decentralised and can be easily modified or deleted by an authorized person or by a hacker easily. The base for this project is to give all the power to the patient by implementing the EHRs System on blockchain, making the records unmodifiable and un-deletable; hence showing 100% transparency with whomsoever we want to share our records.

The blockchain system encrypts the data stored in each layer with the data stored in the next layer, making it almost impossible to crack it without the key which brings me to the next technology implemented which is the public/private key system. The public/private key works like any other system, that is all the hospitals have the public key of the patient and can use it to enter the details of the patient, and the patient will have his/ herprivate key which he/ she and only he/ she can use to access his/ her data, hence making it very secure. In addition to that, I went one step further - where the doctor digitally signs the EHR with his/ her private key, so that he can be held responsible for any false advise or medicine prescribed.

  • Selected in top 3 projects in the entire university out of more than 1000.

In depth: 10 - 15 minute read

Introduction

This project was developed in combination with my next project Disease Predictor and Recommender System

The biggest concern in this era is trust; No one is willing to trust anyone. The latest trend in development of trust is the Blockchain technology and we now bring it into the medical branch. EHRs (Electronic Health Records) are the basis of storing the health records for the patients these days, but they are not decentralised and they can be modified or deleted by an authorised person or by a hacker easily. The base for this project is to give all the power to the patient by implementing the EHRs System on blockchain, making the records unmodifiable and not deletable show-ing transparency with whomsoever we want to share our records. The other part of our project is based on Machine Learning which focusses on predicting a disease based on the symptoms shown by the patient. We will be using SVM, Logistic Regression and Decision Tree algorithm to predict the disease and in the end, we will develop a voting system which takes the votes of the disease predicted by the 3 algorithms and select the majority. Then as per the disease predicted, a doctor for the same will be recommended using a recommender system.

Problem Statement

Data is one thing in this world everyone is after. The ley man is afraid to give up his personal details into the world for privacy reasons. The lay man in this world is also very busy and doesn’t has enough time to spend on his health and take care of it properly. Thus, our aim is to develop a system which is secure and also one which saves the time of the user by predicting his disease from his symptoms and recommend the most suitable doctor accordingly.

BlockChain

With the quick advancement in innovation, new creations continue creating and we should misuse the new advances to do useful for the world. The Blockchain technology centers around a conveyed record, henceforth decentralizing the information. The upside of this is in the event that one of the records is adulterated or hacked, we don't lose any information as rest of the records bolster the uncorrupted information. Blockchain additionally scrambles the following square of the chain with its forerunner, making the information unmodifiable; the star of this is insurance agencies would trust on the patient more as the entirety of his records would be original and appearing with the insurance agencies. As the Health Record will be open by the patient not at all like the current framework where the medical clinics and the specialists get to the records for the patient and every emergency clinic has a different record, thus giving a typical record of the patient for any emergency clinic.d, we do not lose any data as rest of the ledgers support the uncorrupted data. Blockchain also encrypts the next block of the chain with its predecessor, making the data unmodifiable; the pro of this is that insurance companies would trust on the patient more as all his records would be orig-inal and showing transparency with the insurance companies. As the Health Record will be accessible by the patient unlike the existing system where the hospitals and the doctors access the records for the patient and each hospital has a separate record, hence providing a common record of the patient for any hospital.

Transaction

An electronic coin is named as a gathering of computerized marks. Every holder, when he needs to exchange the coin to the following individual, carefully signs the prior exchange with the open ey of the later holder, adding all these as far as possible of the coin. The chain of proprietorship can be effectively confirmed by the representative which should be possible by just checking the marks appended in the exchange.

Proof Of Work

The verification of work is utilized to make sense of if the square has really being mined or not. It involves an esteem which when hashed with a hashing calculation, the hash starts with a required least number of zeros. The middle work required is the time required to mine a specific square which is the exponentials of the quantity of zeros compulsory and can be confirmed by executing a solitary hash. When the measure of CPU control which should be a great deal has been used to influence it to fulfill the required confirmation of-work, at that point the substance of the square can't be changed without playing out that very work once more. As the squares which arrive later are attached onto it, the work done to change the square would consolidate re-trying all the work (or mining) obstructs it which aggregates to be a great deal.

Evidence of work is additionally in charge of the blockchain to just proceed in the first or unmodified chain. The choice of which chain to choose s made by the longest chain; as that will be the chain with the most extreme verification of work used in it. On the off chance that most of the hubs in the chain are straightforward hubs, the valid chain will become the most quickly and will be certainly quicker than any contending chains. To refresh a past square, a programmer would have to mine the square he is assaulting alongside all squares which are after it and after that connect with and outperform crafted by all the legit hubs considering the way that the legitimate hubs become all around quickly; the likelihood of which is by zero.

Transparency and Privacy

As Blockchain uses Public-Private key cryptography, each user has his own pair of keys. When a transaction is made, the user can share his public key and make his transaction visible to the person with whom he shared his key. If the user wishes privacy, he can choose to keep his public key anonymous and all the other people will notice that a transaction took place. Hence giving the user full power for his transparency or privacy.

Encryption - Decryption

Rivest-Shamir-Adleman (RSA) is a public - private key cryptosystem. RSA based on the factoring problem that is the difficulty of factorizing the product of two very large prime numbers; making it almost impossible to crack. In RSA, two keys are generated that is the public and private key such that neither can be derived from one of them. The private key is kept a secret and no one else knows it but the user, on the other hand, the public key is known to anyone or everyone. During encryption, the public key is used to encrypt the document and the private key to decrypt it. For a Digital Signature, the private key is used to digitally signa document. In our App, we have two different classes a Patient and a Doctor. The size of the keys of a doctor is 2048 bits and the size of the keys of a Patient is 2048*4 bits. The size of the doctor keys is small because he will be signing data which is relatively small in size whereas the Patient will be encrypting large sized data. Whenever a patient or a doctor signs in, his public- private keys are generated, his private key is encrypted and both are stored in our database and can be accessed by the user upon login.

Implementation

The keys when generated, are stored in a database in a string format. Whenever we had to load a particular key set, The User ID was required to decrypt the private key of the user and the public key could be read directly from the database. Whenever a Doctor entered an EHR for a Patient, each block of the EHR was digitally signed by the private key of the user and then it was encrypted by the public key of the user. The encrypted data was then stored in the database. Whenever we wanted to extract data from the database to show on the user’s screen, the data was first decrypted using the private key of the user, then the digital signature of the doctor was verified and if the signature was valid, it was displayed on the screen

Results and Discussion

We successfully implemented a blockchain based EHRs on Python. There was a login / sign-up portal to login / create more doctors or users. On creation of another User or Doctor, an instance of a class was created and it was assigned the respective public and private key along with all the other basic information of the User / Doctor. If the user wanted to enter an EHR, he would first have to go to a doctor, then the doctor will sign the EHR with his private key to authenticate it; then the user will use his public key to encrypt the EHR. After that, the user will go on to add the EHR onto the blockchain.

Our application was successfully tested on the first and second application where the EHR cannot be forged which means all the EHRs on the blockchain are original and unmodified. We also tested the proof of work in our blockchain, hence making the records stored in the blockchain undeletable. This application can be extended to various other applications such as the third application stated above which is to show transparency with insurance or any other company. Another benefit could be to detect a fraud doctor; this can be achieved by having a group of professional doctors which authenticate the EHRs if the user wants them to be authenticated. In the authentication, the professional doctors hired will check why the respective medicine or test was given to the patient (the reason must be entered by the doctor who signs the EHR). If the reason given does not correspond with the test, the doctor can be sued for giving fake prescriptions.

And as the Doctor sins the EHR himself, he has no reason to deny that he did not give an unrequired or false prescription. More discussions can be made on the searching system. The current algorithm uses the user-ID or the EHR number to search for a record. Research can be done to implement a query system in a blockchain hence also increasing the speed of the search made.

Conclusion

Aiming to a trustworthy system for storing EHRs, A blockchain can be used as it meets all the requirements of the structure of a record; moreover, it also offers immutability and anonymity of the information. There is a need for this type of system as an EHR can be easily forged and people can use it to get free treatment, medicine or even use it to fake their medical holidays. Another problem is that different hospitals have different EHR for the same patient.

Our project addresses this problem by implementing it on a third party blockchain eliminating the issue regarding trust, forgery and modification. And as a third party will have all the records, the patient can use these records for all the hospitals ensuring the same EHR is used everywhere.