Clear Sky Science · en

Secure electronic health record access control via blockchain, dual-attribute encryption, and large language model-based attribute extraction

· Back to index

Why Your Medical Records Need Smarter Locks

Every visit to a doctor leaves a digital trail—notes, test results, scans—often stored in different hospitals and cloud systems. These records are vital for good care, but if they are too open, your privacy is at risk; if they are locked down too tightly, doctors may not see life-saving information in time. This paper presents a new way to protect electronic health records so that only the right people can see the right slices of a patient’s data, even when those records are scattered across the internet.

Figure 1
Figure 1.

The Problem With One-Size-Fits-All Privacy

Today, many hospitals protect data with broad rules: if you are a cardiologist at a certain hospital, you may get access to most of a heart patient’s file. But modern records are far more complex, full of free‑text notes, images, and reports written in everyday clinical language. Simple rules often fail in this messy reality. They may expose details to staff who do not need them, or block information that specialists genuinely require. As more records move to the cloud and are shared across institutions, the risk of leaks, snooping, or data tampering grows.

Letting Data Describe Itself

The authors argue that access decisions should depend not just on who a user is, but also on what the data actually contains. To achieve this, they use a medical language model called ClinicalBERT, a kind of AI trained on real clinical notes. Instead of leaving text as an unstructured jumble, the model scans notes for key ideas—such as symptoms, diagnoses, medications, and procedures—and turns them into structured tags. For example, a sentence about “chest pain” and “insulin” becomes a short list of standardized concepts. This lets the system know that a given document is, say, a cardiology‑related note involving diabetes, without exposing the full text.

Figure 2
Figure 2.

Building Fine-Grained Locks With Encryption and Blockchain

Once records are tagged, the system uses a technique called attribute-based encryption: data is locked in such a way that only users whose characteristics match a chosen rule can unlock it. Here, those characteristics come from two sides. User attributes capture who someone is—such as their specialty or department—while data attributes come from the ClinicalBERT‑generated tags, such as disease type or sensitivity level. A record can thus be encrypted under policies like “only kidney specialists may see lab results related to kidney function” or “only a small emergency team may see high‑confidentiality flags.” The keys needed to enforce these rules are created jointly by several independent key centers so that no single authority can secretly unlock data on its own.

Using a Shared Ledger to Coordinate Trust

To keep track of which attributes and keys exist, the framework relies on a private blockchain based on Hyperledger Fabric. This ledger records only technical metadata—public keys, anonymous attribute identifiers, and policy information—never raw medical text. Because each change is written to an immutable chain shared among hospitals, it is difficult for an insider to quietly alter access rights or forge keys. Smart contracts on the blockchain automatically calculate combined public keys for new attributes, update or revoke them when staff roles change, and help patients or institutions adjust policies over time. The actual encrypted medical files stay off‑chain in cloud storage, keeping the blockchain light and scalable.

How the System Performs Under Attack and in Practice

The authors put their design through both mathematical and practical tests. Using formal verification tools, they model common threats such as replay attacks, collusion between users, or a curious cloud provider, and show that attackers cannot recover the decryption keys without the right combination of attributes. Because keys are split across multiple authorities, there is no “master key” for an adversary to steal. They also benchmark the system on a standard server and a low‑power Raspberry Pi board, finding that encryption is efficient and, crucially, decryption is faster than in several competing schemes—important because doctors may need to open the same record many times while it is typically encrypted only once.

What This Means for Patients and Clinicians

In plain terms, this work proposes a smarter lock for health records: one that looks at both who is knocking and what is inside the room before opening the door. By combining AI that understands medical language, cryptography that encodes fine‑grained rules, and a blockchain that all parties can trust, the framework aims to let clinicians see exactly what they need—no more, no less—while giving patients stronger protection against misuse of their data. If adopted widely, such systems could make sharing records across hospitals safer and smoother, without forcing people to choose between privacy and good care.

Citation: Nekouie, A., Vafaei Jahan, M., Moattar, M.H. et al. Secure electronic health record access control via blockchain, dual-attribute encryption, and large language model-based attribute extraction. Sci Rep 16, 8673 (2026). https://doi.org/10.1038/s41598-026-39690-2

Keywords: electronic health records, medical data privacy, blockchain healthcare, attribute-based encryption, clinical language models