Data encryption method, decryption method, and revocable ciphertext database disease matching system
By introducing a time key mechanism and second-order polynomial construction into the public key encryption technology for ciphertext equivalence testing, the problem of arbitrary time matching by third parties is solved, enabling patients to revoke third-party permissions and achieve efficient matching, thereby improving data security and matching efficiency.
Patent Information
- Application Number
- CN202210671545.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-06-15
AI Technical Summary
In existing public key encryption technologies for ciphertext equivalence testing, third parties can match the patient's ciphertext at any time, leading to the leakage of the user's ciphertext information, and the patient cannot revoke the third party's permissions.
By introducing a time-key mechanism, which generates time-sensitive authorization trapdoors and ciphertexts, and combines second-order polynomial construction and random number operations, lightweight revocation and efficient matching are achieved, ensuring that third parties can only perform data matching within a specific time period.
It achieves secure protection of patient data in the medical system. Patients can revoke third-party matching permissions when needed, and the matching process is efficient without bilinear pairing operations, thus improving data security and matching efficiency.
Smart Images

Figure CN115098871B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a data encryption method, a data decryption method, a data encryption device, a data decryption device, a revocable encrypted database disease matching system, and a storage medium, belonging to the field of data security. Background Technology
[0002] In recent years, cloud computing technology has developed rapidly. As a convenient service of cloud computing, cloud storage technology has attracted widespread attention from individuals and enterprises. To reduce operating costs and local storage, many individuals and enterprises store their data on cloud servers. However, storing data on cloud servers also poses certain security risks. For example, malicious adversaries can attack cloud servers, threatening the information of individuals or enterprises. To prevent information leakage, data is encrypted before being stored on cloud servers. However, how to process and match encrypted data when users want to search for relevant files becomes a thorny issue. To address this, Yang et al. first proposed a public-key encryption technique that supports ciphertext equivalence testing in multi-public-key environments. When a pair of ciphertexts is encrypted using different public keys, the tester can determine whether the pair of ciphertexts comes from the same message without decryption. This method can be used securely and efficiently for data matching.
[0003] Ciphertext equivalence test (CEPT) public-key cryptography has broad applications, including cloud-based healthcare systems. In these systems, to ensure data confidentiality, patients encrypt their medical records. When patient A wants to find other patients with the same symptoms to discuss their condition, they entrust a third party to do so. Patient A sends their encrypted symptom information to the third party. When patient B also wants to find other patients with the same symptoms, they do the same. The third party matches the two patients' symptoms without decryption. If the symptoms match, the third party notifies both patients to connect, allowing them to exchange information about their conditions and treatment plans. This helps patients express their emotions, receive emotional support, and realize their personal value, positively impacting their mental health and encouraging mutual encouragement for optimal recovery. This process utilizes CEPT public-key cryptography, while ensuring that the third party cannot access the patients' medical information.
[0004] Subsequent scholars introduced a trapdoor mechanism by adopting an authorization mechanism, ensuring that ciphertext can only be tested by user-authorized testers. Furthermore, to improve computational practicality, patent document (publication number: CN109902501A, publication date: June 18, 2019) provides a structured encryption method and system for equivalence testing based on a cloud service platform, eliminating the computationally intensive bilinear pairing operation and improving the operational efficiency of ciphertext equivalence testing public key encryption technology from a testing perspective. Building upon the ciphertext equivalence testing function, many schemes have further expanded its functionality. Wang et al. introduced proxy re-encryption to achieve data sharing between users. To resist offline message recovery attacks, Lin et al. introduced the concept of a group. However, in existing ciphertext equivalence testing public key encryption technologies, a third party can match all of the patient's ciphertext at any subsequent time to obtain information of interest. For example, a third party might impersonate a user to query a cloud server and match future ciphertext containing medical information that the patient may have stored. This could lead to the leakage of the user's ciphertext information. Furthermore, even if the patient no longer needs a third party to match their encrypted messages, the patient cannot revoke the third party's permissions.
[0005] Therefore, an effective revocation technique is needed to enable users to revoke third-party matching permissions in cloud-based medical storage systems that support encrypted equivalence testing. Summary of the Invention
[0006] In view of this, the present invention provides a data encryption method, a data decryption method, a data encryption device, a data decryption device, a revocable encrypted database disease matching system and a storage medium, which allows patients to better enjoy the convenience of cloud storage while further ensuring data security. It features lightweight revocation and efficient matching and can be widely applied in medical systems and other scenarios.
[0007] The first objective of this invention is to provide a data encryption method.
[0008] The second objective of this invention is to provide a data decryption method.
[0009] A third objective of this invention is to provide a data encryption device.
[0010] The fourth objective of this invention is to provide a data decryption device.
[0011] The fifth objective of this invention is to provide a revocable encrypted database disease matching system.
[0012] A sixth object of the present invention is to provide a computer-readable storage medium.
[0013] The first objective of this invention is achieved by adopting the following technical solution:
[0014] A data encryption method, applied to a user terminal, the method comprising:
[0015] Select the plaintext to be encrypted;
[0016] Based on the plaintext to be encrypted, calculate the three coordinates containing the plaintext information;
[0017] Construct a second-order polynomial based on three coordinates containing plaintext information;
[0018] Two points are randomly selected on the second-order polynomial as the two coordinates containing the plaintext information;
[0019] Get the recipient's public key and the recipient's current time public key;
[0020] Two random numbers are randomly selected. Based on the receiver's public key, the receiver's current time public key, the plaintext to be encrypted, two coordinates containing the plaintext information, the two random numbers, and the current time, the ciphertext is generated.
[0021] The ciphertext is transmitted to the cloud server so that the cloud server stores the ciphertext in a ciphertext database.
[0022] Furthermore, the step of calculating three coordinates containing the plaintext information based on the plaintext to be encrypted specifically includes:
[0023] Six predetermined random numbers are XORed with the plaintext to be encrypted.
[0024] A hash operation is performed using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information;
[0025] The five ciphertext segments are as follows:
[0026]
[0027]
[0028]
[0029] Where (X,Y,Z) is the receiver's public key, (w T ,v T ) is the receiver's current public key, m is the plaintext to be encrypted, (x1,y1) and (x2,y2) are two coordinates containing the plaintext information, r1 and r2 are two random numbers, and T is the current time.
[0030] The second objective of this invention is achieved by adopting the following technical solution:
[0031] A data decryption method, applied to a user terminal, the method comprising:
[0032] Retrieve the ciphertext matched from the ciphertext database on the cloud server;
[0033] The sender's plaintext can be calculated based on the receiver's private key;
[0034] Based on the receiver's private key at the time the ciphertext was generated, two coordinates containing the plaintext information are calculated;
[0035] Based on the plaintext, three coordinates containing the plaintext information are calculated.
[0036] Construct a second-order polynomial based on three coordinates containing plaintext information;
[0037] Based on the matched ciphertext and the second-order polynomial, determine whether the ciphertext meets the conditions.
[0038] If the ciphertext meets the conditions, the plaintext will be output.
[0039] Furthermore, the sender's plaintext is calculated based on the receiver's private key, as shown in the following formula:
[0040]
[0041] Where α is the value of the receiver's private key sk, m is the plaintext, r2 is a random number, c1 is the first ciphertext segment, and c2 is the second ciphertext segment;
[0042] The two coordinates containing the plaintext information are calculated based on the receiver's private key at the time the ciphertext was generated, as shown in the following formula:
[0043]
[0044] Where c3 is the third ciphertext segment, c4 is the fourth ciphertext segment, and sk T,1 The first part of the receiver's time private key when the ciphertext was generated, and (x1,y1) and (x2,y2) are two coordinates containing the plaintext information;
[0045] The calculation of three coordinates containing plaintext information based on the plaintext specifically includes:
[0046] Six predetermined random numbers are XORed with the plaintext respectively;
[0047] A hash operation is performed using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information;
[0048] The conditions are met if the following four equations are true:
[0049]
[0050] f(x1)=y1, f(x2)=y2
[0051] Where f(x) is a second-order polynomial.
[0052] The third objective of this invention is achieved by adopting the following technical solution:
[0053] A data encryption device, applied to a user terminal, the device comprising:
[0054] The plaintext selection module is used to select the plaintext to be encrypted;
[0055] The coordinate generation module is used to calculate three coordinates containing the plaintext information based on the plaintext to be encrypted.
[0056] The polynomial construction module is used to construct a second-order polynomial based on three coordinates containing plaintext information, and randomly select two points on the second-order polynomial as the two coordinates containing plaintext information.
[0057] The coordinate selection module is used to randomly select two points on the second-order polynomial as the two coordinates containing the plaintext information.
[0058] The public key acquisition module is used to obtain the recipient's public key and the recipient's current time public key.
[0059] The ciphertext generation module is used to randomly select two random numbers and generate ciphertext based on the receiver's public key, the receiver's current time public key, the plaintext to be encrypted, two coordinates containing the plaintext information, the two random numbers, and the current time.
[0060] The ciphertext transmission module is used to transmit ciphertext to the cloud server so that the cloud server can store the ciphertext in the ciphertext database.
[0061] The fourth objective of this invention is achieved by adopting the following technical solution:
[0062] A data decryption device, applied to a user terminal, the device comprising:
[0063] The ciphertext retrieval module is used to retrieve ciphertext matched from the ciphertext database of the cloud server;
[0064] The plaintext calculation module is used to calculate the sender's plaintext based on the receiver's private key;
[0065] The first coordinate generation module is used to calculate two coordinates containing plaintext information based on the receiver's private key at the time the ciphertext was generated.
[0066] The second coordinate generation module is used to calculate three coordinates containing plaintext information based on the plaintext.
[0067] The polynomial construction module is used to construct a second-order polynomial based on three coordinates containing plaintext information.
[0068] The judgment module is used to determine whether the ciphertext meets the conditions based on the matched ciphertext and the second-order polynomial.
[0069] The plaintext output module is used to output plaintext if the ciphertext meets the conditions.
[0070] The fifth objective of this invention is achieved by adopting the following technical solution:
[0071] A revocable encrypted database symptom matching system, the system comprising a user terminal, a matching terminal, and a cloud server, wherein there are at least two user terminals connected to each other, each user terminal is connected to the matching terminal, and each user terminal and the matching terminal are connected to the cloud server.
[0072] The user terminal is used to implement the above-mentioned data encryption method when the user is the sender, and to implement the above-mentioned data decryption method when the user is the receiver.
[0073] The matching terminal is used by medical institution staff to obtain a set of ciphertexts to be matched submitted by the user to the cloud server as the first ciphertext, and a set of ciphertexts from the ciphertext database as the second ciphertext; obtain the authorization traps corresponding to the first and second ciphertexts; perform data matching based on the first ciphertext and its corresponding authorization trap, and the second ciphertext and its corresponding authorization trap, and determine whether the matching is successful; if the matching is successful, the matching result is fed back to the corresponding user on the user terminal; if the matching is unsuccessful, the next set of ciphertexts in the ciphertext database is obtained until the process is completed.
[0074] The cloud server is a medical system cloud server, used to retrieve the ciphertext that the user needs to revoke the match from the ciphertext database; retrieve the time private key used by the user when the ciphertext was generated and the user's current time private key; update the ciphertext from the generation time to the current time based on the user's time private key used when the ciphertext was generated and the user's current time private key, so that the matching end cannot match the ciphertext at the current time.
[0075] Furthermore, the step of performing data matching based on the first ciphertext and its corresponding authorization trapdoor, and the second ciphertext and its corresponding authorization trapdoor, to determine whether a match is successful, specifically includes:
[0076] Based on the fourth ciphertext segment of the first ciphertext and the corresponding authorization trapdoor, determine the two coordinates containing the plaintext information in the first ciphertext, as follows:
[0077]
[0078] Among them, c i,3 The third ciphertext segment of the first ciphertext, c i,4 The fourth ciphertext segment of the first ciphertext, td i,T Let (x1, y1) and (x2, y2) be the authorization trapdoor corresponding to the first ciphertext, and (x1, y1) and (x2, y2) be the two coordinates of the first ciphertext.
[0079] Based on the fourth ciphertext segment of the second ciphertext and the corresponding authorization trapdoor, determine the two coordinates containing the plaintext information in the second ciphertext, as follows:
[0080]
[0081] Among them, c j,3 The third ciphertext segment of the second ciphertext, c j,4 The fourth ciphertext segment of the second ciphertext, td j,T′ Let (x1′, y1′) and (x2′, y2′) be the authorization trapdoor corresponding to the second ciphertext, and (x1′, y1′) and (x2′, y2′) be the two coordinates of the second ciphertext.
[0082] Construct a first second-order polynomial based on two coordinates of the first ciphertext and one coordinate of the second ciphertext;
[0083] Construct a second second-order polynomial based on two coordinates of the second ciphertext and one coordinate of the first ciphertext;
[0084] Determine if the constant terms of the first and second order polynomials are equal. If they are equal, it means that the two sets of ciphertexts contain the same message and the match is successful. If they are not equal, it means that the two sets of ciphertexts contain different messages and the match is unsuccessful.
[0085] Furthermore, based on the user's private key used when the ciphertext was generated and the user's current private key, the ciphertext is updated from its generation time to the current time, as shown in the following formula:
[0086] c′1=c1, c′2=c2, c′3=c3,
[0087]
[0088] Where T is the generation time, T′ is the current time, (c1,c2,c3,c4,c5) are the five ciphertext segments of ciphertext C, and (c′1,c′2,c′3,c′4,c′5) are the five ciphertext segments of ciphertext C after the update.
[0089] The sixth objective of this invention is achieved by adopting the following technical solution:
[0090] A computer-readable storage medium storing a program that, when executed by a processor, implements the above-described data encryption method or the above-described data decryption method.
[0091] The present invention has the following advantages over the prior art:
[0092] This invention introduces a time key, making the matching authorization trapdoor and ciphertext time-sensitive. At the current time, when a user wants to revoke the matching permission of a medical institution employee, the matching authorization trapdoor and part of the ciphertext are updated, and the distribution of the authorization trapdoor for the current time is stopped, preventing the medical institution employee from performing data matching, thus achieving lightweight revocation. When performing data matching, there is no need to use bilinear pairing operations, achieving efficient matching. It is practical and can be widely used in medical systems and other scenarios. Attached Figure Description
[0093] 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, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0094] Figure 1 This is a structural block diagram of the encrypted database disease matching system according to an embodiment of the present invention.
[0095] Figure 2 This is a flowchart illustrating data encryption in the encrypted database disease matching system according to an embodiment of the present invention.
[0096] Figure 3 This is a flowchart illustrating data decryption in the encrypted database symptom matching system according to an embodiment of the present invention.
[0097] Figure 4 This is a flowchart illustrating data matching in the encrypted database symptom matching system according to an embodiment of the present invention.
[0098] Figure 5 This is a flowchart illustrating the matching cancellation process in the encrypted database symptom matching system according to an embodiment of the present invention.
[0099] Figure 6 This is a structural block diagram of the data encryption device in the encrypted database disease matching system according to an embodiment of the present invention.
[0100] Figure 7 This is a structural block diagram of the data decryption device in the encrypted database disease matching system according to an embodiment of the present invention.
[0101] Figure 8 This is a structural block diagram of the data matching device in the encrypted database disease matching system according to an embodiment of the present invention.
[0102] Figure 9This is a structural block diagram of the matching cancellation device in the encrypted database disease matching system according to an embodiment of the present invention. Detailed Implementation
[0103] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 some embodiments of the present invention, but 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.
[0104] Example 1:
[0105] like Figure 1 As shown, this embodiment provides a revocable encrypted database disease matching system. The system includes a user terminal, a matching terminal, and a cloud server. There are at least two user terminals, which are connected to each other. Each user terminal is connected to the matching terminal, and each user terminal and the matching terminal are connected to the cloud server. The matching terminal is used by medical institution staff, and the cloud server is a medical system cloud server.
[0106] The specific implementation process of the encrypted database symptom matching system in this embodiment is as follows:
[0107] (1) System initialization process
[0108] System Public Parameters Where G is a cyclic group of order p, G is a multiplicative group of order p, and g is a generator of the group G. H3:{0,1} * →{0,1} l , There are six anti-collision functions, where η1, η2, η3, η4, η5, and η6 are random strings of length λ, where λ is the system's safety parameter. The time parameter T is determined according to the actual situation and can be set to one month, one year, etc.
[0109] (2) User key pair generation process
[0110] Each user randomly selects a parameter based on the system's publicly available parameter pp. Calculate X = g α Y = g β Z = g γ Therefore, the user key pair is (pk,sk)=((X,Y,Z),(α,β,γ)).
[0111] (3) User time key pair generation process
[0112] Each user randomly selects a time parameter T based on their private key. calculate sk T,1 =t1+βH4(T,w T ),sk T,2 =s1+γH5(T,v T Therefore, the user time key pair is (pk T ,sk T )=((w T ,v T ),(sk T,1 ,sk T,2 )).
[0113] (4) User authorization trap generation process
[0114] Each user generates a corresponding authorization trapdoor based on their own time private key. For example, user i generates an authorization trapdoor of type td. i,T =sk i,T,1 .
[0115] (5) Data encryption process
[0116] The data encryption process is implemented on the user end, requiring the user to act as the sender. In this case, the user end is the sender's user end, such as... Figure 2 As shown, it includes the following steps:
[0117] S201. Select the plaintext to be encrypted.
[0118] S202. Based on the plaintext to be encrypted, calculate the three coordinates containing the plaintext information.
[0119] Furthermore, step S202 specifically includes:
[0120] S2021. Use six predetermined random numbers to perform an XOR operation with the plaintext to be encrypted.
[0121] S2022. Perform a hash operation using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information.
[0122] Specifically, through the following formula:
[0123]
[0124]
[0125]
[0126] We obtain three coordinates P1, P2, and P3 containing plaintext information.
[0127] S203. Construct a second-order polynomial based on three coordinates containing plaintext information.
[0128] S204. Randomly select two points on the second-order polynomial as the two coordinates containing the plaintext information.
[0129] S205. Obtain the receiver's public key and the receiver's current time public key.
[0130] S206. Randomly select two random numbers, and generate ciphertext based on the receiver's public key, the receiver's current time public key, the plaintext to be encrypted, two coordinates containing the plaintext information, the two random numbers, and the current time.
[0131] Specifically, two random numbers r1 and r2 are randomly selected, based on the receiver's public key pk = (X, Y, Z) and the receiver's current time public key pk. T =(w T ,v T Given the plaintext m to be encrypted, two coordinates (x1, y1) and (x2, y2) containing the plaintext information, two random numbers r1 and r2, and the current time T, generate the ciphertext C = (c1, c2, c3, c4, c5), where:
[0132]
[0133]
[0134]
[0135] S207. Transmit the ciphertext to the cloud server so that the cloud server stores the ciphertext in the ciphertext database.
[0136] (5) Data decryption process
[0137] The data decryption process is implemented on the user's end, requiring the user to act as the receiver. In this case, the user's end is the receiver's end, such as... Figure 3 As shown, it includes the following steps:
[0138] S301. Obtain the ciphertext matched from the ciphertext database of the cloud server.
[0139] S302. Calculate the sender's plaintext based on the receiver's private key.
[0140] Specifically, assuming the receiver's private key sk = α, the sender's plaintext is calculated using the following formula:
[0141]
[0142] S303. Calculate the two coordinates containing the plaintext information based on the receiver's private key at the time the ciphertext was generated.
[0143] Specifically, let sk be the receiver's private key at the time the ciphertext was generated. T =(sk T,1 ,sk T,2 The two coordinates containing the plaintext information are calculated using the following formula:
[0144]
[0145] S304. Based on the plaintext, calculate the three coordinates containing the plaintext information.
[0146] Furthermore, step S302 specifically includes:
[0147] S3041. Use six predetermined random numbers and perform an XOR operation with the plaintext respectively.
[0148] S3042. Perform a hash operation using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information.
[0149] Specifically, through the following formula:
[0150]
[0151]
[0152]
[0153] We obtain three coordinates P1, P2, and P3 containing plaintext information.
[0154] S305. Construct a second-order polynomial based on three coordinates containing plaintext information.
[0155] S306. Based on the matched ciphertext and the second-order polynomial, determine whether the ciphertext meets the conditions. If the ciphertext meets the conditions, proceed to step S307.
[0156] Specifically, meeting the conditions means that the following four equations are true:
[0157]
[0158] f(x1)=y1, f(x2)=y2
[0159] Where f(x) is a second-order polynomial.
[0160] S307, Output plaintext.
[0161] (6) Data matching process
[0162] The data matching process is implemented by the matching end, such as... Figure 4 As shown, it includes the following steps:
[0163] S401. Obtain a set of ciphertexts to be matched submitted by the user to the cloud server as the first ciphertext, and obtain a set of ciphertexts from the ciphertext database as the second ciphertext.
[0164] S402. Obtain the authorization trapdoor corresponding to the first ciphertext and the second ciphertext.
[0165] S403. Perform data matching based on the first ciphertext and its corresponding authorization trapdoor, the second ciphertext and its corresponding authorization trapdoor, and determine whether the matching is successful. If the matching is successful, proceed to step S404. If the matching is unsuccessful, proceed to step S405.
[0166] Furthermore, step S403 specifically includes:
[0167] S4031, According to the fourth ciphertext segment c of the first ciphertext i,4 And the corresponding authorization trap td i,T =sk i,T,1 The coordinates (x1, y1) and (x2, y2) of the plaintext information contained in the first ciphertext are determined as follows:
[0168]
[0169] S4032, According to the fourth ciphertext segment c of the second ciphertext j,4 And the corresponding authorization trap td j,T′ =sk j,T′,1 The coordinates (x1′, y1′) and (x2′, y2′) of the plaintext contained in the second ciphertext are determined as follows:
[0170]
[0171] S4033. Construct the first second-order polynomial f(x) based on the two coordinates (x1, y1) and (x2, y2) of the first ciphertext and the coordinate (x1′, y1′) of the second ciphertext.
[0172] S4034. Based on the two coordinates (x1′, y1′) and (x2′, y2′) of the second ciphertext and the coordinate (x1, y1) of the first ciphertext, construct the second second-order polynomial f′(x).
[0173] S4035. Determine whether the constant terms of the first second-order polynomial f(x) and the second second-order polynomial are equal. If they are equal, it means that the messages contained in the two sets of ciphertexts are consistent and the match is successful. Proceed to step S404. If they are not equal, it means that the messages contained in the two sets of ciphertexts are inconsistent and the match is unsuccessful. Proceed to step S405.
[0174] S404. Send the successful matching result back to the corresponding user on the client side.
[0175] S405. Continue to retrieve the next set of ciphertext from the ciphertext database until processing is complete.
[0176] (7) Matching the cancellation process
[0177] The matching cancellation process is implemented by the cloud server, such as... Figure 5 As shown, it includes the following steps:
[0178] S501. Retrieve the ciphertext for which the user needs to cancel the match from the ciphertext database.
[0179] Specifically, let C be the ciphertext that the user needs to undo the matching, and let the user want to update the ciphertext from the generation time T to the current time T′.
[0180] S502. Obtain the private key used by the user at the time the ciphertext was generated and the private key of the user's current time.
[0181] S503. Based on the private key used by the user at the time the ciphertext was generated and the private key of the user's current time, update the ciphertext from the time of generation to the current time, so that the matching end cannot match the ciphertext at the current time.
[0182] Specifically, let sk be the private key 'time' used when the ciphertext was generated. T The current time private key sk T′ Through the following formula:
[0183] c′1=c1, c′2=c2, c′3=c3,
[0184]
[0185] Where (c1,c2,c3,c4,c5) are the five ciphertext segments of ciphertext C, and (c′1,c′2,c′3,c′4,c′5) are the five ciphertext segments of ciphertext C after the update.
[0186] Based on the above process, this embodiment also provides a data encryption device, a data decryption device, a data matching device, and a matching cancellation device, combined with... Figure 1The user terminal includes a data encryption device and a data decryption device. When the user on the user terminal is the sender, the data encryption device is used; when the user on the user terminal is the receiver, the data decryption device is used. The matching terminal includes a data matching device. The cloud server includes a matching cancellation device.
[0187] The data encryption device in this embodiment is as follows: Figure 6 As shown, the module includes a plaintext selection module 601, a coordinate generation module 602, a polynomial construction module 603, a coordinate selection module 604, a public key acquisition module 605, a ciphertext generation module 606, and a ciphertext transmission module 607. The specific functions of each module are as follows:
[0188] Plaintext selection module 601 is used to select plaintext to be encrypted.
[0189] The coordinate generation module 602 is used to calculate three coordinates containing the plaintext information based on the plaintext to be encrypted.
[0190] Polynomial construction module 603 is used to construct a second-order polynomial based on three coordinates containing plaintext information.
[0191] The coordinate selection module 604 is used to randomly select two points on the second-order polynomial as the two coordinates containing the plaintext information.
[0192] The public key acquisition module 605 is used to acquire the receiver's public key and the receiver's current time public key.
[0193] The ciphertext generation module 606 is used to randomly select two random numbers and generate ciphertext based on the receiver's public key, the receiver's current time public key, the plaintext to be encrypted, two coordinates containing the plaintext information, the two random numbers, and the current time.
[0194] The ciphertext transmission module 607 is used to transmit ciphertext to the cloud server so that the cloud server can store the ciphertext in the ciphertext database.
[0195] The data decryption device in this embodiment is as follows: Figure 7 As shown, the module includes a ciphertext acquisition module 701, a plaintext calculation module 702, a first coordinate generation module 703, a second coordinate generation module 704, a polynomial construction module 705, a judgment module 706, and a plaintext output module 707. The specific functions of each module are as follows:
[0196] The ciphertext acquisition module 701 is used to acquire the ciphertext matched from the ciphertext database of the cloud server.
[0197] The plaintext calculation module 702 is used to calculate the sender's plaintext based on the receiver's private key.
[0198] The first coordinate generation module 703 is used to calculate two coordinates containing plaintext information based on the receiver's time private key when the ciphertext was generated.
[0199] The second coordinate generation module 704 is used to calculate three coordinates containing plaintext information based on the plaintext.
[0200] Polynomial construction module 705 is used to construct a second-order polynomial based on three coordinates containing plaintext information.
[0201] The judgment module 706 is used to determine whether the ciphertext meets the conditions based on the matched ciphertext and the second-order polynomial.
[0202] Plaintext output module 707 is used to output plaintext if the ciphertext meets the conditions.
[0203] The data matching device in this embodiment is as follows: Figure 8 As shown, it includes a first ciphertext acquisition module 801, an authorization trapdoor acquisition module 802, a judgment module 803, and a processing module 804. The specific functions of each module are as follows:
[0204] The ciphertext acquisition module 801 is used to acquire a set of ciphertexts to be matched submitted by the user to the cloud server as the first ciphertext, and to acquire a set of ciphertexts from the ciphertext database as the second ciphertext.
[0205] The authorization trapdoor acquisition module 802 is used to acquire the authorization trapdoors corresponding to the first ciphertext and the second ciphertext.
[0206] The judgment module 803 is used to perform data matching based on the first ciphertext and the corresponding authorization trapdoor, the second ciphertext and the corresponding authorization trapdoor, and to determine whether the matching is successful.
[0207] The processing module 804 is used to send the matching result back to the corresponding user on the client if the match is successful; if the match is unsuccessful, it continues to obtain the next set of ciphertext from the ciphertext database until the processing is completed.
[0208] The matching cancellation device in this embodiment is as follows: Figure 9 As shown, it includes a ciphertext acquisition module 901, a time private key acquisition module 902, and a ciphertext update module 903. The specific functions of each module are as follows:
[0209] The ciphertext acquisition module 901 is used to retrieve the ciphertext that the user needs to revoke the match from the ciphertext database.
[0210] The time private key acquisition module 902 is used to acquire the time private key used by the user when the ciphertext was generated and the time private key of the user's current time.
[0211] The ciphertext update module 903 is used to update the ciphertext from the generation time to the current time based on the user's private key used when the ciphertext was generated and the user's private key for the current time, so that the matching end cannot match the ciphertext at the current time.
[0212] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by a program instructing related hardware, and the corresponding program can be stored in a computer-readable storage medium.
[0213] It should be noted that although the method operations of the above embodiments are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the order of execution of the described steps may be changed. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0214] It should be noted that the device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0215] The computer-readable storage medium of this embodiment may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may 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 a computer-readable storage medium may include, but are not limited to: 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.
[0216] In summary, this invention introduces a time key, making the matching authorization trapdoor and ciphertext time-sensitive. At the current time, when a user wants to revoke the matching permission of a medical institution employee, the matching authorization trapdoor and part of the ciphertext are updated, and the distribution of the current time authorization trapdoor is stopped, preventing the medical institution employee from performing data matching, thus achieving lightweight revocation. When performing data matching, there is no need to use bilinear pairing operations, achieving efficient matching. It is practical and can be widely applied in scenarios such as medical systems.
[0217] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.
Claims
1. A data encryption method, applied to a user terminal, characterized in that, The method includes: Select the plaintext to be encrypted; Based on the plaintext to be encrypted, calculate the three coordinates containing the plaintext information; Construct a second-order polynomial based on three coordinates containing plaintext information; Two points are randomly selected on the second-order polynomial as the two coordinates containing the plaintext information; Get the recipient's public key and the recipient's current time public key; Two random numbers are randomly selected. Based on the receiver's public key, the receiver's current time public key, the plaintext to be encrypted, two coordinates containing the plaintext information, the two random numbers, and the generation time, the ciphertext is generated. The ciphertext is transmitted to the cloud server so that the cloud server stores the ciphertext in a ciphertext database. The step of calculating three coordinates containing the plaintext information based on the plaintext to be encrypted specifically includes: Six predetermined random numbers are XORed with the plaintext to be encrypted. A hash operation is performed using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information; The five ciphertext segments are as follows: Where (X,Y,Z) is the receiver's public key, (w T ,v T Let y1 be the receiver's current public key, m be the plaintext to be encrypted, (x1, y1) and (x2, y2) be two coordinates containing the plaintext information, r1 and r2 be two random numbers, T be the generation time, g be the generator, H1 be the first anti-collision function in the public parameters, H2 be the second anti-collision function in the public parameters, H3 be the third anti-collision function in the public parameters, H4 be the fourth anti-collision function in the public parameters, H5 be the fifth anti-collision function in the public parameters, and Z be the third part of the receiver's public key.
2. A data decryption method, applied to a user terminal, characterized in that, The method includes: Retrieve the ciphertext matched from the ciphertext database on the cloud server; The sender's plaintext can be calculated based on the receiver's private key; Based on the receiver's private key at the time the ciphertext was generated, two coordinates containing the plaintext information are calculated; Based on the plaintext, three coordinates containing the plaintext information are calculated. Construct a second-order polynomial based on three coordinates containing plaintext information; Based on the matched ciphertext and the second-order polynomial, determine whether the ciphertext meets the conditions. If the ciphertext meets the conditions, output the plaintext. The plaintext of the sender is calculated based on the receiver's private key, as shown in the following formula: Where α is the value of the receiver's private key sk, m is the plaintext, r2 is a random number, c1 is the first ciphertext segment, c2 is the second ciphertext segment, and H1 is the first anti-collision function in the public parameters. The two coordinates containing the plaintext information are calculated based on the receiver's private key at the time the ciphertext was generated, as shown in the following formula: Where c3 is the third ciphertext segment, c4 is the fourth ciphertext segment, and sk T,1 H1 is the first part of the receiver's time private key when the ciphertext is generated, (x1,y1) and (x2,y2) are two coordinates containing the plaintext information, and H2 is the second anti-collision function in the public parameters. The calculation of three coordinates containing plaintext information based on the plaintext specifically includes: Six predetermined random numbers are XORed with the plaintext respectively; A hash operation is performed using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information; The conditions are met if the following four equations are true: f(x1)=y1, f(x2)=y2 Where f(x) is a second-order polynomial, g is a generator, c5 is the fifth ciphertext segment, and sk T,2 The private key sk of the receiver at the time the ciphertext was generated. T In the second part, H3 is the third anti-collision function in the public parameters, and T is the generation time.
3. A data encryption device, applied at a user terminal, characterized in that, The device includes: The plaintext selection module is used to select the plaintext to be encrypted; The coordinate generation module is used to calculate three coordinates containing the plaintext information based on the plaintext to be encrypted. The polynomial construction module is used to construct a second-order polynomial based on three coordinates containing plaintext information. The coordinate selection module is used to randomly select two points on the second-order polynomial as the two coordinates containing the plaintext information. The public key acquisition module is used to obtain the recipient's public key and the recipient's current time public key. The ciphertext generation module is used to randomly select two random numbers and generate ciphertext based on the receiver's public key, the receiver's current time public key, the plaintext to be encrypted, two coordinates containing the plaintext information, the two random numbers, and the generation time. The ciphertext transmission module is used to transmit ciphertext to the cloud server so that the cloud server can store the ciphertext in the ciphertext database; The step of calculating three coordinates containing the plaintext information based on the plaintext to be encrypted specifically includes: Six predetermined random numbers are XORed with the plaintext to be encrypted. A hash operation is performed using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information; The five ciphertext segments are as follows: Where (X,Y,Z) is the receiver's public key, (w T ,v T Let y1 be the receiver's current public key, m be the plaintext to be encrypted, (x1, y1) and (x2, y2) be two coordinates containing the plaintext information, r1 and r2 be two random numbers, T be the generation time, g be the generator, H1 be the first anti-collision function in the public parameters, H2 be the second anti-collision function in the public parameters, H3 be the third anti-collision function in the public parameters, H4 be the fourth anti-collision function in the public parameters, H5 be the fifth anti-collision function in the public parameters, and Z be the third part of the receiver's public key.
4. A data decryption device, applied at a user end, characterized in that, The device includes: The ciphertext retrieval module is used to retrieve ciphertext matched from the ciphertext database of the cloud server; The plaintext calculation module is used to calculate the sender's plaintext based on the receiver's private key; The first coordinate generation module is used to calculate two coordinates containing plaintext information based on the receiver's private key at the time the ciphertext was generated. The second coordinate generation module is used to calculate three coordinates containing plaintext information based on the plaintext. The polynomial construction module is used to construct a second-order polynomial based on three coordinates containing plaintext information. The judgment module is used to determine whether the ciphertext meets the conditions based on the matched ciphertext and the second-order polynomial. The plaintext output module is used to output plaintext if the ciphertext meets the conditions. The plaintext of the sender is calculated based on the receiver's private key, as shown in the following formula: Where α is the value of the receiver's private key sk, m is the plaintext, r2 is a random number, c1 is the first ciphertext segment, and c2 is the second ciphertext segment; The two coordinates containing the plaintext information are calculated based on the receiver's private key at the time the ciphertext was generated, as shown in the following formula: Where c3 is the third ciphertext segment, c4 is the fourth ciphertext segment, and sk T,1 The first part of the receiver's time private key when the ciphertext was generated, and (x1,y1) and (x2,y2) are two coordinates containing the plaintext information; The calculation of three coordinates containing plaintext information based on the plaintext specifically includes: Six predetermined random numbers are XORed with the plaintext respectively; A hash operation is performed using a predetermined hash function and the result of six XOR operations to obtain three coordinates containing plaintext information; The conditions are met if the following four equations are true: f(x1)=y1, f(x2)=y2 Where f(x) is a second-order polynomial, g is a generator, c5 is the fifth ciphertext segment, and sk T,2 The private key sk of the receiver at the time the ciphertext was generated. T In the second part, H3 is the third anti-collision function in the public parameters, and T is the generation time.
5. A revocable encrypted database symptom matching system, characterized in that, The system includes a user terminal, a matching terminal, and a cloud server. There are at least two user terminals, which are connected to each other. Each user terminal is connected to the matching terminal, and each user terminal and the matching terminal are connected to the cloud server. The user terminal is used to implement the data encryption method of claim 1 when the user is the sender, and to implement the data decryption method of claim 2 when the user is the receiver. The matching terminal is used by medical institution staff to obtain a set of ciphertexts to be matched submitted by the user to the cloud server as the first ciphertext, and to obtain a set of ciphertexts from the ciphertext database as the second ciphertext; to obtain the authorization trapdoors corresponding to the first ciphertext and the second ciphertext; and to perform data matching based on the first ciphertext and its corresponding authorization trapdoor, and the second ciphertext and its corresponding authorization trapdoor, to determine whether the match is successful. If a match is successful, the result will be sent to the corresponding user on the client side; if a match is unsuccessful, the system will continue to retrieve the next set of ciphertext from the ciphertext database until the process is complete. The cloud server is a medical system cloud server, used to retrieve the ciphertext that the user needs to revoke the match from the ciphertext database; and to retrieve the time private key used by the user when the ciphertext was generated and the user's current time private key. Based on the private key used by the user when the ciphertext was generated and the user's current private key, the ciphertext is updated from the generation time to the current time, making it impossible for the matching end to match the ciphertext at the current time.
6. The encrypted database symptom matching system according to claim 5, characterized in that, The step of performing data matching based on the first ciphertext and its corresponding authorization trapdoor, and the second ciphertext and its corresponding authorization trapdoor, to determine whether the match is successful, specifically includes: Based on the fourth ciphertext segment of the first ciphertext and the corresponding authorization trapdoor, determine the two coordinates containing the plaintext information in the first ciphertext, as follows: Among them, c i,3 The third ciphertext segment of the first ciphertext, c i,4 The fourth ciphertext segment of the first ciphertext, td i,T Let (x1, y1) and (x2, y2) be the authorization trapdoor corresponding to the first ciphertext, and let (x1, y1) and (x2, y2) be the two coordinates of the plaintext information contained in the first ciphertext. Based on the fourth ciphertext segment of the second ciphertext and the corresponding authorization trapdoor, determine the two coordinates containing the plaintext information in the second ciphertext, as follows: Among them, c j,3 The third ciphertext segment of the second ciphertext, c j,4 The fourth ciphertext segment of the second ciphertext, td j,T′ Let (x1′, y1′) and (x2′, y2′) be the authorization trapdoors corresponding to the second ciphertext, and (x1′, y1′) and (x2′, y2′) be the two coordinates of the plaintext information contained in the second ciphertext. Construct a first second-order polynomial based on two coordinates containing plaintext information in the first ciphertext and one coordinate containing plaintext information in the second ciphertext; Construct a second second-order polynomial based on two coordinates containing plaintext information in the second ciphertext and one coordinate containing plaintext information in the first ciphertext; Determine if the constant terms of the first and second order polynomials are equal. If they are equal, it means that the two sets of ciphertexts contain the same message and the match is successful. If they are not equal, it means that the two sets of ciphertexts contain different messages and the match is unsuccessful.
7. The encrypted database symptom matching system according to claim 5, characterized in that, The process involves updating the ciphertext from its generation time to the current time based on the user's private key used when the ciphertext was generated and the user's current private key, as shown in the following formula: c′1=c1, c′2=c2, c′3=c3, Where T is the generation time, T′ is the current time, (c1,c2,c3,c4,c5) are the five ciphertext segments of ciphertext C, (c′1,c′2,c′3,c′4,c′5) are the five ciphertext segments of ciphertext C after the update, and sk T′,1 The private key sk for the current time T′ The first part, sk T′,2 The private key sk for the current time T′ The second part.
8. A computer-readable storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the data encryption method of claim 1 or the data decryption method of claim 2.
Citation Information
Patent Citations
A structured encryption method and system for performing an equivalence test based on a cloud service platform
CN109902501A
Data encryption method and device and data decryption method and device
CN110348229A