Blockchain-based copyright protection and image encryption data transaction method and system
Patent Information
- Application Number
- CN202311351049.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-10-18
AI Technical Summary
[0003]一般的基于医学图像的水印技术都是对整个医学图像进行水印的嵌入,然而,水印的嵌入难免会造成医学图像的失真,而医生及医学领域的研究人员是通过医学图像来诊断和研究疾病的,这种水印嵌入的图像失真的情况应该尽量避免
[0028] This invention utilizes blockchain smart contracts to achieve intelligent and automated data transactions, adding arbitration and copyright authentication stages to the general data transaction process to ensure the fairness of the entire transaction. The gas cost of each event in the smart contract was tested, and its gas consumption is within an acceptable range. Because the digital watermarking technology is embedded after medical image segmentation, and the embedded watermark area is the ROI region, it does not damage the ROI region of the medical image, so it will not affect the results of medical diagnosis and research. Furthermore, the encryption scheme can sensitively detect minute changes in the original image and can effectively resist differential attacks. The robustness of the proposed image encryption scheme is demonstrated using cropping attacks and noise attacks.
Smart Images

Figure CN117610031B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, specifically to a data transaction method and system based on blockchain for copyright protection and image encryption. Background Technology
[0002] Blockchain possesses characteristics such as decentralization, trustlessness, tamper-proofness, forgery prevention, and traceability, which enhance its application value. With the continuous development of science and technology, particularly the internet, massive amounts of data are constantly generated in people's daily lives, making data one of the most valuable assets in our contemporary economy. Data trading allows data buyers to purchase the data they need from data sellers. Traditional data trading markets typically involve a third party to ensure fair transactions. This third party acts as an intermediary between the data buyer and seller, facilitating data transactions through a third-party platform. In this model, buyers and sellers establish a relationship of mutual trust; however, the third-party platform may be dishonest, potentially profiting by stealing data uploaded by sellers and reselling it. Furthermore, the existence of third-party platforms is vulnerable to attacks, leading to single points of failure. This data trading model suffers from issues such as opacity, uncontrollability, and privacy disclosure. Blockchain's decentralization allows data transactions to be completed without a trusted third party. In medical data transactions, electronic medical records contain a large amount of personal information, such as patients' names, ages, and other private details. Medical images are susceptible to privacy breaches, illegal copying, and malicious alteration during transmission. To ensure the security of electronic medical records (primarily referring to medical images in this patent) during transmission, copyright and integrity authentication are crucial. Digital watermarking technology offers both copyright and integrity authentication capabilities, and its ability to hide information can be used to protect patient data. Embedding digital watermarks in medical images involves embedding digital markers (such as hospital logos, names, or patient information) into the image, allowing for subsequent ownership authentication to prevent potential copyright conflicts.
[0003] Typical watermarking techniques for medical images embed the watermark into the entire medical image. However, watermark embedding inevitably causes distortion of the medical image. Since doctors and researchers in the medical field use medical images to diagnose and study diseases, this distortion caused by watermark embedding should be avoided as much as possible. Summary of the Invention
[0004] To address the shortcomings mentioned in the background section, the present invention aims to provide a data transaction method and system based on blockchain for copyright protection and image encryption.
[0005] The objective of this invention can be achieved through the following technical solution: a data transaction method for copyright protection and image encryption based on blockchain, the method comprising the following steps:
[0006] Receive relevant hospital data, preprocess the relevant hospital data to obtain processed hospital data, wherein the relevant hospital data consists of electronic medical records and medical images in the hospital database;
[0007] Data buyers post data requests, data sellers send response information according to the requirements of the data request, and data buyers filter data sellers based on the response information to obtain the corresponding data sellers that meet the requirements.
[0008] The corresponding data seller first calculates the first hash value for the hospital's processed data, then encrypts it to obtain an encrypted medical image dataset, and sends the encrypted medical image dataset and encryption key to the data buyer.
[0009] The data buyer decrypts the encryption key to obtain the key, then uses the key to decrypt the encrypted medical image dataset to obtain the original medical image data, and calculates the hash value of the original medical image data, which is then marked as the second hash value.
[0010] The first and second hash values are compared. If they are different, arbitration is conducted to determine the cheater. If they are the same, the transaction ends.
[0011] Preferably, during the process of receiving relevant data from the hospital, the hospital first submits relevant information to the health department to register itself, and the health department generates unique information HI = {N} for the hospital. h ,R h WM h}, where N h It's the name of the hospital, R h It's the hospital's registration number, WM h It's the hospital's watermark information.
[0012] Preferably, during the process of the data buyer publishing a data request, the data buyer publishes a data request dreq according to its own needs. The data request dreq includes the attribute requirements dattr for the data, and the dattr specifies the attribute requirements that need to be included in the medical image.
[0013] The data seller sends a response message M = {desc, price} according to the data request, where desc is a description of the data and price is the selling price of the data.
[0014] Preferably, the data buyer filters data sellers based on the response information, and after obtaining the corresponding data sellers that meet the requirements, establishes a transaction relationship with the corresponding data sellers. At the same time as establishing the transaction relationship, the data buyer needs to transfer their public key (bpk) and funds (P). b Stored in a smart contract. This sum of money, P... b It needs to contain two parts, one of which is P. b1 After a successful data transaction, payment will be made to the data seller, with another portion going to P. b2 As a deposit, P will be credited to the data buyer upon completion of the transaction, provided the buyer is honest. b2 It will be refunded to the buyer.
[0015] Preferably, the data seller provides the medical image dataset D = {D1, D2, ..., D...} involved in the transaction. n The first hash value (Hash) is obtained by calculating using the blockchain's native cryptographic hash function. s (D). The data seller will then encrypt the medical image dataset to obtain an encrypted dataset E(D). The data seller also needs to hash (D). n Send the data to the data buyer using the public key bpk and the key, and hash(D) using the data buyer's public key bpk. n Encrypt the key and key to get KEY = {Hash(D,key)} n, key), key}, Hash the first hash value s (D) and KEY are uploaded to the smart contract, and the deposit P is stored in the smart contract. s As a fine.
[0016] Preferably, after receiving the encrypted image dataset E(D) and KEY, the data buyer first decrypts the KEY using the private key bsk to obtain Hash(Dn,key) and key. Then, the buyer uses Hash(Dn,key) and key to decrypt the encrypted image dataset E(D) to recover the original medical image data D', and calculates the second hash value Hash. b (D) Hash b (D) and Hash s (D) Compare the data. If they are the same, it proves the data is authentic. If the data buyer has no objection, the data transaction ends, and the data seller receives P, which the data buyer previously stored in the smart contract. b1 Meanwhile, the deposit P of data buyers b2 The deposit P, which the data seller had previously stored in a smart contract, was returned. s The data will also be returned; if they are different, the data buyer will initiate arbitration.
[0017] Preferably, when the data buyer initiates arbitration, the arbitration process is as follows:
[0018] The arbitrator decrypts the encrypted medical image dataset, obtains the decrypted image dataset, and calculates a hash value to obtain a third hash value. v (D) Hash the third hash value v (D) and the first hash value Hash s (D) Compare the data. If they are different, the data seller is determined to be the malicious cheater. If they are the same, it means that the data uploaded by the data seller is correct, and the data buyer is determined to be the malicious cheater.
[0019] Preferably, after arbitration, copyright authentication can be performed. The arbitrator will extract the watermark from the encrypted medical image dataset and display the extracted watermark information WM. d The data will be compared with the watermark information in the health department's database. If the copyright belongs to the hospital to which the data seller belongs, it proves that the data seller did not act dishonestly during the copyright certification stage, and the final arbitration result will still be the judgment made during the arbitration stage. If no watermark information is extracted or the extracted watermark information does not belong to the hospital to which the data seller belongs, the data seller will be judged as a malicious cheater and will be punished accordingly.
[0020] Preferably, during the penalty phase, if the data seller is identified as a malicious cheater, the deposit P that the data seller previously stored in the smart contract is forfeited. s The penalty will be imposed as punishment and will not be refunded after the transaction is completed. The data stored by the buyer in the P... b All deposits will be refunded if the data buyer is deemed to have engaged in malicious fraud. b2 The fine was used as punishment, and P b1 The deposit P stored by the data seller was returned to the data buyer. s It will be returned, and the entire transaction process will end.
[0021] Secondly, in order to achieve the above objectives, this invention discloses a data transaction system for copyright protection and image encryption based on blockchain, comprising:
[0022] Data preprocessing module: used to receive hospital-related data, preprocess the hospital-related data to obtain hospital-processed data, wherein the hospital-related data is electronic medical records and medical images in the hospital database;
[0023] Seller filtering module: This module is used by data buyers to post data requests, data sellers to send response information according to the requirements of the data requests, and data buyers to filter data sellers based on the response information to obtain the corresponding data sellers that meet the requirements.
[0024] Encryption Calculation Module: This module is used by the data seller to calculate the first hash value of the hospital's processed data and encrypt it to obtain an encrypted medical image dataset. The encrypted medical image dataset and encryption key are then sent to the data buyer.
[0025] Decryption Calculation Module: This module is used by the data buyer to decrypt the encryption key to obtain the key, and then uses the key to decrypt the encrypted medical image dataset to obtain the original medical image data. It also calculates the hash value of the original medical image data and marks it as the second hash value.
[0026] Comparison and Judgment Module: This module compares the calculated first hash value with the second hash value. If they are different, arbitration is conducted to determine the cheater. If they are the same, the transaction ends.
[0027] The beneficial effects of this invention are:
[0028] This invention utilizes blockchain smart contracts to achieve intelligent and automated data transactions, adding arbitration and copyright authentication stages to the general data transaction process to ensure the fairness of the entire transaction. The gas cost of each event in the smart contract was tested, and its gas consumption is within an acceptable range. Because the digital watermarking technology is embedded after medical image segmentation, and the embedded watermark area is the ROI region, it does not damage the ROI region of the medical image, so it will not affect the results of medical diagnosis and research. Furthermore, the encryption scheme can sensitively detect minute changes in the original image and can effectively resist differential attacks. The robustness of the proposed image encryption scheme is demonstrated using cropping attacks and noise attacks. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0031] Figure 2 This is a schematic diagram of the system model of the data transaction method for copyright protection and image encryption based on blockchain according to the present invention;
[0032] Figure 3 This is a schematic diagram of a blind diagnostic non-destructive watermarking framework for iterative embedding of the RONI region according to the present invention;
[0033] Figure 4 This is a schematic diagram of the image encryption scheme of the present invention;
[0034] Figure 5This is a schematic diagram of the system structure of the present invention. Detailed Implementation
[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] like Figure 1 As shown, a data transaction method based on blockchain for copyright protection and image encryption includes the following steps:
[0037] Receive relevant hospital data, preprocess the relevant hospital data to obtain processed hospital data, wherein the relevant hospital data consists of electronic medical records and medical images in the hospital database;
[0038] In this embodiment, during the process of receiving hospital-related data, the hospital first submits relevant information to the health department to register itself, and the health department generates unique information HI = {N} for the hospital. h ,R h WM h}, where N h It's the name of the hospital, R h It's the hospital's registration number, WM h It's the hospital's watermark information.
[0039] Data buyers post data requests, data sellers send response information according to the requirements of the data request, and data buyers filter data sellers based on the response information to obtain the corresponding data sellers that meet the requirements.
[0040] In this embodiment, the data buyer publishes a data request (dreq) based on their needs. The data request (dreq) includes attribute requirements (dattr) for the required data, specifying the attributes that must be included in the medical image, such as an X-ray angiography image of a diabetic patient. The data buyer creates a smart contract on the blockchain to publish their data request through the smart contract.
[0041] A data seller with data that meets the conditions sends a response message M = {desc, price} to the smart contract, where desc is a description of the data and price is the selling price of the data.
[0042] The data buyer filters data sellers based on the response information. After identifying qualified data sellers, the buyer establishes a transaction relationship with each qualified data seller. Simultaneously, the data buyer needs to transfer their public key (bpk) and funds (P) to the designated seller.b Stored in a smart contract. This sum of money, P... b It needs to contain two parts, one of which is P. b1 After a successful data transaction, payment will be made to the data seller, with another portion going to P. b2 As a deposit, P will be credited to the data buyer upon completion of the transaction, provided the buyer is honest. b2 It will be refunded to the buyer.
[0043] The corresponding data seller first calculates the first hash value for the hospital's processed data, then encrypts it to obtain an encrypted medical image dataset, and sends the encrypted medical image dataset and encryption key to the data buyer.
[0044] The data seller involved in the transaction possessed an encrypted medical image dataset D = {D1, D2, ..., D...}. n The first hash value (Hash) is obtained by calculating using the blockchain's native cryptographic hash function. s (D). The data seller will then encrypt the medical image dataset to obtain an encrypted dataset E(D). The data seller also needs to hash (D). n Send the data to the data buyer using the public key bpk and the key, and hash(D) using the data buyer's public key bpk. n Encrypt the key and key to get KEY = {Hash(D,key)} n, key), key}, Hash the first hash value s (D) and KEY are uploaded to the smart contract, and the deposit P is stored in the smart contract. s As a fine.
[0045] The data buyer decrypts the encryption key to obtain the key, then uses the key to decrypt the encrypted medical image dataset to obtain the original medical image data, and calculates the hash value of the original medical image data, which is then marked as the second hash value.
[0046] In this embodiment, after receiving the encrypted image dataset E(D) and KEY, the data buyer first decrypts the KEY using the private key bsk to obtain Hash(Dn,key) and key. Then, the buyer uses Hash(Dn,key) and key to decrypt the encrypted image dataset E(D) to recover the original medical image data D', and calculates the second hash value Hash. b (D)
[0047] The first and second hash values are compared. If they are different, arbitration is conducted to determine the cheater. If they are the same, the transaction ends.
[0048] In this embodiment, the Hash b (D) and Hashs (D) Compare the data. If they are the same, it proves the data is authentic. If the data buyer has no objection, the data transaction ends, and the data seller receives P, which the data buyer previously stored in the smart contract. b1 Meanwhile, the deposit P of data buyers b2 The deposit P, which the data seller had previously stored in a smart contract, was returned. s The data was also returned; if it differed, the data buyer initiated arbitration. Furthermore, the data buyer has the right and motivation to request copyright verification to check if they may have purchased pirated data. If the data buyer requests copyright verification, the process will first enter the arbitration stage before proceeding with copyright verification.
[0049] When the data buyer initiates arbitration, the arbitration process is as follows:
[0050] The arbitrator decrypts the encrypted medical image dataset, obtains the decrypted image dataset, and calculates a hash value to obtain a third hash value. v (D) Hash the third hash value v (D) and the first hash value Hash s (D) Compare the data. If they are different, the data seller is determined to be the malicious cheater. If they are the same, it means that the data uploaded by the data seller is correct, and the data buyer is determined to be the malicious cheater.
[0051] Since the arbitration phase has been triggered, we assume the data seller is more likely to be the one engaging in malicious cheating. Therefore, we need to perform copyright verification on the medical images uploaded by the data seller. The arbitrator will extract the watermark from the encrypted medical images and compare the extracted watermark information (WMd) with the watermark information in the health department's database to further confirm the copyright ownership of the image. If the copyright belongs to the hospital to which the data seller belongs, it proves that the data seller did not act dishonestly during the copyright verification phase, and the final arbitration result remains the judgment made during the arbitration phase. However, if there are problems with the copyright verification, such as failure to extract watermark information or the extracted watermark information not belonging to the seller's hospital, the data seller will be judged as the one engaging in malicious cheating and will be subject to corresponding penalties.
[0052] During the penalty phase, if the data seller is determined to have engaged in malicious fraud, the deposit P that the data seller had previously stored in the smart contract will be penalized. s The penalty will be imposed as punishment and will not be refunded after the transaction is completed. The data stored by the buyer in the P... b All deposits were refunded. Conversely, if the data buyer was found to have engaged in malicious fraud, the data buyer's deposit P was refunded. b2 The fine was used as punishment, and P b1 The deposit P stored by the data seller was returned to the buyer. sIt will be returned. The entire transaction process is now complete.
[0053] Table 1 below shows the DNA coding rules.
[0054] Table 1 DNA coding rules
[0055] 00(A) A A T T C C G G 01(C) C G C G A T A T 10(G) G C G C T A T A 11(T) T T A A G G C C
[0056] It should be further explained that, in the specific implementation process, the main technologies of this invention are divided into three parts: smart contracts, digital watermarking technology, and image encryption technology;
[0057] Smart Contracts: The concept of "smart contracts" was first proposed by cryptographer Szabo in 1994, who pointed out that "smart contracts facilitate contract execution through the use of protocols and user interfaces." The emergence and development of blockchain technology has provided opportunities for the application of smart contracts. Smart contracts possess an ideal environment for execution due to the tamper-proof, decentralized, and transparent characteristics of blockchain. Our proposed data transaction can achieve automation and intelligence through smart contracts. In our patented solution design, data sellers and data buyers establish transactions, send data, and verify data through smart contracts. Furthermore, if malicious cheating occurs during the data transaction process, arbitration will be initiated. During the arbitration stage, a group of arbitrators will be randomly generated by the health department and will verify the data. The arbitrators will calculate the hash value of the data uploaded by the data seller to the smart contract. If the calculated hash value is inconsistent with the data uploaded by the seller to the smart contract, it proves that the data seller's dishonest behavior is true; otherwise, it is considered that the data buyer's behavior is dishonest.
[0058] Digital watermarking technology: Additionally, our patented design includes a copyright authentication stage, which is based on digital watermarking technology. To verify the feasibility of our proposed solution, our watermarking technology is built upon BlessMark, an iterative embedding of the RONI region into a blind diagnostic non-destructive watermarking framework. This framework can maintain the confidentiality of patient information through the blind watermarking system, and because the watermark is embedded in the RONI region of the medical image—an area that does not affect diagnosis—it preserves relevant medical information to a certain extent. Figure 3 As shown in the framework diagram, this framework consists of three modules: watermark embedding, watermark extraction, and restoration of the original medical carrier image. A core module of this scheme is the ROI segmentation network, which uses a U-Net-inspired CNN structure to segment ROI pixels. Furthermore, since watermark data embedding can cause image distortion, affecting the segmentation results, another core module is a distortion detection network used in the restoration module. This network is responsible for detecting distorted blocks caused by the embedding process, in order to perform the restoration operation in the next step.
[0059] After registering with the health department, the hospital obtains watermark information and then embeds the watermark into the medical images in its database. During the data transaction, if the data buyer requests verification of the copyright of the medical images provided by the data seller, the arbitrator will extract the watermark from the data and determine whether the copyright of the data belongs to the data seller's hospital by comparing the watermark information.
[0060] Image Encryption Technology: To further enhance the security of data transactions, we perform image encryption on watermarked medical images. Here, we propose an image encryption scheme based on hash functions and DNA computation. Encryption hash functions play a crucial role in image encryption systems because their irreversibility protects against attacks such as known-plaintext, chosen-plaintext, and chosen-ciphertext attacks. SHA-256 and MD5 are two common encryption hash functions. While both have equal complexity, SHA-256 is slower than MD5. Furthermore, SHA-256 offers better resistance to collision attacks, resulting in higher security. Therefore, in this patent, we use a combination of MD5 and SHA-256 hash functions to enhance the execution time and security of the encryption scheme. In addition, in recent years, DNA-based image encryption technology has attracted widespread attention from researchers due to its superior characteristics such as large-scale parallelism, large-capacity storage, and ultra-low power consumption. Since using only DNA-based image encryption is insecure, we combine hash functions and DNA computation here.
[0061] Specific image encryption schemes are as follows: Figure 4 As shown. The encryption process first generates a mixed hash value of the original image and the random value key. We consider the watermarked medical image as a two-dimensional matrix P of size m×n, where P(i,j) represents the pixel value at position (i,j). Next, we calculate the vectors S1 and S2 of matrix P. S1(i) is the sum of the pixel values in the i-th row of matrix P, and S2(i) is the sum of the pixel values in the j-th row of matrix P. Therefore, the size of S1 is m, and the size of S2 is n. Simultaneously, we randomly generate a 256-bit key to generate the encrypted hash value. The key value will also be encrypted using the data buyer's public key and securely transmitted to the data buyer. Then, we use the MD5 hash function to calculate the hash value of vectors S1, S2, and key, and finally use the SHA-256 hash function to calculate the final 256-bit hash value Hash(S,key).
[0062] After obtaining Hash(S,key), we calculate the initial value and control parameters for subsequent DNA computations. We perform an XOR operation on Hash(S,key) and key to obtain K, and then divide the result into four matrix groups to generate the initial value I and control parameters C. We then process the columns of these matrix groups to obtain four 4×1 vector groups, and merge them into a 4×4 matrix. The final initial value I and control parameters C are calculated and used in each DNA operation step to obtain a chaotic sequence based on the logarithmic mapping.
[0063] The next step is to perform image encryption based on DNA computation. DNA is a biological concept; it's a molecule carrying the genetic code, used for survival and the continuation of offspring. DNA is composed of four nucleotides: adenine (A), guanine (G), thymine (T), and cytosine (C). A and T are complementary, as are C and G, similar to the complementary nature of 0 and 1 in a binary system. In binary, 00 and 11 are complementary, and 01 and 10 are complementary. Therefore, we can define DNA rules, where each nucleotide represents a two-digit binary number. For example, A-00, T-11, C-01, G-10 can form 24 different combinations of codes. According to the Watson-Crick complement rule, eight of these combinations meet the requirements. These eight encoding rules are shown in Table 1. Each grayscale pixel is represented by 8 bits, corresponding to a DNA array with 4 nucleotides. We use chaotic sequences to determine the DNA rules and then manipulate the pixel values of the image to achieve secure encryption. The main processes are DNA substitution (replacing pixel positions), DNA encoding (re-encoding according to DNA rules, changing the hue value of each pixel), diffusion (changing pixel values by distributing redundancy from the original image to a diffused image using chaotic mapping), and DNA decoding. Image decryption is the reverse process of image encryption.
[0064] On the other hand, such as Figure 5 As shown, in order to achieve the above objectives, embodiments of the present invention disclose a data transaction system for copyright protection and image encryption based on blockchain, including:
[0065] Data preprocessing module: used to receive hospital-related data, preprocess the hospital-related data to obtain hospital-processed data, wherein the hospital-related data is electronic medical records and medical images in the hospital database;
[0066] Seller filtering module: This module is used by data buyers to post data requests, data sellers to send response information according to the requirements of the data requests, and data buyers to filter data sellers based on the response information to obtain the corresponding data sellers that meet the requirements.
[0067] Encryption Calculation Module: This module is used by the data seller to calculate the first hash value of the hospital's processed data and encrypt it to obtain an encrypted medical image dataset. The encrypted medical image dataset and encryption key are then sent to the data buyer.
[0068] Decryption Calculation Module: This module is used by the data buyer to decrypt the encryption key to obtain the key, and then uses the key to decrypt the encrypted medical image dataset to obtain the original medical image data. It also calculates the hash value of the original medical image data and marks it as the second hash value.
[0069] Comparison and Judgment Module: This module compares the calculated first hash value with the second hash value. If they are different, arbitration is conducted to determine the cheater. If they are the same, the transaction ends.
[0070] Based on the same inventive concept, this invention also provides a computer device, comprising: one or more processors, and a memory for storing one or more computer programs; the programs include program instructions, and the processor executes the program instructions stored in the memory. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, used to implement one or more instructions, specifically for loading and executing one or more instructions stored in a computer storage medium to implement the above-described method.
[0071] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, performs the above-described method. This storage medium can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0072] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0073] The foregoing has shown and described the basic principles, main features, and advantages of this disclosure. Those skilled in the art should understand that this disclosure is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of this disclosure. Various changes and modifications can be made to this disclosure without departing from its spirit and scope, and all such changes and modifications fall within the scope of this disclosure as claimed.
Claims
1. A data transaction method based on blockchain for copyright protection and image encryption, characterized in that, The method includes the following steps: Receive relevant hospital data, preprocess the relevant hospital data to obtain processed hospital data, wherein the relevant hospital data consists of electronic medical records and medical images in the hospital database; When receiving data from hospitals, the hospital first submits relevant information to the health department to register itself. The health department then generates unique information HI={N} for each hospital. h , R h WM h }, where N h It's the name of the hospital, R h It's the hospital's registration number, WM h It's the hospital's watermark information; The preprocessing employs digital watermarking technology, built upon the BlessMark framework for blind diagnostic non-destructive watermarking that iteratively embeds RONI regions. This framework includes watermark embedding, watermark extraction, and restoration of the original medical carrier image. After registering with the health department to obtain watermark information, watermark embedding is performed on medical images in the database. During the data transaction process, when the data buyer requests to verify the copyright of the medical images provided by the data seller, the arbitrator extracts the watermark from the relevant hospital data and determines whether the copyright of the data belongs to the data seller's hospital by comparing the watermark information. Data buyers post data requests, data sellers send response information according to the requirements of the data request, and data buyers filter data sellers based on the response information to obtain the corresponding data sellers that meet the requirements. The corresponding data seller first calculates the first hash value for the hospital's processed data, then encrypts it to obtain an encrypted medical image dataset, and sends the encrypted medical image dataset and encryption key to the data buyer. The encryption process first generates a mixed hash value of the original image and a random key. The medical image with the embedded watermark is considered to be of a certain size. A two-dimensional matrix P, where This represents the position. Given the pixel values, calculate the vectors S1 and S2 of matrix P, where S1(i) is the sum of pixel values in the i-th row of matrix P, and S2(i) is the sum of pixel values in the j-th row of matrix P. The size of S1 is m, and the size of S2 is n. A randomly generated 256-bit key is used to generate an encrypted hash value. The MD5 encrypted hash function is used to calculate the hash value of vectors S1, S2, and key. Finally, the SHA-256 encrypted hash function is used to calculate the final 256-bit hash value Hash(S, key). Perform an XOR operation on Hash(S, key) and key to obtain K. Then, divide the result into four matrix groups and process the columns of the matrix groups to obtain four... The vector groups are then merged into... The matrix is used to calculate the final initial value I and control parameter C; Image encryption is performed based on DNA rules. Chaotic sequences are used to determine DNA rules, and then the pixel values of the image are manipulated to achieve secure encryption, including DNA substitution, DNA encoding, diffusion, and DNA decoding. The data buyer decrypts the encryption key to obtain the key, then uses the key to decrypt the encrypted medical image dataset to obtain the original medical image data, and calculates the hash value of the original medical image data, which is marked as the second hash value; The first and second hash values are compared. If they are different, arbitration is conducted to determine the cheater. If they are the same, the transaction ends.
2. The data transaction method for copyright protection and image encryption based on blockchain according to claim 1, characterized in that, During the process of a data buyer publishing a data request, the data buyer publishes a data request dreq according to their own needs. The data request dreq includes the attribute requirements dattr for the data, which specifies the attribute requirements that need to be included in the medical image. The data seller sends a response message M={desc, price} according to the data request, where desc is a description of the data and price is the selling price of the data.
3. The data transaction method for copyright protection and image encryption based on blockchain according to claim 1, characterized in that, The data buyer filters data sellers based on the response information. After identifying qualified data sellers, the buyer establishes a transaction relationship with each qualified data seller. Simultaneously, the data buyer needs to transfer their public key (bpk) and funds (P) to the designated seller. b This sum of money, P, is stored in a smart contract. b It needs to contain two parts, one of which is P. b1 After a successful data transaction, payment will be made to the data seller, with another portion going to P. b2 As a deposit, P will be credited to the data buyer upon completion of the transaction, provided the buyer is honest. b2 It will be refunded to the buyer.
4. The data transaction method for copyright protection and image encryption based on blockchain according to claim 3, characterized in that, The data seller mentioned a medical image dataset D={D1, D2, ……, D} involved in the transaction. n The first hash value (Hash) is obtained by calculating using the blockchain's native cryptographic hash function. s (D), then the data seller will encrypt the medical image dataset to obtain an encrypted dataset E(D), and the data seller also needs to hash (D). n Send the data to the data buyer using the data buyer's public key bpk and key, and then hash (D) using the data buyer's public key bpk. n Encrypt the key and key to get KEY={Hash(D, key)} n, key), key}, Hash the first hash value s (D) and KEY are uploaded to the smart contract, and the deposit P is stored in the smart contract. s As a fine.
5. The data transaction method for copyright protection and image encryption based on blockchain according to claim 1, characterized in that, After receiving the encrypted image dataset E(D) and KEY, the data buyer first decrypts the KEY using the private key bsk to obtain Hash(Dn, key) and key. Then, the buyer uses Hash(Dn, key) and key to decrypt the encrypted image dataset E(D) to recover the original medical image data D' and calculates the second hash value Hash. b (D) Hash b (D) and Hash s (D) Compare the data. If they are the same, it proves the data is authentic. If the data buyer has no objection, the data transaction ends, and the data seller receives P, which the data buyer previously stored in the smart contract. b1 Meanwhile, the deposit P of data buyers b2 The deposit P that the data seller had previously stored in a smart contract was returned. s The data will also be returned; if they are different, the data buyer will initiate arbitration.
6. The data transaction method for copyright protection and image encryption based on blockchain according to claim 5, characterized in that, When the data buyer initiates arbitration, the arbitration process is as follows: The arbitrator decrypts the encrypted medical image dataset, obtains the decrypted image dataset, and calculates a hash value to obtain a third hash value. v (D) Hash the third hash value v (D) and the first hash value Hash s (D) Compare the data; if they are different, the data seller is determined to be a malicious cheater. If they are the same, it means that the data uploaded by the data seller is correct, and the data buyer is judged to be a malicious cheater.
7. The data transaction method for copyright protection and image encryption based on blockchain according to claim 6, characterized in that, Following the arbitration, copyright authentication can be performed. The arbitrator will extract the watermark from the encrypted medical image dataset and display the extracted watermark information in WM format. d The data will be compared with the watermark information in the health department's database. If the copyright belongs to the hospital to which the data seller belongs, it proves that the data seller did not act dishonestly during the copyright certification stage, and the final arbitration result will still be the judgment made during the arbitration stage. If no watermark information is extracted or the extracted watermark information does not belong to the hospital to which the data seller belongs, the data seller will be judged as a malicious cheater and will be punished accordingly.
8. The data transaction method for copyright protection and image encryption based on blockchain according to claim 7, characterized in that, During the penalty phase, if the data seller is identified as a malicious cheater, the deposit P that the data seller had previously stored in the smart contract will be penalized. s The penalty will be imposed as punishment and will not be refunded after the transaction is completed. The data stored by the buyer in the P... b All deposits will be refunded if the data buyer is deemed to have engaged in malicious fraud. b2 The fine was used as punishment, and P b1 The deposit P stored by the data seller was returned to the data buyer. s It will be returned, and the entire transaction process will end.
9. A data transaction system based on blockchain for copyright protection and image encryption, characterized in that: include: Data preprocessing module: used to receive hospital-related data, preprocess the hospital-related data to obtain hospital-processed data, wherein the hospital-related data is electronic medical records and medical images in the hospital database; When receiving data from hospitals, the hospital first submits relevant information to the health department to register itself. The health department then generates unique information HI={N} for each hospital. h , R h WM h }, where N h It's the name of the hospital, R h It's the hospital's registration number, WM h It's the hospital's watermark information; The preprocessing employs digital watermarking technology, built upon the BlessMark framework for blind diagnostic non-destructive watermarking that iteratively embeds RONI regions. This framework includes watermark embedding, watermark extraction, and restoration of the original medical carrier image. After registering with the health department to obtain watermark information, watermark embedding is performed on medical images in the database. During the data transaction process, when the data buyer requests to verify the copyright of the medical images provided by the data seller, the arbitrator extracts the watermark from the relevant hospital data and determines whether the copyright of the data belongs to the data seller's hospital by comparing the watermark information. Seller filtering module: This module is used by data buyers to post data requests, data sellers to send response information according to the requirements of the data requests, and data buyers to filter data sellers based on the response information to obtain the corresponding data sellers that meet the requirements. Encryption Calculation Module: This module is used by the data seller to calculate the first hash value of the hospital's processed data and encrypt it to obtain an encrypted medical image dataset. The encrypted medical image dataset and encryption key are then sent to the data buyer. The encryption process first generates a mixed hash value of the original image and a random key. The medical image with the embedded watermark is considered to be of a certain size. A two-dimensional matrix P, where This represents the position. Given the pixel values, calculate the vectors S1 and S2 of matrix P, where S1(i) is the sum of pixel values in the i-th row of matrix P, and S2(i) is the sum of pixel values in the j-th row of matrix P. The size of S1 is m, and the size of S2 is n. A randomly generated 256-bit key is used to generate an encrypted hash value. The MD5 encrypted hash function is used to calculate the hash value of vectors S1, S2, and key. Finally, the SHA-256 encrypted hash function is used to calculate the final 256-bit hash value Hash(S, key). Perform an XOR operation on Hash(S, key) and key to obtain K. Then, divide the result into four matrix groups and process the columns of the matrix groups to obtain four... The vector groups are then merged into... The matrix is used to calculate the final initial value I and control parameter C; Image encryption is performed based on DNA rules. Chaotic sequences are used to determine DNA rules, and then the pixel values of the image are manipulated to achieve secure encryption, including DNA substitution, DNA encoding, diffusion, and DNA decoding. Decryption Calculation Module: This module is used by the data buyer to decrypt the encryption key to obtain the key, and then uses the key to decrypt the encrypted medical image dataset to obtain the original medical image data. It also calculates the hash value of the original medical image data and marks it as the second hash value. Comparison and Judgment Module: This module compares the calculated first hash value with the second hash value. If they are different, arbitration is conducted to determine the cheater. If they are the same, the transaction ends.