A method and system for sharing modifiable electronic medical records based on chameleon hashing

By using the Chameleon Hash algorithm and proxy re-encryption technology, the problems of large storage space and difficulty in modification in blockchain medical data sharing solutions are solved, enabling secure sharing and modification of electronic medical records and ensuring data integrity and privacy protection.

CN117371050BActive Publication Date: 2026-11-17BEIJING INFORMATION SCI & TECH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311230572.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2026-11-17
Estimated Expiration
2043-09-22

AI Technical Summary

Technical Problem

Existing technologies in blockchain-based medical data sharing solutions suffer from problems such as large storage space consumption, difficulty in modifying electronic medical records, and unreliability due to untrusted cloud servers, thus failing to effectively protect the security and privacy of electronic medical records.

Method used

The Chameleon Hash algorithm is used to encrypt and sign electronic medical records. Taking advantage of the immutability of blockchain, the encrypted text is stored in a distributed server through proxy re-encryption technology, and the hash value is stored in the blockchain, so as to realize the modification and secure sharing of electronic medical records.

Benefits of technology

This approach enables efficient modification and sharing of electronic medical records while ensuring their security, avoiding the risks associated with untrusted cloud servers and ensuring data integrity and privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117371050B_ABST
    Figure CN117371050B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for sharing modifiable electronic medical records based on chameleon hashing. It employs proxy re-encryption technology to encrypt the electronic medical records. Due to the immutable nature of blockchain, this invention stores the verification information (chameleon hash value) and access permission information of the electronic medical records in the blockchain, thereby ensuring the integrity of the electronic medical records can be verified. The chameleon hash value is used as input when generating the Merkel tree. Only with the private key corresponding to the chameleon hash algorithm can different information generate the same hash value. Without the private key, it is difficult to find collisions, thus enabling participants to modify the electronic medical records.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of secure sharing technology of medical data in blockchain, and in particular to a method and system for sharing modifiable electronic medical records based on chameleon hash. Background Technology

[0002] With the advent of the information age, electronic medical records have been widely used in daily life, bringing convenience but also raising concerns about their security and privacy. How can we effectively share electronic medical records while protecting their security and privacy?

[0003] While this solution enables electronic medical records to be shared via cloud storage, cloud servers are not entirely trustworthy. In cases of misdiagnosis, there is a possibility of collusion between doctors and the cloud server to tamper with electronic medical records. Therefore, a blockchain-based medical data sharing solution is the ideal solution.

[0004] In blockchain-based medical data sharing solutions, there are two data storage methods. One is to directly store electronic medical records (EMRs) on the blockchain. This method stores encrypted medical data in each blockchain node. However, when there are many nodes or a large amount of medical data, it consumes a lot of storage space, making it unsuitable for practical applications. The other method uses a cloud server plus blockchain model. The encrypted EMRs are stored on the cloud server, while the hash values ​​of the medical data are stored on the blockchain. This leverages the tamper-proof nature of the blockchain and the collision resistance of hash values ​​to achieve medical data security. However, because the blockchain is tamper-proof, it also means that the content of the EMR cannot be modified if there are errors. When storing medical data on a cloud server, the plaintext data cannot be stored directly because the cloud server is not entirely trustworthy. Therefore, encrypted data of the EMRs is stored. While symmetric encryption algorithms are simple to implement, re-encryption is required after permissions are revoked, resulting in low efficiency. In schemes using proxy re-encryption, an independent, semi-honest proxy encryption third party is needed, and this third party is not entirely trustworthy. Summary of the Invention

[0005] The present invention aims to provide a method and system for sharing modifiable electronic medical records based on chameleon hashing that overcomes or at least partially solves the above-mentioned problems.

[0006] To achieve the above objectives, the technical solution of the present invention is specifically implemented as follows:

[0007] One aspect of the present invention provides a method for sharing modifiable electronic medical records based on chameleon hashing, comprising:

[0008] Doctors generate electronic medical records for patients.

[0009] The doctor uses the patient's public key to perform encryption calculations on the electronic medical record to obtain the ciphertext of the electronic medical record;

[0010] The doctor performs a hash calculation on the encrypted electronic medical record to obtain a first encrypted hash value.

[0011] The doctor uses the doctor's private key to sign the first information to be signed, thereby obtaining the first signature. The first information to be signed includes: the first ciphertext hash value and the electronic medical record identifier.

[0012] The doctor's terminal sends information to the patient's terminal, and the information includes: the electronic medical record encrypted text, the electronic medical record identifier, and the first signature;

[0013] The doctor determines a first random number, and uses the doctor's private key to sign the first random number and the electronic medical record identifier to obtain a second signature;

[0014] The doctor sends the first stored information to the distributed server. The first stored information includes: the electronic medical record ciphertext, the electronic medical record identifier, the first random number, the first ciphertext hash value, the first signature, and the second signature.

[0015] The patient terminal uses the patient's private key to decrypt the encrypted electronic medical record to obtain the original electronic medical record.

[0016] After the patient terminal verifies the original electronic medical record, it performs a hash operation on the encrypted electronic medical record to obtain a second encrypted hash value.

[0017] The patient terminal uses the patient's private key to sign the second information to be signed, thereby obtaining a third signature. The second information to be signed includes: the second ciphertext hash value and the electronic medical record identifier.

[0018] The patient determines a second random number, and uses the patient's private key to sign the second random number and the electronic medical record identifier to obtain a fourth signature;

[0019] The patient sends the second stored information to the distributed server. The second stored information includes: the electronic medical record ciphertext, the electronic medical record identifier, the second random number, the second ciphertext hash value, the third signature, and the fourth signature.

[0020] The distributed server stores the encrypted electronic medical record.

[0021] The distributed server performs a hash calculation on the encrypted electronic medical record to obtain a third encrypted hash value.

[0022] The distributed server uses its private key to sign the third information to be signed, thereby obtaining a fifth signature. The third information to be signed includes the third ciphertext hash value and the electronic medical record identifier.

[0023] The distributed server determines a third random number, and uses the private key of the distributed server to sign the third random number and the electronic medical record identifier to obtain a sixth signature;

[0024] The distributed server determines the information to be uploaded, wherein the information to be uploaded includes: the electronic medical record identifier, the first signature, the third signature, and the fifth signature;

[0025] The distributed server performs hash calculations on the information to be uploaded, the doctor's chameleon hash public key, and the first random number to obtain the first chameleon hash value.

[0026] The distributed server performs hash calculations on the information to be uploaded, the patient's chameleon hash public key, and the second random number to obtain the second chameleon hash value.

[0027] The distributed server performs a hash calculation on the information to be uploaded, the distributed server's chameleon hash public key, and the third random number to obtain the third chameleon hash value.

[0028] The distributed server sends the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value to the blockchain.

[0029] Optionally, the method further includes:

[0030] The blockchain generates a storage transaction based on the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value;

[0031] The blockchain verifies the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value. If the verification is successful, the hash value is used as input to the Merkel tree to calculate the final Merkel root.

[0032] Optionally, the method further includes:

[0033] The doctor's terminal obtains the modified electronic medical record generated for the patient;

[0034] The doctor uses the patient's public key to perform encryption calculations on the modified electronic medical record to obtain the modified electronic medical record ciphertext.

[0035] The doctor performs a hash calculation on the modified electronic medical record ciphertext to obtain the first modified ciphertext hash value.

[0036] The doctor uses the doctor's private key to sign the first modified information to be signed, thereby obtaining the first modified signature. The first modified information to be signed includes: the first modified ciphertext hash value and the electronic medical record identifier.

[0037] The doctor sends the modified transmission information to the blockchain, wherein the modified transmission information includes: the modified electronic medical record ciphertext, the electronic medical record identifier, and the first modified signature;

[0038] The blockchain generates a modified electronic medical record transaction based on the modified sending information, and sends the modified sending information to the patient's end and the distributed server;

[0039] The patient terminal uses the patient's private key to decrypt the modified electronic medical record ciphertext to obtain the modified electronic medical record original text.

[0040] After the patient terminal verifies the modified original electronic medical record, it performs a hash operation on the modified encrypted electronic medical record to obtain the second modified encrypted hash value.

[0041] The patient terminal uses the patient's private key to sign the second modified information to be signed, thereby obtaining a third modified signature. The second modified information to be signed includes: the second modified ciphertext hash value and the electronic medical record identifier.

[0042] The patient sends the modified storage information to the blockchain. The modified storage information includes: the electronic medical record identifier, the second modified ciphertext hash value, and the third modified signature.

[0043] The distributed server performs a hash calculation on the modified electronic medical record ciphertext to obtain the third modified ciphertext hash value.

[0044] The distributed server uses its private key to sign the third modified information to be signed, thereby obtaining the fifth modified signature. The third modified information to be signed includes the third modified ciphertext hash value and the electronic medical record identifier.

[0045] The distributed server sends the modified upload information to the blockchain, and the modified upload information includes: the electronic medical record identifier, the third modified ciphertext hash value, and the fifth modified signature;

[0046] The blockchain determines the information to be sent, wherein the information to be sent includes: the first modified signature, the third modified signature, and the fifth modified signature;

[0047] The blockchain sends the information to be uploaded, the second signature, the fourth signature, the sixth signature, and the information to be sent to the doctor's end, the patient's end, and the distributed server, respectively.

[0048] The doctor's terminal performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the first random number, and the doctor's private key to obtain the first chameleon random number;

[0049] The doctor uses the doctor's private key to sign the first chameleon random number and the electronic medical record identifier to obtain the first chameleon signature;

[0050] The doctor sends the first chameleon random number, the electronic medical record identifier, and the first chameleon signature to the blockchain.

[0051] The patient terminal performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the second random number, and the patient's private key to obtain the second chameleon random number;

[0052] The patient terminal uses the patient's private key to sign the second chameleon random number and the electronic medical record identifier to obtain the second chameleon signature;

[0053] The patient sends the second chameleon random number, the electronic medical record identifier, and the second chameleon signature to the blockchain;

[0054] The distributed server performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the third random number, and the private key of the distributed server to obtain the third chameleon random number.

[0055] The distributed server uses its private key to sign the third chameleon random number and the electronic medical record identifier to obtain the third chameleon signature.

[0056] The distributed server sends the third chameleon random number, the electronic medical record identifier, and the third chameleon signature to the blockchain;

[0057] The blockchain verifies the first chameleon random number, the second chameleon random number, and the third chameleon random number. If all verifications are correct, the corresponding information in the stored transaction will be replaced according to the information to be sent, the first chameleon signature, the second chameleon signature, and the third chameleon signature, and the result information will be sent to the distributed server.

[0058] Optionally, the method further includes:

[0059] The distributed server replaces the original electronic medical record ciphertext with the modified ciphertext for storage.

[0060] Another aspect of the present invention provides a modifiable electronic medical record sharing system based on chameleon hashing, comprising: a doctor's end, a patient's end, and a distributed server; wherein:

[0061] The doctor's end is used to generate the patient's electronic medical record; to encrypt the electronic medical record using the patient's public key to obtain ciphertext; to hash the ciphertext to obtain a first ciphertext hash value; to sign first information to be signed using the doctor's private key to obtain a first signature, wherein the first information to be signed includes: the first ciphertext hash value and the electronic medical record identifier; to send information to the patient's end, the information including: the ciphertext, the electronic medical record identifier, and the first signature; to determine a first random number, and to sign the first random number and the electronic medical record identifier using the doctor's private key to obtain a second signature; and to send first stored information to a distributed server, the first stored information including: the ciphertext, the electronic medical record identifier, the first random number, the first ciphertext hash value, the first signature, and the second signature.

[0062] The patient-side terminal is used to decrypt the ciphertext of the electronic medical record using the patient's private key to obtain the original electronic medical record; after the original electronic medical record passes verification, a hash operation is performed on the ciphertext to obtain a second ciphertext hash value; the patient's private key is used to sign a second piece of information to be signed to obtain a third signature, wherein the second piece of information to be signed includes: the second ciphertext hash value and the electronic medical record identifier; a second random number is determined, and the patient's private key is used to sign the second random number and the electronic medical record identifier to obtain a fourth signature; second stored information is sent to the distributed server, wherein the second stored information includes: the ciphertext of the electronic medical record, the electronic medical record identifier, the second random number, the second ciphertext hash value, the third signature, and the fourth signature;

[0063] The distributed server is used to store the encrypted electronic medical record; perform hash calculation on the encrypted electronic medical record to obtain a third encrypted hash value; use the private key of the distributed server to sign the third information to be signed to obtain a fifth signature, wherein the third information to be signed includes: the third encrypted hash value and the electronic medical record identifier; determine a third random number, and use the private key of the distributed server to sign the third random number and the electronic medical record identifier to obtain a sixth signature; determine the information to be uploaded, wherein the information to be uploaded includes: the electronic medical record identifier, the first signature, and the third signature. The system performs the following steps: First, it hashes the information to be uploaded, the doctor's chameleon hash public key, and the first random number to obtain a first chameleon hash value. Second, it hashes the information to be uploaded, the patient's chameleon hash public key, and the second random number to obtain a second chameleon hash value. Third, it hashes the information to be uploaded, the distributed server's chameleon hash public key, and the third random number to obtain a third chameleon hash value. Finally, it sends the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value to the blockchain.

[0064] Optionally, the system may also include: a blockchain;

[0065] The blockchain is used to generate storage transactions based on the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value; and to verify the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value. If the verification is successful, they are used as input to the Merkel tree to calculate the final Merkel root.

[0066] Optionally, the doctor's end is further configured to: acquire the modified electronic medical record generated for the patient; perform encryption calculation on the modified electronic medical record using the patient's public key to obtain the modified electronic medical record ciphertext; perform hash calculation on the modified electronic medical record ciphertext to obtain a first modified ciphertext hash value; sign the first modified information to be signed using the doctor's private key to obtain a first modified signature, wherein the first modified information to be signed includes: the first modified ciphertext hash value and the electronic medical record identifier; and send the modified sending information to the blockchain, wherein the modified sending information includes: the modified electronic medical record ciphertext, the electronic medical record identifier, and the first modified signature.

[0067] The blockchain is also used to generate a modified electronic medical record transaction based on the modified sending information, and to send the modified sending information to the patient's end and the distributed server;

[0068] The patient-side terminal is further configured to: decrypt the modified electronic medical record ciphertext using the patient's private key to obtain the modified electronic medical record original text; after verifying the modified electronic medical record original text, perform a hash operation on the modified electronic medical record ciphertext to obtain a second modified ciphertext hash value; sign the second modified information to be signed using the patient's private key to obtain a third modified signature, wherein the second modified information to be signed includes: the second modified ciphertext hash value and the electronic medical record identifier; and send the modified storage information to the blockchain, wherein the modified storage information includes: the electronic medical record identifier, the second modified ciphertext hash value, and the third modified signature.

[0069] The distributed server is further configured to perform hash calculation on the modified electronic medical record ciphertext to obtain a third modified ciphertext hash value; use the private key of the distributed server to sign the third modified information to be signed to obtain a fifth modified signature, wherein the third modified information to be signed includes: the third modified ciphertext hash value and the electronic medical record identifier; and send the modified upload information to the blockchain, wherein the modified upload information includes: the electronic medical record identifier, the third modified ciphertext hash value, and the fifth modified signature;

[0070] The blockchain is also used to determine information to be sent, wherein the information to be sent includes: the first modified signature, the third modified signature, and the fifth modified signature; the information to be uploaded, the second signature, the fourth signature, the sixth signature, and the information to be sent are respectively sent to the doctor's end, the patient's end, and the distributed server;

[0071] The doctor's terminal is further configured to perform chameleon hash calculation on the information to be sent, the information to be uploaded, the first random number, and the doctor's private key to obtain a first chameleon random number; sign the first chameleon random number and the electronic medical record identifier using the doctor's private key to obtain a first chameleon signature; and send the first chameleon random number, the electronic medical record identifier, and the first chameleon signature to the blockchain.

[0072] The patient terminal is further configured to perform chameleon hash calculation on the information to be sent, the information to be uploaded, the second random number, and the patient's private key to obtain a second chameleon random number; sign the second chameleon random number and the electronic medical record identifier using the patient's private key to obtain a second chameleon signature; and send the second chameleon random number, the electronic medical record identifier, and the second chameleon signature to the blockchain.

[0073] The distributed server is further configured to perform a chameleon hash calculation on the information to be sent, the information to be uploaded, the third random number, and the private key of the distributed server to obtain a third chameleon random number; to sign the third chameleon random number and the electronic medical record identifier using the private key of the distributed server to obtain a third chameleon signature; and to send the third chameleon random number, the electronic medical record identifier, and the third chameleon signature to the blockchain.

[0074] The blockchain is also used to verify the first chameleon random number, the second chameleon random number, and the third chameleon random number respectively. If all verifications are correct, the corresponding information in the stored transaction will be replaced according to the information to be sent, the first chameleon signature, the second chameleon signature, and the third chameleon signature, and the result information will be sent to the distributed server.

[0075] Optionally, the distributed server is further configured to replace the original electronic medical record ciphertext with the modified electronic medical record ciphertext for storage.

[0076] Therefore, the modifiable electronic medical record sharing method and system based on chameleon hash provided by this invention uses proxy re-encryption technology to encrypt electronic medical records. Due to the immutable nature of the blockchain itself, this invention stores the verification information (chameleon hash value) and access permission information of the electronic medical record in the blockchain, thereby ensuring that the integrity of the electronic medical record can be verified. When generating the Merkel tree, the chameleon hash value is used as input. Only with the private key corresponding to the chameleon hash algorithm can different information generate the same hash value. If there is no private key, it is difficult to find a collision, thereby enabling the participants to modify the electronic medical record.

[0077] Therefore, this invention utilizes chameleon hashing to modify electronic medical records, and uses threshold encryption algorithms and blockchain to replace semi-honest third parties, thereby achieving secure storage and sharing of electronic medical records. Attached Figure Description

[0078] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0079] Figure 1 This is a schematic diagram of Merkel root generation provided in an embodiment of the present invention;

[0080] Figure 2 A flowchart of the electronic medical record storage process provided in this embodiment of the invention;

[0081] Figure 3 This is a flowchart of the electronic medical record modification process provided in an embodiment of the present invention. Detailed Implementation

[0082] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0083] The core of this invention lies in:

[0084] This solution stores the verification information and access permissions of electronic medical records in the blockchain. The electronic medical records are encrypted using a proxy re-encryption algorithm, and the ciphertext is stored with a distributed service provider. A chameleon hash value is calculated for the ciphertext and stored in the blockchain. Since the chameleon hash can produce the same hash value for different information, modification of the electronic medical record is possible.

[0085] First, the doctor encrypts the electronic medical record (EMR) using the public key re-encrypted by the patient's agent. The doctor signs the hash value of the ciphertext and sends it to the patient. Simultaneously, the doctor selects a random number, signs the random number, and sends the ciphertext, the ciphertext hash value signature, the random number, and the random number signature to the distributed storage service provider. Upon receiving the EMR, the patient checks for errors. If correct, the patient signs the ciphertext hash value, selects a random number, signs the random number, and then sends the ciphertext hash value signature, the random number, and the random number signature to the distributed storage service provider. The distributed storage service provider stores the ciphertext, calculates a chameleon hash, and sends the signatures of the doctor, patient, and storage service provider, along with the chameleon hash value, to the blockchain. The blockchain generates an EMR storage transaction, storing the information sent by the service provider (excluding the chameleon hash value). Unlike conventional schemes, this scheme uses the chameleon hash value of the input transaction, rather than the transaction itself, when generating the Merkel tree for storing EMR-related information.

[0086] When modifying an electronic medical record (EMR), the doctor encrypts the new EMR using the patient's public key and signs the encrypted hash value of the EMR, sending it to the blockchain. The blockchain forwards this to the patient and the distributed storage service provider (DSS). The patient and the DSS each sign the hash value of the new EMR's encrypted data and send it to the blockchain. The blockchain then sends the initial EMR information, a random number, and the signatures of the doctor, patient, and DSS to the doctor, patient, and DSS. Each of the doctor, patient, and DSS uses their private keys to calculate a new random number and sends it to the blockchain. The blockchain then replaces the original information and the random number.

[0087] The present invention will now be described in detail:

[0088] This invention provides a method for sharing modifiable electronic medical records based on chameleon hashing, the method comprising:

[0089] Doctors generate electronic medical records for patients.

[0090] The doctor uses the patient's public key to perform encrypted calculations on the electronic medical record, obtaining the ciphertext of the electronic medical record;

[0091] The doctor performs a hash calculation on the encrypted electronic medical record to obtain the first encrypted hash value;

[0092] The doctor uses the doctor's private key to sign the first information to be signed, and obtains the first signature. The first information to be signed includes: the first ciphertext hash value and the electronic medical record identifier.

[0093] The doctor will send information to the patient. The information sent includes: encrypted electronic medical record, electronic medical record identifier, and first signature.

[0094] The doctor determines a first random number and uses the doctor's private key to sign the first random number and the electronic medical record identifier to obtain a second signature;

[0095] The doctor sends the first stored information to the distributed server. The first stored information includes: electronic medical record ciphertext, electronic medical record identifier, first random number, first ciphertext hash value, first signature and second signature.

[0096] The patient uses their private key to decrypt the encrypted electronic medical record and obtain the original electronic medical record.

[0097] After the patient verifies the original electronic medical record, a hash operation is performed on the encrypted electronic medical record to obtain the second encrypted hash value.

[0098] The patient uses their private key to sign the second information to be signed, thus obtaining the third signature. The second information to be signed includes: a second ciphertext hash value and an electronic medical record identifier.

[0099] The patient determines a second random number, and uses the patient's private key to sign the second random number and the electronic medical record identifier to obtain a fourth signature;

[0100] The patient sends the second stored information to the distributed server. The second stored information includes: electronic medical record ciphertext, electronic medical record identifier, second random number, second ciphertext hash value, third signature and fourth signature.

[0101] Distributed servers store encrypted electronic medical records;

[0102] The distributed server performs a hash calculation on the encrypted electronic medical record to obtain the third encrypted hash value;

[0103] The distributed server uses its private key to sign the third information to be signed, resulting in the fifth signature. The third information to be signed includes: the third ciphertext hash value and the electronic medical record identifier.

[0104] The distributed server determines a third random number, and then uses the private key of the distributed server to sign the third random number and the electronic medical record identifier to obtain the sixth signature.

[0105] The distributed server determines the information to be uploaded, which includes: electronic medical record identifier, first signature, third signature and fifth signature;

[0106] The distributed server performs hash calculations on the information to be uploaded, the doctor's chameleon hash public key, and the first random number to obtain the first chameleon hash value.

[0107] The distributed server performs hash calculations on the information to be uploaded, the patient's chameleon hash public key, and the second random number to obtain the second chameleon hash value.

[0108] The distributed server performs hash calculations on the information to be uploaded, the distributed server's chameleon hash public key, and the third random number to obtain the third chameleon hash value.

[0109] The distributed server sends the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value to the blockchain.

[0110] As an optional implementation of the present invention, the method for sharing modifiable electronic medical records based on chameleon hash provided by the present invention further includes: the blockchain generating a storage transaction based on the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value; the blockchain verifying the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value, and if the verification is successful, using them as input to the Merkel tree to calculate the final Merkel root.

[0111] For specific implementation, please refer to Figure 1 and Figure 2 The electronic medical record storage process includes:

[0112] 1. The doctor (on the doctor's end) generates an electronic medical record and encrypts it using the patient's proxy encryption algorithm's public key, represented as E(EHR, pk). P Perform a hash operation on the ciphertext, and then sign the hash value of the ciphertext and the electronic medical record identifier using the doctor's private key, represented as: Sig D (H(E(EHR,pk P ))||ID EHR The encrypted electronic medical record, electronic medical record identifier, and signature are sent to the patient. That is: E(EHR, pk) P )||ID EHR ||Sig D (H(E(EHR,pk P ))||ID EHR Select a random number R. D The doctor signs the random number and the electronic medical record identifier, denoted as Sig. D (R D ||ID EHR Send the encrypted electronic medical record (EMR) data, EMR identifier, random number, encrypted hash value, and a signature of the EMR identifier, along with the random number and EMR identifier signature, to the distributed service storage provider. This is represented as: E(EHR, pk) P )||ID EHR ||R D ||Sig D (H(E(EHR,pk P ))||ID EHR )||Sig D (R D ||ID EHR ).

[0113] 2. The patient (patient-side) decrypts the electronic medical record and verifies its contents. If correct, the ciphertext is hashed, and the hash value and the electronic medical record identifier are signed using the patient's private key, represented as: SigP (H(E(EHR,pk P ))||ID EHR Select a random number R. P The patient signs a random number and an electronic medical record identifier, denoted as Sig. p (R P ||ID EHR Send the electronic medical record identifier, a random number, a ciphertext hash value, and a signature of the electronic medical record identifier, along with the random number and the electronic medical record identifier signature, to the distributed service storage provider. Represented as: ID EHR ||R P ||Sig P (H(E(EHR,pk P ))||ID EHR )||Sig P (R P ||ID EHR ).

[0114] 3. The distributed storage service provider (distributed storage) stores the ciphertext and signs the hash value of the ciphertext and the electronic medical record identifier with a private key, represented as: Sig S (H(E(EHR,pk P ))||ID EHR Select a random number R. S The patient signs a random number and an electronic medical record identifier, denoted as Sig. S (R S ||ID EHR The electronic medical record identifier, the doctor's hash of the encrypted text and signature of the electronic medical record identifier, the patient's hash of the encrypted text and signature of the electronic medical record identifier, and the distributed storage service provider's hash of the encrypted text and signature of the electronic medical record identifier are taken as information M, that is, M = {ID} EHR ||Sig D (H(E(EHR,pk P ))||ID EHR )||Sig P (H(E(EHR,pk P ))||ID EHR )||Sig S (H(E(EHR,pk P ))||ID EHR The information M, the doctor's chameleon hash public key, and the random number selected by the doctor are used as inputs to calculate the chameleon hash value, which is represented as: CH D Similarly, calculate the chameleon hash values ​​for the patient and the distributed storage service provider, respectively, as: CH P and CH S M||IDEHR ||Sig D (R D ||ID EHR )||Sig p (R P ||ID EHR )||Sig S (R S ||ID EHR )||CH D ||CH P ||CH S Send it to the blockchain.

[0115] 4. Blockchain generates and stores transactions, including M||ID. EHR ||Sig D (R D ||ID EHR )||Sig P (R P ||ID EHR )||Sig S (R S ||ID EHR Save as transaction content. Verify "CH" D ||CH P ||CH S If the chameleon hash is correct, it is used as input to the Merkel tree to calculate the final Merkel root.

[0116] As an optional implementation of the present invention, the modifiable electronic medical record sharing method based on chameleon hashing provided in the present invention further includes:

[0117] The doctor receives the modified electronic medical record generated for the patient.

[0118] The doctor uses the patient's public key to perform encryption calculations on the modified electronic medical record, obtaining the ciphertext of the modified electronic medical record.

[0119] The doctor performs a hash calculation on the modified electronic medical record ciphertext to obtain the first modified ciphertext hash value.

[0120] The doctor uses the doctor's private key to sign the first modified information to be signed, and obtains the first modified signature. The first modified information to be signed includes: the first modified ciphertext hash value and the electronic medical record identifier.

[0121] The doctor sends the modified message to the blockchain. The modified message includes: the modified electronic medical record ciphertext, the electronic medical record identifier, and the first modified signature.

[0122] The blockchain generates an electronic medical record modification transaction based on the modified sending information, and sends the modified sending information to the patient and the distributed server;

[0123] The patient uses their private key to decrypt the modified electronic medical record ciphertext and obtain the original modified electronic medical record.

[0124] After the patient verifies the original modified electronic medical record, a hash operation is performed on the encrypted modified electronic medical record to obtain the hash value of the second modified encrypted record.

[0125] The patient uses their private key to sign the second modified information to be signed, resulting in a third modified signature. The second modified information to be signed includes: the second modified ciphertext hash value and the electronic medical record identifier.

[0126] The patient sends the modified stored information to the blockchain. The modified stored information includes: electronic medical record identifier, second modified ciphertext hash value, and third modified signature;

[0127] The distributed server performs a hash calculation on the modified electronic medical record ciphertext to obtain the third modified ciphertext hash value;

[0128] The distributed server uses its private key to sign the third modified information to be signed, resulting in the fifth modified signature. The third modified information to be signed includes: the third modified ciphertext hash value and the electronic medical record identifier.

[0129] The distributed server sends the modified upload information to the blockchain. The modified upload information includes: electronic medical record identifier, third modified ciphertext hash value, and fifth modified signature;

[0130] The blockchain determines the information to be sent, which includes: the first modified signature, the third modified signature, and the fifth modified signature;

[0131] The blockchain will send the information to be uploaded, the second signature, the fourth signature, the sixth signature, and the information to be sent to the doctor's end, the patient's end, and the distributed server, respectively.

[0132] The doctor performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the first random number, and the doctor's private key to obtain the first chameleon random number;

[0133] The doctor uses their private key to sign the first chameleon random number and the electronic medical record identifier to obtain the first chameleon signature.

[0134] The doctor sends the first chameleon random number, the electronic medical record identifier, and the first chameleon signature to the blockchain;

[0135] The patient's terminal performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the second random number, and the patient's private key to obtain the second chameleon random number;

[0136] The patient uses their private key to sign the second chameleon random number and the electronic medical record identifier to obtain the second chameleon signature.

[0137] The patient sends the second chameleon random number, the electronic medical record identifier, and the second chameleon signature to the blockchain;

[0138] The distributed server performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the third random number, and the private key of the distributed server to obtain the third chameleon random number.

[0139] The distributed server uses its private key to sign the third-party chameleon random number and the electronic medical record identifier to obtain the third-party chameleon signature.

[0140] The distributed server sends the third chameleon random number, electronic medical record identifier, and third chameleon signature to the blockchain;

[0141] The blockchain verifies the first chameleon random number, the second chameleon random number, and the third chameleon random number respectively. If all three are verified to be correct, the corresponding information in the stored transaction will be replaced with the information to be sent, the first chameleon signature, the second chameleon signature, and the third chameleon signature, and the result information will be sent to the distributed server.

[0142] As an optional implementation of the present invention, the modifiable electronic medical record sharing method based on chameleon hash provided in the present invention further includes: a distributed server replacing the original electronic medical record ciphertext with the modified electronic medical record ciphertext for storage.

[0143] For specific implementation, please refer to Figure 3 The electronic medical record modification process includes:

[0144] 1. The doctor encrypts the modified electronic medical record using the patient's public key. A hash value is calculated on the ciphertext, and the doctor signs the hash value and the electronic medical record's identifier, then sends the ciphertext and signature. That is, Modify Request = {E(EHR′, pk...} P )||ID EHR ||Sig D (H(E(EHR′,pk P ))||ID EHR )}.

[0145] 2. Blockchain generates and modifies electronic medical record transactions, transferring E(EHR′, pk) P )||IDEHR ||Sig D (H(E(EHR′,pk P ))||ID EHR (Sent to patients and service providers.)

[0146] 3. The patient reviews the electronic medical record. If the patient agrees, the system sends the hash value of the encrypted electronic medical record and the signature of the electronic medical record identifier. That is, it sends Patient Consent = {ID}. EHR ||Sig P (H(E(EHR′,pk P ))||ID EHR )} to blockchain.

[0147] 4. The distributed storage service provider sends the hash value of the encrypted electronic medical record and the signature of the electronic medical record identifier, i.e., it sends Server Consent = {ID}. EHR ||Sig S (H(E(EHR′,pk P ))||ID EHR )} to blockchain.

[0148] 5. After receiving information from the patient and the distributed storage service provider, the blockchain uses M′ to represent the signatures of the doctor, patient, and distributed storage service provider on the new electronic medical record. That is, M′={Sig D (H(E(EHR′,pk P ))||ID EHR )||Sig P (H(E(EHR′,pk P ))||ID EHR )||Sig S (H(E(EHR′,pk P ))||ID EHR )}. M||ID EHR ||Sig D (R D ||ID EHR )||Sig P (R P ||ID EHR )||Sig S (R S ||ID EHR M′ is sent to doctors, patients, and distributed storage service providers.

[0149] 6. The doctor will take M′, M, and R D Using the doctor's private key as input to the chameleon hash, calculate R′. D Send R′ D ||ID EHR||Sig D (R′ D ||ID EHR From blockchain.

[0150] 7. The patient will take M′, M, R P Using the patient's private key as input to the chameleon hash, calculate R′. p Send R′ p ||ID EHR ||Sig p (R′ p ||ID EHR From blockchain.

[0151] 8. Distributed storage service providers will use M′, M, and R S Using the service provider's private key as input to the Chameleon Hash, calculate R′. S Send R′ S ||ID EHR ||Sig S (R′ S ||ID EHR From blockchain.

[0152] 9. Blockchain verification of R′ D 、R′ P and R′ S If correct, then use M′||ID. EHR ||Sig D (R′ D ||ID EHR )||Sig p (R′ p ||ID EHR )||Sig S (R′ S ||ID EHR Replace the original stored information and return the result information to the service provider.

[0153] 10. The service provider replaces the original encrypted information.

[0154] Therefore, the modifiable electronic medical record sharing method based on chameleon hash provided in this invention uses proxy re-encryption technology to encrypt the electronic medical record. Since the blockchain itself has the characteristic of being immutable, this invention stores the verification information (chameleon hash value) and access permission information of the electronic medical record in the blockchain, thereby ensuring that the integrity of the electronic medical record can be verified. When the Merkel tree is generated, the chameleon hash value is used as input. Only when the private key corresponding to the chameleon hash algorithm is available can the same hash value be generated for different information. If there is no private key, it is difficult to find a collision, thereby enabling the participants to modify the electronic medical record.

[0155] The following embodiments of the present invention provide a modifiable electronic medical record sharing system based on chameleon hashing. This modifiable electronic medical record sharing system based on chameleon hashing applies the above-mentioned method. The following is only a brief description of the structure of the modifiable electronic medical record sharing system based on chameleon hashing. For other matters not covered, please refer to the relevant descriptions in the above-mentioned modifiable electronic medical record sharing method based on chameleon hashing. The modifiable electronic medical record sharing system based on chameleon hashing provided in this embodiment of the present invention includes: a doctor's end, a patient's end, and a distributed server; wherein:

[0156] On the doctor's end, the system generates the patient's electronic medical record; it uses the patient's public key to encrypt the electronic medical record, obtaining ciphertext; it then performs a hash calculation on the ciphertext to obtain a first ciphertext hash value; the doctor's private key is used to sign a first piece of information to be signed, obtaining a first signature, wherein the first piece of information to be signed includes: the first ciphertext hash value and the electronic medical record identifier; the system sends a message to the patient's end, the message including: the ciphertext, the electronic medical record identifier, and the first signature; a first random number is determined, and the doctor's private key is used to sign the first random number and the electronic medical record identifier, obtaining a second signature; finally, a first stored information is sent to a distributed server, the first stored information including: the ciphertext, the electronic medical record identifier, the first random number, the first ciphertext hash value, the first signature, and the second signature.

[0157] On the patient's end, the system uses the patient's private key to decrypt the encrypted electronic medical record (EMR) to obtain the original EMR. After verifying the original EMR, a hash operation is performed on the encrypted EMR to obtain a second encrypted hash value. The patient's private key is then used to sign the second information to be signed, resulting in a third signature. The second information to be signed includes the second encrypted hash value and the EMR identifier. A second random number is determined, and the patient's private key is used to sign the second random number and the EMR identifier, resulting in a fourth signature. Finally, the second stored information is sent to the distributed server. The second stored information includes the encrypted EMR, the EMR identifier, the second random number, the second encrypted hash value, the third signature, and the fourth signature.

[0158] A distributed server is used to store encrypted electronic medical records. The encrypted electronic medical records are hashed to obtain a third encrypted hash value. The private key of the distributed server is used to sign the third information to be signed, resulting in a fifth signature. The third information to be signed includes the third encrypted hash value and the electronic medical record identifier. A third random number is determined, and the private key of the distributed server is used to sign the third random number and the electronic medical record identifier, resulting in a sixth signature. Information to be uploaded is determined, including the electronic medical record identifier, the first signature, the third signature, and the fifth signature. The information to be uploaded, the doctor's chameleon hash public key, and the first random number are hashed to obtain a first chameleon hash value. The information to be uploaded, the patient's chameleon hash public key, and the second random number are hashed to obtain a second chameleon hash value. The information to be uploaded, the distributed server's chameleon hash public key, and the third random number are hashed to obtain a third chameleon hash value. The information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value are sent to the blockchain.

[0159] As an optional implementation of this invention, the modifiable electronic medical record sharing system based on chameleon hash further includes: a blockchain; the blockchain being used to generate a storage transaction based on the information to be uploaded, a second signature, a fourth signature, a sixth signature, a first chameleon hash value, a second chameleon hash value, and a third chameleon hash value; and to verify the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value, and if the verification is successful, to use them as input to a Merkel tree to calculate the final Merkel root.

[0160] As an optional implementation method provided by the embodiments of the present invention:

[0161] On the doctor's end, it is also used to obtain the modified electronic medical record generated for the patient; to perform encryption calculation on the modified electronic medical record using the patient's public key to obtain the modified electronic medical record ciphertext; to perform hash calculation on the modified electronic medical record ciphertext to obtain the first modified ciphertext hash value; to sign the first modified information to be signed using the doctor's private key to obtain the first modified signature, wherein the first modified information to be signed includes: the first modified ciphertext hash value and the electronic medical record identifier; and to send the modified sending information to the blockchain, wherein the modified sending information includes: the modified electronic medical record ciphertext, the electronic medical record identifier, and the first modified signature.

[0162] Blockchain is also used to generate modified electronic medical record transactions based on the modified sending information, and to send the modified sending information to the patient and a distributed server;

[0163] On the patient's end, the system also uses the patient's private key to decrypt the modified electronic medical record ciphertext, obtaining the modified original electronic medical record; after verifying the modified original electronic medical record, a hash operation is performed on the modified ciphertext to obtain a second modified ciphertext hash value; the patient's private key is used to sign the second modified information to be signed, obtaining a third modified signature, wherein the second modified information to be signed includes: the second modified ciphertext hash value and the electronic medical record identifier; the modified stored information is sent to the blockchain, and the modified stored information includes: the electronic medical record identifier, the second modified ciphertext hash value, and the third modified signature;

[0164] The distributed server is also used to perform hash calculations on the modified electronic medical record ciphertext to obtain a third modified ciphertext hash value; to sign the third modified information to be signed using the private key of the distributed server to obtain a fifth modified signature, wherein the third modified information to be signed includes: the third modified ciphertext hash value and the electronic medical record identifier; and to send the modified upload information to the blockchain, wherein the modified upload information includes: the electronic medical record identifier, the third modified ciphertext hash value and the fifth modified signature.

[0165] Blockchain is also used to determine the information to be sent, which includes: the first modified signature, the third modified signature, and the fifth modified signature; the information to be uploaded, the second signature, the fourth signature, the sixth signature, and the information to be sent are sent to the doctor's end, the patient's end, and the distributed server, respectively;

[0166] On the doctor's side, it is also used to perform chameleon hash calculation on the information to be sent, the information to be uploaded, the first random number, and the doctor's private key to obtain the first chameleon random number; the doctor's private key is used to sign the first chameleon random number and the electronic medical record identifier to obtain the first chameleon signature; the first chameleon random number, the electronic medical record identifier, and the first chameleon signature are sent to the blockchain.

[0167] On the patient's end, it is also used to perform chameleon hash calculation on the information to be sent, the information to be uploaded, the second random number, and the patient's private key to obtain the second chameleon random number; to sign the second chameleon random number and the electronic medical record identifier using the patient's private key to obtain the second chameleon signature; and to send the second chameleon random number, the electronic medical record identifier, and the second chameleon signature to the blockchain.

[0168] The distributed server is also used to perform chameleon hash calculations on the information to be sent, the information to be uploaded, the third random number, and the private key of the distributed server to obtain the third chameleon random number; to sign the third chameleon random number and the electronic medical record identifier using the private key of the distributed server to obtain the third chameleon signature; and to send the third chameleon random number, the electronic medical record identifier, and the third chameleon signature to the blockchain.

[0169] The blockchain is also used to verify the first chameleon random number, the second chameleon random number, and the third chameleon random number respectively. If all of them are verified to be correct, the corresponding information in the stored transaction will be replaced according to the information to be sent, the first chameleon signature, the second chameleon signature, and the third chameleon signature, and the result information will be sent to the distributed server.

[0170] As an optional implementation of this invention, the distributed server is also used to replace the original electronic medical record ciphertext with the modified ciphertext for storage.

[0171] Therefore, the modifiable electronic medical record sharing system based on chameleon hash provided in this embodiment of the invention uses proxy re-encryption technology to encrypt electronic medical records. Since the blockchain itself has the characteristic of being immutable, this invention stores the verification information (chameleon hash value) and access permission information of the electronic medical record in the blockchain, thereby ensuring that the integrity of the electronic medical record can be verified. When the Merkel tree is generated, the chameleon hash value is used as input. Only when the private key corresponding to the chameleon hash algorithm is available can the same hash value be generated for different information. If there is no private key, it is difficult to find a collision, thereby enabling the participants to modify the electronic medical record.

[0172] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for sharing modifiable electronic medical records based on chameleon hashing, characterized in that, include: Doctors generate electronic medical records for patients. The doctor uses the patient's public key to perform encryption calculations on the electronic medical record to obtain the ciphertext of the electronic medical record; The doctor performs a hash calculation on the encrypted electronic medical record to obtain a first encrypted hash value. The doctor uses the doctor's private key to sign the first information to be signed, thereby obtaining the first signature. The first information to be signed includes: the first ciphertext hash value and the electronic medical record identifier. The doctor's terminal sends information to the patient's terminal, and the information includes: the electronic medical record encrypted text, the electronic medical record identifier, and the first signature; The doctor determines a first random number, and uses the doctor's private key to sign the first random number and the electronic medical record identifier to obtain a second signature; The doctor sends the first stored information to the distributed server. The first stored information includes: the electronic medical record ciphertext, the electronic medical record identifier, the first random number, the first ciphertext hash value, the first signature, and the second signature. The patient terminal uses the patient's private key to decrypt the encrypted electronic medical record to obtain the original electronic medical record. After the patient terminal verifies the original electronic medical record, it performs a hash operation on the encrypted electronic medical record to obtain a second encrypted hash value. The patient terminal uses the patient's private key to sign the second information to be signed, thereby obtaining a third signature. The second information to be signed includes: the second ciphertext hash value and the electronic medical record identifier. The patient determines a second random number, and uses the patient's private key to sign the second random number and the electronic medical record identifier to obtain a fourth signature; The patient sends the second stored information to the distributed server. The second stored information includes: the electronic medical record ciphertext, the electronic medical record identifier, the second random number, the second ciphertext hash value, the third signature, and the fourth signature. The distributed server stores the encrypted electronic medical record. The distributed server performs a hash calculation on the encrypted electronic medical record to obtain a third encrypted hash value. The distributed server uses its private key to sign the third information to be signed, thereby obtaining a fifth signature. The third information to be signed includes the third ciphertext hash value and the electronic medical record identifier. The distributed server determines a third random number, and uses the private key of the distributed server to sign the third random number and the electronic medical record identifier to obtain a sixth signature; The distributed server determines the information to be uploaded, wherein the information to be uploaded includes: the electronic medical record identifier, the first signature, the third signature, and the fifth signature; The distributed server performs hash calculations on the information to be uploaded, the doctor's chameleon hash public key, and the first random number to obtain the first chameleon hash value. The distributed server performs hash calculations on the information to be uploaded, the patient's chameleon hash public key, and the second random number to obtain the second chameleon hash value. The distributed server performs hash calculations on the information to be uploaded, the distributed server's chameleon hash public key, and the third random number to obtain the third chameleon hash value. The distributed server sends the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value to the blockchain.

2. The method of claim 1, wherein, Also includes: The blockchain generates a storage transaction based on the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value; The blockchain verifies the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value. If the verification is successful, the hash value is used as input to the Merkel tree to calculate the final Merkel root.

3. The method according to claim 2, characterized in that, Also includes: The doctor's terminal obtains the modified electronic medical record generated for the patient; The doctor uses the patient's public key to perform encryption calculations on the modified electronic medical record to obtain the modified electronic medical record ciphertext. The doctor performs a hash calculation on the modified electronic medical record ciphertext to obtain the first modified ciphertext hash value. The doctor uses the doctor's private key to sign the first modified information to be signed, thereby obtaining the first modified signature. The first modified information to be signed includes: the first modified ciphertext hash value and the electronic medical record identifier. The doctor sends the modified transmission information to the blockchain, wherein the modified transmission information includes: the modified electronic medical record ciphertext, the electronic medical record identifier, and the first modified signature; The blockchain generates a modified electronic medical record transaction based on the modified sending information, and sends the modified sending information to the patient's end and the distributed server; The patient terminal uses the patient's private key to decrypt the modified electronic medical record ciphertext to obtain the modified electronic medical record original text. After the patient terminal verifies the modified original electronic medical record, it performs a hash operation on the modified encrypted electronic medical record to obtain the second modified encrypted hash value. The patient terminal uses the patient's private key to sign the second modified information to be signed, thereby obtaining a third modified signature. The second modified information to be signed includes: the second modified ciphertext hash value and the electronic medical record identifier. The patient sends the modified storage information to the blockchain. The modified storage information includes: the electronic medical record identifier, the second modified ciphertext hash value, and the third modified signature. The distributed server performs a hash calculation on the modified electronic medical record ciphertext to obtain the third modified ciphertext hash value. The distributed server uses its private key to sign the third modified information to be signed, thereby obtaining the fifth modified signature. The third modified information to be signed includes the third modified ciphertext hash value and the electronic medical record identifier. The distributed server sends the modified upload information to the blockchain, and the modified upload information includes: the electronic medical record identifier, the third modified ciphertext hash value, and the fifth modified signature; The blockchain determines the information to be sent, wherein the information to be sent includes: the first modified signature, the third modified signature, and the fifth modified signature; The blockchain sends the information to be uploaded, the second signature, the fourth signature, the sixth signature, and the information to be sent to the doctor's end, the patient's end, and the distributed server, respectively. The doctor's terminal performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the first random number, and the doctor's private key to obtain the first chameleon random number; The doctor uses the doctor's private key to sign the first chameleon random number and the electronic medical record identifier to obtain the first chameleon signature; The doctor sends the first chameleon random number, the electronic medical record identifier, and the first chameleon signature to the blockchain. The patient terminal performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the second random number, and the patient's private key to obtain the second chameleon random number; The patient terminal uses the patient's private key to sign the second chameleon random number and the electronic medical record identifier to obtain the second chameleon signature; The patient sends the second chameleon random number, the electronic medical record identifier, and the second chameleon signature to the blockchain; The distributed server performs a chameleon hash calculation on the information to be sent, the information to be uploaded, the third random number, and the private key of the distributed server to obtain the third chameleon random number. The distributed server uses its private key to sign the third chameleon random number and the electronic medical record identifier to obtain the third chameleon signature. The distributed server sends the third chameleon random number, the electronic medical record identifier, and the third chameleon signature to the blockchain; The blockchain verifies the first chameleon random number, the second chameleon random number, and the third chameleon random number. If all verifications are correct, the corresponding information in the stored transaction will be replaced according to the information to be sent, the first chameleon signature, the second chameleon signature, and the third chameleon signature, and the result information will be sent to the distributed server.

4. The method according to claim 3, characterized in that, Also includes: The distributed server replaces the original electronic medical record ciphertext with the modified ciphertext for storage.

5. A modifiable electronic medical record sharing system based on chameleon hashing, characterized in that, include: Doctor's client, patient's client, and distributed server; among which: The doctor's end is used to generate the patient's electronic medical record; to encrypt the electronic medical record using the patient's public key to obtain ciphertext; to hash the ciphertext to obtain a first ciphertext hash value; to sign first information to be signed using the doctor's private key to obtain a first signature, wherein the first information to be signed includes: the first ciphertext hash value and the electronic medical record identifier; to send information to the patient's end, the information including: the ciphertext, the electronic medical record identifier, and the first signature; to determine a first random number, and to sign the first random number and the electronic medical record identifier using the doctor's private key to obtain a second signature; and to send first stored information to a distributed server, the first stored information including: the ciphertext, the electronic medical record identifier, the first random number, the first ciphertext hash value, the first signature, and the second signature. The patient-side terminal is used to decrypt the ciphertext of the electronic medical record using the patient's private key to obtain the original electronic medical record; after the original electronic medical record passes verification, a hash operation is performed on the ciphertext to obtain a second ciphertext hash value; the patient's private key is used to sign a second piece of information to be signed to obtain a third signature, wherein the second piece of information to be signed includes: the second ciphertext hash value and the electronic medical record identifier; a second random number is determined, and the patient's private key is used to sign the second random number and the electronic medical record identifier to obtain a fourth signature; second stored information is sent to the distributed server, wherein the second stored information includes: the ciphertext of the electronic medical record, the electronic medical record identifier, the second random number, the second ciphertext hash value, the third signature, and the fourth signature; The distributed server is used to store the encrypted electronic medical record; perform hash calculation on the encrypted electronic medical record to obtain a third encrypted hash value; use the private key of the distributed server to sign the third information to be signed to obtain a fifth signature, wherein the third information to be signed includes: the third encrypted hash value and the electronic medical record identifier; determine a third random number, and use the private key of the distributed server to sign the third random number and the electronic medical record identifier to obtain a sixth signature; determine the information to be uploaded, wherein the information to be uploaded includes: the electronic medical record identifier, the first signature, and the third signature. The system performs the following steps: First, it hashes the information to be uploaded, the doctor's chameleon hash public key, and the first random number to obtain a first chameleon hash value. Second, it hashes the information to be uploaded, the patient's chameleon hash public key, and the second random number to obtain a second chameleon hash value. Third, it hashes the information to be uploaded, the distributed server's chameleon hash public key, and the third random number to obtain a third chameleon hash value. Finally, it sends the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value to the blockchain.

6. The system according to claim 5, characterized in that, Also includes: Blockchain; The blockchain is used to generate storage transactions based on the information to be uploaded, the second signature, the fourth signature, the sixth signature, the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value; and to verify the first chameleon hash value, the second chameleon hash value, and the third chameleon hash value. If the verification is successful, they are used as input to the Merkel tree to calculate the final Merkel root.

7. The system according to claim 6, characterized in that, The doctor's terminal is also used to obtain the modified electronic medical record generated for the patient; and to perform encryption calculation on the modified electronic medical record using the patient's public key to obtain the modified electronic medical record ciphertext. The modified electronic medical record ciphertext is hashed to obtain the first modified ciphertext hash value; The doctor's private key is used to sign the first modified information to be signed, resulting in a first modified signature. The first modified information to be signed includes: the first modified ciphertext hash value and the electronic medical record identifier. The modified sending information is then sent to the blockchain, wherein the modified sending information includes: the modified electronic medical record ciphertext, the electronic medical record identifier, and the first modified signature. The blockchain is also used to generate a modified electronic medical record transaction based on the modified sending information, and to send the modified sending information to the patient's end and the distributed server; The patient-side terminal is further configured to: decrypt the modified electronic medical record ciphertext using the patient's private key to obtain the modified electronic medical record original text; after verifying the modified electronic medical record original text, perform a hash operation on the modified electronic medical record ciphertext to obtain a second modified ciphertext hash value; sign the second modified information to be signed using the patient's private key to obtain a third modified signature, wherein the second modified information to be signed includes: the second modified ciphertext hash value and the electronic medical record identifier; and send the modified storage information to the blockchain, wherein the modified storage information includes: the electronic medical record identifier, the second modified ciphertext hash value, and the third modified signature. The distributed server is further configured to perform hash calculation on the modified electronic medical record ciphertext to obtain a third modified ciphertext hash value; use the private key of the distributed server to sign the third modified information to be signed to obtain a fifth modified signature, wherein the third modified information to be signed includes: the third modified ciphertext hash value and the electronic medical record identifier; and send the modified upload information to the blockchain, wherein the modified upload information includes: the electronic medical record identifier, the third modified ciphertext hash value, and the fifth modified signature; The blockchain is also used to determine information to be sent, wherein the information to be sent includes: the first modified signature, the third modified signature, and the fifth modified signature; the information to be uploaded, the second signature, the fourth signature, the sixth signature, and the information to be sent are respectively sent to the doctor's end, the patient's end, and the distributed server; The doctor's terminal is further configured to perform chameleon hash calculation on the information to be sent, the information to be uploaded, the first random number, and the doctor's private key to obtain a first chameleon random number; sign the first chameleon random number and the electronic medical record identifier using the doctor's private key to obtain a first chameleon signature; and send the first chameleon random number, the electronic medical record identifier, and the first chameleon signature to the blockchain. The patient terminal is further configured to perform chameleon hash calculation on the information to be sent, the information to be uploaded, the second random number, and the patient's private key to obtain a second chameleon random number; sign the second chameleon random number and the electronic medical record identifier using the patient's private key to obtain a second chameleon signature; and send the second chameleon random number, the electronic medical record identifier, and the second chameleon signature to the blockchain. The distributed server is further configured to perform a chameleon hash calculation on the information to be sent, the information to be uploaded, the third random number, and the private key of the distributed server to obtain a third chameleon random number; to sign the third chameleon random number and the electronic medical record identifier using the private key of the distributed server to obtain a third chameleon signature; and to send the third chameleon random number, the electronic medical record identifier, and the third chameleon signature to the blockchain. The blockchain is also used to verify the first chameleon random number, the second chameleon random number, and the third chameleon random number respectively. If all verifications are correct, the corresponding information in the stored transaction will be replaced according to the information to be sent, the first chameleon signature, the second chameleon signature, and the third chameleon signature, and the result information will be sent to the distributed server.

8. The system according to claim 7, characterized in that, The distributed server is also used to replace the original electronic medical record ciphertext with the modified ciphertext for storage.

Citation Information

Patent Citations

  • Document batch signing method and device based on chameleon hash, equipment and medium

    CN114710298A

  • Ciphertext duplicate checking and storage method based on homomorphic encryption and Simhash

    CN116070276A