Attribute-based encryption method and attribute-based decryption method
By introducing time-varying parameters and attribute tokens generated based on time and attributes in attribute-based encryption technology, the problem that it is difficult to meet the requirements of dynamic cryptography strategies in the existing technology is solved, and the dynamic binding of cryptography strategies and encrypted data is realized. and improve system flexibility and reliability.
Patent Information
- Application Number
- CN202411759443.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-12-03
AI Technical Summary
现有的属性基加密技术难以满足动态密码学策略的需求,导致策略变化时需进行耗时的数据重加密操作。
By introducing time-varying parameters into the attribute-based encryption method, a dynamic cryptography strategy is generated, and a one-time attribute token generated based on time and attributes is used for decryption, dynamic decryption of the ciphertext is achieved.
The dynamic binding of cryptographic strategies and encrypted data is realized, which improves the flexibility and reliability of the system, and avoids the time-consuming operation of re-encryption due to policy changes.
Smart Images

Figure CN119484142A_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 and an attribute-based decryption method. Background Art
[0002] In the computing power network, blockchain technology is used to achieve decentralized data storage and computing task distribution, which can improve data security while avoiding the risk of single point failure and malicious attacks. In view of the distributed broadcast network characteristics of blockchain, group encryption provides a more effective solution for the secure sharing of blockchain transaction data. As a "one-to-many" encryption form, in the group encryption scheme, the authorizer is no longer a single user but a set of multiple users. The sender first selects the authorizer set to encrypt the message and broadcast the ciphertext. Any party in the authorization set can decrypt the ciphertext with its own private key. In addition, for users who have just joined the system, if they belong to the authorization set, they can still decrypt the original ciphertext after obtaining the relevant private key without additional processing.
[0003] At present, according to the different ways of selecting authorization sets, group encryption can be roughly divided into the following types: Identity-based Broadcast Encryption (IBBE), Role-based Encryption (RBE) and Attribute-based Encryption (ABE). They specify authorization sets with "identity", "role" and "attribute" as the minimum units respectively. In particular, in CP-ABE (Ciphertext-Policy Attribute-Based Encryption), the data owner is allowed to encrypt messages under the policy consisting of the attributes of the receiver. For example, the access policy for personal health records can be defined as "((Hospital = Rehabilitation AND Role = Clinician) OR Institution = Insurance company)". This means that in addition to clinicians in rehabilitation hospitals, employees of insurance companies are also allowed to view health records. Compared with IBBE and RBE, the description method of authorized users in CP-ABE is more fine-grained and flexible. It is suitable for the protection of sensitive data in blockchain and has a more flexible authorization method. However, in the existing cryptographic technology ABE, the cryptographic strategy is usually statically bound to the encrypted data. If the strategy changes, time-consuming operations such as data re-encryption are required.
[0004] Therefore, how to implement dynamic cryptography strategies has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present invention provides an attribute-based encryption method and an attribute-based decryption method, which are used to solve the technical problem that it is difficult to meet the demand for dynamic cryptography strategies in the prior art.
[0006] The present invention provides an attribute-based encryption method, comprising: The resource provider randomly selects the first parameter from the polynomial quotient ring; Performing hash processing on the target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of the resource to be encrypted; Based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key, encrypt using a preset encryption algorithm to obtain a ciphertext; Among them, the policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, and the time-varying parameter is a parameter that changes with time.
[0007] According to an attribute-based encryption method provided by the present invention, before the resource provider randomly selects and obtains the first parameter from the polynomial quotient ring, the method further includes: The manager generates a polynomial quotient ring; The policy management entity randomly selects a second parameter from a specified sub-Gaussian distribution, and uses the second parameter as a private key of the policy management entity; The policy management entity generates a public key of the policy management entity based on the polynomial quotient ring; The private key of the policy management entity and the public key of the policy management entity are used as a key pair of the policy management entity.
[0008] The present invention provides an attribute-based decryption method, comprising: Based on the attribute credential and the cryptographic strategy, the ciphertext is decrypted to obtain the session key. The attribute credential is a one-time attribute token generated based on time and attributes.
[0009] According to an attribute-based decryption method provided by the present invention, before decrypting the ciphertext based on the attribute credential and the cryptographic strategy to obtain the session key, the method further includes: The designated attribute authorization entity generates an attribute credential of the attribute under the time-varying parameter based on the private key, the attribute, the time-varying parameter and the Gaussian parameter of the policy management entity.
[0010] According to an attribute-based decryption method provided by the present invention, the ciphertext is decrypted based on the attribute certificate and the cryptographic strategy to obtain the session key, including: Generate a cryptographic policy decision result based on an attribute credential set and a cryptographic policy, wherein the attribute credential set includes attribute credentials of multiple attributes; Based on the cryptographic strategy decision result, the ciphertext is decrypted to obtain the session key.
[0011] The present invention also provides an attribute-based encryption device, comprising the following modules: A parameter acquisition module, used for: a resource provider randomly selects a first parameter from a polynomial quotient ring; A hash processing module is used to: perform hash processing on a target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of a resource that needs to be encrypted; A session encryption module, used to: encrypt based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key using a preset encryption algorithm to obtain a ciphertext, wherein the policy management entity is an entity used to store and manage the access policy specified by the data owner; Among them, the policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, and the time-varying parameter is a parameter that changes with time.
[0012] The present invention also provides an attribute-based decryption device, comprising the following modules: The session decryption module is used to decrypt the ciphertext based on the attribute certificate and the cryptographic strategy to obtain the session key. The attribute certificate is a one-time attribute token generated based on time and attributes.
[0013] 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, any of the attribute-based encryption methods or attribute-based decryption methods described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the attribute-based encryption method or attribute-based decryption method described above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the attribute-based encryption methods or attribute-based decryption methods described above.
[0016] The attribute-based encryption method and attribute-based decryption method provided by the present invention obtain a first parameter by randomly selecting from a polynomial quotient ring by a resource provider; hash processing is performed on a target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of a resource to be encrypted; encryption is performed using a preset encryption algorithm based on the first parameter, the hash mapping result, a public key of a policy management entity, and a session key to obtain a ciphertext; wherein the policy management entity is an entity for storing and managing access policies specified by a data owner, and the policy management entity is used to generate a cryptographic policy for an access policy based on a key pair of the policy management entity, the target resource identifier, a time-varying parameter, and a Gaussian parameter, wherein the time-varying parameter is a parameter that varies with time; or, based on an attribute credential and a cryptographic policy, the ciphertext is decrypted to obtain a session key, wherein the attribute credential is a one-time attribute token generated based on time and attributes. In the attribute-based encryption method of this scheme, the cryptographic policy of the access policy is generated based on time-varying parameters, that is, the cryptographic policy is generated based on time parameters, which makes the cryptographic policy time-effective and realizes the dynamic binding of the cryptographic policy and the encrypted data; in the attribute-based decryption method of this scheme, a one-time attribute token is generated based on time and attribute, that is, the attribute and the current time are encoded at the same time, so that the generated attribute certificate is time-effective, and the decryption process does not rely on the user's private key, but uses the attribute certificate generated in real time, thereby improving the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or 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.
[0018] Figure 1 It is a flow chart of the attribute-based encryption method provided by the present invention.
[0019] Figure 2 It is a flow chart of the attribute-based decryption method provided by the present invention.
[0020] Figure 3 It is a structural schematic diagram of the attribute-based encryption device provided by the present invention.
[0021] Figure 4 It is a structural schematic diagram of the attribute-based decryption device provided by the present invention.
[0022] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0024] It should be noted that in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or position relationship indicated by the terms "upper", "lower" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be a connection between two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0025] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not 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 application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0026] Existing ABE solutions are difficult to meet the needs of blockchain, computing power network, cloud services, etc. for real-time attribute credentials and dynamic cryptographic strategies. Generally speaking, most ABEs treat user private keys as long-term decryption credentials to decrypt data, which will not reflect real-time attributes such as time and location; in addition, cryptographic strategies are usually statically bound to encrypted data, and if the strategy is changed, it will involve time-consuming operations such as data re-encryption.
[0027] In view of the above problems, the present invention proposes the following embodiments. Figure 1-Figure 5 The attribute-based encryption method and the attribute-based decryption method provided by the embodiments of the present invention are described.
[0028] Figure 1 It is a flow chart of the attribute-based encryption method provided by the present invention, such as Figure 1 As shown, including but not limited to the following steps: S110, the resource provider randomly selects a first parameter from the polynomial quotient ring; S120, performing hash processing on the target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of a resource that needs to be encrypted; S130, based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key, encrypt using a preset encryption algorithm to obtain a ciphertext.
[0029] Here, the policy management entity is an entity that stores and manages access policies specified by the data owner. The policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, a time-varying parameter and a Gaussian parameter, where the time-varying parameter is a parameter that changes over time.
[0030] It should be noted that the execution subject of the attribute-based method provided in the embodiment of the present invention may be a server or a computer device.
[0031] In S110, the resource provider generates a polynomial quotient ring from the manager. Randomly select the first parameter , used for subsequent ciphertext generation.
[0032] In S120, the target resource is identified Hash processing, hash function , mapping a bit string of arbitrary length into Random elements on the hash map result .
[0033] In S130, based on the first parameter δ, the target resource identifier , the public key of the policy management entity and session key ,calculate ,in, is a vector and connection; extraction and , the ciphertext is calculated based on the following formula : ; in, q is the modulus.
[0034] The attribute-based encryption method provided by the embodiment of the present invention obtains a first parameter by randomly selecting from a polynomial quotient ring by a resource provider; performs hash processing on a target resource identifier to obtain a hash mapping result, wherein the target resource identifier is the identification information of the resource to be encrypted; encrypts using a preset encryption algorithm based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key to obtain a ciphertext; wherein the policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, a time-varying parameter and a Gaussian parameter, wherein the time-varying parameter is a parameter that changes with time. In the attribute-based encryption method of this scheme, the cryptographic policy for the access policy is generated based on the time-varying parameter, that is, the cryptographic policy is generated based on the time parameter, so that the cryptographic policy has timeliness, and the dynamic binding of the cryptographic policy and the encrypted data is realized.
[0035] In an optional embodiment, before the resource provider randomly selects and obtains the first parameter from the polynomial quotient ring, the method further includes: The manager generates a polynomial quotient ring; The policy management entity randomly selects a second parameter from a specified sub-Gaussian distribution, and uses the second parameter as a private key of the policy management entity; The policy management entity generates a public key of the policy management entity based on the polynomial quotient ring; The private key of the policy management entity and the public key of the policy management entity are used as a key pair of the policy management entity.
[0036] Specifically, the polynomial quotient ring generated by the manager , the attribute authorization entity and the policy management entity can generate a public-private key pair through the following steps , complete the system initialization, where the attribute authorization entity is the entity used to manage the specified attributes: Randomly select from the specified sub-Gaussian distribution ; Random Selection and ; calculate ,in For vector and combination of; Finally, output the entity Key pair .
[0037] In an optional embodiment, the cryptographic policy generates Policy Management Entity Based on its key pair , Access Policy , Resource Identifier , time-varying parameters and Gaussian parameters , generate cryptographic policies . Specifically: calculate ; Extraction , so that ; Random Selection ,calculate , where the symbol It represents the XOR operation of any two bit strings. When the lengths of the input bit strings are different, the high bits of the shorter bit string can be filled in a circular manner; Will Convert to Strategy Matrix ; Randomly select vector ,in For the secret, calculate the vector ; calculate and ,in , It is a management attribute The specified attribute of the authorized entity, symbol It is the connector of two bit strings; Extraction ,calculate ,in ; Extraction ,calculate ; Finally, the output strategy Cryptography strategy ,in For cryptographic policy decisions, Used to recover session keys .
[0038] Figure 2 It is a flow chart of the attribute-based decryption method provided by the present invention. Figure 2 As shown, including but not limited to the following steps: S210, decrypting the ciphertext based on the attribute credential and the cryptographic strategy to obtain a session key, wherein the attribute credential is a one-time attribute token generated based on time and attributes.
[0039] The attribute-based decryption method provided in the embodiment of the present invention decrypts the ciphertext based on the attribute voucher and the cryptographic strategy to obtain the session key. The attribute voucher is a one-time attribute token generated based on time and attribute. In the attribute-based decryption method of this scheme, the one-time attribute token generated based on time and attribute, that is, the attribute and the current time are encoded at the same time, so that the generated attribute voucher has timeliness, and the decryption process does not rely on the user's private key, but uses the attribute voucher generated in real time, thereby improving the reliability of the system.
[0040] In an optional embodiment, before decrypting the ciphertext based on the attribute credential and the cryptographic policy to obtain the session key, the method further includes: The designated attribute authorization entity generates an attribute credential of the attribute under the time-varying parameter based on the private key, the attribute, the time-varying parameter and the Gaussian parameter of the policy management entity.
[0041] Specifying the attribute authorization entity based on Private key ,property , time-varying parameters and Gaussian parameters , calculate the attribute certificate Specifically: Specify attribute authorization entity calculation and ; Extraction , so that ; Finally, the output attributes In time-varying parameters Attribute certificate under .
[0042] Based on any of the above embodiments, decrypting the ciphertext based on the attribute certificate and the cryptographic strategy to obtain the session key includes: Generate a cryptographic policy decision result based on an attribute credential set and a cryptographic policy, wherein the attribute credential set includes attribute credentials of multiple attributes; Based on the cryptographic strategy decision result, the ciphertext is decrypted to obtain the session key.
[0043] Here, collect the credentials ,in accordance with and Generate judgment results Specifically, based on the strategy matrix , attribute credential collection , attribute sub-ciphertext and sub-ciphertext , generate cryptographic policy decision results: from Retrieve candidate invertible submatrices from , so that ; for ,calculate ; make ,calculate ,in for The first row of the inverse matrix of ; calculate ; ( Is it less than , if so, then , if not, then ),in , n is the parameter; Finally, output the judgment result .
[0044] Here, if the attribute set Satisfaction strategy , available from At least one candidate invertible submatrix is retrieved from ,and Matchable (This process can be expressed as ). Then, calculate ,in, , Secondly, for , in, ,vector , thus we can get .
[0045] for ,like No. The coefficients are close to 0. No. coefficients are set to 0; otherwise No. The coefficients are set to 1. To ensure correctness, No. Coefficient Should meet .
[0046] Further, using To decrypt The session key in Specifically, based on the following steps, according to the attribute certificate, sub-ciphertext and The ciphertext Decrypt and get the session key: calculate ; calculate ; calculate ( Is it less than , if so, then , if not, then ),in ; Finally, output the session key .
[0047] according to ,calculate ; in, Should meet , .
[0048] In summary, in business scenarios such as "East-West Data Computing" and "East-West Data Rendering" in blockchain, IoT, cloud services, and computing power networks that require large-scale data security sharing, the security of data depends on the security of the data owner's key. Once the data owner's key is stolen, the data will be leaked. However, the key security in these scenarios is not optimistic. For IoT devices, there are cost and energy consumption requirements, and many users are not aware of the security of access keys. Most of the keys are hard-coded in the code and are easier to obtain. For cloud services, blockchains, and computing power networks, many users usually provide the original keys on the cloud service, computing power service, and blockchain service platforms for hosting and management. This method leads to the risk of data being spied on by platform operators. In addition, the key generation, distribution, and access control strategies of these platforms are basically independent processes. Encryption and decryption require multiple interactions, and the key management process is complicated, which affects the efficiency of encryption and decryption. The attribute-based encryption method and attribute-based decryption method provided by the present invention simultaneously encode the attributes and the current time during the sampling process to make the credential time-effective; an algorithm for generating a cryptographic policy based on time parameters is proposed to make the generated cryptographic policy time-effective and dynamically bound to the encrypted data; the decryption process does not rely on the user's private key, but instead uses a one-time attribute token (i.e., credential), which improves the reliability of the system, better compensates for the shortcomings of the above-mentioned scenarios, realizes one-time one-credential, dynamic cryptographic strategy to simplify the key management process, and has the ability to resist quantum attacks.
[0049] The attribute-based encryption device provided by an embodiment of the present invention is described below. The attribute-based encryption device described below and the attribute-based encryption method described above can be referred to each other.
[0050] Figure 3 is a schematic diagram of the structure of the attribute-based encryption device provided by the present invention, such as Figure 3 As shown, the attribute-based encryption device may include but is not limited to; The parameter acquisition module 310 is used for: the resource provider randomly selects and obtains a first parameter from the polynomial quotient ring; The hash processing module 320 is used to: perform hash processing on the target resource identifier to obtain a hash mapping result, wherein the target resource identifier is the identification information of the resource to be encrypted; The session encryption module 330 is used to: encrypt based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key using a preset encryption algorithm to obtain a ciphertext, wherein the policy management entity is an entity used to store and manage the access policy specified by the data owner; Among them, the policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, and the time-varying parameter is a parameter that changes with time.
[0051] It should be noted that the attribute-based encryption device provided in the embodiment of the present invention can execute the attribute-based encryption method described in any of the above embodiments during specific operation, which will not be described in detail in this embodiment.
[0052] The attribute-based encryption device provided by the embodiment of the present invention obtains a first parameter by randomly selecting from a polynomial quotient ring by a resource provider; performs hash processing on a target resource identifier to obtain a hash mapping result, wherein the target resource identifier is the identification information of the resource to be encrypted; encrypts using a preset encryption algorithm based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key to obtain a ciphertext; wherein the policy management entity is an entity for storing and managing access policies specified by a data owner, and the policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, a time-varying parameter and a Gaussian parameter, wherein the time-varying parameter is a parameter that changes with time. In the attribute-based encryption method of this scheme, a cryptographic policy for the access policy is generated based on a time-varying parameter, that is, the cryptographic policy is generated based on a time parameter, so that the cryptographic policy has timeliness, and dynamic binding of the cryptographic policy with encrypted data is achieved.
[0053] The attribute-based decryption device provided by an embodiment of the present invention is described below. The attribute-based decryption device described below and the attribute-based decryption method described above can be referred to each other.
[0054] Figure 4 is a schematic diagram of the structure of the attribute-based decryption device provided by the present invention. Figure 4 As shown, the attribute-based decryption device may include but is not limited to; The session decryption module 410 is used to decrypt the ciphertext based on the attribute certificate and the cryptographic strategy to obtain the session key. The attribute certificate is a one-time attribute token generated based on time and attributes.
[0055] It should be noted that the attribute-based decryption device provided in the embodiment of the present invention can execute the attribute-based decryption method described in any of the above embodiments when it is specifically run, which will not be described in detail in this embodiment.
[0056] The attribute-based decryption device provided by the embodiment of the present invention decrypts the ciphertext based on the attribute voucher and the cryptographic strategy to obtain the session key. The attribute voucher is a one-time attribute token generated based on time and attribute. In the attribute-based decryption method of this scheme, the one-time attribute token generated based on time and attribute, that is, the attribute and the current time are encoded at the same time, so that the generated attribute voucher has timeliness, and the decryption process does not rely on the user's private key, but uses the attribute voucher generated in real time, thereby improving the reliability of the system.
[0057] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communications interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the attribute-based encryption method and the attribute-based decryption method, which includes: The resource provider randomly selects the first parameter from the polynomial quotient ring; Performing hash processing on the target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of the resource to be encrypted; Based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key, encrypt using a preset encryption algorithm to obtain a ciphertext; The policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy of the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, wherein the time-varying parameter is a parameter that changes with time; Or, include: Based on the attribute credential and the cryptographic strategy, the ciphertext is decrypted to obtain the session key. The attribute credential is a one-time attribute token generated based on time and attributes.
[0058] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this 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 a number of instructions to enable 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: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0059] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the attribute-based encryption method and the attribute-based decryption method provided by the above methods, the method includes: The resource provider randomly selects the first parameter from the polynomial quotient ring; Performing hash processing on the target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of the resource to be encrypted; Based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key, encrypt using a preset encryption algorithm to obtain a ciphertext; The policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy of the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, wherein the time-varying parameter is a parameter that changes with time; Or, include: Based on the attribute credential and the cryptographic strategy, the ciphertext is decrypted to obtain the session key. The attribute credential is a one-time attribute token generated based on time and attributes.
[0060] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the attribute-based encryption method and the attribute-based decryption method provided by the above methods, the method comprising: The resource provider randomly selects the first parameter from the polynomial quotient ring; Performing hash processing on the target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of the resource to be encrypted; Based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key, encrypt using a preset encryption algorithm to obtain a ciphertext; The policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy of the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, wherein the time-varying parameter is a parameter that changes with time; Or, include: Based on the attribute credential and the cryptographic strategy, the ciphertext is decrypted to obtain the session key. The attribute credential is a one-time attribute token generated based on time and attributes.
[0061] 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.
[0062] 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, 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.
[0063] 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. An attribute-based encryption method, characterized in that: include: The resource provider randomly selects the first parameter from the polynomial quotient ring; Performing hash processing on the target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of the resource to be encrypted; Based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key, encrypt using a preset encryption algorithm to obtain a ciphertext; Among them, the policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, and the time-varying parameter is a parameter that changes with time.
2. The attribute-based encryption method according to claim 1, characterized in that: Before the resource provider randomly selects and obtains the first parameter from the polynomial quotient ring, the method further includes: The manager generates a polynomial quotient ring; The policy management entity randomly selects a second parameter from a specified sub-Gaussian distribution, and uses the second parameter as a private key of the policy management entity; The policy management entity generates a public key of the policy management entity based on the polynomial quotient ring; The private key of the policy management entity and the public key of the policy management entity are used as a key pair of the policy management entity.
3. An attribute-based decryption method, characterized in that: include: Based on the attribute credential and the cryptographic strategy, the ciphertext is decrypted to obtain the session key. The attribute credential is a one-time attribute token generated based on time and attributes.
4. The attribute-based decryption method according to claim 3, characterized in that: Before decrypting the ciphertext based on the attribute certificate and the cryptographic strategy to obtain the session key, the method further includes: The designated attribute authorization entity generates an attribute credential of the attribute under the time-varying parameter based on the private key, the attribute, the time-varying parameter and the Gaussian parameter of the policy management entity.
5. The attribute-based decryption method according to claim 3 or 4, characterized in that: The method of decrypting the ciphertext based on the attribute certificate and the cryptographic strategy to obtain the session key includes: Generate a cryptographic policy decision result based on an attribute credential set and a cryptographic policy, wherein the attribute credential set includes attribute credentials of multiple attributes; Based on the cryptographic strategy decision result, the ciphertext is decrypted to obtain the session key.
6. An attribute-based encryption device, characterized in that: include: A parameter acquisition module, used for: a resource provider randomly selects a first parameter from a polynomial quotient ring; A hash processing module is used to: perform hash processing on a target resource identifier to obtain a hash mapping result, wherein the target resource identifier is identification information of a resource that needs to be encrypted; A session encryption module, used to: encrypt based on the first parameter, the hash mapping result, the public key of the policy management entity and the session key using a preset encryption algorithm to obtain a ciphertext, wherein the policy management entity is an entity used to store and manage the access policy specified by the data owner; Among them, the policy management entity is an entity that stores and manages the access policy specified by the data owner, and the policy management entity is used to generate a cryptographic policy for the access policy based on the key pair of the policy management entity, the target resource identifier, the time-varying parameter and the Gaussian parameter, and the time-varying parameter is a parameter that changes with time.
7. An attribute-based decryption device, characterized in that: include: The session decryption module is used to decrypt the ciphertext based on the attribute certificate and the cryptographic strategy to obtain the session key. The attribute certificate is a one-time attribute token generated based on time and attributes.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the attribute-based encryption method according to any one of claims 1 to 2 is implemented, or the attribute-based decryption method according to any one of claims 3 to 5 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the attribute-based encryption method according to any one of claims 1 to 2 is implemented, or the attribute-based decryption method according to any one of claims 3 to 5 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the attribute-based encryption method according to any one of claims 1 to 2 is implemented, or the attribute-based decryption method according to any one of claims 3 to 5 is implemented.
Citation Information
Patent Citations
Attribute-based hybrid encryption method capable of tracing leaked secret key
CN104168108A
Cryptography attribute-based access control method and system based on dynamic rule
CN107864139A
Time domain-based encryption and strategy updating method for edge environment
CN110933052A
Blockchain data supervision method and system based on attribute encryption
CN111859444A
Attribute-based access control method on block chain
CN113761583A
Cited By
Authority management method and system for double-token decoupling and dynamic token mapping
CN120768687A
A permission management method and system based on dual-token decoupling and dynamic token mapping
CN120768687B
Trusted data space construction method, equipment, storage medium and system
CN121356911A