WO2022134119A1 - 基于区块链的电子病历共享方法和电子设备 - Google Patents

基于区块链的电子病历共享方法和电子设备 Download PDF

Info

Publication number
WO2022134119A1
WO2022134119A1 PCT/CN2020/139753 CN2020139753W WO2022134119A1 WO 2022134119 A1 WO2022134119 A1 WO 2022134119A1 CN 2020139753 W CN2020139753 W CN 2020139753W WO 2022134119 A1 WO2022134119 A1 WO 2022134119A1
Authority
WO
WIPO (PCT)
Prior art keywords
medical record
digital signature
matrix
electronic medical
blockchain
Prior art date
Application number
PCT/CN2020/139753
Other languages
English (en)
French (fr)
Inventor
吴从华
Original Assignee
西安科锐盛创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西安科锐盛创新科技有限公司 filed Critical 西安科锐盛创新科技有限公司
Priority to PCT/CN2020/139753 priority Critical patent/WO2022134119A1/zh
Publication of WO2022134119A1 publication Critical patent/WO2022134119A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H10/00ICT specially adapted for the handling or processing of patient-related medical or healthcare data
    • G16H10/60ICT specially adapted for the handling or processing of patient-related medical or healthcare data for patient-specific data, e.g. for electronic patient records

Definitions

  • the invention belongs to the technical field of blockchain, and in particular relates to a blockchain-based electronic medical record sharing method and electronic device.
  • EMR Electronic medical record
  • EMR Electronic Medical Record
  • Its content includes all the information of paper medical records, and compared with paper medical records, electronic medical records also provide medical staff with complete, real-time, anytime, anywhere access to patient information, and support the sharing of medical information between patients in different medical institutions equal meaning.
  • the existing medical institutions that use electronic medical records usually only store the electronic medical records, so that the medical records can be kept and inquired in the future.
  • the present invention provides a blockchain-based electronic medical record sharing method and electronic device.
  • the technical problem to be solved by the present invention is realized by the following technical solutions:
  • an embodiment of the present invention provides a blockchain-based electronic medical record sharing method, which is applied to a medical institution node, including:
  • the block confirmed by the verification node is received and added to the block chain structure maintained by the preset database.
  • the construction of a finite field-based GRS code includes:
  • generating a public key and a private key according to the GRS code includes:
  • a (n-k) ⁇ (n-k) non-singular matrix, an n ⁇ n dense matrix and an n ⁇ n sparse matrix are selected in the finite field; the rank of the dense matrix is z, and the average of the sparse matrix
  • the row weight and column weight are x; among them, z and x are natural numbers, and z is less than n, and x is less than n.
  • the check matrix is a (n-k) ⁇ n matrix of the GRS code ;
  • the non-singular matrix, the check matrix, the transformation matrix and the decoding algorithm are used as the private key.
  • the performing a hash operation on the electronic medical record to generate a medical record abstract includes:
  • Hash operation is performed again on the result obtained by the initial hash operation to obtain the medical record abstract.
  • the first digital signature obtained by encrypting the medical record abstract includes:
  • the first digital signature is obtained by multiplying the non-singular matrix and the medical record abstract.
  • using the private key to decode the first digital signature and using the obtained error vector as the second digital signature includes:
  • the method further includes:
  • the index pair is used as the second digital signature.
  • an embodiment of the present invention provides a blockchain-based electronic medical record sharing method, which is applied to a verification node, including:
  • the block is confirmed through a consensus mechanism and the confirmed block is sent to the medical institution node.
  • the obtaining the public key of the medical institution node and verifying the second digital signature according to the public key includes:
  • the case abstract to be verified is compared with the medical record abstract. If the to-be-verified case abstract is the same as the case abstract, the verification is successful, otherwise, the verification fails.
  • an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
  • the processor is configured to implement any one of the method steps described in the first aspect or the method steps described in the second aspect when executing the program stored in the memory.
  • the solution of the present invention is based on blockchain technology and digital signature technology, which can ensure that electronic medical records are shared among medical institutions and will not be tampered with; and the digital signature solution provided by the embodiment of the present invention has high feasibility and can reduce Small amount of public keys, improve signature efficiency, and can further improve security.
  • FIG. 1 is a schematic diagram of a blockchain-based electronic medical record sharing method provided by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of another method for sharing electronic medical records based on blockchain provided by an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • Fig. 4 is the feasibility simulation result diagram of the signature method provided by the embodiment of the present invention.
  • Fig. 5 is a feasibility simulation result diagram of the signature method provided by an embodiment of the present invention under different error correction capabilities
  • Fig. 6 is the simulation result diagram of the signature method provided by the embodiment of the present invention under ISD decoding attack
  • FIG. 7 is a simulation result diagram of the public key quantity of the signature method provided by the embodiment of the present invention under different error correction capabilities.
  • the embodiments of the present invention provide a blockchain-based electronic medical record sharing method and electronic device.
  • a blockchain-based electronic medical record sharing method provided by an embodiment of the present invention is applied to a node of a medical institution.
  • the electronic medical record sharing method is described below.
  • FIG. 1 is a flowchart of a method for sharing electronic medical records based on a blockchain provided by an embodiment of the present invention.
  • the blockchain-based electronic medical record sharing method provided by the embodiment of the present invention is applied to a node of a medical institution.
  • the medical institution node can be the computing server of the medical institution, the blockchain is jointly maintained by each node server, and the medical institution node is one of many nodes.
  • the method includes:
  • Medical institutions refer to hospitals, clinics, community health centers and other medical organizations.
  • Electronic medical records are medical record information recorded by doctors in various medical institutions during the process of inquiring patients, such as symptoms and diagnosis and treatment methods. These medical record information is stored In the preset database of each medical institution, it can be directly obtained from the preset database during use.
  • the hash operation refers to an algorithm that can map a message of any length into a fixed-length message, and the hash operation implemented in the present invention can adopt any one of MD4, MD5 or SHA256.
  • the medical record abstract is an unencrypted plaintext, and the plaintext is a character whose meaning can be intuitively understood by people.
  • the first encryption is performed by a hash algorithm to map the plaintext of any length into a series of ciphertexts of fixed length, and the ciphertext is encrypted. After the string, people cannot intuitively understand its meaning, this string of ciphertext is the digital digest.
  • a medical record abstract is generated from the plaintext of the electronic medical record through hash operation, and the medical record abstract is used for the next step of encryption of the electronic medical record.
  • S12 may include S121-S122.
  • h(M) is obtained by performing the initial hash operation on the electronic medical record.
  • i), where i 0, 1,2....
  • one or more hash operations can also be used to obtain the electronic medical record abstract, as long as the output of the fixed length is satisfied.
  • this step may include: constructing a finite field, and constructing a GRS code with a code length of n, a dimension of k and an error correction capability of t according to the finite field, where n, k and t are all any positive integers , and satisfy
  • the reason why the embodiment of the present invention chooses to be based on the finite field F q instead of the common binary is because when facing an ISD decoding attack, for codes with the same security level (for example, Goppa codes), the Compared with the binary Goppa code based on the binary Goppa code, the finite field F q Goppa code has a smaller amount of public keys.
  • a finite field-based Goppa code with a security level of 128 has a public key size of 725,740 bits; while a binary Goppa code with a security level of 128 has a public key size of 1,537,536 bits.
  • the public key amount of Goppa code based on finite field F q is nearly an order of magnitude smaller than that of binary Goppa code.
  • GRS code is a very large distance separable (MDS) code, and the performance of the code is good;
  • MDS very large distance separable
  • Generating public and private keys based on finite field GRS codes can ensure that public keys and private keys have higher security performance and take up less space, and generate different public keys and private keys for different logistics information.
  • a public key can only decrypt one encrypted label.
  • S14 may include S141 to S144.
  • the rank z of the dense matrix may be much smaller than n, and the average row weight and column weight x of the sparse matrix may be much smaller than n.
  • a dense matrix can be represented by the product of the transposed matrix of the matrix and the matrix, that is, in are two z ⁇ n matrices defined over a finite field F q , and the rank of the matrices is z.
  • the scheme of the present invention has the following options for the selection of parameters m, n, k, t and x for reference, see Table 1, there are and are not limited to these types, but considering the correctness of the scheme , feasibility and security, as well as the amount of public keys and the length of the signature, the solution of the present invention preferably adopts the three groups of parameter values listed in Table 1.
  • the public key is used for public disclosure, and the private key is used for storage.
  • the public key and the private key are two different parameter sets in an algorithm, but are intrinsically related.
  • the public key and the private key are generated at the same time, but can be used independently.
  • S15 Encrypt the medical record abstract to obtain a first digital signature.
  • this step may include:
  • S' x represents the first digital signature, which can also be called the syndrome to be translated, represents a non-singular matrix, and S x represents the medical record summary.
  • this step may include S161 to S163:
  • the decoding algorithm can be selected from any existing decoding algorithm.
  • the decoding algorithm is preferably an iterative decoding algorithm in the time domain, namely: BM iterative decoding algorithm (Berlekamp-Massey), money search algorithm (Chien) and a combination of Forney's algorithm.
  • BM iterative decoding algorithm Bit-Massey
  • Chien money search algorithm
  • the decoding algorithm is fast, simple to implement, and easy to implement with a computer, so it is a fast decoding algorithm.
  • the decoding algorithm may include the following steps:
  • Step 1 Calculate the syndrome
  • Step 2 Determine the error location polynomial
  • Step 3 Determine the error estimation function
  • Step 4 Find the number of error positions and error values, and correct them.
  • one decoding can be completed. If the decoding is successful, the error vector will be directly decoded; otherwise, it will be regarded as a decoding failure.
  • the digital signature based on the error vector error correction code has been obtained, but because there are multiple 0 elements in the error vector, more bits are occupied.
  • the solution provided by the present invention can be further optimized on the basis of the above embodiments.
  • the following steps are further included:
  • An index pair is constructed for the second error vector to obtain an index pair of the second error vector.
  • the index pair of the second error vector can be obtained according to formula (5).
  • I e represents an index pair
  • the non-zero elements in the second error vector are extracted and marked as error values, and the index pair I e of the second error vector is constructed with the error position ⁇ and the error position c.
  • the index pair is used as a digital signature.
  • the signature usually corresponds to the process of signature verification.
  • the obtained index pair I e is used as a digital signature; and in the signature verification process, since the signature verification person needs to use the index
  • i) are verified together, so after the signature verification is successful, [I e
  • the number of bits can be reduced, thereby reducing the length of the signature.
  • the digital signature and the digest of the electronic medical record are broadcast to each verification node of the network, and the verification node verifies the digital signature after receiving the digital signature and the digest of the electronic medical record.
  • the verification node verifies the digital signature after receiving the digital signature and the digest of the electronic medical record.
  • Each node maintains a common blockchain, and each node stores the blockchain in a distributed manner, so a common blockchain is also maintained in the preset database. After receiving the block confirmed by the verification node, connect the confirmed block with the previous block in the local block chain structure in the order of occurrence to update the maintained block chain, thus realizing the electronic medical record of sharing.
  • the blockchain uses a blockchain data structure to verify and store data, use a distributed node consensus algorithm to generate and update data, and use cryptography to ensure The security of data transmission and access, a brand-new distributed infrastructure and computing method that uses smart contracts composed of automated script codes to program and manipulate data, which are characterized by decentralization, openness, and immutability.
  • the blockchain-based electronic medical record sharing method is applied to a node of a medical institution, generates a public key and a private key through the GRS code of the finite field F q , obtains an electronic medical record abstract according to the electronic medical record, and uses the private key to pair
  • the electronic medical record abstract is encrypted to obtain a digital signature, and the digital signature is encapsulated into a block, and the block is confirmed through a consensus mechanism and the confirmed block is sent to the medical institution node.
  • the solution of the present invention is based on blockchain technology and digital signature technology, which can ensure that electronic medical records are shared among medical institutions and will not be tampered with; and the digital signature solution provided by the embodiment of the present invention has high feasibility and can reduce Small amount of public keys, improve signature efficiency, and can further improve security.
  • an embodiment of the present invention provides a blockchain-based electronic medical record sharing method, which is applied to a verification node.
  • the electronic medical record sharing method is described below.
  • FIG. 2 is a flowchart of another method for sharing electronic medical records based on blockchain provided by an embodiment of the present invention.
  • the flowchart of the blockchain-based electronic medical record sharing method provided by the embodiment of the present invention is applied to a verification node.
  • the verification process in this part is the signature verification process of the digital signature provided by the medical institution node in the first aspect.
  • the method includes:
  • the verification node receives the digital signature and the electronic medical record digest broadcast from the medical institution node in the network for the next verification.
  • each node Since the public key of each node is public, its public key is obtained from the medical institution node. Verification of the digital signature by the obtained public key can prove that the case abstract is from the medical institution node and that the medical record abstract is complete and not tampered with.
  • this step may include S221-S223:
  • this step is to use the public key to directly decrypt the second error vector to obtain the digest of the electronic medical record to be verified.
  • the second error vector needs to be recovered according to the index pair, and then the second error vector is decrypted by using the public key to obtain the digest of the electronic medical record to be verified. .
  • the second error vector needs to be recovered according to the index pair, that is, the position of the ⁇ j index in the index pair I e is filled with c j , and the position outside the ⁇ j index is filled with 0, until the vector The length reaches (nk).
  • the second error vector is decrypted by using the public key, that is, the digest of the electronic medical record to be verified is obtained according to formula (6):
  • y represents the summary of the electronic medical record to be verified.
  • Each column in is the product of the value of the corresponding row indexed by ⁇ j and c j , and the product is taken as the electronic medical record abstract to be verified.
  • the electronic medical record needs to be hashed twice, and the specific steps are the same as those of the hash operation in the first aspect, which will not be repeated here.
  • the electronic medical record summary y' h(h(M)
  • i) is obtained.
  • the block refers to the data block that records the medical record abstract, which includes the block header and the block body.
  • the block body is used to store the medical record abstract.
  • the block header includes the hash value, timestamp, version number, and difficulty value of the previous block. , random numbers, and Merkle tree roots.
  • the Merkle tree is a middle binary tree, which consists of a root node, an intermediate node and a leaf node. The leaf node stores data and the hash value of the data, the intermediate node is the hash value of the leaf node, and the root node is the intermediate node.
  • Hash value called Merkel root
  • Merkel root the data change of any node will lead to the change of Merkel root, so the data can be summarized and the integrity of the data can be verified through the Merkel tree
  • timestamp refers to the time stamp , which is used to prove the occurrence time of the medical record summary
  • the difficulty value refers to the difficulty of confirming that the block is valid
  • the random number is the parameter used to calculate the hash value.
  • the consensus mechanism refers to the means by which nodes in the network reach a consensus to confirm the validity of the block, mainly including the workload proof mechanism, the equity proof mechanism and the share authorization proof mechanism.
  • the workload proof mechanism is used, and the workload proof mechanism refers to It is a proof of work.
  • the proof of work is the result that the node consumes a lot of computer computing power to meet the conditions, and the proof is very easy to verify.
  • the hash value of the block header composed of the hash value, timestamp, version number, difficulty value, random number and Merkle tree root of the previous block is first obtained according to the hash algorithm.
  • the blockchain-based electronic medical record sharing method provided by the embodiment of the present invention is applied to a verification node, generates a public key and a private key through the GRS code of the finite field F q , obtains the electronic medical record abstract according to the electronic medical record, and uses the private key to pair the electronic medical record.
  • the medical record abstract is encrypted to obtain a digital signature, and the digital signature is encapsulated into a block, and the block is confirmed and verified through a consensus mechanism.
  • the solution of the present invention is based on blockchain technology and digital signature technology, which can ensure that electronic medical records are shared among medical institutions and will not be tampered with; and the digital signature solution provided by the embodiment of the present invention has high feasibility and can reduce Small amount of public keys, improve signature efficiency, and can further improve security.
  • an embodiment of the present invention further provides an electronic device.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • the electronic device includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, the memory 303 completes mutual communication through the communication bus 304;
  • the processor 301 is configured to implement any one of the method steps of the first aspect or any one of the method steps of the second aspect when executing the program stored in the memory 303 .
  • the communication bus mentioned in the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus or the like.
  • PCI peripheral component interconnect standard
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface is used for communication between the above electronic device and other devices.
  • the memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk storage.
  • RAM Random Access Memory
  • NVM non-Volatile Memory
  • the memory may also be at least one storage device located away from the aforementioned processor.
  • the above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the solution of the present invention is based on blockchain technology and digital signature technology, which can ensure that electronic medical records are shared among medical institutions and will not be tampered with; and the digital signature solution provided by the embodiment of the present invention has high feasibility and can reduce Small amount of public keys, improve signature efficiency, and can further improve security.
  • the scheme of the present invention adopts the digital signature method based on the finite field GRS code. Below, the following five aspects of the correctness, feasibility, security, public key quantity and signature length of the digital signature are provided by the embodiments of the present invention. scheme is verified.
  • the verification of correctness is also the verification of whether the signature is successfully verified. It is necessary to prove that the digest to be verified obtained by decrypting the second error vector with the public key is equal to the digest obtained in the process of generating the signature, which can prove the correctness.
  • the specific process is as follows:
  • the public key is obtained by multiplying the matrix based on the inverse matrix of the non-singular matrix, the check matrix and the transposed matrix of the change matrix, that is, the above formula ( 2);
  • the second error vector is obtained by multiplying the matrix based on the first error vector and the inverse matrix of the change matrix of the private key, that is, the above formula (4);
  • the digest to be verified is based on each column in the public key according to ⁇ It is obtained by multiplying the value of the corresponding row of index j and c j , that is, the above formula (6).
  • y represents the digest to be verified, represents the inverse of a non-singular matrix, and S' x represents the syndrome to be translated.
  • the syndrome to be translated is obtained based on the multiplication of the non-singular matrix and the digest, that is, the above formula (3).
  • the parameter pair (m, t) of the GRS code signature based on the finite field F q should not only ensure that the average number of searches is below the order of ten million, but also ensure that the selection of the parameter pair cannot be too small.
  • FIG. 4 is a feasibility simulation result diagram of the signature method provided by the embodiment of the present invention.
  • the figure shows the relationship between the error correction capability t and the log 2 Z of the average number of searches. It can be seen from FIG. 4 that the error correction capability t is proportional to the logarithm log 2 Z of the average search times, that is, the average search times Z has an exponential relationship with the error correction capability t.
  • the error correction capability t When the value of the error correction capability t is greater than 10, the average number of searches will be too large. Therefore, it is more appropriate for the error correction capability t to be less than or equal to 10.
  • FIG. 5 is a feasibility simulation result diagram of the signature method provided by an embodiment of the present invention under different error correction capabilities.
  • Figure 5 shows the relationship between m and the logarithm of the average search times when the error correction capability t is 9 and 10.
  • the data x in the figure represents m
  • y represents log 2 Z. It can be seen from Figure 5 that when m ⁇ 12, as m increases, log 2 Z tends to be stable with little change; when m ⁇ 12, the average search times will increase. Therefore, it is more appropriate for m to be greater than or equal to 12.
  • the parameter pairs (m, t) used by the known CFS signature are (15, 10) and (16, 9).
  • the logarithm value of the average search times of CFS signature is 27.7911
  • the logarithm value of the average search times of the GRS code signature based on finite field F q is 21.7933
  • the parameter pair is (16,9 )
  • the logarithm of the average search times of the CFS signature is 18.4691
  • the logarithm of the average search times of the GRS code signature based on the finite field F q is 18.4703.
  • FIG. 6 is a simulation result diagram of the signature method provided by the embodiment of the present invention under the ISD decoding attack.
  • Figure 6 shows the relationship between m and the security level SL in the case of an ISD decoding attack.
  • the security level coefficient under the ISD decoding attack has an exponential relationship with the product of m and t. Based on the above conditions, t is selected to be less than or equal to 10. That is, when t is determined, the larger m is, the higher the safety level coefficient is.
  • the data x in the figure represents m
  • y represents SL.
  • the security level SL can reach 80, which has reached the general security level, and the selected parameter pair is (16,9), the security level SL exceeds 128.
  • the GRS code signature based on the finite field F q provided by the embodiment of the present invention has a higher security level coefficient under the ISD decoding attack.
  • the GRS code signature based on the finite field F q provided by the embodiment of the present invention can also effectively resist the discrimination attack, while the parameter selection of the CFS signature under the discrimination attack has defects.
  • Gaussian elimination is performed on the check matrix of the GRS code to obtain a row ladder matrix, that is, the public key
  • the amount of public keys is k ⁇ (nk). Therefore, on the GRS code based on the finite field F q , the amount of public keys is k ⁇ (nk) ⁇ log 2 q.
  • FIG. 7 is a graph of a simulation result of the public key quantity of the signature method provided by the embodiment of the present invention under different error correction capabilities.
  • Figure 7 shows the relationship between m and the amount of public keys when the error correction capability t is 9 and 10.
  • the data x represents m
  • y represents k ⁇ (nk) ⁇ log 2 q.
  • the amount of public keys has an exponential relationship with m, and under different error correction capabilities t, the impact on the amount of public keys is not obvious.
  • m is larger, the GRS code signature based on finite field F q is more secure, but it also leads to a larger amount of public keys. Therefore, a more appropriate m is selected, so that the security factor is high and the public key amount is small, for example, m is 10, 12, etc.
  • the GRS code signature based on the finite field F q provided by the embodiment of the present invention has a signature length of 2m ⁇ t p +log 2 Z.
  • Table 3 shows the comparison of the average search times, security level, public key amount and signature length between the GRS code signature based on the finite field F q and the CFS signature under two different parameter pairs.
  • the security level coefficient of the GRS code signature based on the finite field F q provided by the embodiment of the present invention is higher than that of the CFS signature, but the amount of public keys and the digital signature The length is also larger.
  • the GRS code signature based on the finite field Fq provided by the embodiment of the present invention can reduce the selection of parameter pairs, reduce the amount of public keys and the length of the signature on the premise of improving the security level coefficient.
  • the above verification shows that the digital signature scheme adopted in the present invention has the effects of correctness, feasibility, security, and the reduction of the amount of public keys and the length of the signature.

Landscapes

  • Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Epidemiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Medical Treatment And Welfare Office Work (AREA)
  • Storage Device Security (AREA)

Abstract

一种基于区块链的电子病历共享方法,应用于医疗机构节点,包括:从预设数据库获取电子病历(S11);对电子病历进行哈希运算生成病历摘要(S12);构造一基于有限域的GRS码(S13);根据GRS码生成公钥以及私钥(S14);使用私钥对病历摘要进行加密处理得到第一数字签名(S15);使用私钥对第一数字签名进行译码并将得到的错误向量作为第二数字签名(S16);将第二数字签名发送至验证节点进行验证(S17);接收验证节点确认的区块并将区块添加到预设数据库所维护的区块链结构上(S18)。该方案基于区块链技术和数字签名技术,能够保证电子病历在各医疗机构之间共享且不会被篡改;且该数字签名方案具有较高的可行性,能够减小公钥量,提高签名效率,并能够进一步提高安全性。

Description

基于区块链的电子病历共享方法和电子设备 技术领域
本发明属于涉及区块链技术领域,具体涉及一种基于区块链的电子病历共享方法和电子设备。
背景技术
电子病历(EMR,Electronic Medical Record)也叫计算机化的病案系统或称基于计算机的病人记录,它是用电子设备(计算机、健康卡等)保存、管理、传输和重现的数字化的医疗记录,用以取代手写纸张病历。它的内容包括纸张病历的所有信息,且相比纸张病历,电子病历还具有为医护人员提供完整的、实时的、随时随地的病人信息访问,以及支持病人在不同医疗机构之间的医疗信息共享等意义。
而现有使用电子病历的医疗机构通常只是将问电子病历存储起来,以便以后病历的保管和查询,不同医疗机构之间的电子病历不能共享;从而导致了病人在其他医疗机构看病时不能方便的获取到原来医疗机构的电子病历;且由于每个医疗机构管理各自的电子病历,因此电子病历存在被篡改的风险,无法保证电子病历的真实性。
发明内容
为了解决现有技术中存在的上述问题,本发明提供了一种基于区块链的电子病历共享方法及电子设备。本发明要解决的技术问题通过以下技术方案实现:
第一方面,本发明实施例提供了一种基于区块链的电子病历共享方法,应用于医疗机构节点,包括:
从预设数据库获取电子病历;
对所述电子病历进行哈希运算生成病历摘要;
构造一基于有限域的GRS码;
根据所述GRS码生成公钥以及私钥;
使用所述私钥对所述病历摘要进行加密处理得到第一数字签名;
使用所述私钥对所述第一数字签名进行译码并将得到的错误向量作为第二数字签名;
将所述第二数字签名发送至验证节点进行验证;
接收所述验证节点确认的区块并将所述区块添加到所述预设数据库所维护的区块链结构上。
在本发明的一个实施例中,所述构造一基于有限域的GRS码,包括:
构造一有限域,并根据所述有限域构造一个码长为n、维数为k且纠错能力为t的GRS码,其中,n、k和t均为任意正整数,且满足
Figure PCTCN2020139753-appb-000001
在本发明的一个实施例中,所述根据所述GRS码生成公钥以及私钥,包括:
在所述有限域内选取一(n-k)×(n-k)的非奇异矩阵、一n×n的稠密矩阵以及一n×n的稀疏矩阵;所述稠密矩阵的秩为z,所述稀疏矩阵的平均行重和列重为x;其中,z、x为自然数,且z小于n,x小于n。
将所述稠密矩阵以及所述稀疏矩阵进行矩阵的加法运算,得到变换矩阵;
将所述非奇异矩阵的逆矩阵、校验矩阵以及所述变换矩阵的转置矩阵进行矩阵的乘法运算,得到公钥;其中,所述校验矩阵是GRS码的(n-k)×n的矩阵;
将所述非奇异矩阵、所述校验矩阵、所述变换矩阵与译码算法作为私钥。
在本发明的一个实施例中,所述对所述电子病历进行哈希运算生成病历摘要,包括:
对所述电子病历进行初次哈希运算;
对初次哈希运算得到的结果再次进行哈希运算,得到所述病历摘要。
在本发明的一个实施例中,所述对所述病历摘要进行加密处理得到第一数字签名,包括:
将所述非奇异矩阵与所述病历摘要进行乘法运算,得到所述第一数字签名。
在本发明的一个实施例中,所述使用所述私钥对所述第一数字签名进行译码并将得到的错误向量作为第二数字签名,包括:
结合所述私钥的变换矩阵使用所述译码算法对所述第一数字签名进行译码,得到第一错误向量;
将所述第一错误向量与所述私钥的变换矩阵的逆矩阵进行矩阵的乘法运算,得到第二错误向量,所述第二错误向量的权重小于等于所述GRS码的纠错能力值;
将所述第二错误向量作为所述第二数字签名。
在本发明的一个实施例中,在得到所述第二错误向量之后,还包括:
对所述第二错误向量构建索引对,得到第二错误向量的索引对;
相应的,将所述索引对作为所述第二数字签名。
第二方面,本发明实施例提供了一种基于区块链的电子病历共享方法,应用于验证节点,包括:
接收来自医疗机构节点的第二数字签名,所述第二数字签名第一方面任一项所述的方法得到;
获取所述医疗机构节点的公钥并根据所述公钥对所述第二数字签名进行验证;
若所述第二数字签名验证通过,将所述病历摘要封装到区块中;
通过共识机制对所述区块进行确认并将所确认的区块发送至所述医疗机构节点。
在本发明的一个实施例中,所述获取所述医疗机构节点的公钥并根据所述公钥对所述第二数字签名进行验证,包括:
获取所述医疗机构节点的公钥并根据所述公钥对所述第二数字签名进行解密,得到待验证的病例摘要;
获取所述电子病历并对所述电子病历进行哈希运算,得到病历摘要;
将所述待验证的病例摘要与所述病历摘要进行比较,若所述待验证病例摘要与所述病例摘要相同,则验证成功,反之则验证失败。
第三方面,本发明实施例还提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
存储器,用于存放计算机程序;
处理器,用于执行存储器上所存放的程序时,实现第一方面任一所述的方法步骤或第二方面所述的方法步骤。
本发明的方案基于区块链技术和数字签名技术,能够保证电子病历在各医疗机构之间共享且不会被篡改;且本发明实施例提供的数字签名方案具有较高的可行性,能够减小公钥量,提高签名效率,并能够进一步提高安全性。
以下将结合附图及实施例对本发明做进一步详细说明。
附图说明
图1是本发明实施例提供的一种基于区块链的电子病历共享方法示意图;
图2是本发明实施例提供的另一种基于区块链的电子病历共享方法示意图;
图3是本发明实施例提供的电子设备结构示意图;
图4是本发明实施例提供的签名方法的可行性仿真结果图;
图5是本发明实施例提供的签名方法在不同纠错能力下的可行性仿真结果图;
图6是本发明实施例提供的签名方法在ISD译码攻击下的仿真结果图;
图7是本发明实施例提供的签名方法在不同纠错能力下的公钥量仿真结果图。
具体实施方式
下面结合具体实施例对本发明做进一步详细的描述,但本发明的实施方式不限于此。
为了解决现有电子病历在不同医疗机构之间不能共享,以及存在的被篡改的风险,本发明实施例提供了一种基于区块链的电子病历共享方法和电子设备。
第一方面,本发明实施例提供的一种基于区块链的电子病历共享方法,应用于医疗机构节点,下面对该电子病历共享方法进行介绍。
请参见图1,图1是本发明实施例提供的一种基于区块链的电子病历共享方法流程图。本发明实施例提供的基于区块链的电子病历共享方法,应用于医疗机构节点。医疗机构节点可以是医疗机构的计算服务器,区块链由各个节点服务器共同维护,而医疗机构节点为众多节点中的一个节点。该方法包括:
S11、从预设数据库获取电子病历。
医疗机构指的是医院、诊所、社区健康中心以及其他医疗组织,电子病历是各医疗机构的医生在为病人问诊过程中记录的病历信息,例如症状及诊疗手段等内容,这些病历信息均存储在各医疗机构的预设数据库中,使用时直接从预设数据库中获取即可。
S12、对电子病历进行哈希运算生成病历摘要。
哈希运算指的是可将任意长度的消息映射成固定长度消息的算法,本发明实施的哈希运算可以采用MD4、MD5或者SHA256中的任意一种。其中, 病历摘要作为未经过加密的明文,明文即人可直观地理解其意思的字符,通过哈希算法进行第一加密将任意长度的明文映射成一串固定长度的密文,密文即经过加密后的字符串,人无法直观地理解其意思,这串密文即为数字摘要。本步骤通过哈希运算,由电子病历明文生成病历摘要,该病历摘要用于电子病历的下一步加密。
可选的一种实施方式中,S12可以包括S121~S122。
S121、对需要进行数字签名的电子病历进行初次哈希运算。
若用M表示电子病历明文,对电子病历进行初次哈希运算得到h(M)。
S122、对初次哈希运算得到的结果再次进行哈希运算,得到电子病历摘要。
本步骤中,对初次哈希运算得到的结果h(M)再次进行哈希运算,得到电子病历摘要S x,即计算S x=h(h(M)|i),其中,i=0,1,2……。本发明实施例中取i=0,使电子病历摘要S x为一个长度为n-k的向量。
在其他实施例中,也可以使用一次或多次哈希运算得到电子病历摘要,满足固定长度的输出即可。
S13、构造一基于有限域的GRS码。
示例的,本步骤可以包括:构造一有限域,并根据有限域构造一个码长为n、维数为k且纠错能力为t的GRS码,其中,n、k和t均为任意正整数,且满足
Figure PCTCN2020139753-appb-000002
其中,有限域可以选择包括q个元素的有限域F q,且选取一正整数m,使q满足q=2 m
需要说明的是,本发明实施例之所以选择基于有限域F q而不是选择基于通常的二进制,是因为在面对ISD译码攻击时,对于安全级别相同的码(比如:Goppa码),基于有限域F q的Goppa码相比基于二进制Goppa码具有更小的公钥量。举例来说,具有128的安全级别的基于有限域的Goppa码,公钥量为725740bits;而具有128的安全级别的基于二进制Goppa码,公钥量为1537536bits。相比来说,基于有限域F q的Goppa码的公钥量要比基于二进制Goppa码的公钥量小近一个数量级。
此外,本发明之所以选择GRS码而不是别的码(比如Goppa码),是因为GRS码是极大距离可分(MDS)码,码的性能好;且GRS码现有编译码器在各领域应用多,实用性好;此外,GRS码比Goppa码更灵活;以及GRS码具有可发展性更强的优势。
S14、根据GRS码生成公钥以及私钥。
基于有限域的GRS码生成公钥以及私钥,可以保证公钥以及私钥具有的安全性能更高且占空间更小,且针对不同的物流信息生成不同的公钥以及私钥。一个公钥只能对一个加密标签进行解密。
可选的一种实施方式中,S14可以包括S141~S144。
S141、在有限域内选取(n-k)×(n-k)的非奇异矩阵、n×n的稠密矩阵以及n×n的稀疏矩阵,且稠密矩阵的秩为z,稀疏矩阵的平均行重和列重为x,其中,z、x为自然数,且z小于n,x小于n。
作为本发明的一种实施方式,可以采用稠密矩阵的秩z远小于n,且稀疏矩阵的平均行重和列重x远小于n。
具体的,稠密矩阵可以用矩阵的转置矩阵与矩阵的乘积表示,即
Figure PCTCN2020139753-appb-000003
其中
Figure PCTCN2020139753-appb-000004
为有限域F q上定义的两个z×n的矩阵,且矩阵的秩为z。
可选的,本发明的方案,对参数m、n、k、t以及x的选取有以下几种选择可供参考,参见表1,有且不限于这几种,但考虑到方案的正确性、可行性与安全性,以及公钥量和签名长度,本发明的方案优选采用表1列出的三组参数值。
表1参数选取
m n k t x
12 4094 4074 10 1~1.1
16 65534 65516 9 1~1.1
10 1022 1002 10 1~1.1
S142、将稠密矩阵以及稀疏矩阵进行矩阵的加法运算,得到变换矩阵。
具体的,加法运算采用公式(1):
Figure PCTCN2020139753-appb-000005
其中,
Figure PCTCN2020139753-appb-000006
表示变换矩阵,
Figure PCTCN2020139753-appb-000007
表示稠密矩阵,
Figure PCTCN2020139753-appb-000008
表示稀疏矩阵。
S143、将非奇异矩阵的逆矩阵、校验矩阵以及变换矩阵的转置矩阵进行矩阵的乘法运算得到公钥;其中,校验矩阵为GRS码的(n-k)×n矩阵。
具体的,乘法运算采用公式(2):
Figure PCTCN2020139753-appb-000009
其中,
Figure PCTCN2020139753-appb-000010
表示公钥,
Figure PCTCN2020139753-appb-000011
表示非奇异矩阵的逆矩阵,
Figure PCTCN2020139753-appb-000012
表示校验矩阵,
Figure PCTCN2020139753-appb-000013
表示变换矩阵的转置矩阵。
S144、将非奇异矩阵
Figure PCTCN2020139753-appb-000014
校验矩阵
Figure PCTCN2020139753-appb-000015
变换矩阵
Figure PCTCN2020139753-appb-000016
与译码算法
Figure PCTCN2020139753-appb-000017
作为私 钥。
可以理解的是,公钥用于对外公开,私钥用于存储。公钥和私钥是一个算法中不同的两个参数集合,但内在又相关联的参数集合,公钥和私钥是同时生成,但可以独立使用的。
S15、对病历摘要进行加密处理得到第一数字签名。
示例的,该步骤可以包括:
将非奇异矩阵与病历摘要进行乘法运算,得到第一数字签名。具体的,乘法运算采用公式(3):
Figure PCTCN2020139753-appb-000018
其中,S' x表示第一数字签名,也可以叫做待译校正子,
Figure PCTCN2020139753-appb-000019
表示非奇异矩阵,S x表示病历摘要。
S16、对第一数字签名进行译码并将得到的错误向量作为第二数字签名。
示例的,该步骤可以包括S161~S163:
S161、结合私钥的变换矩阵使用译码算法对第一数字签名进行译码,得到第一错误向量。
译码算法可以选用现有的任一译码算法,本实施例中,译码算法优选为时域上的迭代译码算法,即:BM迭代译码算法(Berlekamp-Massey)、钱式搜索算法(Chien)以及Forney算法的组合。该译码算法速度快,实现简单,易于用计算机实现,因此是一种快速译码算法。
可选的,译码算法可以包括以下几个步骤:
步骤一:计算校正子;
步骤二:确定错误位置多项式;
步骤三:确定错误估值函数;
步骤四:求解错误位置数和错误数值,并进行纠错。
完成上述四步即可完成一次译码,若译码成功,则直接译出错误向量;否则,将视为译码失败。
结合本发明实施例的方案,若译码失败,则使i'=i+1,从重新开始哈希运算重新译码,直到译码成功,得到第一错误向量。
S162、将第一错误向量与私钥的变换矩阵的逆矩阵进行矩阵的乘法运算,得到第二错误向量,第二错误向量的权重小于等于GRS码的纠错能力值。
具体的,本步骤的乘法运算采用公式(4):
Figure PCTCN2020139753-appb-000020
其中,
Figure PCTCN2020139753-appb-000021
表示第二错误向量,
Figure PCTCN2020139753-appb-000022
表示第一错误向量,
Figure PCTCN2020139753-appb-000023
表示私钥的变换矩阵的逆矩阵。
S163、将第二错误向量作为第二数字签名。
至此,已经得到基于错误向量纠错码的数字签名,但该错误向量中由于存在多个0元素,占用较多的比特位。为减小比特位数,本发明提供的方案在上述实施例的基础上,可以进一步优化。
优选的,在得到第二错误向量之后,还包括以下步骤:
对第二错误向量构建索引对,得到第二错误向量的索引对。
具体的,第二错误向量的索引对可以根据公式(5)得到。
Figure PCTCN2020139753-appb-000024
其中,I e表示索引对。
即提取第二错误向量中的非零元素标记为错误值,用错误位置α以及错误位置c构建第二错误向量的索引对I e
相应的,将索引对作为数字签名。
需要说明的是,签名通常对应的还有验签的过程,作为只生成数字签名的步骤,将得到的索引对I e作为数字签名;而在验签过程中,由于验签者需要用到索引对I e和电子病历摘要h(h(m)|i)一起验签,因此在验签成功后,最终是将[I e|i]作为电子病历明文M的数字签名。
在优选的方案里,通过进一步对生成的第二错误向量建立索引对,并将索引对作为数字签名,可以减少比特位数,从而减小签名长度。
S17、将第二数字签名发送至验证节点进行验证。
在得到第二数字签名后,将该数字签名以及电子病历摘要广播到网络的各个验证节点中,验证节点接收到该数字签名以及电子病历摘要后,对该数字签名进行验证。具体验证的方法可以参考本发明第二发面用于验证节点的基于区块链的电子病历共享方法,为了避免重复,此处略去。
S18、接收验证节点确认的区块并将区块添加到预设数据库所维护的区块链结构上。
每个节点均维护一个共同的区块链,每个节点分布式存储区块链,因此预设数据库中也维护着一个共同的区块链。在接收到验证节点所确认的区块后,按照发生顺序将所确认的区块与本地的区块链结构中的上一区块首尾连接以更新所维护的区块链,从而实现了电子病历的共享。
需要说明的是,本发明的方案基于区块链技术实现,区块链是利用块链式数据结构来验证与存储数据、利用分布式节点共识算法来生成和更新数据、利用密码学的方式保证数据传输和访问的安全、利用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算方式,其具有去中心化、开放性以及不可篡改的特点。
本发明实施例提供的基于区块链的电子病历共享方法,应用于医疗机构节点,通过有限域F q的GRS码生成公钥以及私钥,根据电子病历得到电子病历摘要,并使用私钥对电子病历摘要进行加密,得到数字签名,并将数字签名封装到区块中,通过共识机制对该区块进行确认并将所确认的区块发送至医疗机构节点。本发明的方案基于区块链技术和数字签名技术,能够保证电子病历在各医疗机构之间共享且不会被篡改;且本发明实施例提供的数字签名方案具有较高的可行性,能够减小公钥量,提高签名效率,并能够进一步提高安全性。
第二方面,本发明实施例提供了一种基于区块链的电子病历共享方法,应用于验证节点,下面对该电子病历共享方法进行介绍。
请参见图2,图2是本发明实施例提供的另一种基于区块链的电子病历共享方法流程图。本发明实施例提供的基于区块链的电子病历共享方法流程图,应用于验证节点。
首先需要说明的是,由于数字签名和验签是相互对应的过程,因此本部分的验证过程即对第一方面医疗机构节点提供的数字签名的验签过程。
该方法包括:
S21、接收来自医疗机构节点的第二数字签名,第二数字签名由第一方面的实施例中的方法得到。
本步骤中,验证节点接收网络中来自医疗机构节点广播的数字签名以及电子病历摘要,以用于下一步的验证。
S22、获取医疗机构节点的公钥并根据公钥对第二数字签名进行验证。
由于每个节点的公钥都是公开的,因此从医疗机构节点中获取其公钥。通过所获取的公钥验证数字签名可以证明该病例摘要来自医疗机构节点以及证明病历摘要完整且未篡改。
示例的,该步骤可以包括S221~S223:
S221、获取医疗机构节点的公钥并根据公钥对第二数字签名进行解密,得到待验证的病例摘要。
对应于上述签名方法中将得到的第二错误向量作为数字签名的方案,本步骤是利用公钥直接对第二错误向量进行解密,得到待验证电子病历摘要。
对应于上述签名方法中将得到的索引对作为数字签名的方案,本步骤需要先根据索引对恢复出第二错误向量,然后再利用公钥对第二错误向量进行解密,得到待验证电子病历摘要。
具体的,需要根据索引对恢复出第二错误向量,即在索引对I e中α j索引的位置用c j填充,在α j索引之外的位置用0填充,直到向量
Figure PCTCN2020139753-appb-000025
的长度达到(n-k)。
利用公钥对第二错误向量进行解密,即根据公式(6)得到待验证电子病历摘要:
Figure PCTCN2020139753-appb-000026
其中,y表示待验证电子病历摘要。
计算公钥
Figure PCTCN2020139753-appb-000027
中的每一列根据α j索引的对应行的值与c j的乘积,并将该乘积作为待验证电子病历摘要。
S222、获取电子病历并对电子病历进行哈希运算,得到病历摘要。
同样的,需要对电子病历进行两次哈希运算,具体步骤与第一方面中哈希运算步骤相同,在此不再赘述。通过两次哈希运算,得到电子病历摘要y'=h(h(M)|i)。
S223、将待验证的病例摘要与病历摘要进行比较,若待验证病例摘要与病例摘要相同,则验证成功,反之则验证失败。
本发明实施例中,比较待验证电子病历摘要y与电子病历摘要y',若y=y',即待验证电子病历摘要与电子病历摘要相等,验证签名成功;否则,验证签名失败。
S23、若第二数字签名验证通过,将病历摘要封装到区块中。
区块指的是记录病历摘要的数据块,其包括区块头以及区块体,区块体用于存储病历摘要,区块头包括前一区块的哈希值、时间戳、版本号、难度值、随机数以及默克尔树根植。其中,默克尔树是中二叉树,其由根节点、中间节点以及叶节点组成,叶节点存储数据以及数据的哈希值,中间节点是叶节点的哈希值,而根节点则是中间节点哈希值,称为默克尔根植,任意一个节点的数据改变都会导致默克尔根植的改变,因此通过默克尔树可归纳数据以及校验数据的完整性;时间戳指的是时间标记,用于证 明病历摘要的发生时间;难度值指的是确认区块有效的难度;随机数是用于计算哈希值的参数。
S24、通过共识机制对区块进行确认并将所确认的区块发送至医疗机构节点。
共识机制指的是网络中的节点怎么达成共识一致确认区块有效的手段,主要包括工作量证明机制、权益证明机制以及股份授权证明机制,本实施例采用工作量证明机制,工作量证明机制指的是一种工作量证明,该工作量证明是节点耗费大量的计算机算力得到满足条件的结果,而该证明极易验证,当某个节点完成工作量证明后,由其余节点迅速验证即可确认有效。具体地,首先根据哈希算法求出由前一区块的哈希值、时间戳、版本号、难度值、随机数以及默克尔树根植组成的区块头的哈希值,本实施例哈希算法采用SHA256;然后根据难度值求出目标值,目标值=最大目标值/难度值,其中,最大目标值是恒定值,难度值由区块链系统设定的以维护区块确认的难度;接着将区块头的哈希值与目标值进行对比,若区块头的哈希值小于等于目标值则确认区块有效,若区块头的哈希值大于目标值则将区块头中的随机数加一,重新求出区块头的哈希值,将重新求出的区块头的哈希值再次与目标值进行对比,重复上述过程直至区块头的哈希值小于等于目标值,从而完成区块的工作量计算;最后再由其他的验证节点对上述过程中最终的区块头进行一次哈希运算即可快速验证从而完成区块的确认。完成区块确认后广播到网络中,网络中的医疗机构节点接收到验证节点确认的区块后即可将所确认的区块添加到区块链中。
本发明实施例提供的基于区块链的电子病历共享方法,应用于验证节点,通过有限域F q的GRS码生成公钥以及私钥,根据电子病历得到电子病历摘要,并使用私钥对电子病历摘要进行加密,得到数字签名,并将数字签名封装到区块中,通过共识机制对该区块进行确认验证。本发明的方案基于区块链技术和数字签名技术,能够保证电子病历在各医疗机构之间共享且不会被篡改;且本发明实施例提供的数字签名方案具有较高的可行性,能够减小公钥量,提高签名效率,并能够进一步提高安全性。
第三方面,本发明实施例还提供了一种电子设备。
请参见图3,图3是本发明实施例提供的电子设备结构示意图;该电子设备,包括处理器301、通信接口302、存储器303和通信总线304,其中,处理器301、通信接口302、存储器303通过通信总线304完成相互间的通 信;
存储器303,用于存放计算机程序;
处理器301,用于执行存储器303上所存放的程序时,实现第一方面任一的方法步骤或第二方面任一项的方法步骤。
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral ComponentInterconnect,PCI)总线或扩展工业标准结构(Extended Industry StandardArchitecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
通信接口用于上述电子设备与其他设备之间的通信。
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital SignalProcessing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
通过上述电子设备,可以实现:通过有限域F q的GRS码生成公钥以及私钥,根据电子病历得到电子病历摘要,并使用私钥对电子病历摘要进行加密,得到数字签名,并将数字签名封装到区块中,通过共识机制对该区块进行确认并将所确认的区块发送至医疗机构节点。本发明的方案基于区块链技术和数字签名技术,能够保证电子病历在各医疗机构之间共享且不会被篡改;且本发明实施例提供的数字签名方案具有较高的可行性,能够减小公钥量,提高签名效率,并能够进一步提高安全性。
本发明的方案采用了基于有限域的GRS码的数字签名方法,以下,分别从该数字签名的正确性、可行性、安全性、公钥量以及签名长度这五个方面对本发明实施例提供的方案进行验证。
(1)正确性:
正确性的验证也是对签名是否验签成功的验证,需要证明利用公钥对 第二错误向量进行解密得到的待验证摘要与生成签名过程中得到的摘要相等,即可证明正确性。具体过程如下:
利用公钥对第二错误向量进行解密得到待验证摘要,其中,公钥是基于非奇异矩阵的逆矩阵、校验矩阵以及变化矩阵的转置矩阵进行矩阵的乘法运算得到的,即上述公式(2);第二错误向量是基于第一错误向量与私钥的变化矩阵的逆矩阵进行矩阵的乘法运算得到的,即上述公式(4);待验证摘要是基于公钥中的每一列根据α j索引的对应行的值与c j的乘积得到的,即上述公式(6)。
因此,将公式(2)以及公式(4)代入公式(6)可以得到,
Figure PCTCN2020139753-appb-000028
对上述公式(7)进行简化公式,可以得到:
Figure PCTCN2020139753-appb-000029
又由于
Figure PCTCN2020139753-appb-000030
因此从公式(8)可以得到:
Figure PCTCN2020139753-appb-000031
其中,y表示待验证摘要,
Figure PCTCN2020139753-appb-000032
表示非奇异矩阵的逆矩阵,S' x表示待译校正子。
待译校正子是基于非奇异矩阵与摘要进行乘法运算得到的,即上述公式(3)。
因此,根据公式(3),得到y=S x,即能够得到y=y',验证成功,说明签名正确。
(2)可行性:
设基于有限域F q的GRS码的总校正子数为N,且N=q n-k=q 2t=q 2mt,可进行译码的校正子数为M,且
Figure PCTCN2020139753-appb-000033
因此对摘要S x查找成功的概率为
Figure PCTCN2020139753-appb-000034
即平均查找次数为
Figure PCTCN2020139753-appb-000035
基于有限域F q的GRS码签名的参数对(m,t)在选取上不仅要保证平均查找次数在千万数量级以下,还要保证参数对的选取不能过小。
请参见图4,图4是本发明实施例提供的签名方法的可行性仿真结果图。图中表示了纠错能力t与平均查找次数的对数log 2Z之间的关系。由图4可以看出,纠错能力t与平均查找次数的对数log 2Z成正比,也就是平均查找次数Z与纠错能力t呈指数关系。
图4中的横线表示千万数量级的运算,图中数据x表示m,y表示log 2Z。
当纠错能力t的值大于10后,平均查找次数将会过大,因此,纠错能力t选取小于等于10更为合适。
请参见图5,图5是本发明实施例提供的签名方法在不同纠错能力下的可行性仿真结果图。图5表示的是纠错能力t取9和10时,m与平均查找次数的对数的关系。图中数据x表示m,y表示log 2Z。由图5可以看出,当m≥12时,随着m的增大,log 2Z趋于平稳,几乎没有什么变化;当m<12时,会增加平均查找次数。因此,m取大于等于12较为合适。
另外,根据图5可以得到表2的两组数据:
表2(a)
m(t=10) 6 8 10 12 14 16 18
log 2Z 23.33 22.16 21.88 21.81 21.80 21.79 21.79
表2(b)
m(t=9) 6 8 10 12 14 16 18
log 2Z 19.74 18.78 18.55 18.49 18.47 18.4703 18.47
已知CFS签名使用的参数对(m,t)为(15,10)以及(16,9)。当参数对为(15,10)时,CFS签名的平均查找次数的对数值为27.7911,基于有限域F q的GRS码签名的平均查找次数的对数值为21.7933;当参数对为(16,9)时,CFS签名的平均查找次数的对数值为18.4691,基于有限域F q的GRS码签名的平均查找次数的对数值为18.4703。
相比较来说,在两种参数对下,CFS签名与基于有限域F q的GRS码签名的平均查找次数的数据差别不大,因此本发明基于有限域F q的GRS码数字签名方法具有可行性。
(3)安全性:
请参见图6,图6是本发明实施例提供的签名方法在ISD译码攻击下的仿真结果图。图6表示的是在在ISD译码攻击的情况下,m与安全级别SL的关系。
ISD译码攻击下的安全级别系数与m和t的乘积呈指数关系,基于上述条件,t选取小于等于10。即当t确定下,m越大,安全级别系数越高。
图中数据x表示m,y表示SL。从图6可以看出,基于有限域F q的GRS码数字签名在参数对选取为(10,10)时,安全级别SL可以达到80,已经达到了一般安全级别,而在选取的参数对为(16,9)时,安全级别SL超过了128。
在ISD译码攻击下,当参数对为(15,10)时,CFS签名的安全级别系数SL为76.89,基于有限域F q的GRS码签名的安全级别系数SL为135.42; 当参数对为(16,9)时,CFS签名的安全级别系数SL为76.92,基于有限域F q的GRS码签名的安全级别系数SL为135.56。
相比较来看,本发明实施例提供的基于有限域F q的GRS码签名在ISD译码攻击下,具有较高的安全级别系数。
另外,本发明实施例提供的基于有限域F q的GRS码签名还能有效抵抗区分攻击,而CFS签名在区分攻击下的参数选取存在缺陷。
(4)公钥量:
本发明实施例中,对GRS码的校验矩阵进行高斯消元化,得到行阶梯型矩阵,即公钥
Figure PCTCN2020139753-appb-000036
的公钥量为k·(n-k)。因此,基于有限域F q的GRS码上,公钥量为k·(n-k)·log 2q。
请参见图7,图7是本发明实施例提供的签名方法在不同纠错能力下的公钥量仿真结果图。图7表示的是纠错能力t取9和10时,m与公钥量的关系。图中数据x表示m,y表示k·(n-k)·log 2q。由图7可以看出,公钥量与m呈指数关系,而不同纠错能力t下,对公钥量的影响不是很明显。虽然当m越大,基于有限域F q的GRS码签名越安全,但也会导致公钥量越大。因此,选取较为合适的m,使得安全系数较高且公钥量较小,例如m取10、12等。
(5)签名长度:
本发明实施例提供的基于有限域F q的GRS码签名,签名长度为2m·t p+log 2Z。
表3为基于有限域F q的GRS码签名与CFS签名在两组不同参数对下,平均查找次数、安全级别、公钥量以及签名长度的对比。
表3不同参数对下基于有限域Fq的GRS码签名与CFS签名的参数对比
Figure PCTCN2020139753-appb-000037
从表3可以看出,在不同的参数对下,本发明实施例提供的基于有限域F q的GRS码签名的安全级别系数比CFS签名的安全级别系数要高,但是公钥量以及数字签名长度也要大一些。
因此,选取几组不同的参数对对基于有限域F q的GRS码签名的参数进 行仿真,结果如表4所示。
表4不同参数对下基于有限域F q的GRS码签名的参数
参数对 平均查找次数 安全级别(SL) 公钥量 签名长度(bits)
(11,9) 18.5072 85.5239 401544 195
(10,10) 21.8829 80.3254 200400 202
(12,10) 21.8140 102.3972 977760 238
本发明实施例提供的基于有限域Fq的GRS码签名,在提升安全级别系数的前提下,能够降低参数对的选择,减少公钥量以及签名长度。
通过以上验证说明本发明采用的数字签名方案具有正确性、可行性、安全性,以及公钥量降低、签名长度减小等效果。
以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。

Claims (10)

  1. 一种基于区块链的电子病历共享方法,其特征在于,应用于医疗机构节点,包括:
    从预设数据库获取电子病历;
    对所述电子病历进行哈希运算生成病历摘要;
    构造一基于有限域的GRS码;
    根据所述GRS码生成公钥以及私钥;
    使用所述私钥对所述病历摘要进行加密处理得到第一数字签名;
    使用所述私钥对所述第一数字签名进行译码并将得到的错误向量作为第二数字签名;
    将所述第二数字签名发送至验证节点进行验证;
    接收所述验证节点确认的区块并将所述区块添加到所述预设数据库所维护的区块链结构上。
  2. 根据权利要求1所述的基于区块链的电子病历共享方法,其特征在于,所述构造一基于有限域的GRS码,包括:
    构造一有限域,并根据所述有限域构造一个码长为n、维数为k且纠错能力为t的GRS码,其中,n、k和t均为任意正整数,且满足
    Figure PCTCN2020139753-appb-100001
  3. 根据权利要求2所述的基于区块链的电子病历共享方法,其特征在于,所述根据所述GRS码生成公钥以及私钥,包括:
    在所述有限域内选取一(n-k)×(n-k)的非奇异矩阵、一n×n的稠密矩阵以及一n×n的稀疏矩阵;所述稠密矩阵的秩为z,所述稀疏矩阵的平均行重和列重为x;其中,z、x为自然数,且z小于n,x小于n;
    将所述稠密矩阵以及所述稀疏矩阵进行矩阵的加法运算,得到变换矩阵;
    将所述非奇异矩阵的逆矩阵、校验矩阵以及所述变换矩阵的转置矩阵进行矩阵的乘法运算,得到公钥;其中,所述校验矩阵是GRS码的(n-k)×n的矩阵;
    将所述非奇异矩阵、所述校验矩阵、所述变换矩阵与译码算法作为私钥。
  4. 根据权利要求1所述的基于区块链的电子病历共享方法,其特征在于,所述对所述电子病历进行哈希运算生成病历摘要,包括:
    对所述电子病历进行初次哈希运算;
    对初次哈希运算得到的结果再次进行哈希运算,得到所述病历摘要。
  5. 根据权利要求3所述的基于区块链的电子病历共享方法,其特征在于,所述对所述病历摘要进行加密处理得到第一数字签名,包括:
    将所述非奇异矩阵与所述病历摘要进行乘法运算,得到所述第一数字签名。
  6. 根据权利要求5所述的基于区块链的电子病历共享方法,其特征在于,所述使用所述私钥对所述第一数字签名进行译码并将得到的错误向量作为第二数字签名,包括:
    结合所述私钥的变换矩阵使用所述译码算法对所述第一数字签名进行译码,得到第一错误向量;
    将所述第一错误向量与所述私钥的变换矩阵的逆矩阵进行矩阵的乘法运算,得到第二错误向量,所述第二错误向量的权重小于等于所述GRS码的纠错能力值;
    将所述第二错误向量作为所述第二数字签名。
  7. 根据权利要求6所述的基于区块链的电子病历共享方法,其特征在于,在得到所述第二错误向量之后,还包括:
    对所述第二错误向量构建索引对,得到第二错误向量的索引对;
    相应的,将所述索引对作为所述第二数字签名。
  8. 一种基于区块链的电子病历共享方法,其特征在于,应用于验证节点,包括:
    接收来自医疗机构节点的第二数字签名,所述第二数字签名由权利要求1-7任一项所述的方法得到;
    获取所述医疗机构节点的公钥并根据所述公钥对所述第二数字签名进行验证;
    若所述第二数字签名验证通过,将所述病历摘要封装到区块中;
    通过共识机制对所述区块进行确认并将所确认的区块发送至所述医疗机构节点。
  9. 根据权利要求8所述的基于区块链的电子病历共享方法,其特征在于,所述获取所述医疗机构节点的公钥并根据所述公钥对所述第二数字签名进行验证,包括:
    获取所述医疗机构节点的公钥并根据所述公钥对所述第二数字签名进行解密,得到待验证的病例摘要;
    获取所述电子病历并对所述电子病历进行哈希运算,得到病历摘要;
    将所述待验证的病例摘要与所述病历摘要进行比较,若所述待验证病例摘要与所述病例摘要相同,则验证成功,反之则验证失败。
  10. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;
    存储器,用于存放计算机程序;
    处理器,用于执行存储器上所存放的程序时,实现权利要求1-7任一所述的方法步骤或权利要求8所述的方法步骤。
PCT/CN2020/139753 2020-12-26 2020-12-26 基于区块链的电子病历共享方法和电子设备 WO2022134119A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/139753 WO2022134119A1 (zh) 2020-12-26 2020-12-26 基于区块链的电子病历共享方法和电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/139753 WO2022134119A1 (zh) 2020-12-26 2020-12-26 基于区块链的电子病历共享方法和电子设备

Publications (1)

Publication Number Publication Date
WO2022134119A1 true WO2022134119A1 (zh) 2022-06-30

Family

ID=82157236

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139753 WO2022134119A1 (zh) 2020-12-26 2020-12-26 基于区块链的电子病历共享方法和电子设备

Country Status (1)

Country Link
WO (1) WO2022134119A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115879153A (zh) * 2022-12-16 2023-03-31 高雅娟 基于区块链的病历访问方法
CN117134981A (zh) * 2023-09-07 2023-11-28 中南大学湘雅二医院 基于ai学习的身体术面创伤压力数据处理方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122140A1 (en) * 2005-01-10 2010-05-13 Broadcom Corporation Algebraic construction of LDPC (Low Density Parity Check) codes with corresponding parity check matrix having CSI (Cyclic Shifted Identity) sub-matrices
CN102150168A (zh) * 2008-09-11 2011-08-10 科乐美数码娱乐株式会社 服务扩展系统以及联系服务器
CN109326337A (zh) * 2018-09-06 2019-02-12 西安电子科技大学 基于区块链的电子医疗记录存储和共享的模型及方法
CN109670334A (zh) * 2018-12-19 2019-04-23 平安科技(深圳)有限公司 电子病历共享方法、装置、计算机设备及存储介质
CN110008746A (zh) * 2019-04-01 2019-07-12 大连理工大学 基于区块链的医疗记录存储、共享和安全理赔模型及方法
CN111526130A (zh) * 2020-04-03 2020-08-11 杭州电子科技大学 一种轻量级的无证书工业物联网访问控制方法和系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122140A1 (en) * 2005-01-10 2010-05-13 Broadcom Corporation Algebraic construction of LDPC (Low Density Parity Check) codes with corresponding parity check matrix having CSI (Cyclic Shifted Identity) sub-matrices
CN102150168A (zh) * 2008-09-11 2011-08-10 科乐美数码娱乐株式会社 服务扩展系统以及联系服务器
CN109326337A (zh) * 2018-09-06 2019-02-12 西安电子科技大学 基于区块链的电子医疗记录存储和共享的模型及方法
CN109670334A (zh) * 2018-12-19 2019-04-23 平安科技(深圳)有限公司 电子病历共享方法、装置、计算机设备及存储介质
CN110008746A (zh) * 2019-04-01 2019-07-12 大连理工大学 基于区块链的医疗记录存储、共享和安全理赔模型及方法
CN111526130A (zh) * 2020-04-03 2020-08-11 杭州电子科技大学 一种轻量级的无证书工业物联网访问控制方法和系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115879153A (zh) * 2022-12-16 2023-03-31 高雅娟 基于区块链的病历访问方法
CN115879153B (zh) * 2022-12-16 2023-11-03 湖南提奥医疗科技有限公司 基于区块链的病历访问方法
CN117134981A (zh) * 2023-09-07 2023-11-28 中南大学湘雅二医院 基于ai学习的身体术面创伤压力数据处理方法及系统
CN117134981B (zh) * 2023-09-07 2024-05-14 中南大学湘雅二医院 基于ai学习的身体术面创伤压力数据处理方法及系统

Similar Documents

Publication Publication Date Title
US8689087B2 (en) Method and entity for probabilistic symmetrical encryption
WO2022134119A1 (zh) 基于区块链的电子病历共享方法和电子设备
JP5854443B2 (ja) 誤り訂正符号方式を用いて計算環境における資産集合についての識別子を生成する変化許容力を有する方法
US10511445B1 (en) Signature compression for hash-based signature schemes
CN112635009A (zh) 基于区块链的医疗数据加密方法
CN104769675B (zh) 数据处理
US11546166B2 (en) Hash tree computation device
JP7209431B2 (ja) デジタル署名方法、署名情報の検証方法、関連装置及び電子機器
CN116324778A (zh) 可更新私有集合交集
CN112635008A (zh) 基于数字签名的医疗检验报告生成方法
Chailloux et al. On the (In) security of optimized Stern-like signature schemes
CN112613008A (zh) 一种学生身份在线认证方法及系统
Balmany et al. Dynamic proof of retrievability based on public auditing for coded secure cloud storage
CN112614558A (zh) 基于区块链的电子病历共享方法和电子设备
CN112613760A (zh) 基于区块链技术的产品质量评定方法及系统
US20200287722A1 (en) Electronic device capable of data communication through electronic signatures based on syndrome and operating method thereof
CN112614001A (zh) 基于区块链的农产品追溯方法及系统
CN112614557A (zh) 电子病历加密存档方法
CN112769573B (zh) 一种基于grs码的数字签名方法、验签方法及其装置
CN112631992A (zh) 一种电子文件归档方法及系统
CN112634092A (zh) 一种基于区块链的合同认证方法、装置、电子设备
CN112633712A (zh) 一种基于grs码的在线投标方法及系统
CN112613879A (zh) 一种基于grs码的金融交易数据处理方法
CN112613844A (zh) 一种人事合同电子签名方法
CN112738210A (zh) 一种路面养护方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20966682

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20966682

Country of ref document: EP

Kind code of ref document: A1