A data encryption method and device based on attribute
By combining ABBE and HP-CP-ABE technologies, obfuscating hidden access policies and adding signature information to ciphertext solves the problems of user personal information leakage and data tampering risks in existing technologies, and achieves higher data encryption security.
Patent Information
- Application Number
- CN202110672273.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-06-17
AI Technical Summary
Existing attribute-based data encryption methods have limitations and insufficient security in protecting users' personal information and preventing data tampering.
Using a data encryption method that combines ABBE and HP-CP-ABE, by obfuscating the hidden access policy and adding signature information to the ciphertext, public key parameters and master key parameters based on user attributes are generated to determine the symmetric encryption key and broadcast header parameters, perform data encryption, and perform permission verification during the decryption process to ensure the authenticity of the ciphertext.
Effectively protect users' personal information, prevent information leakage, avoid malicious tampering of data during transmission, and improve the security of data encryption.
Smart Images

Figure CN115499141B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet communication technology, and in particular to a data encryption method and device based on attributes. In addition, the present invention also relates to a data decryption method and device based on attributes, an electronic device, and a processor-readable storage medium. Background Art
[0002] In recent years, with the rapid development of Internet technology, more and more business processes are being realized with the help of the Internet. How to ensure the security of user personal information is the main problem currently faced. In order to solve the above problems and ensure the security of user personal information, the new public key data encryption methods commonly used in the prior art are mainly divided into two categories: one is the data encryption method based on identity (Identify Document, ID) (Identity Based Encryption, IBE), which uses ID as the public key to encrypt data, but its disadvantage is that the ID contains too much user personal information, which will pose a great threat to the user's personal privacy. At the same time, this encryption method is not conducive to one-to-many data transmission; the other is the data encryption method based on attributes (Attribute Based Encryption, ABE), which uses multiple attributes of users to produce private keys by formulating access policies, giving users more detailed access control rights to data, allowing users to share data one-to-many and fine-grained, but because the data is encrypted by user-related attributes, attackers may use ciphertext to infer user personal information, which will also cause user personal information leakage. The most common data encryption method based on attributes to protect user privacy is the data encryption method based on attribute hidden access policy (Hidden Policy Cipertext Attribute Based Encryption, HP-CP-ABE). HP-CP-ABE hides the access policy in attribute-based encryption through obfuscation, so that attackers cannot obtain the recipient's information from the ciphertext, and even legitimate users cannot obtain other information in the access policy, thereby achieving the purpose of protecting user privacy.
[0003] Attribute Based Broadcast Encryption (ABBE) has the advantages of both Broadcast Encryption (BE) and ABE, allowing data owners to formulate access policies and broadcast sets. Only users who belong to the broadcast set and meet the access policy can successfully decrypt. Although ABBE can provide users with flexible access control to data, it also has two major problems: the receiver set and access policy contain a large amount of user personal information. If not protected, it will cause the leakage of user personal information and increase the risk of user data being cracked; there is a risk of malicious tampering during data transmission, and the authenticity of the ciphertext cannot be guaranteed. Therefore, how to design a more secure data encryption scheme has become an important research topic in this field. Summary of the invention
[0004] To this end, the present invention provides an attribute-based data encryption method and device to solve the problems of high limitations and poor security of data encryption schemes in the prior art.
[0005] In a first aspect, the present invention provides an attribute-based data encryption method, comprising:
[0006] Obtain public key parameters and master key parameters generated based on user attribute information;
[0007] Based on the master key parameter, the public key parameter, the selected first random value and the corresponding target matrix, determine the first symmetric encryption key and broadcast header parameter for data encryption; and based on the preset hash function and the selected random integer, determine the signature information; wherein the target matrix is pre-generated based on the attribute set of all users;
[0008] The formulated access policy is encrypted based on the first symmetric encryption key and the broadcast header parameter to obtain corresponding ciphertext data; and the signature information is written into the ciphertext data to obtain corresponding target ciphertext data.
[0009] In one embodiment, each row of the target matrix corresponds to attribute information of a user.
[0010] In one embodiment, the attribute-based data encryption method further includes: sending the target ciphertext data to a data user receiving end through a corresponding cloud server.
[0011] In a second aspect, the present invention further provides an attribute-based data decryption method, comprising:
[0012] Obtaining target ciphertext data to be decrypted; the target ciphertext data includes corresponding label information;
[0013] Performing authority verification based on the tag information, if the verification is successful, obtaining a target private key parameter and a broadcast header parameter determined based on the user's tag and the user's attribute information, and obtaining a corresponding second symmetric encryption key according to the target private key parameter and the broadcast header parameter;
[0014] The target ciphertext data is decrypted based on the second symmetric encryption key to obtain decrypted target data.
[0015] In one embodiment, the attribute-based data decryption method further includes: pre-acquiring attribute information based on all users, the selected corresponding second random value and the public key parameter, and determining the private key parameter required for decryption;
[0016] The public key parameters are generated based on the attribute information of different users respectively, and the private key parameters include the target private key parameters.
[0017] In one embodiment, the tag information is obtained based on a preset hash function and a selected random integer.
[0018] In a third aspect, the present invention further provides an attribute-based data encryption device, comprising:
[0019] A public parameter acquisition unit, used to acquire public key parameters and master key parameters generated based on user attribute information;
[0020] An encryption information determination unit is used to determine a first symmetric encryption key and a broadcast header parameter for data encryption based on the master key parameter, the public key parameter, the selected first random value and a corresponding target matrix; and to determine signature information based on a preset hash function and a selected random integer; wherein the target matrix is generated in advance based on a set of attributes of all users;
[0021] A data encryption processing unit is used to encrypt the formulated access policy based on the first symmetric encryption key and the broadcast header parameter to obtain corresponding ciphertext data; and write the signature information into the ciphertext data to obtain corresponding target ciphertext data.
[0022] In one embodiment, each row of the target matrix corresponds to attribute information of a user.
[0023] In one embodiment, the attribute-based data encryption device further includes: a ciphertext data sending unit, which is used to send the target ciphertext data to a data user receiving end through a corresponding cloud server.
[0024] In a fourth aspect, the present invention further provides an attribute-based data decryption device, comprising:
[0025] A ciphertext data acquisition unit, used to acquire target ciphertext data to be decrypted; the target ciphertext data includes corresponding label information;
[0026] a decryption information determination unit, configured to perform authority verification based on the tag information, and if the verification is successful, obtain a target private key parameter and a broadcast header parameter determined based on the user's tag and the user's attribute information, and obtain a corresponding second symmetric encryption key according to the target private key parameter and the broadcast header parameter;
[0027] The data decryption processing unit is used to decrypt the target ciphertext data based on the second symmetric encryption key to obtain decrypted target data.
[0028] In one embodiment, the attribute-based data decryption device further includes: a private key parameter determination unit, which is used to pre-acquire attribute information based on all users, the selected corresponding second random value and the public key parameter, and determine the private key parameter required for decryption;
[0029] The public key parameters are generated based on the attribute information of different users respectively, and the private key parameters include the target private key parameters.
[0030] In one embodiment, the tag information is obtained based on a preset hash function and a selected random integer.
[0031] In a fifth aspect, the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the attribute-based data encryption method or the attribute-based data decryption method as described in any one of the above are implemented.
[0032] In a sixth aspect, the present invention further provides a processor-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the attribute-based data encryption method or the attribute-based data decryption method as described in any one of the above are implemented.
[0033] By adopting the attribute-based data encryption method described in the present invention, the authenticity of the ciphertext is ensured by obfuscating the hidden access strategy and adding signature information to the ciphertext, thereby protecting the user's personal information, effectively preventing the leakage of the user's personal information, and avoiding the risk of malicious tampering of the data during transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 One of the flow charts of the attribute-based data encryption method provided in an embodiment of the present invention;
[0036] Figure 2 A complete flow chart of the attribute-based data encryption method provided by an embodiment of the present invention;
[0037] Figure 3 One of the structural schematic diagrams of the attribute-based data encryption device provided in an embodiment of the present invention;
[0038] Figure 4 A second flowchart of the attribute-based data decryption method provided by an embodiment of the present invention;
[0039] Figure 5 A second structural diagram of an attribute-based data decryption device provided in an embodiment of the present invention;
[0040] Figure 6 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 are within the scope of protection of the present invention.
[0042] This application proposes an attribute-based data encryption method (Hidden Policy Cipertext Attribute Based Broadcast Encryption, HP-CP-ABBE) for protecting user privacy. This method combines ABBE technology and HP-CP-ABE technology to ensure the authenticity of ciphertext by obfuscating hidden access policies and broadcast sets and adding signature information to ciphertext.
[0043] The following describes in detail an embodiment of the attribute-based data encryption method according to the present invention. Figure 1As shown, it is one of the flow charts of the attribute-based data encryption method provided by an embodiment of the present invention, and the specific implementation process includes the following steps:
[0044] Step 101: Obtain public key parameters and master key parameters generated based on user attribute information.
[0045] like Figure 2 As shown, before executing this step, the authority center needs to be initialized first. Specifically, the system initialization process includes: running the group generator To generate Ω=(N=p1p2p3,G,G T ,e); then for any Select g, α, and For any user attribute information Select Then select the group The random generator g3 is based on the user attribute information and the The random generator selected from the above is calculated according to the preset algorithm: A0 = g·R0, A1 = g a , A2=g τ and The public key parameters PK and master key parameters MK are as follows (1)-(2):
[0046]
[0047]
[0048] Where G is a composite order group with order N=p1p2p3; p1, p2, p3 are prime numbers; U is a set of positive integers; is the order p i Prime order group; e is the generator of G.
[0049] In this step, the user attribute information includes user name, gender and other information.
[0050] Step 102: Based on the master key parameter, the public key parameter, the selected first random value and the corresponding target matrix, determine the first symmetric encryption key and broadcast header parameters for data encryption; and determine the signature information based on a preset hash function and the selected random integer.
[0051] The target matrix is generated in advance based on the attribute set of all users, and each row of the target matrix corresponds to the attribute information of one user. The public parameter is the public key parameter. The first symmetric encryption key and the broadcast header parameter are used to encrypt the access policy related data, and the tag information is used to write into the encrypted ciphertext to ensure the authenticity of the ciphertext.
[0052] Specifically, the data owner first generates a target matrix based on the attribute set of all users, and further determines the first symmetric encryption key and broadcast header parameters for data encryption based on the master key parameters, the public key parameters, the selected first random value and the corresponding target matrix, and determines the signature information based on a preset hash function and a selected random integer, and then writes the signature information into the encrypted ciphertext.
[0053] In an actual embodiment, the data encryption process specifically includes: selecting a vector Random integer And calculate λ according to the preset algorithm x =A x v, where A x represents the xth row of the target matrix A. Further, the first random value is selected R x,1 ,R x,2 ,R 3,3 ,R 3,4 , According to the preset algorithm, we calculate the following: K=e(g,g) αs The first symmetric encryption key parameter K and the broadcast header parameter Hdr are (3)-(4) respectively:
[0054] K=e(g,g) αs , (3)
[0055]
[0056] In the specific implementation process, choose a secure hash function Then pick a random integer Based on the hash function and the selected random integer, the following calculations are performed according to the preset algorithm: Υ=e(g,Θ) δ , Ψ=H(M) H(γ) ,Ω=g δ (K s ) Ψ , and then obtain the signature information Sign = <Θ, Ψ, Ω>.
[0057] Step 103: Encrypt the formulated access policy based on the first symmetric encryption key and the broadcast header parameter to obtain corresponding ciphertext data; and write the signature information into the ciphertext data to obtain corresponding target ciphertext data.
[0058] In an embodiment of the present invention, after obtaining the first symmetric encryption key, the broadcast header parameters and the signature information through the above-mentioned algorithm, the formulated access policy can be further encrypted based on the first symmetric encryption key and the broadcast header parameters to obtain corresponding ciphertext data, and the signature information is written into the ciphertext data to obtain corresponding target ciphertext data, thereby realizing data encryption.
[0059] In the specific implementation process, after obtaining the target ciphertext data, the data owner can also send the target ciphertext data to the data user receiving end (ie, the data user side) through the corresponding cloud server.
[0060] In addition, the access policy can be verified based on the following formula algorithms (5)-(7):
[0061]
[0062] If (A',ρ')=(A,ρ) then ρ(x)'=ρ(x),∑ x∈I μ′ x λ x =s, where A, A' are access policy matrices, ρ, ρ' are mappings, so:
[0063]
[0064] If (A',ρ')≠(A,ρ), then ρ(x)'≠ρ(x). So:
[0065]
[0066] From the above algorithm equation, we can know that no matter (A',ρ')=(A,ρ) or (A',ρ')≠(A,ρ), the Diffie-Hellman assumption can only obtain a random value, and the attacker cannot obtain any user personal information about the access policy.
[0067] Furthermore, the verification of the broadcast set can be realized based on the following formula algorithms (8)-(9). Because there is the following equation:
[0068]
[0069] e(C3,A0)=e(∏ j∈S u j ,g) s ·e(R0,R3,3 ), (9)
[0070] Then there is The Diffie-Hellman assumption is not met, so the attacker cannot obtain any user personal information about the broadcast set (receiver set). The above verification process shows that the data encryption security of the present invention is higher.
[0071] By adopting the attribute-based data encryption method described in the embodiment of the present invention, by combining ABBE with HP-CP-ABE, the hiding of access policy and broadcast set in ABBE is solved, and user information leakage is prevented. The ciphertext signature is added to ABBE to ensure the authenticity of the ciphertext in ABBE. That is, by confusing the hidden access policy and adding signature information to the ciphertext to ensure the authenticity of the ciphertext, the protection of user personal information is achieved, the leakage of user personal information is effectively prevented, and the risk of data being maliciously tampered with during transmission is avoided.
[0072] Corresponding to the attribute-based data encryption method provided above, the present invention also provides an attribute-based data encryption device. Since the embodiment of the device is similar to the above method embodiment, the description is relatively simple. For relevant parts, please refer to the description of the above method embodiment. The embodiment of the attribute-based data encryption device described below is only illustrative. Please refer to Figure 3 As shown, it is one of the structural schematic diagrams of an attribute-based data encryption device provided by an embodiment of the present invention.
[0073] The attribute-based data encryption device described in the present invention specifically includes the following parts:
[0074] The public parameter acquisition unit 301 is used to acquire public key parameters and master key parameters generated based on user attribute information.
[0075] The encryption information determination unit 302 is used to determine the first symmetric encryption key and broadcast header parameters for data encryption based on the master key parameters, the public key parameters, the selected first random value and the corresponding target matrix; and determine the signature information based on a preset hash function and a selected random integer.
[0076] The target matrix is generated in advance based on the attribute set of all users.
[0077] The data encryption processing unit 303 is used to encrypt the formulated access policy based on the first symmetric encryption key and the broadcast header parameter to obtain corresponding ciphertext data; and write the signature information into the ciphertext data to obtain corresponding target ciphertext data.
[0078] By using the attribute-based data encryption device described in the embodiment of the present invention, by combining ABBE with HP-CP-ABE, the hiding of access policy and broadcast set in ABBE is solved to prevent leakage of user information. The ciphertext signature is added to ABBE to ensure the authenticity of the ciphertext in ABBE. That is, by confusing the hidden access policy and adding signature information to the ciphertext to ensure the authenticity of the ciphertext, the protection of user personal information is achieved, the leakage of user personal information is effectively prevented, and the risk of data being maliciously tampered with during transmission is avoided.
[0079] Accordingly, the present invention also provides a data decryption method based on attributes. Figure 4 As shown, it is the second flow chart of the attribute-based data decryption method provided by an embodiment of the present invention.
[0080] Step 401: Obtain target ciphertext data to be decrypted; the target ciphertext data includes corresponding label information.
[0081] Before executing this step, it is necessary to generate private key parameters based on the attribute information of all users, the selected corresponding second random values and the public key parameters in advance to determine the private key parameters required for decryption. The public key parameters are generated based on the attribute information of different users respectively.
[0082] The generation process of the private key parameters specifically includes: randomly selecting an integer Then, according to the preset algorithm, we can calculate: Further, a second random value is selected And calculate the signature key according to the preset algorithm: and the ciphertext verification key K v =g γ . Then the user's private key parameters are obtained as follows:
[0083]
[0084] Among them, Z N ={0,1,2,....N-1} is the remaining set, each integer represents Z N A residual class of , α, θ, τ are any positive integers.
[0085] Step 402: Perform authority verification based on the tag information. If the verification passes, obtain the target private key parameters and broadcast header parameters determined based on the user's tag and the user's attribute information, and obtain the corresponding second symmetric encryption key based on the target private key parameters and the broadcast header parameters.
[0086] The tag information is obtained based on a preset hash function and a selected random integer. The private key parameters include the target private key parameters.
[0087] Step 403: Decrypt the target ciphertext data based on the second symmetric encryption key to obtain decrypted target data.
[0088] Corresponding to the above-mentioned attribute-based data decryption method, the present invention also provides an attribute-based data decryption device. Since the embodiment of the device is similar to the above-mentioned method embodiment, the description is relatively simple. For the relevant parts, please refer to the description of the above-mentioned method embodiment. The embodiment of the attribute-based data decryption device described below is only illustrative. Please refer to Figure 5 As shown, it is a second structural schematic diagram of an attribute-based data decryption device provided by an embodiment of the present invention.
[0089] The ciphertext data acquisition unit 501 is used to acquire target ciphertext data to be decrypted; the target ciphertext data includes corresponding label information.
[0090] The decryption information determination unit 502 is used to perform authority verification based on the tag information. If the verification is successful, the target private key parameters and broadcast header parameters determined based on the user's tag and the user's attribute information are obtained, and the corresponding second symmetric encryption key is obtained based on the target private key parameters and the broadcast header parameters.
[0091] The data decryption processing unit 503 is used to decrypt the target ciphertext data based on the second symmetric encryption key to obtain decrypted target data.
[0092] By adopting the attribute-based data decryption method and device described in the embodiment of the present invention, the authenticity of the ciphertext is ensured by obfuscating the hidden access strategy and adding signature information to the ciphertext, thereby protecting the user's personal information, effectively preventing the leakage of the user's personal information, and avoiding the risk of malicious tampering of the data during transmission.
[0093] Corresponding to the attribute-based data encryption method provided above, the present invention also provides an electronic device. Since the embodiment of the electronic device is similar to the embodiment of the method described above, the description is relatively simple. For the relevant parts, please refer to the description of the embodiment of the method described above. The electronic device described below is only for illustration. Figure 6As shown, it is a schematic diagram of the physical structure of an electronic device disclosed in an embodiment of the present invention. The electronic device may include: a processor 601, a memory 602 and a communication bus 603, wherein the processor 601 and the memory 602 complete mutual communication through the communication bus 603, and communicate with the outside through the communication interface 604. The processor 601 can call the logic instructions in the memory 602 to execute the attribute-based data encryption method, which includes: obtaining a public key parameter and a master key parameter generated based on the attribute information of the user; based on the master key parameter, the public key parameter, the selected first random value and the corresponding target matrix, determining the first symmetric encryption key and the broadcast header parameter for data encryption; and determining the signature information based on the preset hash function and the selected random integer; wherein the target matrix is pre-generated based on the attribute set of all users; encrypting the formulated access policy based on the first symmetric encryption key and the broadcast header parameter to obtain the corresponding ciphertext data; and writing the signature information into the ciphertext data to obtain the corresponding target ciphertext data. Or execute an attribute-based data decryption method, which includes: obtaining target ciphertext data to be decrypted; the target ciphertext data contains corresponding tag information; performing authority verification based on the tag information, and if the verification passes, obtaining a target private key parameter and a broadcast header parameter determined based on the user's tag and the user's attribute information, and obtaining a corresponding second symmetric encryption key based on the target private key parameter and the broadcast header parameter; decrypting the target ciphertext data based on the second symmetric encryption key to obtain the decrypted target data.
[0094] In addition, the logic instructions in the above-mentioned memory 602 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a storage chip, a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes.
[0095] On the other hand, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a processor-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the attribute-based data encryption method provided by the above-mentioned method embodiments. The attribute-based data encryption method includes: obtaining public key parameters and master key parameters generated based on user attribute information; determining a first symmetric encryption key and broadcast header parameters for data encryption based on the master key parameters, the public key parameters, a selected first random value and a corresponding target matrix; and determining signature information based on a preset hash function and a selected random integer; wherein the target matrix is pre-generated based on a set of attributes of all users; encrypting the formulated access policy based on the first symmetric encryption key and the broadcast header parameters to obtain corresponding ciphertext data; and writing the signature information into the ciphertext data to obtain corresponding target ciphertext data. Or execute an attribute-based data decryption method, which includes: obtaining target ciphertext data to be decrypted; the target ciphertext data contains corresponding tag information; performing authority verification based on the tag information, and if the verification passes, obtaining a target private key parameter and a broadcast header parameter determined based on the user's tag and the user's attribute information, and obtaining a corresponding second symmetric encryption key based on the target private key parameter and the broadcast header parameter; decrypting the target ciphertext data based on the second symmetric encryption key to obtain the decrypted target data.
[0096] On the other hand, an embodiment of the present invention further provides a processor-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, it is implemented to execute the attribute-based data encryption method provided by the above-mentioned embodiments. The attribute-based data encryption method includes: obtaining public key parameters and master key parameters generated based on user attribute information; determining a first symmetric encryption key and broadcast header parameters for data encryption based on the master key parameters, the public key parameters, a selected first random value and a corresponding target matrix; and determining signature information based on a preset hash function and a selected random integer; wherein the target matrix is pre-generated based on a set of attributes of all users; encrypting the formulated access policy based on the first symmetric encryption key and the broadcast header parameters to obtain corresponding ciphertext data; and writing the signature information into the ciphertext data to obtain corresponding target ciphertext data. Or execute an attribute-based data decryption method, which includes: obtaining target ciphertext data to be decrypted; the target ciphertext data contains corresponding tag information; performing authority verification based on the tag information, and if the verification passes, obtaining a target private key parameter and a broadcast header parameter determined based on the user's tag and the user's attribute information, and obtaining a corresponding second symmetric encryption key based on the target private key parameter and the broadcast header parameter; decrypting the target ciphertext data based on the second symmetric encryption key to obtain the decrypted target data.
[0097] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0098] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data encryption method based on attributes, characterized in that: include: Obtain public key parameters and master key parameters generated based on user attribute information; Based on the master key parameter, the public key parameter, the selected first random value and the corresponding target matrix, a first symmetric encryption key and a broadcast header parameter for data encryption are determined; and based on a preset hash function and a selected random integer, signature information is determined; wherein the target matrix is pre-generated based on a set of attributes of all users; the first symmetric encryption key and the broadcast header parameter are used to encrypt access policy related data; the tag information is used to write into the encrypted ciphertext to ensure the authenticity of the ciphertext; the public key parameter is a public parameter, which is generated based on the attribute information of different users respectively; Based on the master key parameter, the public key parameter, the selected first random value and the corresponding target matrix, a first symmetric encryption key and a broadcast header parameter for data encryption are determined; and based on a preset hash function and a selected random integer, signature information is determined, specifically: Select a vector v, a random integer r x , and calculate λ according to the preset algorithm x =A x v, where A x represents the xth row of the target matrix A; selects the first random value s; Select a random generator g, is the order p i Prime order group; e is the generator of G, G is a composite order group with order N = p1p2p3, p1, p2, p3 are prime numbers; based on user attribute information and from the group The random generator selected from the above is calculated according to the preset algorithm: A0 = g·R0, A1 = g α , A2=g τ and Select According to the preset algorithm, we calculate the following: C3=(∏ j∈S u j ) s R 3,3 , K=e(g,g) αs ; The first symmetric encryption key parameter K and the broadcast header parameter Hdr are (3)-(4) respectively: K=e(g,g) αs , (3) Pick a hash function H: Then a random integer δ is selected; based on the hash function and the selected random integer, calculations are performed according to a preset algorithm: Ω=g δ (K s ) Ψ , and then get the signature information Sign=<Θ,Ψ,Ω>; where A2=g τ , α, τ are any positive integers, the first random value s, the random integer δ; The formulated access policy is encrypted based on the first symmetric encryption key and the broadcast header parameter to obtain corresponding ciphertext data; and the signature information is written into the ciphertext data to obtain corresponding target ciphertext data.
2. The attribute-based data encryption method according to claim 1, characterized in that: Each row of the target matrix corresponds to attribute information of a user.
3. The attribute-based data encryption method according to claim 1, characterized in that: Also includes: The target ciphertext data is sent to the data user receiving end through the corresponding cloud server.
4. A data decryption method based on attributes, characterized in that: include: Pre-acquire the attribute information of all users, the corresponding second random value selected, and the public key parameters to determine the private key parameters required for decryption; wherein the public key parameters are generated based on the attribute information of different users respectively, and the private key parameters include the target private key parameters; The generation process of the private key parameters specifically includes: randomly selecting an integer θ k , and then calculate according to the preset algorithm: Select the second random value γ and calculate the signature key according to the preset algorithm: and the ciphertext verification key K v =g γ , and then get the user's private key parameters as follows: Among them, Z N ={0,1,2,....N-1} is the remaining set, each integer represents Z N A residual class of , α, θ, τ are any positive integers; for any j, the random generator g, For any user attribute information v i ; first random value s; Obtaining target ciphertext data to be decrypted; the target ciphertext data includes corresponding label information; Based on the tag information, permission verification is performed. If the verification is successful, a target private key parameter and a broadcast header parameter determined based on the user's tag and the user's attribute information are obtained, and a corresponding second symmetric encryption key is obtained according to the target private key parameter and the broadcast header parameter; the tag information is obtained based on a preset hash function and a selected random integer; the signature information is Sign=<Θ,Ψ,Ω>; wherein the signature information is based on the selected hash function H: and the selected random integer δ, and based on the hash function and the selected random integer, respectively calculate according to a preset algorithm: Ω=g δ (K s ) Ψ Obtained; where A2 = g τ , α, τ are any positive integers, the first random value s, the random integer δ; is the order p i Prime order group; e is the generator of G, G is a composite order group of order N = p1p2p3, p1, p2, p3 are prime numbers; R 4,4 ∈G p3 ; Random integer δ; The broadcast header parameter Hdr is (4): in, C3=(Π j∈S u j ) s R 3,3 , vector v, random integer r x , and calculate λ according to the preset algorithm x =A x v, where A x represents the xth row of the target matrix A; selects the first random value s; Select a random generator g, is the order p i Prime order group; e is the generator of G, G is a composite order group with order N = p1p2p3, p1, p2, p3 are prime numbers; based on user attribute information and from the group The random generator selected from the above is calculated according to the preset algorithm: A0 = g·R0, A1 = g α , A2=g τ and Select The target ciphertext data is decrypted based on the second symmetric encryption key to obtain decrypted target data.
5. An attribute-based data encryption device, characterized in that: include: A public parameter acquisition unit, used to acquire public key parameters and master key parameters generated based on user attribute information; An encryption information determination unit is used to determine a first symmetric encryption key and a broadcast header parameter for data encryption based on the master key parameter, the public key parameter, the selected first random value and a corresponding target matrix; and to determine signature information based on a preset hash function and a selected random integer; wherein the target matrix is generated in advance based on a set of attributes of all users; The first symmetric encryption key and the broadcast header parameter are used to encrypt the access policy related data; the tag information is used to write into the encrypted ciphertext to ensure the authenticity of the ciphertext; the public key parameter is a public parameter, which is generated based on the attribute information of different users; Based on the master key parameter, the public key parameter, the selected first random value and the corresponding target matrix, a first symmetric encryption key and a broadcast header parameter for data encryption are determined; and based on a preset hash function and a selected random integer, signature information is determined, specifically: Select a vector v, a random integer r x , and calculate λ according to the preset algorithm x =A x v, where A x represents the xth row of the target matrix A; selects the first random value s; Select a random generator g, is the order p i Prime order group; e is the generator of G, G is a composite order group with order N = p1p2p3, p1, p2, p3 are prime numbers; based on user attribute information and from the group The random generator selected from the above is calculated according to the preset algorithm: A0 = g·R0, A1 = g α , A2=g τ and Select According to the preset algorithm, we calculate the following: C3=(Π j∈S u j ) s R 3,3 , K=e(g,g) αs ; The first symmetric encryption key parameter K and the broadcast header parameter Hdr are (3)-(4) respectively: K=e(g,g) αs , (3) Pick a hash function H: Then a random integer δ is selected; based on the hash function and the selected random integer, calculations are performed according to a preset algorithm: Ω=g δ (K s ) Ψ , and then get the signature information Sign=<Θ,Ψ,Ω>; where A2=g τ , α, τ are any positive integers, the first random value s, the random integer δ; A data encryption processing unit is used to encrypt the formulated access policy based on the first symmetric encryption key and the broadcast header parameter to obtain corresponding ciphertext data; and write the signature information into the ciphertext data to obtain corresponding target ciphertext data.
6. An attribute-based data decryption device, characterized in that: include: A private key parameter determination unit is used to pre-acquire attribute information based on all users, a corresponding second random value selected, and a public key parameter to determine the private key parameter required for decryption; wherein the public key parameter is generated based on the attribute information of different users, and the private key parameter includes the target private key parameter; the generation process of the private key parameter specifically includes: randomly selecting an integer θ k , and then calculate according to the preset algorithm: Select the second random value γ and calculate the signature key according to the preset algorithm: and the ciphertext verification key K v =g γ , and then get the user's private key parameters as follows: Among them, Z N ={0,1,2,....N-1} is the remaining set, each integer represents Z N A residual class of , α, θ, τ are any positive integers; for any j, the random generator g, For any user attribute information v i ; first random value s; A ciphertext data acquisition unit, used to acquire target ciphertext data to be decrypted; the target ciphertext data includes corresponding label information; The decryption information determination unit is used to perform authority verification based on the tag information. If the verification is successful, a target private key parameter and a broadcast header parameter determined based on the user's tag and the user's attribute information are obtained, and a corresponding second symmetric encryption key is obtained according to the target private key parameter and the broadcast header parameter; the tag information is obtained based on a preset hash function and a selected random integer; the signature information is Sign=<Θ,Ψ,Ω>; wherein the signature information is based on the selected hash function H: and the selected random integer δ, and based on the hash function and the selected random integer, respectively calculate according to a preset algorithm: Ω=g δ (K s ) Ψ Obtained; where A2 = g τ , α, τ are any positive integers, the first random value s, the random integer δ; is the order p i Prime order group; e is the generator of G, G is a composite order group of order N = p1p2p3, p1, p2, p3 are prime numbers; R 4,4 ∈G p3 ; Random integer δ; The broadcast header parameter Hdr is (4): in, C3=(Π j∈S u j ) s R 3,3 , vector v, random integer r x , and calculate λ according to the preset algorithm x =A x v, where A x represents the xth row of the target matrix A; selects the first random value s; Select a random generator g, is the order p i Prime order group; e is the generator of G, G is a composite order group with order N = p1p2p3, p1, p2, p3 are prime numbers; based on user attribute information and from the group The random generator selected from the above is calculated according to the preset algorithm: A0 = g·R0, A1 = g α , A2=g τ and Select The data decryption processing unit is used to decrypt the target ciphertext data based on the second symmetric encryption key to obtain decrypted target data.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the attribute-based data encryption method according to any one of claims 1 to 3 or the attribute-based data decryption method according to claim 4 are implemented.
8. A processor-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the attribute-based data encryption method according to any one of claims 1 to 3 or the attribute-based data decryption method according to claim 4 are implemented.
