Abstract

Electronic Health Record (EHR) systems are a valuable and effective tool for exchanging medical information about patients between hospitals and other significant healthcare sector stakeholders in order to improve patient diagnosis and treatment around the world. Nevertheless, the majority of the hospital infrastructures that are now in place lack the proper security, trusted access control, and management of privacy and confidentiality concerns that the current EHR systems are supposed to provide. Goal. For various EHR systems, this research proposes a Blockchain-enabled Hyperledger Fabric Architecture as a solution to this delicate issue. The three steps of the suggested system are the secure upload phase, the secure download phase, and authentication. Patient registration, login, and verification make up the authentication step. The administrator grants authorization to read, edit, delete, or revoke the files following user details verification. In the secure upload phase, feature extraction is carried out first, and then a hashed access policy is created from the extracted feature. Next, the hash value is stored in an IoT-based Hyperledger blockchain. The uploaded EHR files are additionally encrypted before being stored on the cloud server. In the secure download step, the physician uses a hashed access policy to send the request to the cloud and decrypts the corresponding files. The experimental findings demonstrate that the system outperformed cutting-edge techniques. The proposed Modified Key Policy Attribute-Based Encryption performs better for the remaining 10 to 25 mb file sizes. This IoT framework compares MKP-ABE with certain efficiency indicators, such as encryption, decryption period, protection level analysis and encrypted memory use, resource use on decryption, upload time, and transfer time, which are present in the KP-ABE, the ECC, RSA, and AES. Here, the IoT device suggested requires 4008 ms for data encryption and 4138 ms for the data decryption.

1. Introduction

The basis of a happier life is good health. The subject of social interest was still on public health issues [1]. Current healthcare services are technologically complicated and expensive. But effective health record keeping, the usage of insurance providers, and technology blockchain can mitigate this [2]. This is also probable. Blockchain [3] is an unchangeable data base technology with an ever-growing list of papers, distributed and encrypted [4]. It is also a joint pooled data collection technology that will decentralise data storage to enhance patient results by improving data access activities and data protection simultaneously [5]. Consumer details should not be misused, and patients do not have power of the identities of robberies, financial data violations, or spam. This is the solution to these problems by the hyperleader fabric. Transactions involving the health records of a patient are registered with certain special IDs in the ledger [6].

Electronic Health Record (EHR) systems have significantly transformed the way in which patient health information is managed and made accessible, constituting a critical milestone in healthcare technology. These systems perform the digitization and consolidation of extensive patient data, encompassing not only medications and treatment plans but also medical histories and diagnoses. Electronic health records (EHRs) optimize healthcare processes by facilitating workflows, boosting provider-to-provider communication, and augmenting patient care via timely access to vital data. They enable patients to access their health records more conveniently, promote data-driven decision-making to deliver personalized healthcare, and facilitate the secure exchange of information. There are multiple classifications of electronic health record (EHR) systems. These include hybrid EHRs, which integrate features of both on-premise and cloud-based solutions, on-premise systems that are deployed locally within healthcare facilities, and cloud-based EHRs that operate on remote servers accessed via the Internet. Every category presents unique benefits with regard to usability, expansion, protection, and tailoring, accommodating the varied requirements of healthcare providers. The ongoing advancement in healthcare is really helpful. By eliminating mistakes in data, they have increased the quality and clarity of health information [7].

In addition, EHRs may be useful for obtaining clinical records at any time and everywhere, thus minimising the potential of repeating checks, diminishing gaps in care, and informing patients in improved decision-making [8]. Each patient care centre has its own EHR administration system, making it hard to communicate health records across medical channels. Medical histories are untraceable. EHRs can now be shared across numerous platforms, thanks to blockchain technology [9]. EHR management using Hyperledger Fabric, we can build a permissioned peer-to-peer blockchain network with a large number of well-known and registered healthcare businesses. However, certain difficulties must be taken into consideration in the application of EHRs. Managing the EHR system through a secure and efficient architecture built on Hyperledger Fabric. In order to maximise interoperability, security, privacy, scalability, and permissioning, this allows us to create a peer-to-peer, private, permissioned blockchain network with several registered and identifiable healthcare stakeholders. Certain problems concerning two factors: privacy and security [10] risk the secrecy, credibility, and availability of user details, fake injection [11], Sybil Attack vulnerability [12], and a single failure point because of centralised control [13]. Drawbacks of EHR are as health data are shared electronically, patient privacy concerns are growing. To ease these concerns, policymakers have protected patient data. The Health Insurance Portability and Accountability Act’s privacy and security regulations have been reinforced by recent legislation that requires the interchange of electronic health information. EHRs may increase medical errors, bad emotions, power shifts, and technology dependence. 40 CPOE has been linked to medical errors due to poor system interfaces or a lack of end-user training. Other income decreases may result from EHR implementation. Because EHRs reduce redundancies, errors, and durations of stay, a provider may be able to avoid chargeable transactions that would have resulted in third-party payer reimbursements, especially if the payment system is fee-for-service. Each organization’s reimbursement rates may fall, while EHR system efficiencies may increase revenue.

Because Hyperledger Blockchain technology combines two cutting-edge concepts, its integration with the Internet of Things offers a powerful answer. The convergence of the Internet of Things (IoT) and Hyperledger Blockchain results in an unprecedented synergy that presents a novel framework for the administration of data in a secure, transparent, and efficient manner. This convergence facilitates the development of decentralized ledgers that are tamper-proof and distributed, guaranteeing the integrity, authenticity, and immutability of data generated by the Internet of Things. The revolutionary impact of the seamless incorporation of IoT devices with Hyperledger Blockchain extends to various sectors, including supply chain management, healthcare, finance, and more, by enhancing traceability, enabling real-time data sharing, and facilitating automated transactions devoid of trust. This integration serves as a resilient resolution, enhancing the possibility of interconnected, scalable, and secure systems that revolutionize contemporary technological implementations [14].

Using lightweight cryptographic features like elliptical curve encryption, Rivest–Shamir–Adelman (RSA), and others, the majority of modern approaches use key exchange between the parties involved. The coded data will be jeopardised if a hostile party obtains the key [15]. Based on elliptic curve theory, elliptic curve cryptography (ECC) can provide cryptographic keys that are more efficient, quicker, and smaller than those used by current methods. It is used in elliptic curve cryptography (ECC). Elliptic Curve Cryptography is comparable to Rivest–Shamir–Adleman (RSA) (ECC). It creates digital signatures for digital currencies like Bitcoin and Ethereum and one-way encrypts emails, data, and software, as well as RSA and ECC. Some programmes provide an access control mechanism with an attribute-based encryption scheme. In this situation, the attribute-bases cryptography induces the increasing operation period in line with the number of users who are unrevoked and is unable to deter internal attacks, and blockchain’s irreversibility is an obstacle to the revocation of consent [16].

The motivation for this innovation originates from the urgent requirement to tackle persistent issues in healthcare systems: the secure transmission of confidential patient data between disparate entities, while simultaneously guaranteeing the availability, integrity, and confidentiality of the information. Through the integration of Internet of Things (IoT) devices with Hyperledger Blockchain, this proposed solution aims to address these deficiencies by creating a resilient infrastructure that enhances the security of health records and enables the seamless integration of real-time data, thereby fostering a holistic perspective of patient well-being. The main goal is to equip healthcare providers with secure and efficient tools that enable them to seamlessly share critical patient data. This will ultimately lead to improved decision-making processes, increased collaboration among stakeholders, and an overall enhancement in the quality and efficiency of healthcare delivery. The following is a discussion of this paper’s main goals and contributions:(i)We introduce a decentralized system for access control and authentication intended for BC-based EHS. Medical service providers can produce paired secret keys during the key management step in order to implement secure communication. After negotiating with one another, users and medical healthcare providers can create session keys during the authentication and access control phase.(ii)Encrypts sensitive health records to prevent unwanted access and maintain data integrity by using Hyperledger Blockchain technology and strong encryption standards.(iii)The security of the proposed protocol’s mutual authentication and session key exchange is examined through a formal security analysis that employs Burrows–Abadi–Needham (BAN) logic. The communications that are exchanged specify the security objectives. A nonformal security evaluation of the protocol is additionally offered to assess its resilience against certain established assaults.(iv)Facilitates accurate and secure data transmission across various healthcare systems, allowing for the safe transfer of electronic health records (EHRs) between medical professionals without compromising patient privacy.(v)Improves the quality and efficiency of healthcare services by streamlining administrative tasks and minimising the likelihood of mistakes.

The majority of the paper is structured as follows. Several associated works and context material on blockchain technologies in a cloud setting were provided in Section 2 utilising the Hyperledger and electronic health record framework. Section 3 explains the stable distribution of EHR by the Hyperledger blockchain is used in the proposed approach. Section 4 displays the performance of the model as well as the disputes. To end, Section 5 displays the nm.

Wang and Song [17] using blockchain technology and attribute-based cryptosystems, a secure electronic health record (EHR) system was constructed. The scheme has embraced a contemporary primitive form of cryptography known as the hybrid attribute-based/identity-based encryption and signature (C-AB/IB-ES) in order to carry out the many duties connected with ABE, IBE, and IBS while operating within a particular cryptographic system. According to the research’ findings, the system is able to perform at levels that are acceptable. However, there is a potential that the system will result in a variety of significant problems, including complete confidentiality, difficult computation, and high storage costs.

Dagher et al. [18] recommended a blockchain-based system for patient, vendor, and third-party reliable, interoperable, and productive access to medical data, while ensuring the protection of personal details for patients. In an Ethereum-based blockchain, the framework was called Ancile and used smart contracts to enhance access protection and data obstruction and sophisticated encryption methods for increased defence. The method specifically explores how Ancile deals with the diverse interests of patients, clinicians, and third parties and how the process will solve a long-standing challenge in healthcare privacy and protection. However, the blockchain technology did not meet the legislative standards for medical data, and it provided less security.

Mubarakali [19] proposed that a Blockchain- (SRHB-) based on a safe and stable healthcare-based cryptography be used to securely transfer the EHR. The machine obtained data from the patient in a standardised healthcare system focused on the wearable technology. In a cloud computing server, the patient received data were uploaded and processed. In order to administer medications and measures for fast healing, the doctor checked the patient’s health examination, genetic details, and observational study. Blockchain principle applied in health data to protect secrecy. A separate block as a chain was generated every time. The device took some time to exchange health data and to access health records in the database server storage.

Bayat and Farjami [15] implemented a stable and powerful framework focused on blockchain-based technologies and encoding-based attributes named “MedSBA,” for the recording and store of healthcare data and for the security and privacy of the system (GDPR). The MedSBA used private blockchains to boost the ability and it is a problem with attribute-based encryption, to revoke rapid access. The device was seen to be secure and functional on the basis of the Burrows–Abadi–Needham (BAN) logic, and storage showed the reliability of the system. However, the device does not trade the cryptocurrency for data users and individuals for the sharing of medical data.

Cao et al. [20] a hybrid blockchain-based medical record exchange system was demonstrated. A consortium-approved medical information control system may extract data for correct diagnosis. A work prototype was introduced to illustrate how the hybrid blockchain enables pharmacy practises in an environment for the management of health knowledge. A Hyperledger Calliper blockchain benchmarking method was used to test the achievement of a hybrid electronic medical record exchange device for efficiency and average latency that was feasible and outstanding. The framework did not, however, illustrate the exact extent of protection of the system.

Xia et al. [21] provided data exchange in cloud environments on the basis of blockchain for electronic medical records. The scheme was built on a blockchain permit that only invited and thus authenticated users could use. Responsibility was assured because the blockchain was already known to all developers and held a record of their behaviour. After authentication of their identity and cryptographic keys, the framework supports requests for public pool data. The framework was discovered to be light and adaptable throughout the system analysis. The findings also indicate that relative to the current methodologies the framework worked higher. The device, however, produced less efficiency.

According to Laghari et al. [22], the goal of this study is to analyse the gaps that exist between connected IoV devices during network communication and to highlight current security and privacy strategies and protocols. In this work, we provide a Hyperledger sawtooth-enabled IoV architecture with lightweight-BIoV capabilities to decrease blockchain DLT resource adaptability and enhance system acceptability. Without abandoning the Hyperledger sawtooth, this lightweight-BIoV demonstrates how the architecture and design are resource-efficient while preserving effective information traceability and reliability. However, in order to investigate the validation and verification of car node transactions while utilising fewer computing resources, we create, develop, and implement smart contracts in addition to a number of PoW consensus techniques. In this study, [23] focuses on blockchain technology, its characteristics, and the fundamental technologies that form the foundation of the blockchain network. The history of blockchain is narrated in chapters that flow gradually from cryptocurrencies to blockchain technology platforms and applications that are widely used in the financial and industrial sectors worldwide because of their greater security, transparency, and ease of use focuses on using blockchain technology as a data repository and in the Internet of Things.

Khan et al. [24] use distributed ledger blockchain technology (BHIIoT) to provide a novel and secure architecture for the protection of E-healthcare data. Second, the lifespan of medical wireless sensor networks is modified for data management and optimization through the use of a distributed layered hierarchy. As a result, network resources are enhanced, and trust in the peer-to-peer (P2P) setting made possible by blockchain technology is increased. Third, the proposed BHIIoT encrypts data using the NuCypher threshold re-encryption method to protect shared resources, which are blocks stored in an immutable blockchain storage system. For instance, chain codes are used in distributed e-healthcare applications to automate transaction tracing, index data distribution, logging, and authentication in order to stop illegal conduct. In [25], the quality issues that is currently present with blockchain technology implementation. Additionally, it specifies terminologies related to smart contracts in industries, public, private, hybrid, and consortia blockchains, as well as the properties that are necessary, including autonomy, transparency, immutability, data integrity, and security.

A blockchain-based decentralized authentication and access control protocol for EHS is described by Xiang et al. [26]. By addressing the more important privacy and security issues related to medical data, this protocol makes it possible for consumers and medical service providers to collaborate effectively and safely share resources. To enhance the negotiation process, a multiweighted subjective logic-based practical Byzantine fault-tolerant (PBFT) negotiation mechanism is used. Ultimately, we show that our solution is resilient to known security threats by employing BAN logic to establish the dependability of the systems-security safeguards. The authors in [27] suggest a blockchain consortium with preselected users. Here, public key encryption with keyword search (PEKS) technology is utilized to ensure data security, access management, privacy preservation, and secure search. The security proof indicates that there is no discernible difference between our suggested strategy and the keyword guessing attack. The suggested scheme outperforms other relevant schemes, according to the results of the comparative simulations and performance analysis.

Shamshad et al. [28] propose a novel blockchain-based EHR sharing system that preserves privacy and security and enables better diagnosis and effective treatment in TMIS. First, the consensus, data structures, and procedures of two different types of blockchains the consortium blockchain and the private blockchain are developed. While consortium blockchain keeps the safe indexes of EHRs, private blockchain manages EHR maintenance. Our protocol’s security study confirms that it meets all security objectives by avoiding a number of security threats. The authors in [29] suggest an IoT authenticated group key agreement system based on blockchain technology. In the proposed protocol, a new entity known as the device manager is introduced. This entity serves as a bridge to connect blockchain networks and Internet of Things devices. Security research shows how resistant the suggested protocol is to different types of assaults.

Singh and Das [30] in order to increase access control over medical data, a lightweight two factor authentication approach (TFAS) that incorporates user authorization, device, user, and data authentication is recommended. This two-stage authentication verification process begins with human and device authentication utilising PUF and fuzzy extractor; the second stage employs user authorization and data authentication based on blockchain. In addition to ensuring the scalability and expansion of the blockchain-based IoMT network, it uses a cluster of servers that are interplanetary file systems enabled by smart contracts.

Table 1 provides a summary of healthcare data management mechanisms in blockchain technology.

3. Proposed Methodology

In terms of revenue and data, healthcare is the industry with the biggest boom. Security is the need of the hour for too many electronic health reports. There was a need to use blockchain technologies to make this sensitive information more secure. Because of its specific distributed deceptive and privacy-proof characteristics, it becomes famous. However, owing to the authentication challenges of the IoT Based blockchain framework, eHealth programmes use blockchain technologies face certain security threats. Worse, medical institutions have computerised health records, which creates privacy concerns. Bitcoin’s blockchain technology is indestructible because it is decentralized, encrypted, faith-based, and maintained through mutual collaboration. It is characterised by data exchangeability and data integrity. The effective, safe, modified policy attribute-based encryption (MKP-ABE) is implemented in this paper to ensure secure and secure sharing of electronic health records through blockchain hyperleader. Figure 1 displays the model system of the proposed architecture.

3.1. Authentication Phase

The first phase of the proposed secure sharing of EHR using blockchain technology is authentication. Authentication is the process of verification or testing to make sure that the user is who he claims to be. It is an important step in providing access to authorized patients. This phase mainly consists of three steps, registration, namely, login and verification.

3.1.1. Patient Registration

Throughout the initial stage of the patient registration procedure, the user is responsible for entering the patient’s information. The health assistant is in charge of inputting the patient’s information into the database, which includes the patient’s name, age, username, gender, password, address, hospital ID, patient ID and doctor name, among other things. These particulars will be saved in the database. The patient details are mathematically represented as follows:where signifies the patient details set and indicates the information about the patients, such as age, sex, name, and patient ID.

3.1.2. Optimized Key Generation

After filling in the patient details, in this step, the optimized key generation process is done. The randomly generated key value is less secured for the data encryption and decryption process. So, the keys are generated optimally to provide highly secure during the encryption and decryption process. Getting the modified salp swarm optimization (MSSO) algorithm, the main values are optimally chosen here. The Modified Salp Swarm Optimization (MSSO) algorithm is an improved iteration of the Salp Swarm Optimization (SSO) algorithm that draws inspiration from the swarming characteristics observed in marine salps. In order to tackle optimization problems, this metaheuristic algorithm is based on the imitation of the collective behaviour of these organisms. MSSO implements alterations and enhancements to the conventional SSO with the objective of bolstering the rate of convergence, capabilities for exploration, and capabilities for exploitation. A notable improvement entails the integration of adaptive strategies or hybridization with alternative algorithms to strengthen its capability to address intricate and multidimensional optimization problems. MSSO generally entails the generation of a population of salp agents, in which each agent modifies its position in the search space iteratively in accordance with a predetermined set of rules. The regulations comprise motion protocols that emulate the swimming patterns of salps, as well as approaches for revising positions in light of regional and international data. The enhanced functionalities incorporated in MSSO are designed to rectify the deficiencies identified in the initial SSO, thereby guaranteeing improved convergence towards optimal solutions in a wide range of problem domains, including finance, machine learning and logistics [40, 41].

MSSO has been successfully used in a large variety of optimization problems and is among the most effective metaheuristic optimization algorithms. However, there are still problems such as low convergence and lower performance. Salp swarm is an invertebrate that lives predominantly in the Southern Ocean and swings forward by absorbing water. They generally form a salp swarm chain in the deep water, which is divided into two parts: leaders and followers. Individuals at the top of the group chain are referred to as leaders, while the rest are referred to as followers. The group’s purpose is for followers to move in unison under the supervision of leaders, constantly updating their locations and finding and developing better food sources in the search environment. The MSSO algorithm is used to increase convergence performance in global search and local search as well as to improve the quality of the main generation efficiency optimized. Below are step-by-step illustrations of the MSSO process. To pick an optimum key attribute, the following processes are used. Introduced in the computational model used to replicate the swarming action of MSSO:Step 1: First, initialize the salp population randomly, which is represented in the following equation:where signifies the initial position of the salps, indicates the random number between 0 and 1, and signify the upper limit and lower limit of the dimension, respectively.Step 2: Next, change the head salp location according to the gap between the salp and the source of food. To increase the search ability, the upgrade strategy for head salp is modified instead of the average as a weighted number of best positions.where denotes the position of the leader, and indicate the weight values, indicates the position of the target food in the dimensions, , , and signify the random coefficients between 0 and 1. The coefficient is the essential parameter because it provides a balance between exploration and exploitation capabilities. It is mathematically expressed as follows:where signifies the maximum iterations and indicates the current iteration.Step 3: Then, update the position of the follower using the following equation:where , denotes the position of the follower at the dimension, and , , and represent the coefficient vectors. Based on this coefficient vector, the weight is calculated. This strategic update for weighted roles strikes a compromise between search engine discovery and extraction capacities. It also improves the pace of convergence, contributing to better SSO efficiency. Finally, evaluate the fitness of every salp that is maximizing the objective function. It is expressed as follows:

The operation of the method ends only if the highest number of variations is completed and the optimal fitness benefit structure is selected as optimum. This will analyse the optimized meaning for the primary value. Based on the optimal prime value the method selects the public key () and private key (). These keys are also used in extra dispensation. The pseudocode for the MSSO algorithm is presented in Algorithm 1.

Set the salp population Hsi (i = 1, 2, …, n) as Cu and Cl
While (end condition is not accomplished)
Compute the fitness of each search agent equation (7)
Da = the best search agent
Modify Zwi by equation (4)
 For every salp (HSi)
  If (I = 1)
   Modify the position of the leading salp
  Else
   Modify the position of the follower salp by equation (5)
  End
 End
 Amend the salps based on the upper and lower bounds of variables
End Return Da
3.1.3. Login

In order to be confirmed, the patient must provide the authentication information provided by the hospital administration when accessing the system. At the beginning of the login process, the patient must input both their login information and password. The ID for the hospital and the ID for the patient should then be given. The best version of the patient’s private key must be provided as a last obligation ().

3.1.4. Verification

The system will go on to the verification stage after the patient logs in, where it will check the patient’s login, password, and private key against the database. The system will determine that the patient has already been registered with the cloud server associated with the hospital if all of the information including the Username, password, and key is determined to match. You will have to go through the registration process once more in such instance.

3.1.5. Admin Login Page

On the admin login screen, logged-in users can access their accounts by providing their username and password. The system can then be accessed by the admin. Furthermore, the administrator grants read/write access to the database to other practitioners or institutions. The admin module gives the following permission to the patient or other institutions such as view option, edit option, delete option, and update option. An example of these permissions could be given in the tabular form as in Table 2.

3.2. Secure Upload Phase

After successfully completing the authentication process, select which EHR files needs to be uploaded. All primary health administrative documentation for the treatment professional comprises the submitted EHR file, including records, progress notices, issues and prescriptions, essential symptoms, previous medical background, vaccines, laboratory results, and radiology studies. Also, it is file formats, including folders (.doc), graphic (.jpeg, .png), and excel (.xlsx). It has various file formats. These uploading data is mathematically expressed as follows:where indicates the uploaded EHR file and represents the amount of information in the EHR files. After that, upload these files are securely to the blockchain storage and cloud server, the following steps are used.

3.2.1. Feature Extraction

This is the first step of the secure upload phase. From the uploaded EHR file, some important features are extracted in this step. The extraction of features includes reducing the number of resources needed for a vast number of details. The name of the file, absolute path, file type, file size, parent folder and free space is secret, executable, accessible, readable, and main features are derived from EHR data , as are available, hash code, time, time-recovery, and time. Mathematically, it is expressed as follows:where signifies the extracted feature set and indicates the number of features extracted from the EHR file.

3.2.2. Hashed Access Policy Creation

After feature extraction, the hashed access policy for the extracted features will be developed using the Whirlpool Hash (WH) algorithm. Whirlpool iterates a compression mechanism based on a specialised 512 bit block cypher with a 512 bit key. Wide Trail guides the round function and key scheduling. The function structure, which is not platform-specific, benefits 8 bit and 64 bit Whirlpool implementations. Whirlpool employed a randomly generated substitution box (S-box), the internal structure of which made hardware implementation challenging. Any linear combination of input bits and the hash result cannot be securely connected, even the hash output itself. This is because the hash approach is one-way. Whirlpool is immune to differential attacks because it is impossible to predict which bits of the hash output will change when input bits are altered. As a result, it is difficult for an attacker to decide which bits of the hash result to change. In this algorithm, the extracted features are converted into hash code. Based on this hash code, for future authentication, the access policy is being created [4244]. The algorithmic procedures of the Whirlpool hash algorithm are explained below.

First, given an extracting feature set () as message consisting of a sequence of blocks , the whirlpool hash function is described as follows:

Each iteration’s encryption key input displays the interim hash value of the last iteration is the present message block and the plaintext. “The output for this iteration consists of the bitwise XOR of the current message block, the intermediate hash value from the previous iteration, and the output from the block cipher .” Figure 2 shows the process of hashcode created for the extracted feature.Step 1: Append padding bitsThe message is padded by appending a single “1” bit followed by the required number of “0” bits.Step 2: Append length ()The message is attached with a block of 256 bits. This block is handled as a 256 bit integer (most relevant first byte) and consists of the first message bit duration (before the padding). The consequences of the first two steps produce a message containing 512 bits of integer. The extended message here is displayed as the 512 bit block series , so increasing the total length of the enlarged message is ​ bits.Step 3: Initialize the hash matrixThe intermediate and final effects of the hash function are stored in a byte 8 × 8 matrix. The matrix is starting as a 0 bit matrix.Step 4: Message processingMessages are interpreted one block of 1024 bits at a time from structured input. The block cypher X is the core of this algorithm.Step 5: Output

The final 512 bit Hash value of the extracted feature is determined after each block of 1024 bits has gone through the message processing stage () is obtained. The final hash value is denoted as . Based on this final hash value, the access tree is constructed. The doctors or other institutions are able to decrypt if and only if the data attributes satisfy their access structure. This hashed access policy () is considered as a secret key for further processing to improve the security level.

3.2.3. Hyperledger Blockchain Storage

The resulting Hash Code was subsequently entered in the Hyperledger Fabric blockchain in order to satisfy the credibility, availability and privacy criteria at each time of the transaction. Here, a single blockchain is generated for each hospital. During this function, the device consults multiple hospitals, which is Hyperledger blockchain. It requires data transaction blocks. An algorithm named minerals’ work evidence for a stable, tamper-resistant agreement between any nodes in the network verifies and adds the blocks to the blockchain. Each block includes chronologic order hash of its preceding block, timestamp, nonce and preceding hash value. The platform’s cryptographical hash algorithm ensures that connected blocks are immune and that blockchain data cannot be altered, although allowed users are still searching for such EHRs in the blockchain. The Hyperledger blockchain’s organisational structure is depicted in Figure 3.

3.2.4. Encrypt EHR File Using MKP-ABE

In this phase, the uploaded EHR file is encrypted by using the Modified Key Policy Attribute-Based Encryption (MKP-ABE) algorithm and the encrypted file will be stored in a cloud server. Key Policy Attribute-based Encryption (KP-ABE) is a public key that supports fine-grained decryption access control. Only the ciphertext may be decrypted with attributes satisfying the control structure. To enhance the security level of the conventional KP-ABE, the proposed system uses a secret key (i.e., hashed access policy), so the term is called MKP-ABE. The MKP-ABE scheme consists of the following steps:(a)Setup: This algorithm takes the security parameter and a universe description of attributes as a starting point for the creation of a master secret key and some public parameter as .(b)Key Generation: In this key generation step, the system will take the optimized public and private key of the patient, which is already generated in the optimized key generation phase (Section 3.1.2).(c)Encryption: This algorithm takes as input , public parameter (), hashed access policy (), and patient private key (). It output the ciphertext. Mathematically, it is expressed as follows:(d)Decryption: Finally (4), the decryption process is carried out; here, the authenticated user can retrieve the file from the cloud server. Given a ciphertext , patient public key () and secret key (hashed access policy) , it produces the decrypted original file as follows:where denotes the original document. This way the data receiver retrieves the encrypted data from the cloud server. The receiver receives a document with a secure authentication scheme.

3.3. Secure Download Phase

This procedure enables hospital clinicians to safely retrieve patient data. If the doctor requests the file from the Cloud Server, the system will check the Hashed Access Policy before delivering it to the doctor. If the inquiring user has the correct Hashed Access Code, the system decides that they own the file containing the keys to decode the encrypted PHR file. This system allows the targeted user to decrypt the file using the decryption keys. The doctor can read, write, and cancel authorization. If the hasher access policy does not match, the system will refuse to download.

4. Results and Discussion

The effectiveness of the envisioned secure exchange of electronic health records utilising Hyperledger blockchain was evaluated using assessment techniques in this performance analysis section. In this part, examples from comparative research and recent test results are used to further illustrate the effectiveness of the suggested strategy. A software programme was used to build the proposed architecture (JAVA). The part that follows talks about the comparative analysis [45].

For our framework, Hyperledger (permissioned blockchain) is a better fit than Ethereum (permissionless blockchain) for the following two reasons: It can be difficult because of a permissionless blockchain, which allows anyone to join the network anonymously and without permission. Regarding an electronic medical record system, each member of the network must have their identity known. Hyperledger is a permissioned Blockchain network with identifiers for each participant; therefore, it makes sense to use it.

Patient medical data are susceptible to security breaches. Because everyone on the network participates in Ethereum’s consensus process, material recorded on the distributed ledger that requires a higher level of anonymity can be accessed by all users. The privacy problems of patient medical data are addressed by Hyperledger’s permissioned Blockchain, which only permits nodes approved by authorities to read such data [46].

The main issue that permissionless Blockchain networks like Ethereum are experiencing is privacy. When it comes to maintaining and operating the health system, it makes sense to safeguard data from unauthorized individuals, protecting the system’s overall privacy as depicted in Table 3.

4.1. Performance Analysis

Compared to the classical Key Policy Attribute-Dependent Encryption (KP-ABE), Elliptic Curve Cryptography (ECC), Rivest–Shamir–Adelman (RSA) and Advanced Encryption Standard (AES), the performance of the suggested MKP-ABE is presented in the performance analysis portion. The analysis can obtain the results by varying parameters like file size ranges from 10 to 50. The observations are seen with respect to the period of success encryption, decryption time, encryption memory use, decryption memory use, upload time, and download time. The following table verifies the relationship based on the encryption and decryption times.

Table 4 and Figure 4 depict the performance of the proposed MKP-ABE with the traditional KP-ABE, ECC, RSA, and AES algorithms. Encryption and decryption times were used in this comparison as performance metrics. Concerning the encryption time metric, for file size 5 mb, the existent AES method takes 1538 ms time to encrypt the data, which is higher than the recommended ones. Also, the existent KP-ABE, ECC, and RSA algorithms take the encryption time of 701 ms, 912 ms, and 1242 ms, respectively. The proposed MKP-ABE, on the other hand, encrypts files faster than current approaches. The proposed technique is similar to how it takes less time to encrypt data for a smaller file size (10 to 25). In terms of decryption time, the suggested MKP-ABE takes 4138 ms to decrypt data from a 25 mb file, but the existent KP-ABE, ECC, RSA, and AES take decryption time of 4701 ms, 5025 ms, 5501 ms, and 5976 ms time, respectively, which is higher when compared to the suggested one. For file size 5 mb to 20 mb, the proposed one takes less time to decrypt the data than the conventional methods. Thus, the discussion reveals that the suggested one attains better performance than the traditional techniques.

Figure 5 contrasts the proposed MKP-ABE with the conventional KP-ABE, ECC, RSA, and AES in terms of security level analysis. The conventional AES hence performs worse than the suggested one. Furthermore, the suggested method performs better than conventional KP-ABE, ECC, and RSA. For example, the proposed MKP-ABE provides 98.76% security, but the conventional KP-ABE, ECC, RSA, and AES provide security of 94.56%, 93.21%, 91.29%, and 89.98%. The discussion therefore shows that, in terms of high-level performance, the proposed system outperforms the baseline KP-BE, ECC, RSA, and AES.

Figure 6 shows, based on memory use during encryption and decryption, how well the suggested MKP-ABE performs in comparison to the current security methods, such as KP-ABE, ECC, RSA, and AES. The amount of RAM allocated for encryption and decryption is specified. A file size between 5 and 25 megabytes is required for the performance. Figure 6(a) demonstrates that the proposed MKP-ABE uses less memory for encryption than conventional methods (5133475 kb for a 5 mb file). While encrypting data, however, current encryption techniques like KP-ABE, ECC, RSA, and AES use far more RAM. Figure 6(b) analysis led to the conclusion that the proposed technique performed better than the alternatives. For example, for file size 5 mb, the proposed MKP-ABE takes memory usage of 5221775 kb, but the existent KP-ABE, ECC, RSA, and AES occupy the memory of 5532321 kb, 5833761 kb, 6222786 kb, and 6877865 kb, respectively. Similarly, all remaining 10 to 25 MB file sizes necessitate higher performance from the recommended MKP-ABE. This discussion preserves the anonymity of the access controls while requiring less computational cost than current alternatives.

Figure 7 depicts the performance of the proposed MKP-ABE algorithm in terms of two performance indicators, namely upload time and download time. The proposed one performs remarkably well, according to the study of the presented figure. The proposed approach, for instance, uploads files up to 5 mb in 9447 ms and downloads them in 8813 ms. The proposed one also requires 11221 milliseconds to upload and 10814 milliseconds to retrieve a 10 MB file. For remaining file sizes ranging from 15 MB to 25 MB, the suggested method necessitates quicker upload and download times. Thus, the discussion shows that the proposed method achieves better performance.

5. Conclusions

Blockchain technology provides great potential for the application of digital healthcare systems. Access control for EHR is problematic, though. EHR transactions need to be kept on distributed storage on the blockchain due to their enormous number. In this article, the method recommended an effective protected exchange of electronic health data utilising the IoT-based MKP-ABE algorithm. For data collection and transformation in the healthcare domain, the approach suggested is highly responsive. The framework suggested consists of three main phases: authorization, secure upload, and stable download. The suggested system is therefore stronger than traditional models, depending on the remaining metrics. The proposed IoT mechanism achieves a high degree of success through the experimental effects analysis as opposed to traditional methods, and the protection analysis indicated that the proposed system is viable and effective and often works in a more flexible manner. The proposed Modified Key Policy Attribute-Based Encryption performs better for the remaining 10 to 25 mb file sizes. This IoT framework compares MKP-ABE to various efficiency indicators, such as encryption, decryption period, protection level analysis and encrypted memory use, resource use on decryption, upload time, and transfer time, which are present in the KP-ABE, ECC, RSA, and AES. In this case, the IoT device indicated requires 4008 ms for data encryption and 4138 ms for data decryption. Limitations and challenges with the suggested system are First off, blockchain technology has scalability problems despite providing strong security due to its decentralized structure and use of cryptography. The blockchain might find it difficult to manage the strain as the number of health records rises, which could have an effect on the performance and speed of data transactions. Moreover, there are new challenges in assuring the security and legitimacy of data from several sources when IoT devices are integrated into the blockchain network. Different IoT systems and devices may not work together properly, which could result in compatibility problems, vulnerabilities, and inconsistent data.

In future to build a test EHR organization on the Hyperledger Fabric platform in the near future. We hope this will make a strong case for other nations to start implementing it and will have a important impact on smaller countries like North Macedonia.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest.