Attribute-based encryption method, device, electronic device and storage medium
The central organization generates public parameters and keys, and uses symmetric encryption algorithms to encrypt and decrypt data, solving the computing resource consumption and security risks caused by the participation of third-party authentication agencies in the attribute-based encryption method, and achieving efficient data encryption.
Patent Information
- Application Number
- CN202211288525.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-10-20
AI Technical Summary
The existing attribute-based encryption method requires the participation of third-party authentication agencies in cloud computing, resulting in high consumption of computing resources and security risks, and the use of bilinearity increases the computing burden on the computing.
The central organization establishes an attribute-based encryption system, generates common parameters and keys, uses symmetric encryption algorithms to encrypt and decrypt data, reduces the participation of third-party authentication agencies, and uses symmetric encryption algorithms to replace bilinear pair operations.
Save computing resources, avoid security risks, and improve encryption efficiency.
Smart Images

Figure CN115603911B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to an attribute-based encryption method, device, electronic device and storage medium. Background Art
[0002] As a new computing model, cloud computing is being used by more and more business systems. However, data security issues in cloud computing have become the most concerned issue for users, and traditional public key encryption methods cannot be directly applied to cloud computing to protect data confidentiality.
[0003] With the development of data security technology, attribute-based encryption, as a new public key encryption method, has been widely used in cloud computing. In the prior art, in an attribute-based encryption method, each user has a set of attributes, and a central agency has a master key. When a user joins the attribute-based encryption system for the first time, the central agency generates a key for the user based on the user's attributes using the master key. The encryptor can use a set of attributes to encrypt a message so that only users whose attributes match the attributes required in the ciphertext can use their keys to decrypt the ciphertext. Since different users may have some of the same attributes, the attribute-based encryption method can achieve one-to-many secure data transmission.
[0004] However, existing attribute-based encryption methods usually require a third-party certification agency to reduce the computing cost of the central authorization agency. Due to the excessive number of third-party certification agencies, it is easy to cause major security risks to the existing system. Secondly, existing methods usually use bilinear pairing operations, which leads to more computing resources and increases the computing burden of the Internet of Things and electronic devices. Summary of the invention
[0005] The present invention provides an attribute-based encryption method, device, electronic device and storage medium, which can reduce the participation of a third-party authentication agency in an attribute-based encryption system and save a large amount of computing resources.
[0006] According to one aspect of the present invention, there is provided an attribute-based encryption method, comprising:
[0007] Establishing an attribute-based encryption system through a central agency and initializing the attribute-based encryption system;
[0008] Through the central agency, based on the attribute set and public key provided by the first-layer users in the system, the key corresponding to the first-layer users is generated, and through the users of each layer in the system, based on the attribute set and public key provided by the lower-layer users, the keys corresponding to the remaining users are generated respectively;
[0009] Through the data owning node, the plain text is encrypted using a symmetric encryption algorithm to obtain the ciphertext;
[0010] The ciphertext is decrypted by users at each layer according to the corresponding secret key and private key using a symmetric encryption algorithm.
[0011] Optionally, initializing the attribute-based encryption system includes:
[0012] Generate public parameters and master keys matching the attribute-based encryption system through the central agency;
[0013] The corresponding public key is submitted to the central agency through the first-layer users, and the corresponding public key is submitted to the upper-layer users through the remaining layers of users.
[0014] Optionally, generating public parameters matching the attribute-based encryption system through the central organization includes:
[0015] Through the central mechanism, according to the input security parameters corresponding to the system, a group generator is called to generate a bilinear group and an integer group matching the system;
[0016] According to the bilinear group and the integer group matched by the system, public parameters matched with the attribute-based encryption system are generated.
[0017] Optionally, a central agency generates keys corresponding to first-layer users based on attribute sets and public keys provided by first-layer users in the system, and generates keys corresponding to remaining users based on attribute sets and public keys provided by lower-layer users through users at each layer in the system, including:
[0018] Through the central agency, based on the attribute set and public key provided by the first-layer user, the key corresponding to the first-layer user is generated by using the hash function and power operation method;
[0019] Through each layer of users in the system, based on the attribute set and public key provided by the lower layer users, hash function and power operation are used to generate the keys corresponding to the remaining users.
[0020] Optionally, the data owning node uses a symmetric encryption algorithm to encrypt the plaintext to obtain the ciphertext, including:
[0021] Through the data owning node, according to the integer group and access structure matching the attribute-based encryption system, the plaintext is encrypted using a symmetric encryption algorithm to obtain the ciphertext;
[0022] The ciphertext is uploaded to a preset cloud server.
[0023] Optionally, before the ciphertext is decrypted by using a symmetric encryption algorithm according to the corresponding key and private key by users at each layer, the method further includes:
[0024] Through each layer of users, the corresponding ciphertext is obtained from the cloud server, and the integrity of the ciphertext is verified by using a hash function.
[0025] Optionally, the ciphertext is decrypted by using a symmetric encryption algorithm according to the corresponding key and private key by users at each layer, including:
[0026] After confirming that the ciphertext passes the integrity check through users at each layer, it is determined whether the corresponding attribute set satisfies the access structure included in the ciphertext;
[0027] If so, the ciphertext is decrypted by using a symmetric encryption algorithm according to the corresponding key and private key of each layer of users.
[0028] According to another aspect of the present invention, there is provided an attribute-based encryption device, the device comprising:
[0029] A system initialization module, used to establish an attribute-based encryption system through a central agency and perform initialization processing on the attribute-based encryption system;
[0030] The key generation module is used to generate keys corresponding to the first-layer users through the central agency according to the attribute set and public key provided by the first-layer users in the system, and to generate keys corresponding to the remaining users respectively through the users of each layer in the system according to the attribute set and public key provided by the lower-layer users;
[0031] An encryption module is used to encrypt the plain text by using a symmetric encryption algorithm through a data-owning node to obtain a cipher text;
[0032] The decryption module is used to decrypt the ciphertext using a symmetric encryption algorithm according to the corresponding secret key and private key of each layer of users.
[0033] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0034] at least one processor; and
[0035] a memory communicatively connected to the at least one processor; wherein,
[0036] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the attribute-based encryption method described in any embodiment of the present invention.
[0037] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the attribute-based encryption method described in any embodiment of the present invention when executed.
[0038] The technical solution provided by the embodiment of the present invention establishes an attribute-based encryption system through a central agency and initializes the attribute-based encryption system. The central agency generates keys corresponding to the first-layer users according to the attribute sets and public keys provided by the first-layer users in the system, and the users at each layer in the system generate keys corresponding to the remaining users according to the attribute sets and public keys provided by the lower-layer users. The data owning node uses a symmetric encryption algorithm to encrypt the plaintext to obtain the ciphertext. The users at each layer use a symmetric encryption algorithm to decrypt the ciphertext according to the corresponding keys and private keys. This technical means can reduce the participation of third-party certification agencies in the attribute-based encryption system, save a lot of computing resources, and avoid security risks to the encryption system.
[0039] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 is a flow chart of an attribute-based encryption method provided according to an embodiment of the present invention;
[0042] Figure 2 is a flow chart of another attribute-based encryption method provided according to an embodiment of the present invention;
[0043] Figure 3 is a flow chart of another attribute-based encryption method provided according to an embodiment of the present invention;
[0044] Figure 4 is a schematic diagram of the structure of an attribute-based encryption device provided according to an embodiment of the present invention;
[0045] Figure 5 It is a schematic diagram of the structure of an electronic device for implementing the attribute-based encryption method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0048] Figure 1 This is a flowchart of an attribute-based encryption method provided in the first embodiment of the present invention. This embodiment is applicable to the case of attribute-based encryption of a business system. The method can be executed by an attribute-based encryption device. The attribute-based encryption device can be implemented in the form of hardware and / or software. The attribute-based encryption device can be configured in an electronic device (such as a terminal or server) with data processing functions. Figure 1 As shown, the method includes:
[0049] Step 110: Establish an attribute-based encryption system through a central organization and initialize the attribute-based encryption system.
[0050] In this embodiment, the central authority (CA) can be a trusted institution in the cloud computing process, which is responsible for verifying the legitimacy of the public key in the public key system. Specifically, the central authority can be a terminal using the attribute-based encryption system, which can be a personal computer, a desktop computer, a smart mobile device, etc.
[0051] In this step, optionally, a central agency may determine system parameters of the attribute-based encryption system and initialize the system.
[0052] Step 120: Generate keys corresponding to the first-layer users according to the attribute sets and public keys provided by the first-layer users in the system through the central agency, and generate keys corresponding to the remaining users according to the attribute sets and public keys provided by the lower-layer users through the users of each layer in the system.
[0053] In this embodiment, each user (Data User, DU) in the attribute-based encryption system can be deployed in a hierarchical manner. Specifically, the user can be a business node in the business system that needs to process encrypted data, such as a personal computer, a desktop computer or a mobile terminal.
[0054] In this step, optionally, the central agency can use the attribute set and public key of the first-layer users to generate a key corresponding to the first-layer users, and then the upper-layer users can use the public key and attribute set of the lower-layer users to generate a corresponding key for the lower-layer users.
[0055] In a specific embodiment, the attributes in the attribute set can be defined by the user unit of the attribute-based encryption system. For example, when the attribute-based encryption system is applied to colleges and universities, the first user attributes can be defined as: name, gender, age, professional title, position, department, etc.; when the attribute-based encryption system is applied to government agencies, the first user attributes can be defined as: name, gender, age, registered residence, native place, etc.
[0056] The advantage of this setting is that by using the method of upper-level users determining keys for lower-level users, on the one hand it can solve the computing bottleneck problem of the central agency, and on the other hand it can reduce the participation of third-party certification agencies and avoid security risks to the encryption system.
[0057] Step 130: Encrypt the plaintext using a symmetric encryption algorithm through the data owning node to obtain a ciphertext.
[0058] In this embodiment, the data owner node (DO) is responsible for data encryption in the attribute-based encryption system. Specifically, the data owner node can first symmetrically encrypt the initial plaintext of the original data, and then store the symmetrically encrypted ciphertext in a preset storage location.
[0059] Step 140: Decrypt the ciphertext using a symmetric encryption algorithm according to the corresponding key and private key of each layer of users.
[0060] In this embodiment, users at each level can obtain the ciphertext from a preset storage location, and decrypt the ciphertext using a symmetric encryption algorithm based on the key generated in step 120 and the private key corresponding to each level of users.
[0061] The advantage of this setting is that by using a symmetric encryption algorithm to encrypt and decrypt data, the operation of bilinear pairings can be reduced, thereby saving a lot of computing resources, avoiding a heavy computing burden on the Internet of Things and electronic devices, and thus improving encryption efficiency.
[0062] The technical solution provided by the embodiment of the present invention establishes an attribute-based encryption system through a central agency and initializes the attribute-based encryption system. The central agency generates keys corresponding to the first-layer users according to the attribute sets and public keys provided by the first-layer users in the system, and the users at each layer in the system generate keys corresponding to the remaining users according to the attribute sets and public keys provided by the lower-layer users. The data owning node uses a symmetric encryption algorithm to encrypt the plaintext to obtain the ciphertext. The users at each layer use a symmetric encryption algorithm to decrypt the ciphertext according to the corresponding keys and private keys. This technical means can reduce the participation of third-party certification agencies in the attribute-based encryption system, save a lot of computing resources, and avoid security risks to the encryption system.
[0063] Figure 2 This is a flow chart of an attribute-based encryption method provided in Embodiment 2 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 2 As shown, the method includes:
[0064] Step 210: Establish an attribute-based encryption system through a central agency.
[0065] Step 220: Generate public parameters and a master key that match the attribute-based encryption system through the central agency.
[0066] In this step, the central agency can generate system matching public parameters params and master key msk.
[0067] In one implementation of this embodiment, public parameters matching the attribute-based encryption system are generated through the central organization, including: through the central organization, according to the input security parameters corresponding to the system, calling a group generator to generate a bilinear group and an integer group matching the system; based on the bilinear group and the integer group matching the system, generating public parameters matching the attribute-based encryption system.
[0068] In a specific embodiment, the central agency can call the group generator G according to the input security parameter κ to generate bilinear groups G1 and G2 of prime order p and integer group Z p , then select g∈G1,h∈G2,α∈Z p , calculate g1 = g a , h1=h a , T=e(g,h) α, from which we can get the common parameters of system matching as params = (g, h, g1, h1, T).
[0069] Step 230: Submit the corresponding public key to the central agency through the first-layer users, and submit the corresponding public key to the upper-layer users through the remaining layers of users.
[0070] In this step, users at each level in the system can choose x∈Z p As the corresponding private key sk, and calculate pk = g x As the corresponding public key, the first-layer user then submits the corresponding public key to the central agency, and the remaining layers of users submit the corresponding public keys to the upper-layer users to complete the registration.
[0071] Step 240: The central agency generates a key corresponding to the first-layer user by using a hash function and a power operation method according to the attribute set and the public key provided by the first-layer user.
[0072] In this step, the central agency can generate a key SK1 corresponding to the first-layer user based on the attribute set S1 and the public key pk1 corresponding to the first-layer user.
[0073] In a specific embodiment, the process of the central agency generating the first user key (KeyGen1(params, S1, msk, pk1)→SK1) can be shown as follows:
[0074] Select σ y ∈Z p , and select t∈Z p ,calculate:
[0075]
[0076]
[0077] K2=H(0111) t h,
[0078]
[0079] The above formula can be used to obtain the key corresponding to the first-level user: SK1 = (K0, K1, K2, {K y,1 ,K y,2} y∈S ), and the central agency sends (t,SK1) to the first-layer users.
[0080] Step 250: Generate keys corresponding to the remaining users respectively through users at each level in the system, according to the attribute set and public key provided by the lower-level users, using hash function and power operation.
[0081] In this step, each layer of users in the system can be assigned a set of attributes S corresponding to the lower layer users. i And the public key pk i , generate the keys SK corresponding to the remaining users i .
[0082] In a specific embodiment, the key generation process (KeyGen i (params,S i ,t,pk i )→SK i ) can be expressed as the following formula:
[0083] The i-1th layer user receives the attribute set S of the i-th layer user (i≥2) i And the public key pk i After that, we can randomly select σ y ∈Z p , and calculate:
[0084]
[0085] K1=K1
[0086]
[0087]
[0088] Through the above formula, the key of the i-th layer user can be determined as SK i =(K0,K1,K2,{K y,1 ,K y,2} y∈S ) and sends the key to the i-th layer user.
[0089] In a specific implementation, before the first-layer user sends the key to the lower-layer user, it is necessary to update K2 (ie, K2=K2 / h) and then perform the above calculation process.
[0090] Step 260: Encrypt the plaintext using a symmetric encryption algorithm through the data owning node to obtain a ciphertext.
[0091] Step 270: Decrypt the ciphertext using a symmetric encryption algorithm according to the corresponding key and private key of each layer of users.
[0092] The technical solution provided by the embodiment of the present invention is to establish an attribute-based encryption system through a central agency, generate public parameters and a master key matching the attribute-based encryption system through the central agency, submit the corresponding public key to the central agency through the first-layer users, and submit the corresponding public keys to the upper-layer users through the remaining layers of users, generate the keys corresponding to the first-layer users by the central agency according to the attribute set and public key of the first-layer users, and generate the keys corresponding to the remaining users by the hash function and power operation according to the attribute set and public key of the lower-layer users through the users of each layer in the system, encrypt the plaintext with a symmetric encryption algorithm through the data owning node to obtain the ciphertext, and decrypt the ciphertext with a symmetric encryption algorithm through the users of each layer according to the corresponding keys and private keys. This technical means can reduce the participation of third-party certification agencies in the attribute-based encryption system, save a lot of computing resources, and avoid security risks to the encryption system.
[0093] Figure 3 This is a flow chart of an attribute-based encryption method provided in Embodiment 3 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 3 As shown, the method includes:
[0094] Step 310: Establish an attribute-based encryption system through a central organization and initialize the attribute-based encryption system.
[0095] Step 320: Generate keys corresponding to the first-layer users according to the attribute sets and public keys provided by the first-layer users in the system through the central agency, and generate keys corresponding to the remaining users according to the attribute sets and public keys provided by the lower-layer users through the users of each layer in the system.
[0096] Step 330: Encrypt the plaintext using a symmetric encryption algorithm through the data owning node according to the integer group and access structure that match the attribute-based encryption system to obtain a ciphertext.
[0097] In a specific embodiment, when the data owner node encrypts the plaintext, it can randomly select s∈Z p , determine (M, ρ) as the access structure corresponding to the system. Where M represents the n1×n2 access matrix, and ρ is used to map each row in the matrix to the corresponding attribute. The data owner node can encrypt the plaintext through the symmetric encryption algorithm C=SE.Enc key (msg), and determine the ciphertext using the following formula:
[0098]
[0099]
[0100] C3=key·T s
[0101]
[0102] calculate
[0103] Therefore, the ciphertext can be obtained through the above formula:
[0104]
[0105] Step 340: Upload the ciphertext to a preset cloud server.
[0106] In this step, the data owning node may upload the ciphertext ct to the cloud server (Cloud Service Provider, CSP).
[0107] Step 350: Obtain the corresponding ciphertext from the cloud server through users at each layer, and use a hash function to perform integrity verification on the ciphertext.
[0108] In a specific embodiment, after obtaining the ciphertext ct from the cloud server, the users at each layer can calculate σ' and determine e(V, h1) and e(C1, h σ' ), then judge e(V,h1) and e(C1,h σ' ) are the same, if so, it is determined that the ciphertext passes the integrity check, if not, the operation process of the ciphertext is terminated.
[0109] Here, e represents the Elliptic Curve Cryptography (ECC) algorithm.
[0110] Step 360: After confirming that the ciphertext has passed the integrity check through users at each layer, determine whether the corresponding attribute set satisfies the access structure included in the ciphertext; if so, execute step 370; if not, execute step 380.
[0111] In this embodiment, if the user determines that the ciphertext passes the integrity check, it is necessary to calculate the row set of the matrix M, that is, I = {i:ρ(i)∈S}, and then determine whether the corresponding attribute set satisfies the access structure based on the calculation result.
[0112] Step 370: Decrypt the ciphertext using a symmetric encryption algorithm according to the corresponding key and private key of each layer of users.
[0113] In this embodiment, if the user determines that the corresponding attribute set satisfies the access structure, the ciphertext can be decrypted according to the following formula:
[0114] Coefficient of determination {γ i ∈Z p} i∈I , and ensure that the coefficient satisfies Then calculate:
[0115]
[0116] The private key sk of the i-th layer user i ,calculate
[0117]
[0118]
[0119] key=C3 / res
[0120] Finally, the symmetric encryption algorithm is used to decrypt the ciphertext to obtain the plaintext msg = SE.Dec key (C).
[0121] Step 380: terminate the operation process on the ciphertext.
[0122] The technical solution provided by the embodiment of the present invention is to establish an attribute-based encryption system through a central agency, and initialize the attribute-based encryption system. The central agency generates a key corresponding to the first-layer users according to the attribute set and public key of the first-layer users in the system, and generates keys corresponding to the remaining users according to the attribute set and public key of the lower-layer users through the users of each layer in the system. The data-owning node uses a symmetric encryption algorithm to encrypt the plaintext according to the integer group and access structure matching the attribute-based encryption system to obtain a ciphertext, and uploads the ciphertext to a preset cloud server. The corresponding ciphertext is obtained from the cloud server by the users of each layer, and the ciphertext is checked for integrity by a hash function. After the users of each layer determine that the ciphertext passes the integrity check, it is determined whether the corresponding attribute set satisfies the access structure included in the ciphertext. If so, the users of each layer use a symmetric encryption algorithm to decrypt the ciphertext according to the corresponding key and private key. This technical means can reduce the participation of third-party certification agencies in the attribute-based encryption system, save a lot of computing resources, and avoid security risks to the encryption system.
[0123] Figure 4 A schematic diagram of the structure of an attribute-based encryption device provided in Embodiment 4 of the present invention is shown in FIG. Figure 4 As shown, the device includes: a system initialization module 410, a key generation module 420, an encryption module 430 and a decryption module 440.
[0124] The system initialization module 410 is used to establish an attribute-based encryption system through a central organization and perform initialization processing on the attribute-based encryption system;
[0125] The key generation module 420 is used to generate keys corresponding to the first-layer users according to the attribute set and public keys provided by the first-layer users in the system through the central organization, and to generate keys corresponding to the remaining users according to the attribute set and public keys provided by the lower-layer users through the users of each layer in the system;
[0126] The encryption module 430 is used to encrypt the plain text by using a symmetric encryption algorithm through the data owning node to obtain a cipher text;
[0127] The decryption module 440 is used to decrypt the ciphertext using a symmetric encryption algorithm according to the corresponding secret key and private key of each layer of users.
[0128] The technical solution provided by the embodiment of the present invention establishes an attribute-based encryption system through a central agency and initializes the attribute-based encryption system. The central agency generates keys corresponding to the first-layer users according to the attribute sets and public keys provided by the first-layer users in the system, and the users at each layer in the system generate keys corresponding to the remaining users according to the attribute sets and public keys provided by the lower-layer users. The data owning node uses a symmetric encryption algorithm to encrypt the plaintext to obtain the ciphertext. The users at each layer use a symmetric encryption algorithm to decrypt the ciphertext according to the corresponding keys and private keys. This technical means can reduce the participation of third-party certification agencies in the attribute-based encryption system, save a lot of computing resources, and avoid security risks to the encryption system.
[0129] Based on the above embodiment, the system initialization module 410 includes:
[0130] A parameter generation unit, used to generate public parameters and a master key matching the attribute-based encryption system through the central organization;
[0131] The public key submission unit is used to submit the corresponding public key to the central agency through the first-layer users, and submit the corresponding public key to the upper-layer users through the remaining layers of users;
[0132] The parameter processing unit is used to call the group generator to generate a bilinear group and an integer group matching the system through the central organization according to the input security parameters corresponding to the system; and generate public parameters matching the attribute-based encryption system according to the bilinear group and the integer group matching the system.
[0133] The key generation module 420 includes:
[0134] A first key generation unit is used to generate a key corresponding to the first-layer user by using a hash function and a power operation method according to the attribute set and the public key provided by the first-layer user through a central organization;
[0135] The second key generation unit is used to generate keys corresponding to the remaining users respectively through the users of each layer in the system, according to the attribute set and public key provided by the lower layer users, using hash function and power operation.
[0136] The encryption module 430 includes:
[0137] The symmetric encryption unit is used to encrypt the plain text using the symmetric encryption algorithm through the data owning node according to the integer group and access structure matching the attribute-based encryption system to obtain the cipher text;
[0138] The ciphertext uploading unit is used to upload the ciphertext to a preset cloud server.
[0139] The decryption module 440 includes:
[0140] An integrity verification unit, used to obtain corresponding ciphertexts from the cloud server through users at each layer, and perform integrity verification on the ciphertexts using a hash function;
[0141] The attribute set judgment unit is used to determine whether the corresponding attribute set satisfies the access structure included in the ciphertext after the ciphertext passes the integrity check through users at each layer; if so, the ciphertext is decrypted by using a symmetric encryption algorithm according to the corresponding key and private key through users at each layer.
[0142] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.
[0143] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0144] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0145] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0146] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the attribute-based encryption method.
[0147] In some embodiments, the attribute-based encryption method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the attribute-based encryption method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the attribute-based encryption method in any other appropriate manner (e.g., by means of firmware).
[0148] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0149] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0150] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0151] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0152] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0153] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0154] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0155] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An attribute-based encryption method, characterized in that: include: Establishing an attribute-based encryption system through a central agency and initializing the attribute-based encryption system; Through the central agency, based on the attribute set and public key provided by the first-layer users in the system, the key corresponding to the first-layer users is generated, and through the users of each layer in the system, based on the attribute set and public key provided by the next layer of users, the keys corresponding to the remaining users are generated respectively; Through the data owning node, the plain text is encrypted using a symmetric encryption algorithm to obtain the ciphertext; The ciphertext is decrypted by using a symmetric encryption algorithm according to the corresponding secret key and private key of each layer of users; The central agency generates the keys corresponding to the first-layer users according to the attribute set and public key provided by the first-layer users in the system, and generates the keys corresponding to the remaining users according to the attribute set and public key provided by the next-layer users through the users of each layer in the system, including: Through the central agency, based on the attribute set and public key provided by the first-layer user, the key corresponding to the first-layer user is generated by using the hash function and power operation method; Through each layer of users in the system, based on the attribute set and public key provided by the next layer of users, hash functions and power operations are used to generate the keys corresponding to the remaining users.
2. The method according to claim 1, characterized in that Initializing the attribute-based encryption system includes: Generate public parameters and master keys matching the attribute-based encryption system through the central agency; The corresponding public key is submitted to the central agency through the first layer of users, and the corresponding public key is submitted to the upper layer of users through the remaining layers of users.
3. The method according to claim 2, characterized in that The central agency generates public parameters matching the attribute-based encryption system, including: Through the central mechanism, according to the input security parameters corresponding to the system, a group generator is called to generate a bilinear group and an integer group matching the system; According to the bilinear group and the integer group matched by the system, public parameters matched with the attribute-based encryption system are generated.
4. The method according to claim 3, characterized in that Through the data owner node, the plaintext is encrypted using a symmetric encryption algorithm to obtain the ciphertext, including: Through the data owning node, according to the integer group and access structure matching the attribute-based encryption system, the plaintext is encrypted using a symmetric encryption algorithm to obtain the ciphertext; The ciphertext is uploaded to a preset cloud server.
5. The method according to claim 4, characterized in that Before the ciphertext is decrypted by the symmetric encryption algorithm according to the corresponding key and private key of each layer of users, the following is also included: Through each layer of users, the corresponding ciphertext is obtained from the cloud server, and the integrity of the ciphertext is verified by using a hash function.
6. The method according to claim 5, characterized in that The ciphertext is decrypted by using a symmetric encryption algorithm according to the corresponding key and private key of each layer of users, including: After confirming that the ciphertext passes the integrity check through users at each layer, it is determined whether the corresponding attribute set satisfies the access structure included in the ciphertext; If so, the ciphertext is decrypted by using a symmetric encryption algorithm according to the corresponding key and private key of each layer of users.
7. An attribute-based encryption device, characterized in that: include: A system initialization module, used to establish an attribute-based encryption system through a central agency and perform initialization processing on the attribute-based encryption system; The key generation module is used to generate keys corresponding to the first-layer users through the central agency according to the attribute set and public key provided by the first-layer users in the system, and to generate keys corresponding to the remaining users respectively through the users of each layer in the system according to the attribute set and public key provided by the users of the next layer; The central agency generates the keys corresponding to the first-layer users according to the attribute set and public key provided by the first-layer users in the system, and generates the keys corresponding to the remaining users according to the attribute set and public key provided by the next-layer users through the users of each layer in the system, including: Through the central agency, based on the attribute set and public key provided by the first-layer user, the key corresponding to the first-layer user is generated by using the hash function and power operation method; Through each layer of users in the system, according to the attribute set and public key provided by the next layer of users, the hash function and power operation are used to generate the keys corresponding to the remaining users; An encryption module is used to encrypt the plain text by using a symmetric encryption algorithm through a data-owning node to obtain a cipher text; The decryption module is used to decrypt the ciphertext using a symmetric encryption algorithm according to the corresponding secret key and private key of each layer of users.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory in communication with the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the attribute-based encryption method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the attribute-based encryption method according to any one of claims 1 to 6 when executed.
