Revocable file layering CP-ABE method based on Chinese remainder theorem
By introducing the access tree structure and user binary tree in the cloud environment, combined with the Chinese Remainder Theorem, the encryption strategy construction and key management of the CP-ABE method are optimized, solving the low efficiency and key management problems in the traditional method, and achieving rapid revocation and updates that improve security and performance.
Patent Information
- Application Number
- CN202410889698.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-15
AI Technical Summary
In the cloud environment, the traditional CP-ABE scheme is inefficient when encrypting files at different levels, and the revocation and update process of user keys or file ciphertexts has problems of key leakage and resource consumption.
The revocability file hierarchical CP-ABE method based on the Chinese Remainder Theorem is adopted. By introducing the access tree structure and the user binary tree, the encryption strategy construction is optimized, and the Chinese Remainder Theorem is used to achieve rapid revocation and update of the user key.
It improves the speed and efficiency of the encryption and decryption process, reduces the time overhead of revocation and update, and reduces the risk of key leakage and resource consumption.
Smart Images

Figure CN118784307A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of encryption technology, and in particular to a revocable file layering CP-ABE method based on the Chinese remainder theorem. Background Art
[0002] With the widespread popularization and in-depth development of cloud computing technology, data migration to cloud environments has become an important means for many enterprises and units to reduce computing costs and improve management efficiency. However, in this process, the security and privacy protection issues of corporate secrets, unit sensitive information, and user personal data are particularly prominent. The storage and circulation of data in cloud environments must ensure that the privacy of sensitive data is protected. At the same time, when accessing data, it is also necessary to ensure that only users with corresponding permissions can obtain and use relevant information. Traditional access control methods can no longer meet the current complex and ever-changing data security needs. Therefore, ciphertext policy attribute encryption technology (CP-ABE) as an effective means to achieve fine-grained access control is widely used in data storage and access in cloud environments.
[0003] However, there are still a series of challenges when applying CP-ABE schemes in cloud environments. On the one hand, there are many types of files in enterprises and units, and the permission levels are complex. When encrypting files at different levels, the existing CP-ABE schemes need to construct multiple access policies based on the permission characteristics of the files, resulting in a long and inefficient process of file encryption, decryption and storage. On the other hand, personnel changes often occur in enterprises and units, which requires timely revocation and update of user keys or file ciphertexts. However, traditional revocable CP-ABE mechanisms are often implemented based on key updates or re-encryption, which may not only cause security risks of key leakage, but also consume a lot of resources. Therefore, it is necessary to develop a CP-ABE method with hierarchical file encryption and quick and secure revocation of users. Summary of the invention
[0004] The purpose of the present invention is to provide a revocable file layering CP-ABE method based on the Chinese remainder theorem.
[0005] To achieve the purpose of the present invention, the technical solution provided by the present invention is specifically as follows:
[0006] The present invention provides a revocable file layering CP-ABE method based on the Chinese remainder theorem, comprising the following steps:
[0007] Step S1: The central authority executes the Setup algorithm to generate a system master key and a system public key according to system security parameters;
[0008] Step S2: The central authority executes the KeyGen algorithm and the AES key generation algorithm to generate CP-ABE keys for data accessors and different AES encryption keys corresponding to different levels for data owners;
[0009] Step S3: The data owner executes the Encryption algorithm to encrypt and upload the file;
[0010] Step S4: The data accessor formulates a Decryption algorithm. The data accessor can download the hierarchical key ciphertext and file ciphertext through the cloud server according to his needs. After the download is completed, the hierarchical key ciphertext is first decrypted using his own CP-ABE key to obtain an AES key set that meets his own attribute set, and then the AES key is used to decrypt the corresponding file ciphertext to obtain the file;
[0011] Step S5: The central authority executes the Revocation algorithm, inputs the ID of the data accessor, revokes its CP-ABE key and updates the revocation ciphertext;
[0012] Step S6: The central authority executes the Update algorithm, inputs the ID of the data accessor, updates its CP-ABE key and updates the revocation ciphertext.
[0013] Compared with the prior art, the present invention has the following beneficial effects:
[0014] The solution provided by the present invention first constructs the access policy by introducing an access tree structure including transmission nodes and storage nodes, and optimizes the polynomial construction method in the traditional CP-ABE to make it more adaptable to the access tree structure introducing transmission nodes and storage nodes, thereby improving the flexibility and efficiency of the policy construction and speeding up the encryption and decryption process, and realizing hierarchical access to files. In terms of revocation, the present invention innovatively combines the Chinese remainder theorem with the user binary tree to realize the rapid revocation and update of user keys, saving time and effectively solving the key leakage and resource consumption problems that may exist in the traditional revocable CP-ABE mechanism. The details are as follows:
[0015] (1) The present invention generates the master key and public key of the system through a central authorization agency, generates an AES key set for the data owner, generates a CP-ABE key for the data accessor, and generates a revocation ciphertext; the data owner performs an encryption operation on the file, uses the AES key set to encrypt the hierarchical file, formulates a hierarchical access strategy, encrypts the AES key set, and uploads the ciphertext to the cloud server; the cloud server stores the ciphertext and combines the AES key ciphertext with the revocation ciphertext uploaded by the central authorization agency to generate a hierarchical key ciphertext for storage, and transmits the ciphertext in the system; the data accessor downloads the ciphertext from the cloud server and decrypts the AES key ciphertext into an AES key set, and then uses the AES key to decrypt the corresponding file ciphertext to obtain the file. The present invention optimizes the polynomial construction method in the traditional CP-ABE, making it more suitable for introducing the access tree structure of the transmission node and the storage node, improving the flexibility and efficiency of the policy construction and thus speeding up the encryption and decryption process.
[0016] (2) The present invention innovatively combines the Chinese remainder theorem with the user binary tree, divides the user key into two parts, one part is associated with the user binary tree constructed according to the data accessor, and realizes efficient revocation and update of the user key based on the Chinese remainder theorem, effectively solving the key leakage and resource consumption problems that may exist in the traditional revocable CP-ABE mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of the overall process provided by an embodiment of the present invention;
[0018] Figure 2 A schematic diagram of a hierarchical access structure tree provided in an embodiment of the present invention;
[0019] Figure 3 A schematic diagram of a user binary tree structure including 7 users provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention provides a revocable file layering CP-ABE method based on the Chinese remainder theorem, comprising the following steps:
[0021] Step S1: The central authority executes the Setup algorithm to generate a system master key and a system public key according to system security parameters;
[0022] Step S2: The central authority executes the KeyGen algorithm and the AES key generation algorithm. Specifically, the central authority will establish a user binary tree based on the identities of all data accessors. The KeyGen algorithm generates CP-ABE keys for data accessors based on the attribute set of data accessors and the user binary tree. The AES key generation algorithm generates different AES encryption keys corresponding to different levels for data owners.
[0023] Step S3: The data owner executes the Encryption algorithm; specifically, firstly, the AES keys corresponding to different levels are used to encrypt the files at different levels, and then the data owner performs CP-ABE encryption on the AES key set containing different levels based on the hierarchical access structure tree associated with the set hierarchical access control policy, and then uploads the AES key ciphertext and the file ciphertext to the cloud server together; the central authorization agency generates the revocation ciphertext based on the Chinese remainder theorem according to the user binary tree, and then uploads the revocation ciphertext to the cloud server; the cloud server combines the AES key ciphertext with the revocation ciphertext to form the hierarchical key ciphertext;
[0024] Step S4: The data accessor formulates a Decryption algorithm. The data accessor can download the hierarchical key ciphertext and file ciphertext through the cloud server according to his needs. After the download is completed, the hierarchical key ciphertext is first decrypted using his own CP-ABE key to obtain an AES key set that meets his own attribute set, and then the AES key is used to decrypt the corresponding file ciphertext to obtain the file;
[0025] Step S5: The central authority executes the Revocation algorithm, inputs the ID of the data accessor, revokes its CP-ABE key and updates the revocation ciphertext;
[0026] Step S6: The central authority executes the Update algorithm, inputs the data accessor's ID, updates its CP-ABE key and updates the revocation ciphertext.
[0027] Furthermore, in step S2, the user binary tree constructed according to the data accessor set is defined as follows: Let U be a set of users in the system, and the user binary tree τ U It is depicted as follows: the leaf nodes of the binary tree are associated with user u, defined as user nodes, let |U| be the number of users, the number of nodes in the tree is 2|U|-1, and the nodes are numbered according to the breadth-first search, for example, the root is 0 and the last node is 2|U|-2; path(i) is defined as the path from the root node to node i, path(u i ) is defined as the distance from the root node to the user node u i For example, in the user binary tree constructed by 7 data visitors, path(3) = {0,1,3}, path(u2) = {0,1,3,7}.
[0028] Furthermore, in step S2, a minimum included node set is defined in the user binary tree, which is defined as follows: for a given leaf node set, there exists a minimum node set such that the nodes in the set themselves or their descendant nodes just contain the given leaf node set. This minimum node set is called the minimum included node set.
[0029] Furthermore, in step S3, the hierarchical access structure tree is defined as follows: Assume τ A It is a tree representing a hierarchical access structure with the root node R, which is divided into k access levels from top to bottom. The nodes in the tree can be divided into hierarchical nodes, transmission nodes, attribute nodes and storage nodes, and the root node is the highest hierarchical node; the child nodes of the hierarchical nodes can be attribute nodes and transmission nodes; the child nodes of the transmission node are composed of a hierarchical node and a storage node; the storage node is a leaf node with no child nodes, which is responsible for storing the relevant parameters required for obtaining keys from top to bottom; the leaf nodes other than the storage nodes are attribute nodes, which are represented as user attributes; each non-leaf node is represented as a threshold gate, and the hierarchical node threshold gate can be represented as (m,n), m≤n, n is the number of child nodes, and m is the threshold. The transmission node threshold gate is AND or OR, and AND means that upward transmission is not allowed, and OR means that upward transmission is allowed.
[0030] Furthermore, in step S6, when the user's attribute set changes and the key needs to be updated, the central authorization agency needs to re-use the key generation algorithm to generate the user's CP-ABE key. When the user's attribute set does not change and the key needs to be updated, the central authorization agency only needs to use the update algorithm to update the user's CP-ABE key.
[0031] Furthermore, the step S1 specifically includes the following:
[0032] S1.1: The central authority executes the system initialization algorithm Setup (1 λ ): Initialization algorithm Setup(1 λ ) Select the system security parameter λ and generate the system parameters (G,G) through the group generation function T ,g,e), where G and G T are two cyclic groups of prime order p, g is a generator of G, and e is a bilinear map;
[0033] S1.2: Randomly select two α, β∈Z p , calculate and generate the system master key as MSK = (β, g α ) and the system public key PK=(g,e(g,g) α ,g β ).
[0034] Furthermore, the step S2 specifically includes the following:
[0035] S2.1: The central authority executes the key generation algorithm KeyGen(MSK,S,τ U ): Key generation algorithm KeyGen(MSK,S,τ U ) Input is the system master key MSK, the data accessor attribute set S and the user binary tree τ constructed by the data accessor set U , first the algorithm selects a random r∈Z p , are the attributes s1, s2, …, s in the data accessor attribute set S n Randomly select r1,r2,...,r n ∈Z p , and calculate Then for each node N of the user binary tree i ∈τ U Randomly select a large prime number m i , a random number a i ∈Z p , for all nodes N1,N2,…N k ∈τ U calculate For all nodes in the user binary tree, establish a set of equations:
[0036] x≡a1 mod m1
[0037] x≡a2 mod m2
[0038] …
[0039] x≡a k mod m k
[0040] when When , we can calculate: Get the path path (u i ), then the data accessor private key
[0041] S2.2: The central authority executes the AES key generation algorithm to generate an AES key set sk for the data owner to encrypt files at different levels.
[0042] Furthermore, the step S3 specifically includes the following:
[0043] S3.1: The data owner executes the encryption algorithm Encryption(PK, sk, τ A ,τ U): Encryption algorithm Encryption(PK,sk,τ A ,τ U ) Input is the system public key PK, AES key set sk, hierarchical access structure tree τ A , user binary tree τ U ,The data owner uses the AES keys corresponding to different levels to encrypt files at different levels and generate file ciphertext;
[0044] S3.2: The data owner performs CP-ABE encryption on the AES key set containing different levels based on the set hierarchical access control policy. A For the symmetric hierarchical key sk = {sk1, sk2, ..., sk k} is encrypted, and k hierarchical nodes are set from top to bottom in the hierarchical access strategy tree.
[0045] Corresponding to sk1, sk2, ..., sk k , and for each level node, according to its threshold gate (v, w) to ensure q parent(x) (0) = q x (1) under the premise of randomly generating the v-1 degree polynomial q corresponding to the node of this level x , so that q x (0) = S, store the coefficient set of the polynomial corresponding to the hierarchical node in the storage node with the same level, so as to obtain the secret value from top to bottom, and assign the value q to the w-1 child nodes of the hierarchical node except the transmission node. x (2)…q x (n). Only when the values corresponding to at least v child nodes are obtained can the polynomial corresponding to the hierarchical node be solved and the secret value obtained. For a transmission node whose child node is a hierarchical node, its value is defined as the secret value S corresponding to the child hierarchical node. k , if the transmission node threshold gate is "AND", the value will no longer be transmitted upward, if it is "OR", the value is allowed to be transmitted upward. Assume that J is a hierarchical access structure tree τ A The set of middle-level nodes, T is the hierarchical access structure tree τ A The collection of attribute nodes in the structure tree τ A Calculate and output the AES key ciphertext:
[0046]
[0047] Where H:{0,1} * →G is a random oracle, which maps any attribute described as a binary string to a group element. att(t) refers to the attribute binary string represented by the attribute node t.
[0048] S3.3: The data owner uploads the AES key ciphertext and the file ciphertext to the cloud server;
[0049] S3.4: The central authority will generate the revocation ciphertext CT based on the user binary tree and the Chinese remainder theorem re =(x), then upload the revocation ciphertext to the cloud server;
[0050] S3.5: The cloud server combines the AES key ciphertext and the revocation ciphertext to form a hierarchical key ciphertext CT H .
[0051] Furthermore, the step S4 specifically includes the following:
[0052] S4.1: The data accessor downloads the file ciphertext and hierarchical key ciphertext from the cloud server;
[0053] S4.2: The data accessor executes the decryption algorithm Decryption (CT H ,SK): Decryption algorithm Decryption (CT H ,SK) Input hierarchical key ciphertext CT H , the data accessor's private key SK, first the decryption algorithm will verify the identity of the data accessor, check the legitimacy of the data accessor's access, and follow the path path (u k ) Verify x≡a for all nodes along the path from the root node to the user node in turn k (mod m k ) is correct. If all nodes pass the verification, it means that the data accessor is legitimate. Otherwise, the data accessor is deemed to be illegitimate and the decryption is interrupted.
[0054] S4.3: If the data accessor passes the identity authentication, the hierarchical key ciphertext decryption phase is entered. The decryption process is a recursive process. The recursive algorithm DecNode(CT H ,SK,y), the input is the hierarchical key ciphertext CT H , the data accessor private key SK and τ associated with the attribute set S A If a node y is an attribute node, let i = att(y). If i∈S, then
[0055]
[0056] if Then DecNode(CT H ,SK,y)=⊥. When j is a hierarchical node, calculate DecNode(CT H ,SK,z) and save the result as F z , let Sj For any v results F z ≠⊥, v is the lowest threshold that satisfies the threshold gate (v, w) of the level node. If there is no such set, the decryption of the level node j fails; otherwise, it is calculated under the hierarchical access structure tree.
[0057]
[0058] Continue the calculation using Lagrange interpolation:
[0059]
[0060] Set for level node j Then the private key sk corresponding to the hierarchical node can be calculated j =C j / (e(C,D) / A)=C j / (e(h s ,g (α+r) / β ) / e(g,g) rs );
[0061] S4.4: Then check the threshold of the parent node of the hierarchical node, that is, the threshold of the transmission node. If the threshold is AND, it means that upward transmission is not allowed, and the decryption ends. If the threshold is OR, it means that upward transmission is allowed, and the transmission node is regarded as a result of the data accessor F z ≠⊥ attribute nodes, repeat step S4.3 until decryption of a certain level node fails;
[0062] S4.5: If the child nodes of the hierarchical node j include the transmission node, the sk corresponding to the hierarchical child nodes of the transmission node can be obtained through the storage child nodes of the transmission node. Repeat until the sk of the hierarchical node whose child nodes do not include the transmission node is obtained. The decryption is completed.
[0063] Furthermore, the step S5 specifically includes the following:
[0064] S5.1: The central authority executes the revocation algorithm Revocation (U i ,τ U ): Revocation algorithm Revocation (U i ,τ U ) Input the ID of the data visitor, and the user binary tree τ associated with the data visitor set U When revoking a single user, the a value of the user node corresponding to the user in the user binary tree is modified to a'. After the modification, the x value changes to x'. At this time, when performing user verification, x'≡a' (mod m) will not hold, and the revocation of the single user is completed;
[0065] S5.2: When revoking multiple users, query the user node set corresponding to the revoked user set in the user binary tree, obtain the minimum included node set corresponding to the user node set, modify the a value of the node in the minimum included node set to a', and after the modification, the x value changes to x'. At this time, x'≡a' (mod m) will not hold during user verification, and the revocation of multiple users is completed.
[0066] Furthermore, the step S6 specifically includes the following:
[0067] S6.1: The central authority executes the update algorithm Update (U i ,τ U ): Update algorithm Update(U i ,τ U ) Input the ID of the data visitor, and the user binary tree τ associated with the data visitor set U , when a single user needs to update, the a value of the user node corresponding to the user in the user binary tree is modified to a', and the m value is modified to m'. After the modification, the x value is changed to x'. At this time, when performing user verification, x'≡a' (mod m') will still hold, and the update of the single user is completed;
[0068] S6.2: When multiple users need to update operations, query the user node set corresponding to the updated user set in the user binary tree, obtain the minimum included node set corresponding to the user node set, modify the a value of the node in the minimum included node set to a', and the m value to m'. After the modification, the x value changes to x'. At this time, when performing user verification, x'≡a' (mod m') will still hold, and the key ciphertext update for multiple users is completed.
[0069] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0070] like Figure 1 As shown, this embodiment provides a revocable file hierarchical CP-ABE method based on the Chinese remainder theorem, and the overall process is:
[0071] S1: System initialization phase, the central authority CA generates the system master key and system public key according to the system initialization result, and sends the system public key to the data owner DO; specifically:
[0072] S1.1: The central authority executes the system initialization algorithm Setup (1 λ ): Initialization algorithm Setup(1 λ ) Select the system security parameter λ and generate the system parameters (G,G) through the group generation function T,g,e), where G and G T are two cyclic groups of prime order p, g is a generator of G, and e is a bilinear map;
[0073] S1.2: Randomly select two α, β∈Z p , calculate and generate the system master key as MSK = (β, g α ) and the system public key PK=(g,e(g,g) α ,g β ).
[0074] S2: Private key distribution phase: the central authority CA generates an AES key set {sk1, sk2, sk3} for the data owner DO and distributes the private key to the three data accessors DV1, DV2, and DV3 according to their respective
[0075] The attribute collection of Generate respective CP-ABE keys SK1, SK2, SK3;
[0076] Specifically:
[0077] S2.1: The central authority executes the key generation algorithm KeyGen(MSK,S,τ U ): Key generation algorithm KeyGen(MSK,S,τ U ) Input is the system master key MSK, the data accessor attribute set S and the user binary tree τ constructed by the data accessor set U , first the algorithm selects a random r∈Z p , are the attributes s1, s2, ..., s in the data accessor attribute set S n Randomly select r1,r2,...,r n ∈Z p , and calculate Then for each node N of the user binary tree i ∈τ U Randomly select a large prime number m i , a random number a i ∈Z p , for all nodes N1,N2,...N k ∈τ U calculate For all nodes in the user binary tree, establish a set of equations:
[0078] x≡a1 mod m1
[0079] x≡a2 mod m2
[0080] …
[0081] x≡ak mod m k
[0082] when When , we can calculate: Get the path path (u i ), then the data accessor private key like Figure 3 , which is a schematic diagram of a user binary tree structure including 7 users.
[0083] S2.2: The central authority executes the AES key generation algorithm to generate an AES key set sk for the data owner to encrypt files at different levels.
[0084] S3: In the file encryption upload phase, the data owner DO uses the AES key set {sk1, sk2, sk3} to encrypt the hierarchical files m1, m2, and m3 to generate file ciphertexts, and then uses the access policy specified by the data owner DO to generate the ciphertexts. Figure 2 The hierarchical access structure tree shown encrypts the AES key set {sk1, sk2, sk3} to generate AES key ciphertext, uploads the file ciphertext and the AES ciphertext to the cloud server CS, and the central authority CA generates a revocation ciphertext based on the user binary tree and uploads it to the cloud server CS. The cloud server CS combines the revocation ciphertext with the AES key ciphertext to generate a hierarchical key ciphertext.
[0085] Specifically:
[0086] S3.1: The data owner executes the encryption algorithm Encryption(PK, sk, τ A ,τ U ): Encryption algorithm Encryption(PK,sk,τ A ,τ U ) Input is the system public key PK, AES key set sk, hierarchical access structure tree τ A , user binary tree τ U ,The data owner uses the AES keys corresponding to different levels to encrypt files at different levels and generate file ciphertext;
[0087] S3.2: The data owner performs CP-ABE encryption on the AES key set containing different levels based on the set hierarchical access control policy. A For the symmetric hierarchical key sk = {sk1, sk2, ..., sk k} is encrypted, and k hierarchical nodes are set from top to bottom in the hierarchical access strategy tree, corresponding to sk1, sk2, ..., sk k, and for each level node, according to its threshold gate (v, w) to ensure q parent(x) (0) = q x (1) under the premise of randomly generating the v-1 degree polynomial q corresponding to the node of this level x , so that q x (0) = S, store the coefficient set of the polynomial corresponding to the hierarchical node in the storage node with the same level, so as to obtain the secret value from top to bottom, and assign the value q to the w-1 child nodes of the hierarchical node except the transmission node. x (2)…q x (n). Only when the values corresponding to at least v child nodes are obtained can the polynomial corresponding to the hierarchical node be solved and the secret value obtained. For a transmission node whose child node is a hierarchical node, its value is defined as the secret value S corresponding to the child hierarchical node. k , if the transmission node threshold gate is "AND", the value will no longer be transmitted upward, if it is "OR", the value is allowed to be transmitted upward. Assume that J is a hierarchical access structure tree τ A The set of middle-level nodes, T is the hierarchical access structure tree τ A The collection of attribute nodes in the structure tree τ A Calculate and output the AES key ciphertext:
[0088]
[0089] Where H:{0,1} * →G is a random oracle, which maps any attribute described as a binary string to a group element. att(t) refers to the attribute binary string represented by the attribute node t.
[0090] S3.3: The data owner uploads the AES key ciphertext and the file ciphertext to the cloud server;
[0091] S3.4: The central authority will generate the revocation ciphertext CT based on the user binary tree and the Chinese remainder theorem re =(x), then upload the revocation ciphertext to the cloud server;
[0092] S3.5: The cloud server combines the AES key ciphertext and the revocation ciphertext to form a hierarchical key ciphertext CT H .
[0093] S4: Ciphertext download and decryption phase. The data accessor DV downloads the file ciphertext and the hierarchical key ciphertext from the cloud server CS, uses the CP-ABE key to decrypt the hierarchical key ciphertext to obtain the AES key set, and then uses the AES key to decrypt the corresponding file ciphertext to obtain the file. Figure 1In the flowchart shown, user DV1 can decrypt to obtain sk3, and then obtain file m3. User DV2 can decrypt to obtain sk1, sk2, sk3, and then obtain files m1, m2, m3. User DV3 cannot decrypt to obtain any file.
[0094] Specifically:
[0095] S4.1: The data accessor downloads the file ciphertext and hierarchical key ciphertext from the cloud server;
[0096] S4.2: The data accessor executes the decryption algorithm Decryption (CT H ,SK): Decryption algorithm Decryption (CT H ,SK) Input hierarchical key ciphertext CT H , the data accessor's private key SK, first the decryption algorithm will verify the identity of the data accessor, check the legitimacy of the data accessor's access, and follow the path path (u k ) Verify x≡a for all nodes along the path from the root node to the user node in turn k (mod m k ) is correct. If all nodes pass the verification, it means that the data accessor is legitimate. Otherwise, the data accessor is deemed to be illegitimate and the decryption is interrupted.
[0097] S4.3: If the data accessor passes the identity authentication, the hierarchical key ciphertext decryption phase is entered. The decryption process is a recursive process. The recursive algorithm DecNode(CT H ,SK,y), the input is the hierarchical key ciphertext CT H , the data accessor private key SK and τ associated with the attribute set S A If a node y is an attribute node, let i = att(y). If i∈S, then
[0098]
[0099] if Then DecNode(CT H ,SK,y)=⊥. When j is a hierarchical node, calculate DecNode(CT H ,SK,z) and save the result as F z , let S j For any v results F z ≠⊥, v is the lowest threshold that satisfies the threshold gate (v, w) of the level node. If there is no such set, the decryption of the level node j fails; otherwise, it is calculated under the hierarchical access structure tree:
[0100]
[0101] Continue the calculation using Lagrange interpolation:
[0102]
[0103] Set for level node j Then the private key sk corresponding to the hierarchical node can be calculated j =C j / (e(C,D) / A)=C j / (e(h s ,g (α+r) / β ) / e(g,g) rs );
[0104] S4.4: Then check the threshold of the parent node of the hierarchical node, that is, the threshold of the transmission node. If the threshold is AND, it means that upward transmission is not allowed, and the decryption ends. If the threshold is OR, it means that upward transmission is allowed, and the transmission node is regarded as a result of the data accessor F z ≠⊥ attribute nodes, repeat step S4.3 until decryption of a certain level node fails;
[0105] S4.5: If the child nodes of the hierarchical node j include the transmission node, the sk corresponding to the hierarchical child nodes of the transmission node can be obtained through the storage child nodes of the transmission node. Repeat until the sk of the hierarchical node whose child nodes never include the transmission node is obtained. The decryption is now completed.
[0106] S5: User revocation stage, when revoking the data accessor DV, the central authorization agency CA inputs the data accessor DV identity ID, updates the data accessor DV key parameters and revocation ciphertext; S5, user revocation: the central authorization agency executes the Revocation algorithm, inputs the data accessor ID, revokes its CP-ABE key and updates the revocation ciphertext. Specifically:
[0107] S5.1: The central authority executes the revocation algorithm Revocation (U i ,τ U ): Revocation algorithm Revocation (U i ,τ U ) Input the ID of the data visitor, and the user binary tree τ associated with the data visitor set U When revoking a single user, the a value of the user node corresponding to the user in the user binary tree is modified to a'. After the modification, the x value changes to x'. At this time, when performing user verification, x'≡a' (mod m) will not hold, and the revocation of the single user is completed;
[0108] S5.2: When revoking multiple users, query the user node set corresponding to the revoked user set in the user binary tree, obtain the minimum included node set corresponding to the user node set, modify the a value of the node in the minimum included node set to a', and after the modification, the x value changes to x'. At this time, x'≡a' (mod m) will not hold during user verification, and the revocation of multiple users is completed.
[0109] S6: User key update phase. When the data accessor DV is updated, the central authority CA inputs the data accessor DV identity id, updates some parameters of the data accessor DV key and revokes the ciphertext.
[0110] Specifically:
[0111] S6.1: The central authority executes the update algorithm Update (U i ,τ U ): Update algorithm Update(U i ,τ U ) Input the ID of the data visitor, and the user binary tree τ associated with the data visitor set U , when a single user needs to update, the a value of the user node corresponding to the user in the user binary tree is modified to a', and the m value is modified to m'. After the modification, the x value is changed to x'. At this time, when performing user verification, x'≡a' (mod m') will still hold, and the update of the single user is completed;
[0112] S6.2: When multiple users need to update operations, query the user node set corresponding to the updated user set in the user binary tree, obtain the minimum included node set corresponding to the user node set, modify the a value of the node in the minimum included node set to a', and the m value to m'. After the modification, the x value changes to x'. At this time, when performing user verification, x'≡a' (mod m') will still hold, and the key ciphertext update for multiple users is completed.
[0113] The optional implementation modes of the embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above implementation modes. Within the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical scheme of the embodiments of the present invention, and these simple modifications all belong to the protection scope of the embodiments of the present invention.
Claims
1. A CP-ABE method for revocable file stratification based on the Chinese remainder theorem, characterized in that: The steps include: Step S1: The central authority executes the Setup algorithm to generate a system master key and a system public key according to system security parameters; Step S2: The central authority executes the KeyGen algorithm and the AES key generation algorithm to generate CP-ABE keys for data accessors and different AES encryption keys corresponding to different levels for data owners; Step S3: The data owner executes the Encryption algorithm to encrypt and upload the file; Step S4: The data accessor formulates a Decryption algorithm. The data accessor can download the hierarchical key ciphertext and file ciphertext through the cloud server according to his needs. After the download is completed, the hierarchical key ciphertext is first decrypted using his own CP-ABE key to obtain an AES key set that meets his own attribute set, and then the AES key is used to decrypt the corresponding file ciphertext to obtain the file; Step S5: The central authority executes the Revocation algorithm, inputs the ID of the data accessor, revokes its CP-ABE key and updates the revocation ciphertext; Step S6: The central authority executes the Update algorithm, inputs the ID of the data accessor, updates its CP-ABE key and updates the revocation ciphertext.
2. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 1, characterized in that: In step S2, the central authorization agency will establish a user binary tree based on the identities of all data accessors, execute the KeyGen algorithm to generate CP-ABE keys for data accessors based on the data accessor's attribute set and the user binary tree, and execute the AES key generation algorithm to generate different AES encryption keys corresponding to different levels for data owners.
3. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 2, characterized in that: In step S2, the user binary tree constructed according to the data accessor identity is defined as follows: Let U be a set of users in the system, and the user binary tree τ U It is depicted as: the leaf nodes of the binary tree are associated with user u, defined as user nodes, let |U| be the number of users, the number of nodes in the tree is 2|U|-1, and the nodes are numbered according to the breadth-first search.
4. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 3, characterized in that: The minimum included node set is defined in the user binary tree, and is defined as follows: for a given leaf node set, there exists a minimum node set such that the nodes in the set or their descendant nodes just contain the given leaf node set. This minimum node set is called the minimum included node set.
5. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 4, characterized in that: In step S3, the data owner executes the encryption algorithm, including: First, use the AES keys corresponding to different levels to encrypt files at different levels; Then, the data owner performs CP-ABE encryption on the AES key set containing different levels based on the hierarchical access structure tree associated with the set hierarchical access control policy; Afterwards, the AES key ciphertext and the file ciphertext are uploaded to the cloud server together; the central authorization agency will generate the revocation ciphertext based on the user binary tree based on the Chinese remainder theorem, and then upload the revocation ciphertext to the cloud server; the cloud server will combine the AES key ciphertext and the revocation ciphertext to form a hierarchical key ciphertext.
6. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 5, characterized in that: In step S3, the hierarchical access structure tree is defined as follows: Assume τ A It is a tree representing a hierarchical access structure with the root node R, which is divided into k access levels from top to bottom. The nodes in the tree can be divided into hierarchical nodes, transmission nodes, attribute nodes and storage nodes, and the root node is the highest hierarchical node; the child nodes of the hierarchical nodes can be attribute nodes and transmission nodes; the child nodes of the transmission node are composed of a hierarchical node and a storage node; the storage node is a leaf node and has no children, which is responsible for storing the relevant parameters required for obtaining keys from top to bottom; the leaf nodes other than the storage nodes are attribute nodes, which are represented as user attributes; each non-leaf node is represented as a threshold gate, and the hierarchical node threshold gate can be represented as (m,n), m≤n, n is the number of child nodes, and m is the threshold. The transmission node threshold gate is AND or OR, and AND means that upward transmission is not allowed, and OR means that upward transmission is allowed.
7. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 6, characterized in that: In step S6, the central authorization agency executes the Update algorithm, inputs the ID of the data accessor, updates its CP-ABE key and updates the revocation ciphertext; when the user's attribute set changes and the key needs to be updated, the central authorization agency needs to re-use the key generation algorithm to generate the user's CP-ABE key; when the user's attribute set does not change and the key needs to be updated, the central authorization agency only needs to use the update algorithm to update the user's CP-ABE key.
8. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 1, characterized in that: The step S1 specifically includes the following: S1.1: The central authority executes the system initialization algorithm Setup (1 = ): Initialization algorithm Setup(1 = ) Select the system security parameter λ and generate the system parameters (G,G) through the group generation function T ,g,e), where G and G T are two cyclic groups of prime order p, g is a generator of G, and e is a bilinear map; S1.
2. Randomly select two α, β∈Z p , calculate and generate the system master key as MSK = (β, g α ) and the system public key PK=(g,e(g,g) α ,g β ).
9. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 1, characterized in that: The step S2 specifically includes the following: S2.1: The central authority executes the key generation algorithm KeyGen(MSK,S,τ U ): Key generation algorithm KeyGen(MSK,S,τ U ) Input is the system master key MSK, the data accessor attribute set S and the user binary tree τ constructed by the data accessor set U ; First, the algorithm selects a random r∈Z p , are the attributes s1, s2, ..., s in the data accessor attribute set S n Randomly select r1,r2,...,r n ∈Z p , and calculate Next, for each node N of the user binary tree i ∈τ U Randomly select a large prime number m i , a random number a i ∈Z p , for all nodes N1,N2,...N k ∈τ U calculate For all nodes in the user binary tree, establish a set of equations: x≡a1 mod m1 x≡a2 mod m2 … x≡a k mod m k when When , we can calculate: Get the path path (u i ), then the data accessor private key S2.2: The central authority executes the AES key generation algorithm to generate an AES key set sk for the data owner to encrypt files at different levels.
10. The CP-ABE method for revocable file layering based on the Chinese remainder theorem according to claim 1, characterized in that: The step S3 specifically includes the following: S3.1: The data owner executes the encryption algorithm Encryption(PK, sk, τ A ,τ U ): Encryption algorithm Encryption(PK,sk,τ A ,τ U ) Input is the system public key PK, AES key set sk, hierarchical access structure tree τ A , user binary tree τ U ,The data owner uses the AES keys corresponding to different levels to encrypt files at different levels and generate file ciphertext; S3.2: The data owner performs CP-ABE encryption on the AES key set containing different levels based on the set hierarchical access control policy. A For the symmetric hierarchical key sk = {sk1, sk2, ..., sk k } is encrypted, and k hierarchical nodes are set from top to bottom in the hierarchical access strategy tree, corresponding to sk1, sk2, ..., sk k , and for each level node, according to its threshold gate (v, w) to ensure q parent(x) (0) = q x (1) under the premise of randomly generating the v-1 degree polynomial q corresponding to the node of this level x , so that q x (0) = S, store the coefficient set of the polynomial corresponding to the hierarchical node in the storage node with the same level, so as to obtain the secret value from top to bottom, and assign the value q to the w-1 child nodes of the hierarchical node except the transmission node. x (2)…q x (n), only when at least v child nodes are obtained can the polynomial corresponding to the hierarchical node be solved to obtain the secret value. For a transmission node whose child node is a hierarchical node, its value is defined as the secret value S corresponding to the child hierarchical node. k , if the transmission node threshold gate is AND, then the value will no longer be transmitted upward, if it is OR, then the value is allowed to be transmitted upward; assuming that J is a hierarchical access structure tree τ A The set of middle-level nodes, T is the hierarchical access structure tree τ A The collection of attribute nodes in the structure tree τ A Calculate and output the AES key ciphertext: Where H:{0,1} * →G is a random oracle, which maps any attribute described as a binary string to a group element. att(t) refers to the attribute binary string represented by the attribute node t. S3.3: The data owner uploads the AES key ciphertext and the file ciphertext to the cloud server; S3.4: The central authority will generate the revocation ciphertext CT based on the user binary tree and the Chinese remainder theorem re =(x), then upload the revocation ciphertext to the cloud server; S3.5: The cloud server combines the AES key ciphertext and the revocation ciphertext to form a hierarchical key ciphertext CT H .
