A data processing method, apparatus and electronic device
By using attribute encryption algorithms and public parameters generated by the blockchain system, it is ensured that only clients that meet the access policy can decrypt data, thus solving the problem of insufficient security in data transmission between clients and servers and achieving secure protection for data transmission.
Patent Information
- Application Number
- CN202411495512.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-10-24
AI Technical Summary
In existing technologies, the data transmission security between clients and servers is insufficient, making them vulnerable to attacks from web crawlers or automated programs, leading to the leakage of important data and threatening personal privacy and corporate property security.
By employing attribute encryption algorithms combined with public parameters and keys generated by the blockchain system, the encryption and decryption process ensures that only clients that comply with the access policy can decrypt and obtain the target data, thereby improving the security of data transmission.
It effectively prevents unauthorized users from intercepting data, improves the security of data transmission between the client and the server, and protects important data from being illegally obtained.
Smart Images

Figure CN119484040B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security technology, and in particular to a data processing method, apparatus and electronic device. Background Technology
[0002] With the rapid development of internet technology, some users illegally obtain important data from websites through web crawlers or automated programs to gain illicit profits. This important data includes personal information, confidential corporate information, and so on. The leakage of this important data directly threatens individuals' economic security and privacy, and can even cause serious financial losses to businesses and organizations. Therefore, improving the security of data transmitted between clients and servers has become an urgent technical problem to be solved. Summary of the Invention
[0003] This application provides a data processing method, apparatus, and electronic device for improving the security of data transmission between a client and a server.
[0004] In a first aspect, embodiments of this application provide a data processing method applied to a server. The method includes: receiving an access request from a client, the access request being for requesting access to target data; obtaining the target data according to the access request; encrypting the target data according to a pre-stored first key to obtain a first ciphertext; determining a second ciphertext according to pre-stored public parameters, an access policy, and the first key, combined with an attribute encryption algorithm, the access policy being for indicating data access permissions corresponding to attributes of each client; wherein the second ciphertext includes a first component, a second component, a third component, and a fourth component, the second component, the third component, and the fourth component being for assisting the client in determining a first parameter, the first component being for assisting the client in determining a second key based on the first parameter and the first component, the second key being for decrypting the first ciphertext; combining the first ciphertext and the second ciphertext into a response ciphertext, and sending the response ciphertext to the client.
[0005] In this embodiment, a second ciphertext is obtained by combining the access policy and the first key with an attribute encryption algorithm using common parameters, an access policy, and the first key. Therefore, when decrypting the response ciphertext, the correct second key can only be calculated if the client's attributes conform to the access policy, thus allowing the decryption of the target data. In this way, even if other users intercept the response ciphertext between the client and server, they cannot decrypt the target data because their client devices do not conform to the access policy, thereby improving the security of data transmission between the client and server.
[0006] In one possible implementation, the second ciphertext is determined based on pre-stored public parameters, access policies, and the first key, combined with an attribute encryption algorithm. This includes: determining a first component based on the first key and the public parameters; determining a second component based on the public parameters; determining a third component based on the public parameters, access policies, a random vector, and a first random parameter; determining a fourth component based on the public parameters and the first random parameter; and combining the first component, the second component, the third component, and the fourth component to form the second ciphertext; wherein the second ciphertext is C = {C s ,C0,{C 1i} i∈[1,l] ,{C 2i} i∈[1,l]}, where C represents the second ciphertext, C s C0 represents the first component, and C0 represents the second component. 1i} i∈[1,l] Representing the third component, {C 2i} i∈[1,l]} represents the fourth component, and l represents the number of attributes included in the attribute set pre-stored by the server.
[0007] In one possible implementation, determining the third component based on the common parameters, access strategy, random vector, and first random parameter includes: determining the random vector from the p-order additive prime group; determining the second parameter as the product of the access strategy and the random vector; determining a predefined generator based on the common parameters; and determining the third component as the product of the generator with the exponent of the second parameter and the generator with the exponent of the first random parameter.
[0008] In one possible implementation, encrypting the target data according to a pre-stored first key to obtain a first ciphertext includes: determining the client's business requirements based on the access request; determining sensitive data in the target data according to the business requirements; and encrypting the sensitive data in the target data according to the first key to obtain the first ciphertext.
[0009] In this implementation, by determining the client's business needs through the access request, sensitive data related to the business needs can be identified, and then the sensitive data in the target data can be encrypted. Compared with directly encrypting all the target data, this method can effectively improve encryption and decryption efficiency.
[0010] In one possible implementation, the public parameter is generated by a blockchain system, and the public parameter is {G,G}. T ,H,e,g,g α ,{H(x)}x∈A}, where g is a predefined generator, and G and G T Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be an attribute set.
[0011] Secondly, embodiments of this application provide a data processing method applied to a client. The method includes: sending an access request to a server, the access request being used to request access to target data; receiving a response ciphertext from the server, the response ciphertext including a first ciphertext and a second ciphertext, the first ciphertext being obtained by the server encrypting the target data according to a pre-stored first key, the second ciphertext being determined by the server according to pre-stored public parameters, an access policy, and the first key, combined with an attribute encryption algorithm, the second ciphertext including a first component, a second component, a third component, and a fourth component; determining a first parameter according to a pre-stored third key, the second component, the third component, and the fourth component, the third key being generated and sent to the client by a blockchain system according to the client's attribute information, a pre-stored fourth key, and the public parameters; determining a second key according to the first parameter and the first component; and decrypting the first ciphertext according to the second key to obtain the target data.
[0012] In one possible implementation, the second ciphertext is C = {C} s ,C0,{C 1i} i∈[1,l] ,{C 2i} i∈[1,l]}, where C represents the second ciphertext, C s C0 represents the first component in the second ciphertext, which is determined based on the first key and the public parameters. C0 represents the second component in the second ciphertext, which is determined based on the public parameters. 1i} i∈[1,l] This represents the third component in the second ciphertext, which is determined based on the public parameter, the access policy, the random vector, and the first random parameter, {C 2i} i∈[1,l]} represents the fourth component in the second ciphertext, which is determined based on the public parameter and the first random parameter; where l represents the number of attributes included in the attribute set pre-stored by the server.
[0013] In one possible implementation, the public parameter is generated by a blockchain system, and the public parameter is {G,G}. T ,H,e,g,gα ,{H(x)} x∈A}, where g is a predefined generator, and G and G T Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be an attribute set.
[0014] In one possible implementation, the second key is K = {K0, K1, {K...} 2ii} i∈[1,n]}, where K represents the second key, K0 represents the first key component, K1 represents the second key component, {K 2i} i∈[1,n] This represents the third key component.
[0015] In one possible implementation, determining the first parameter based on a pre-stored third key, the second component, the third component, and the fourth component includes: determining the first parameter based on a preset formula, the second component, the third component, and the fourth component; wherein the preset formula is:
[0016]
[0017] Where MC represents the first parameter, e represents the bilinear mapping, and ω j The parameter values are calculated by the client based on preset conditions.
[0018] Thirdly, embodiments of this application provide a data processing apparatus applied to a server. The apparatus includes: a transceiver module for receiving an access request from a client, the access request being for requesting access to target data; an acquisition module for acquiring the target data according to the access request; an encryption module for encrypting the target data according to a pre-stored first key to obtain a first ciphertext; the encryption module is further configured to determine a second ciphertext according to pre-stored public parameters, an access policy, and the first key, combined with an attribute encryption algorithm, the access policy being used to indicate data access permissions corresponding to attributes of each client; wherein the second ciphertext includes a first component, a second component, a third component, and a fourth component, the second component, the third component, and the fourth component being used to assist the client in determining a first parameter, the first component being used to assist the client in determining a second key based on the first parameter and the first component, and the second key being used to decrypt the first ciphertext; the transceiver module is further configured to combine the first ciphertext and the second ciphertext into a response ciphertext and send the response ciphertext to the client.
[0019] In one possible implementation, the encryption module is specifically configured to: determine a first component based on the first key and the public parameters; determine a second component based on the public parameters; determine a third component based on the public parameters, an access policy, a random vector, and a first random parameter; determine a fourth component based on the public parameters and the first random parameter; and combine the first component, the second component, the third component, and the fourth component to form a second ciphertext; wherein the second ciphertext is C = {C s ,C0,{C 1i} i∈[1,l] ,{C 2i} i∈[1,l]}, where C represents the second ciphertext, C s C0 represents the first component, and C0 represents the second component. 1i} i∈[1,l] Representing the third component, {C 2i} i∈[1,l]} represents the fourth component, and l represents the number of attributes included in the attribute set pre-stored by the server.
[0020] In one possible implementation, the encryption module is specifically configured to: determine the random vector from the p-order additive prime group; determine the product of the access strategy and the random vector as a second parameter; determine a predefined generator based on the common parameter; and determine the product of the generator with the exponent of the second parameter and the generator with the exponent of the first random parameter as the third component.
[0021] In one possible implementation, the encryption module is specifically configured to: determine the client's business requirements based on the access request; determine sensitive data in the target data based on the business requirements; and encrypt the sensitive data in the target data using the first key to obtain the first ciphertext.
[0022] In one possible implementation, the public parameter is generated by a blockchain system, and the public parameter is {G,G}. T ,H,e,g,g α ,{H(x)} x∈A}, where g is a predefined generator, and G and G T Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be an attribute set.
[0023] Fourthly, embodiments of this application provide a data processing apparatus applied to a client. The apparatus includes: a transceiver module, configured to send an access request to a server, the access request being used to request access to target data; the transceiver module is further configured to receive a response ciphertext from the server, the response ciphertext including a first ciphertext and a second ciphertext, the first ciphertext being obtained by the server encrypting the target data according to a pre-stored first key, the second ciphertext being determined by the server according to pre-stored public parameters, an access policy, and the first key, combined with an attribute encryption algorithm, the second ciphertext including a first component, a second component, a third component, and a fourth component; a decryption module, configured to determine a first parameter according to a pre-stored third key, the second component, the third component, and the fourth component, the third key being generated and sent to the client by a blockchain system according to the client's attribute information, a pre-stored fourth key, and the public parameters; the decryption module is further configured to determine a second key according to the first parameter and the first component; the decryption module is further configured to decrypt the first ciphertext according to the second key to obtain the target data.
[0024] In one possible implementation, the second ciphertext is C = {C} s ,C0,{C 1i} i∈[1,l] ,{C 2i} i∈[1,l]}, where C represents the second ciphertext, C s C0 represents the first component in the second ciphertext, which is determined based on the first key and the public parameters. C0 represents the second component in the second ciphertext, which is determined based on the public parameters. 1i} i∈[1,l] This represents the third component in the second ciphertext, which is determined based on the common parameters, the access strategy, the random vector, and the first random parameter, which is randomly selected from the p-order additive prime group. 2i} i∈[1,l]} represents the fourth component in the second ciphertext, which is determined based on the public parameter and the first random parameter; where l represents the number of attributes included in the attribute set pre-stored by the server.
[0025] In one possible implementation, the public parameter is generated by a blockchain system, and the public parameter is {G,G}. T ,H,e,g,g α ,{H(x)} x∈A}, where g is a predefined generator, and G and G TLet g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be an attribute set.
[0026] In one possible implementation, the second key is K = {K0, K1, {K...} 2i} i∈[1,n]}, where K represents the second key, K0 represents the first key component, K1 represents the second key component, {K 2i} i∈[1,n] This represents the third key component.
[0027] In one possible implementation, the decryption module is specifically configured to: determine a first parameter based on a preset formula, the second component, the third component, and the fourth component; wherein the preset formula is:
[0028]
[0029] Where MC represents the first parameter, e represents the bilinear mapping, and ω j The parameter values are calculated by the client based on preset conditions.
[0030] Fifthly, embodiments of this application provide an electronic device, including at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the method as described in the first aspect and any possible implementation or the second aspect and any possible implementation by executing the instructions stored in the memory.
[0031] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect and any possible implementation, or the second aspect and any possible implementation.
[0032] In a seventh aspect, embodiments of this application provide a computer program product comprising computer instructions that, when run on a computer, cause the methods described above, as in the first aspect and any possible implementation, or the second aspect and any possible implementation, to be implemented.
[0033] The beneficial effects of aspects two through seven can be referred to in the first aspect above, and will not be repeated here. Attached Figure Description
[0034] Figure 1This is a schematic diagram illustrating an application scenario of a data processing method provided in an embodiment of this application;
[0035] Figure 2 A flowchart illustrating a data processing method provided in this application embodiment. Figure 1 ;
[0036] Figure 3 A flowchart illustrating a data processing method provided in this application embodiment. Figure 2 ;
[0037] Figure 4 A flowchart illustrating a data processing method provided in this application embodiment. Figure 3 ;
[0038] Figure 5 A schematic diagram of the structure of a data processing device provided in this application embodiment. Figure 1 ;
[0039] Figure 6 A schematic diagram of the structure of a data processing device provided in this application embodiment. Figure 2 ;
[0040] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0042] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0043] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0044] The acquisition, transmission, storage, and use of data in this application all comply with relevant national laws and regulations.
[0045] Please refer to Figure 1 This is a schematic diagram illustrating an application scenario of a data processing method provided in an embodiment of this application. For example... Figure 1 As shown in the diagram, the scenario includes a client 110 and a server 120, and the client 110 and the server 120 can communicate via wired or wireless means.
[0046] In this context, client 110 can refer to a user device with data access requests. Client 110 may run browsers, applications, etc., and the browser or application can send access requests to server 120 through client 110. User devices include, but are not limited to, mobile phones, personal computers (PCs), tablets, laptops, PDAs, mobile internet devices (MIDs), etc. Server 120 refers to a server with data query capabilities.
[0047] For example, client 110 may send an access request to server 120, requesting access to target data. Based on the access request, server 120 obtains the target data, encrypts the target data using a first key to obtain a first ciphertext, and calculates a second ciphertext based on the first key, access policy, public parameters, and an attribute encryption algorithm. Server 120 then combines the first and second ciphertexts into a response ciphertext and sends it to client 110. Client 110 can then decrypt the response ciphertext to obtain the target data. The specific implementation methods for server 120 encrypting the response ciphertext and client decrypting the response ciphertext will be described in detail below.
[0048] In one possible implementation, the scenario diagram may further include a blockchain system 130, which can communicate with the client 110 and the server 120 via wired or wireless communication. The blockchain system 130 is established by an authoritative authorized institution.
[0049] In this implementation, the blockchain system 130 may pre-store attribute information of at least one client connected to the server 120, and pre-configure access policies for the at least one client to access the server 120. The blockchain system 130 may generate public parameters and a fourth key based on the access policies and predefined parameters. Furthermore, the blockchain system 130 may generate a third key for each client based on the fourth key and the attribute information of each client. The specific implementation methods for the blockchain system 130 to generate public parameters and the third key will be described in detail below.
[0050] Please refer to Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 The following text describes server execution. Figure 2 The steps shown are illustrated, and the server is, for example, Figure 1 Server 120 shown Figure 2 The clients involved are, for example, Figure 1 The client 110 shown is shown. Figure 2 The distributed blockchains involved are, for example, Figure 1 The distributed blockchain 130 shown.
[0051] S201, Receive an access request from the client, the access request is used to request access to the target data.
[0052] The access request may be entered by the user on the client's display interface or received from other user devices; this application embodiment does not limit this.
[0053] For example, a user enters a query on a browser's search page. The browser generates an access request based on this query and establishes a Transmission Control Protocol (TCP) connection with the server by accessing the server's Internet Protocol (IP) address. The browser on the client then sends an access request to the server based on this connection. This request can be, for example, a Hypertext Transfer Protocol (HTTP) request, a GET request, or a POST request. The specific request method used depends on the user's query; for example, a GET request might be used to retrieve a page, while a POST request might be used to submit a form.
[0054] In one possible implementation, the server can upload access requests from clients to the blockchain system for subsequent auditing and analysis.
[0055] S202, Based on the access request, obtain the target data.
[0056] After receiving an access request, the server can retrieve the target data that matches the access request. Specifically, the server can retrieve the target data by querying a database, executing corresponding logic code, or querying other data sources; this application embodiment does not limit this.
[0057] S203, encrypt the target data according to the pre-stored first key to obtain the first ciphertext.
[0058] The first key is a symmetric key pre-configured in the server.
[0059] Specifically, the server can encrypt the target data using the first key and a symmetric encryption algorithm to obtain the first ciphertext. The symmetric encryption algorithm can be, for example, the Advanced Encryption Standard (AES) or SM4. An example expression for encrypting the first ciphertext is shown below:
[0060] C D =ENC sk (D)
[0061] Among them, C D represents the first ciphertext, D represents the target data, sk represents the first key, and EN refers to the encryption operation.
[0062] In one possible implementation, the server may selectively encrypt a portion of the target data. This portion may be sensitive data within the target data, such as identity information, confidential business information, or government information. Specifically, the server may determine the client's business requirements based on the access request, identify the sensitive data within the target data based on the business requirements, and then encrypt the sensitive data within the target data using a first key to obtain the first ciphertext.
[0063] For example, if an access request instructs the server to retrieve webpage information from government website A, the server can determine that the client's business requirement is government information based on the access request. Therefore, the server can encrypt the government information in the target data as sensitive data.
[0064] In one possible implementation, in some application scenarios, the sensitive data involved between the server and the client is fixed, such as data transmission within an enterprise. This sensitive data includes the identity information of internal personnel and confidential enterprise information. Therefore, the server can pre-encrypt this sensitive data. Then, upon receiving an access request, if the server determines that the target data includes the aforementioned fixed sensitive data, it directly retrieves the encrypted sensitive data as the first ciphertext. This approach effectively reduces repeated encryption operations on the server and also improves the data transmission efficiency between the server and the client.
[0065] S204. Based on the pre-stored public parameters, access policy, and first key, and combined with the attribute encryption algorithm, determine the second ciphertext. The second ciphertext includes a first component, a second component, a third component, and a fourth component. The second, third, and fourth components are used to assist the client in determining the first parameter. The first component is used to assist the client in determining the second key based on the first parameter and the first component. The second key is used to decrypt the first ciphertext.
[0066] The access policy is used to indicate the data access permissions corresponding to the attributes of each client. The client attributes are related to the specific application scenario. For example, in an enterprise scenario, where each client is an internal office device, the attributes of each client can be divided by department, such as R&D, product, marketing, and finance. Alternatively, they can be divided by job level, etc., and can be set according to actual needs; this embodiment does not limit this. The attributes of each client can be assigned by the blockchain system when the client registers, and each client can be assigned one or more attributes.
[0067] Access policies can be generated by the blockchain system based on pre-configured data access permissions for each client's attributes and sent to the server. The access policy can be an access structure based on a linear secret sharing scheme (LSSS), specifically represented as (M, ρ), where M is an l×n matrix, l represents the number of attributes included in the attribute set, and ρ is a mapping function that maps each row of matrix M to the corresponding attribute value, i.e., ρ:{1,...,l}→U.
[0068] The public parameters are generated by the blockchain system and sent to the server. The specific method for generating public parameters is explained below. The blockchain system can generate a multiplicative cyclic group G and G' of prime order p based on a predefined generator g. TThe blockchain system randomly selects a second random parameter from the p-order additive prime group, and determines a third parameter based on the second random parameter, a predefined bilinear mapping e, and a generator g, where the bilinear mapping e is: G × G = G. T .
[0069] For example, the third parameter can be represented as e(g,g) α Where α is the second random parameter, α∈Z p Z p Let p be the group of additive prime numbers. The blockchain system determines the hash function for each attribute in the attribute set, which includes attributes from each client. The hash function is a predefined hash function, specifically represented as H: {0,1}. * →Z p Where H represents the hash function, Z p Let represent the p-order additive prime group. Based on this, if we define each attribute x∈A, where A is the set of attributes, then the hash function of each attribute can be represented as H(x).
[0070] Based on the above parameters, the blockchain system can generate public parameters, which can be specifically represented as follows:
[0071] para={G,G T ,H,e,g,g α ,{H(x)} x∈A}
[0072] Where g is a predefined generator, and G and G T Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be an attribute set.
[0073] The server can then calculate the second ciphertext based on pre-stored public parameters, access policies, and the first key, combined with an attribute encryption algorithm. Specifically, the attribute encryption algorithm described in this embodiment can refer to an attribute encryption algorithm based on a key policy.
[0074] The second ciphertext may include a first component, a second component, a third component, and a fourth component. The following explains the specific method by which the server determines the four components in the second ciphertext.
[0075] 1. First component
[0076] The server can determine the first component based on the first key, public parameters, and a third random parameter. For example, a calculation formula for determining the first component is shown below:
[0077] C s =sk·e(g,g)αs
[0078] Among them, C s Let represent the first component, sk represent the first key, e represent the bilinear mapping, α represent the second random parameter, g represent the predefined generator, and s represent the third random parameter, which is randomly selected by the server from the p-order additive prime group.
[0079] 2. Second component
[0080] The server can determine the second component based on common parameters and a third random parameter. For example, a calculation formula for determining the second component is shown below:
[0081] C0 = g s
[0082] Where C0 represents the second component, g is a predefined generator, and s is the third random parameter.
[0083] 3. Third component
[0084] The server can determine the third component based on public parameters, access policy, random vector, and first random parameter. The first random parameter is randomly selected from the p-order additive prime group, and the random vector is composed of a set of random parameters randomly selected by the server from the p-order additive prime group. The set of random numbers includes the third random parameter.
[0085] The server selects a set of random parameters from the p-order additive prime group to form a random vector, which can be represented as u = (s, x2, ..., x...). n ), where s is the third random parameter, x2,...,x n The server randomly selects multiple random parameters from the p-order additive prime group, namely s, x², ..., x. n ∈Z p , where n is the number of columns in matrix M.
[0086] Furthermore, the server can determine the second parameter as the product of the access strategy and the random vector. The access strategy can be represented as (M, ρ), where M is an l×n matrix, l represents the number of attributes in the attribute set, and ρ is a mapping function that maps each row of matrix M to the corresponding attribute value, i.e., ρ:{1,...,l}→U. An exemplary formula for determining the second parameter is shown below:
[0087] λ i =M i ·u
[0088] Where, λ i M represents the second parameter. iM represents the attribute value corresponding to the i-th row in matrix M. i This can be understood as the attribute in the access policy that the server allows clients to access the target data, where u represents a random vector.
[0089] Based on the second parameter obtained above, the server determines a predefined generator from the common parameters and randomly selects a first random parameter from the p-order additive prime group. Then, the server determines the product of the generator with the exponent of the second parameter and the generator with the exponent of the first random parameter as the third component.
[0090] For example, a formula for determining the third component is shown below:
[0091]
[0092] Among them, C 1i Let g represent the third component, and λ be a predefined generator. i t is the second parameter. i is the first random parameter.
[0093] 4. Fourth component
[0094] The server can determine the fourth component based on the common parameters and the first random parameters. For example, a formula for determining the fourth component is shown below:
[0095]
[0096] Among them, C 2i H(a) is the fourth component, g is a predefined generator, and H(a) is the fourth component. i Let t be the hash function of the i-th attribute in the attribute set. i is the first random parameter.
[0097] Based on the above calculation method, the server can calculate the second ciphertext, which can be represented as:
[0098] C = {C s ,C0,{C 1i} i∈[1,l] ,{C 2i} i∈[1,l]}
[0099] Where C represents the second ciphertext, C s C0 represents the first component of the second ciphertext, and C0 represents the second component of the second ciphertext. 1i} i∈[1,l] This represents the third component in the second ciphertext, {C 2i} i∈[1,l]} represents the fourth component in the second ciphertext, l represents the number of attributes included in the attribute set pre-stored by the server, 1≤i≤l.
[0100] S205, combine the first ciphertext and the second ciphertext to form a response ciphertext, and send the response ciphertext to the client.
[0101] The server combines the first and second ciphertexts into a response ciphertext and sends it to the client. The client then receives the response ciphertext from the server and can decrypt it to obtain the target data.
[0102] The following is combined Figure 3 The diagram shows a data processing method. Figure 2 This document describes the specific implementation method for obtaining the target data from the client's encrypted response. The following section describes the client's execution... Figure 3 The steps shown are explained below. The client is, for example,... Figure 1 The client 110 shown is shown. Figure 3 The servers involved are, for example, Figure 1 Server 120 shown Figure 3 The distributed blockchains involved are, for example, Figure 1 The distributed blockchain 130 shown.
[0103] S301, send an access request to the server. The access request is used to request access to the target data.
[0104] The details of the client sending an access request to the server and the specific content of the access request can be found in the previous text and will not be repeated here.
[0105] S302, receive a response ciphertext from the server. The response ciphertext includes a first ciphertext and a second ciphertext. The first ciphertext is obtained by the server encrypting the target data according to the pre-stored first key. The second ciphertext is determined by the server based on the pre-stored public parameters, access policy, and first key, combined with the attribute encryption algorithm. The second ciphertext includes a first component, a second component, a third component, and a fourth component.
[0106] The specific details of the first key, public parameters, access policy, and attribute encryption algorithm can be found in the preceding text and will not be repeated here.
[0107] The specific implementation method for determining the second ciphertext based on public parameters, access policies, and the first key, combined with the attribute encryption algorithm, can be referred to the content described above, and will not be repeated here.
[0108] S303, determine the first parameter based on the pre-stored third key, second component, third component and fourth component.
[0109] The third key is generated and sent to the client by the blockchain system based on the client's attribute information, the pre-stored fourth key, and public parameters. The fourth key is generated by the blockchain system. Specifically, the fourth key can be the second random parameter mentioned above, i.e., α, or it can be represented as MSK = {α}, where MSK represents the fourth key.
[0110] The third key may include the first key component, the second key component, and the third key component. The specific methods for generating the first key component, the second key component, and the third key component in a blockchain system are explained below.
[0111] 1. First key component
[0112] The blockchain system can determine the first key component based on public parameters, a fourth key, and a fourth random parameter, wherein the fourth random parameter is randomly selected by the blockchain system from a group of p-order additive primes. An exemplary formula for determining the first key component is shown below:
[0113] K0 = g α g r
[0114] Where K0 represents the first key component, g is a predefined generator, α is the fourth key, and r is the fourth random parameter.
[0115] 2. Second key component
[0116] The blockchain system can determine the second key component based on a fourth random parameter and public parameters. For example, one formula for determining the second key component is shown below:
[0117] K1 = g r
[0118] Where K1 represents the second key component, g is a predefined generator, and r is the fourth random parameter.
[0119] 3. Third key component
[0120] A blockchain system can determine a third key component based on public parameters and a fourth random parameter. For example, one formula for determining the third key component is shown below.
[0121]
[0122] Among them, K 2i Let H(a) represent the third key component, g be a predefined generator, r be the fourth random parameter, and H(a) be the fourth random parameter. i ) is the hash function for the i-th attribute in the attribute set.
[0123] Based on the above calculation method, the blockchain system can calculate the third key, which can be represented as:
[0124] K = {K0, K1, {K 2i} i∈[1,n]}
[0125] Where K represents the third key, K0 represents the first key component, K1 represents the second key component, {K 2i} i∈[1,n] Let i represent the third key component, i represent the i-th attribute in the attribute set, or the i-th row in matrix M, and n represent the column number in matrix M.
[0126] After the blockchain system determines the third key, it sends the third key to the client. The client can then determine the first parameter based on the third key, the second component, the third component, and the fourth component. Specifically, the client can determine the first parameter based on a preset formula, the second component, the third component, and the fourth component. The preset formula is as follows:
[0127]
[0128] Where MC represents the first parameter, C0 represents the second component, and C 1j C1 represents the third component, C2 represents the fourth component, K0 represents the first key component in the third key, K1 represents the second key component in the third key, and K... 2j Let ω represent the third key component in the third key, e represent the bilinear mapping, and ω represent the third key component. j The parameter value is calculated by the client based on preset conditions, where the preset conditions can be expressed as ∑ω j ·M j = (1,0,...,0), M j This represents the j-th row in matrix M, which represents the client's attributes. This preset condition is determined based on the access matrix and pre-configured in the client.
[0129] S304, Determine the second key based on the first parameter and the first component.
[0130] The specific contents of the first parameter and the first component can be referred to the contents described above.
[0131] The client can calculate the second key based on the calculated first parameter and the first component. For example, a formula for determining the second key is shown below:
[0132]
[0133] Where sk represents the second key, C s represents the first component, and MC represents the first parameter.
[0134] It should be understood that the first key is a symmetric key, and the first key is the same as the second key.
[0135] S305, Decrypt the first ciphertext using the second key to obtain the target data.
[0136] The client uses the second key to decrypt the first ciphertext, obtaining the target data. For example, the client's expression for decrypting the first ciphertext is as follows:
[0137] D = DEC sk (C D )
[0138] Where D represents the target data, C D sk represents the first ciphertext, sk represents the second key, and DE refers to the decryption operation.
[0139] In one possible implementation, to improve the client's decryption efficiency, a third-party device can be set up between the client and the server. The server sends the ciphertext response to the client through this third-party device. In this implementation, when the third-party device receives the ciphertext response from the server, it can determine the first parameter based on the second, third, and fourth components and the third key in the second ciphertext, and then forward the ciphertext response and the first parameter to the client. The client can then directly determine the second key based on the first component and the first parameter in the second ciphertext, and decrypt the first ciphertext using the second key. The specific method by which the third-party device determines the first parameter is analogous to the method by which the client determines the first parameter, and will not be elaborated here.
[0140] The third-party device can be a device trusted by both the client and the server, or it can be another server or terminal device, or it can be a blockchain system; this application does not limit this. In practical applications, a device with strong computing power can be selected as the third-party device to further improve decryption efficiency.
[0141] It should be noted that in the attribute encryption algorithm provided in this application embodiment, ω is calculated based on preset conditions. j If the client's attributes conform to the access policy, then s = ∑λ j ·ω j However, during the actual decryption process on the client side, if the client's attributes do not conform to the access policy, the calculated second key cannot decrypt the first ciphertext.
[0142] In one possible implementation, after the client decrypts and obtains the target data, the target data can be rendered on the page and displayed to the user. For example, after receiving an HTTP response from the server, the browser on the client side begins parsing the response content. Based on the HTML, cascading stylesheets (CSS), and JavaScript in the response, the browser renders the page, including parsing the HTML structure, applying styles, and executing JavaScript code.
[0143] To better understand the method flow of a data processing method provided in the embodiments of this application, the following will be combined with... Figure 4 The diagram shows a data processing method. Figure 3 This application describes a data processing method provided in an embodiment. Figure 4 The clients involved are, for example, Figure 1 The client 110 shown is shown. Figure 4 The servers involved are, for example, Figure 1 Server 120 shown Figure 4 The blockchain systems involved are, for example, Figure 1 The blockchain system 130 shown.
[0144] S401, the blockchain system generates public parameters, a fourth key, and an access policy.
[0145] The specific methods by which the blockchain system generates public parameters, the fourth key, and access policies can be found in the content described above.
[0146] S402, the blockchain system sends public parameters and access policies to the server. Correspondingly, the server receives the public parameters and access policies from the blockchain system.
[0147] S403, the blockchain system generates a third key based on public parameters, the fourth key, and the client's attribute information.
[0148] The specific method by which the blockchain system generates the third key can be found in the content described above.
[0149] S404, the blockchain system sends a third key to the client. Correspondingly, the client receives the third key from the blockchain system.
[0150] S405: The client sends an access request to the server, requesting access to the target data. Correspondingly, the server receives the access request from the client.
[0151] S406, the server retrieves the target data based on the access request.
[0152] The specific method by which the server obtains the target data based on the access request can be referred to the content described above.
[0153] S407, the server encrypts the target data using the first key to obtain the first ciphertext, and determines the second ciphertext using public parameters, access policy, and the first key, combined with an attribute encryption algorithm.
[0154] The specific content of the server encrypting the first ciphertext and determining the second ciphertext can be referred to in the preceding text.
[0155] S408, the server sends a ciphertext response to the client, which includes a first ciphertext and a second ciphertext. Correspondingly, the client receives the ciphertext response from the server.
[0156] S409, the client decrypts the first ciphertext using the third key and the second ciphertext in the response ciphertext to obtain the target data.
[0157] The client decrypts the first ciphertext using the third key and the second ciphertext in the response ciphertext to obtain the target data. The specific method is described above and will not be repeated here.
[0158] Based on the same inventive concept, embodiments of this application provide a data processing apparatus for implementing any of the above-described data processing methods, for example, for... Figure 2 The data processing method shown is illustrated, and the device can also perform the functions of the server mentioned above.
[0159] Please refer to Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 5 As shown, the data processing device 500 includes a transceiver module 501, an acquisition module 502, and an encryption module 503. This data processing device 500 can be used in a server.
[0160] For example, the transceiver module 501 is used to receive an access request from a client, the access request being used to request access to target data; the acquisition module 502 is used to acquire the target data according to the access request; the encryption module 503 is used to encrypt the target data according to a pre-stored first key to obtain a first ciphertext; the encryption module 503 is also used to determine a second ciphertext according to pre-stored public parameters, access policies, and the first key, combined with an attribute encryption algorithm, the access policy being used to indicate the data access permissions corresponding to the attributes of each client; wherein, the second ciphertext includes a first component, a second component, a third component, and a fourth component, the second component, the third component, and the fourth component being used to assist the client in determining the first parameter, the first component being used to assist the client in determining the second key based on the first parameter and the first component, and the second key being used to decrypt the first ciphertext; the transceiver module 501 is also used to combine the first ciphertext and the second ciphertext into a response ciphertext and send the response ciphertext to the client.
[0161] In one possible implementation, the encryption module 503 is specifically configured to: determine a first component based on a first key and public parameters; determine a second component based on public parameters; determine a third component based on public parameters, an access policy, a random vector, and a first random parameter; determine a fourth component based on public parameters and the first random parameter; and combine the first, second, third, and fourth components to form a second ciphertext; wherein the second ciphertext is C = {C s ,C0,{C 1i} i∈[1,l] ,{C 2i} i∈[1,l]}, where C represents the second ciphertext, C s Let C0 represent the first component and C0 represent the second component. 1i} i∈[1,l] Representing the third component, {C 2i} i∈[1,l]} represents the fourth component, and l represents the number of attributes included in the attribute set pre-stored by the server.
[0162] In one possible implementation, the encryption module 503 is further configured to: determine a random vector from a group of p-order additive primes; determine the product of the access strategy and the random vector as a second parameter; determine a predefined generator based on a common parameter; and determine the product of the generator with the second parameter as the exponent and the generator with the first random parameter as the exponent as a third component.
[0163] In one possible implementation, the encryption module 503 is specifically used to: determine the client's business requirements based on the access request; determine the sensitive data in the target data based on the business requirements; and encrypt the sensitive data in the target data according to the first key to obtain the first ciphertext.
[0164] In one possible implementation, the public parameters are generated by the blockchain system, and the public parameters are {G,G}. T ,H,e,g,g α ,{H(x)} x∈A}, where g is a predefined generator, and G and G T Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be a set of attributes.
[0165] Based on the same inventive concept, embodiments of this application provide a data processing apparatus for implementing any of the above-described data processing methods, for example, for... Figure 3 The data processing method shown is illustrated, and the device can also implement the client-side functions described above.
[0166] Please refer to Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 2 .like Figure 6 As shown, the data processing device 600 includes a transceiver module 601 and a decryption module 602. This data processing device 600 can be applied to a client.
[0167] For example, the transceiver module 601 is used to send an access request to the server, the access request being used to request access to target data; the transceiver module 601 is also used to receive a response ciphertext from the server, the response ciphertext including a first ciphertext and a second ciphertext, the first ciphertext being obtained by the server encrypting the target data according to a pre-stored first key, the second ciphertext being determined by the server according to pre-stored public parameters, access policy, and the first key, combined with an attribute encryption algorithm, the second ciphertext including a first component, a second component, a third component, and a fourth component; the decryption module 602 is used to determine a first parameter according to the pre-stored third key, the second component, the third component, and the fourth component, the third key being generated by the blockchain system according to the client's attribute information, the pre-stored fourth key, and the public parameters and sent to the client; the decryption module 602 is also used to determine a second key according to the first parameter and the first component; the decryption module 602 is also used to decrypt the first ciphertext according to the second key to obtain the target data.
[0168] In one possible implementation, the second ciphertext is C = {C} s ,C0,{C 1i} i∈[1,l] ,{C 2i} i∈[1,l]}, where C represents the second ciphertext, C sC0 represents the first component in the second ciphertext, which is determined based on the first key and common parameters. C0 represents the second component in the second ciphertext, which is determined based on common parameters. 1i} i∈[1,l] This represents the third component in the second ciphertext. The third component is determined based on common parameters, access strategy, a random vector, and a first random parameter. The first random parameter is randomly selected from the p-order additive prime group. {C} 2i} i∈[1,l]} represents the fourth component in the second ciphertext, which is determined based on the common parameters and the first random parameters; where l represents the number of attributes included in the attribute set pre-stored by the server.
[0169] In one possible implementation, the public parameters are generated by the blockchain system, and the public parameters are {G,G}. T ,H,e,g,g α ,{H(x)} x∈A}, where g is a predefined generator, and G and G T Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be a set of attributes.
[0170] In one possible implementation, the second key is K = {K0, K1, {K...} 2i} i∈[1,n]}, where K represents the second key, K0 represents the first key component, K1 represents the second key component, {K 2i} i∈[1,n] This represents the third key component.
[0171] In one possible implementation, the decryption module 602 is specifically used to: determine the first parameter based on a preset formula, a second component, a third component, and a fourth component; wherein the preset formula is:
[0172]
[0173] Where MC represents the first parameter, e represents the bilinear mapping, and ω j The parameter values are calculated by the client based on preset conditions.
[0174] Please refer to Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 700 includes at least one processor 701 and a memory 702 communicatively connected to the at least one processor 701.
[0175] The processor 701 can be a general-purpose processor or a dedicated processor. For example, the processor 701 may include a baseband processor or a central processing unit (CPU). The baseband processor can be used to process communication protocols and communication data. The CPU can be used to control the electronic device 700, execute software programs, and / or process data. Different processors can be independent devices or can be integrated into one or more processing circuits, for example, integrated onto one or more application-specific integrated circuits (ASICs).
[0176] In one embodiment, memory 702 stores instructions that can be executed by at least one processor 701. At least one processor 701 implements the functions of the aforementioned server by executing the instructions stored in memory 702, and correspondingly, can also implement the steps executed by the aforementioned server.
[0177] In this embodiment, the electronic device 700 can implement the functions of the preceding data processing device 500. Furthermore, at least one processor 701 in the electronic device 700 can also implement the functions of the preceding transceiver module 501, the acquisition module 502, and the encryption module 503.
[0178] In another embodiment, memory 702 stores instructions that can be executed by at least one processor 701. At least one processor 701 implements the functions of the client described above by executing the instructions stored in memory 702, and correspondingly, can also implement the steps executed by the client described above.
[0179] In this embodiment, the electronic device 700 can implement the functions of the aforementioned data processing device 600. Furthermore, at least one processor 701 in the electronic device 700 can also implement the functions of the aforementioned transceiver module 601 and decryption module 602.
[0180] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform any data processing method, such as... Figure 2 , Figure 3 or Figure 4 The data processing method shown.
[0181] Based on the same inventive concept, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the data processing method described above, for example, to implement... Figure 2 , Figure 3 or Figure 4 The data processing method shown.
[0182] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0183] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0184] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0185] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0186] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data processing method, characterized in that, The data processing method is applied to a server; the method includes: Receive an access request from a client, the access request being used to request access to target data; Based on the access request, obtain the target data; The target data is encrypted using a pre-stored first key to obtain the first ciphertext; Based on pre-stored public parameters, access policies, and the first key, and combined with an attribute encryption algorithm, a second ciphertext is determined. The access policy is used to indicate the data access permissions corresponding to the attributes of each client. The second ciphertext includes a first component, a second component, a third component, and a fourth component. The first component is determined based on the public parameters and the first key. The second component is determined based on the public parameters. The third component is determined based on the public parameters, the access policy, a random vector, and a first random parameter. The fourth component is determined based on the public parameters and the first random parameter. The second, third, and fourth components assist the client in determining the first parameter. The first component assists the client in determining the second key based on the first parameter and the first component. The second key is used to decrypt the first ciphertext. The first ciphertext and the second ciphertext are combined to form a response ciphertext, which is then sent to the client.
2. The method according to claim 1, characterized in that, The second ciphertext is , This indicates the second ciphertext. This represents the first component. This represents the second component. This refers to the third component. This represents the fourth component. This indicates the number of attributes included in the attribute set pre-stored by the server.
3. The method according to claim 2, characterized in that, The third component is determined based on the public parameters, access policy, random vector, and first random parameters, including: The random vector is determined from the p-order additive prime group; The product of the access strategy and the random vector is determined as the second parameter; Based on the aforementioned common parameters, predefined generators are determined; The product of the generator whose exponent is the second parameter and the generator whose exponent is the first random parameter is determined as the third component.
4. The method according to claim 1, characterized in that, The target data is encrypted using a pre-stored first key to obtain a first ciphertext, including: Based on the access request, determine the client's business requirements; Based on the aforementioned business requirements, identify the sensitive data within the target data; Based on the first key, sensitive data in the target data is encrypted to obtain the first ciphertext.
5. The method according to any one of claims 1-3, characterized in that, The public parameters are generated by the blockchain system, and the public parameters are... Where g is a predefined generator, and Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be an attribute set.
6. A data processing method, characterized in that, The data processing method is applied to a client; the method includes: Send an access request to the server, the access request being used to request access to the target data; The system receives a ciphertext response from the server. The ciphertext response includes a first ciphertext and a second ciphertext. The first ciphertext is obtained by the server encrypting the target data using a pre-stored first key. The second ciphertext is determined by the server using pre-stored public parameters, access policies, and the first key, combined with an attribute encryption algorithm. The second ciphertext includes a first component, a second component, a third component, and a fourth component. The first component is determined based on the public parameters and the first key. The second component is determined based on the public parameters. The third component is determined based on the public parameters, the access policy, a random vector, and a first random parameter. The fourth component is determined based on the public parameters and the first random parameter. The first parameter is determined based on the pre-stored third key, the second component, the third component, and the fourth component. The third key is generated by the blockchain system based on the client's attribute information, the pre-stored fourth key, and the public parameter and sent to the client. Determine the second key based on the first parameter and the first component; The first ciphertext is decrypted using the second key to obtain the target data.
7. The method according to claim 6, characterized in that, The second ciphertext is ,in, This indicates the second ciphertext. This represents the first component. This represents the second component. This refers to the third component. Represents the fourth component; wherein, This indicates the number of attributes included in the attribute set pre-stored by the server.
8. The method according to claim 6 or 7, characterized in that, The public parameters are generated by the blockchain system, and the public parameters are... Where g is a predefined generator, and Let g be a multiplicative cyclic group of prime order generated from the generator g, H be a predefined hash function, e be a bilinear mapping, α be a second random parameter, x be an attribute, and A be an attribute set.
9. The method according to claim 7, characterized in that, The second key is Where K represents the second key. Indicates the first key component. Indicates the second key component. This represents the third key component.
10. The method according to claim 9, characterized in that, Based on the pre-stored third key, the second component, the third component, and the fourth component, the first parameter is determined, including: The first parameter is determined based on the preset formula, the second component, the third component, and the fourth component; The preset formula is as follows: in, Let represent the first parameter, and e represent the bilinear mapping. The parameter values are calculated by the client based on preset conditions.
11. A data processing apparatus, characterized in that, The data processing device is applied to a server; the device includes: The transceiver module is used to receive access requests from clients, the access requests being used to request access to target data; The acquisition module is used to acquire the target data based on the access request; The encryption module is used to encrypt the target data according to the pre-stored first key to obtain the first ciphertext; The encryption module is further configured to determine a second ciphertext based on pre-stored public parameters, access policies, and the first key, combined with an attribute encryption algorithm. The access policy is used to indicate the data access permissions corresponding to the attributes of each client. The second ciphertext includes a first component, a second component, a third component, and a fourth component. The first component is determined based on the public parameters and the first key. The second component is determined based on the public parameters. The third component is determined based on the public parameters, the access policy, a random vector, and a first random parameter. The fourth component is determined based on the public parameters and the first random parameter. The second, third, and fourth components assist the client in determining the first parameter. The first component assists the client in determining the second key based on the first parameter and the first component. The second key is used to decrypt the first ciphertext. The transceiver module is further configured to combine the first ciphertext and the second ciphertext into a response ciphertext and send the response ciphertext to the client.
12. A data processing apparatus, characterized in that, The data processing device is applied to a client; the device includes: The transceiver module is used to send access requests to the server, the access requests being used to request access to target data; The transceiver module is further configured to receive a response ciphertext from the server. The response ciphertext includes a first ciphertext and a second ciphertext. The first ciphertext is obtained by the server encrypting the target data according to a pre-stored first key. The second ciphertext is determined by the server based on pre-stored public parameters, access policies, and the first key, combined with an attribute encryption algorithm. The second ciphertext includes a first component, a second component, a third component, and a fourth component. The first component is determined based on the public parameters and the first key. The second component is determined based on the public parameters. The third component is determined based on the public parameters, the access policy, a random vector, and a first random parameter. The fourth component is determined based on the public parameters and the first random parameter. The decryption module is used to determine the first parameter based on the pre-stored third key, the second component, the third component, and the fourth component. The third key is generated by the blockchain system based on the client's attribute information, the pre-stored fourth key, and the public parameter and sent to the client. The decryption module is further configured to determine a second key based on the first parameter and the first component; The decryption module is further configured to decrypt the first ciphertext according to the second key to obtain the target data.
13. An electronic device, characterized in that, include: At least one processor, and A memory that is communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the method as described in any one of claims 1-10 by executing the instructions stored in the memory.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-10.
15. A computer program product, characterized in that, It contains computer instructions that, when run on a computer, cause the method described in any one of claims 1-10 to be implemented.
Citation Information
Patent Citations
Attribute-based data encryption method and device
CN115499141A
Data encryption sharing method and device, equipment and storage medium
CN117675310A