Big data hybrid encryption method based on attribute-based encryption

By allocating attribute sets and constructing access control trees for data source devices in big data systems, and combining attribute encryption and AES symmetric encryption, the problems of key management burden and leakage risk in big data systems are solved, achieving efficient and secure data access control.

CN116488797BActive Publication Date: 2026-02-24XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310274001.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2026-02-24
Estimated Expiration
2043-03-21

AI Technical Summary

Technical Problem

Existing technologies cannot effectively address the burden of key management and the risk of key leakage in big data systems, resulting in insufficient data security and encryption/decryption efficiency, especially in high real-time environments where fine-grained access control is difficult to achieve.

Method used

An attribute encryption algorithm is used to assign attribute sets to data source devices. Combined with the AES symmetric encryption algorithm and access control tree structure, the access control tree is constructed by randomly generating an AES symmetric key and a root node secret value. The AES key is encrypted using the attribute encryption algorithm and decrypted using the user attribute set, thereby achieving fine-grained access control.

Benefits of technology

It improves the security and efficiency of data encryption in big data environments, reduces the burden of key management, enables flexible data access control, and avoids the risk of key leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116488797B_ABST
    Figure CN116488797B_ABST
Patent Text Reader

Abstract

The application discloses a kind of big data hybrid encryption methods based on attribute encryption, mainly solve the problem of low efficiency of data encryption and decryption in the prior art under big data environment, and cannot guarantee the security of key.The implementation scheme is: randomly generating AES symmetric key, using AES symmetric encryption algorithm to the data generated by data source equipment is encrypted to obtain ciphertext data;Using the attribute set of data source equipment constructs access control tree;Using the control tree using attribute encryption algorithm encrypts AES symmetric key to obtain encrypted key;When user accesses data, according to its identity information and environmental information, construct its attribute set, use attribute encryption algorithm to decrypt encrypted key to obtain AES symmetric key, use AES symmetric encryption algorithm to decrypt ciphertext data to obtain plaintext data.Compared with traditional encryption technology, the present application has better security and higher efficiency, and can meet the data encryption and decryption requirements of high real-time big data system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of cyberspace security technology, specifically relating to a big data hybrid encryption method that can be used to achieve data security and efficient access control in big data systems. Background Technology

[0002] With the rapid development of internet technology, emerging technologies such as big data and cloud computing are constantly emerging. This has not only brought convenience to people's daily lives but also promoted the better development of science and technology. These emerging technologies have greatly increased the amount of information generated and used in people's daily lives. Faced with the ever-growing volume of data resources, traditional information technology can no longer cope, and more and more enterprises and institutions are beginning to apply big data technology to their system platforms. For example, in the medical industry, users can use big data technology to centrally manage and analyze medical records. Using big data technology, specific data can be collected, organized, and analyzed in a short time, and useful information can be quickly extracted from massive amounts of data to help decision-makers formulate and implement more efficient strategies.

[0003] However, the emergence and application of new technologies have also brought new challenges. Big data systems contain massive amounts of user and system information, including a significant amount of sensitive data that needs to be kept confidential. If this data is leaked and maliciously used by attackers, it can cause incalculable consequences, ranging from system malfunctions to substantial losses for companies and users.

[0004] In existing technologies, symmetric and asymmetric encryption algorithms are common data encryption methods. Symmetric encryption algorithms use the same key for both encryption and decryption, offering fast encryption and decryption speeds. However, their security depends heavily on the security of the key, making them susceptible to security issues in key management and distribution. Asymmetric encryption algorithms use two different keys to perform encryption and decryption operations: one uses a public key to encrypt the data, which can only be decrypted using the corresponding private key; the other uses a private key to encrypt the data, which can only be decrypted using the corresponding public key. Asymmetric encryption algorithms offer a certain level of security compared to symmetric encryption algorithms, but their encryption and decryption speeds are relatively slower, making them unsuitable for large-scale, high-real-time big data systems. Using a single encryption algorithm is no longer sufficient to meet practical needs, offering insufficient guarantees for the performance and data security of big data systems. Furthermore, managing a large number of keys places a significant burden on the system and administrators.

[0005] Therefore, while enjoying the convenience brought by big data technology, it is essential to further improve the security of data storage and transmission, preventing unauthorized users from accessing data they should not have access to. Simultaneously, it is crucial to ensure that even if an attacker successfully intercepts the target data during transmission, they are unable to decrypt the encrypted data to obtain the corresponding plaintext data.

[0006] Xu Yunjie et al. published a cloud computing data security storage strategy design based on Hadoop and dual-key cryptography in the field of computer measurement and control. Their approach adds a dynamically changing public key to the traditional symmetric encryption algorithm, which uses only a private key. Both the private and public keys are passed as parameters to the encryption sensitivity function, generating a randomly changing keystream. This keystream is used to encrypt plaintext data, yielding ciphertext. For decryption, the dynamic public key is first obtained, and a decryption key is generated using the dynamic public key and the user's private key. This decryption key is then used to extract the plaintext data. While this scheme effectively improves data storage security, it fails to consider the massive data volume and large user base characteristic of big data environments. Generating a dynamic public key for each data point increases the system's key management burden and reduces system performance. Furthermore, since the dynamic public key is stored directly on the node server without encryption, the risk of key leakage remains. Summary of the Invention

[0007] The purpose of this invention is to address the shortcomings of the prior art by proposing a hybrid encryption method for big data based on attribute encryption, so as to avoid the risk of key leakage, improve the security, efficiency and flexibility of data encryption and decryption operations, and realize fine-grained secure access control in big data systems.

[0008] To achieve the above objectives, the technical solution of the present invention includes the following steps:

[0009] (1) In the big data system, each data source device is assigned a corresponding set of attributes so that the data generated by the data source device can only be accessed by users who meet its set of attributes.

[0010] (2) Various data source devices continuously generate data. After receiving this data, the big data system reads the attribute set of the corresponding device from the database.

[0011] (3) Big data systems use the attribute set of data source devices to perform encryption operations on the data they generate:

[0012] (3a) Randomly generate an AES symmetric key and use the symmetric key to encrypt the data generated by the data source device to obtain ciphertext data;

[0013] (3b) Randomly generate the secret value of the root node, and use the secret value of the root node and the attribute set of the data source device to construct the structure of the corresponding access control tree;

[0014] (3c) Initialize the common parameters used by the attribute encryption algorithm, and use the common parameters and the structure of the access control tree to encrypt the AES symmetric key to obtain the encryption key;

[0015] (3d) Store the ciphertext data, the structure of the access control tree, the encryption key, the hash value of the secret value, and the hash value of the AES symmetric key in the database;

[0016] (4) When a user accesses the big data system to view data, a corresponding set of attributes is constructed for the user based on the user's identity information and environmental information;

[0017] (5) Big data systems use pre-constructed attribute sets to perform decryption operations on encrypted data:

[0018] (5a) The structure of the access control tree for reading data to be accessed from the database;

[0019] (5b) Initialize the public parameters and master key used by the attribute encryption algorithm, and use them and the user's attribute set to generate the user's private key;

[0020] (5c) Input the user's attribute set into the structure of the access control tree and use the Lagrange interpolation theorem to solve for the secret value of the root node;

[0021] (5d) Based on the solution results

[0022] If the secret value cannot be solved, the user does not have access to the current data, their actions are denied, and a corresponding error message is displayed.

[0023] If the secret value can be determined, then calculate the hash value of that secret value;

[0024] (5e) Compare the hash value of the secret value obtained in step (5d) with the hash value stored in the database:

[0025] If the two are inconsistent, the user's action will be rejected and the corresponding error message will be displayed;

[0026] If the two match, the encrypted AES symmetric key is decrypted using the user's private key to obtain the original AES symmetric key, and the hash value of the symmetric key is calculated before proceeding to step (5f).

[0027] (5f) Compare the hash value of the symmetric key obtained in step (5e) with the hash value stored in the database:

[0028] If the two are inconsistent, the user's action will be rejected and the corresponding error message will be displayed;

[0029] If the two match, the ciphertext data is decrypted using the AES symmetric key to obtain the plaintext data.

[0030] Compared with existing technologies, the present invention has the following beneficial effects:

[0031] First, this invention introduces an attribute encryption algorithm, which can be used to address the situation in big data scenarios where there are many data types and a large number of users and data source devices. Different attribute sets can be assigned to different data source devices, and the user's own attribute set can be matched with the access control structure of the data to be accessed. This enables more flexible and accurate one-to-many data access control, avoids the burden on the system caused by a large number of keys, and improves the shortcomings of existing solutions in terms of the inflexibility of traditional data access control and the difficulty of key management.

[0032] Second, it improves the security and efficiency of data encryption in a big data environment.

[0033] The security of existing symmetric encryption algorithms depends on the security of key management. Once the key is stolen, the data can be successfully decrypted by the attacker. Although existing asymmetric encryption algorithms have a certain level of security, their encryption efficiency is relatively low, making them unsuitable for high real-time big data environments.

[0034] This invention is a hybrid encryption method based on attribute encryption. By using the AES symmetric encryption algorithm to encrypt data, it can improve the data encryption efficiency in big data environments. At the same time, by using the attribute encryption algorithm to encrypt the AES symmetric key, it can improve the data encryption efficiency in big data environments while avoiding the insecurity caused by key leakage. Attached Figure Description

[0035] Figure 1 This is a system architecture diagram of the big data system used in this invention;

[0036] Figure 2 This is a flowchart illustrating the overall implementation of the present invention;

[0037] Figure 3 This is a sub-flowchart of the present invention that uses a hybrid encryption algorithm to perform encryption operations on plaintext data;

[0038] Figure 4 This is a sub-flowchart of the present invention that uses a hybrid encryption algorithm to perform decryption operations on ciphertext data. Detailed Implementation

[0039] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0040] Reference Figure 1 The big data system used in this invention consists of a Web big data platform management system, underlying data source devices, and a backend system. The Web big data platform system provides a web front-end interface, allowing users to access the system through a browser and perform operations such as viewing, modifying, and downloading data. Upon receiving a request, the system calls the encryption / decryption module to execute subsequent operations. The data source devices are the underlying web crawlers or specific hardware devices in the big data system, responsible for continuously generating various types of data. The generated data is encrypted by the encryption / decryption module before being stored in the system.

[0041] The backend system comprises an attribute management module, an encryption / decryption module, and a storage server, responsible for handling specific business logic. The attribute management module manages the attribute sets of users and data source devices in the system. It constructs corresponding attribute sets for users based on their identity information and corresponding environment information, used for access control during system access. It assigns corresponding attribute sets to data source devices based on their characteristics, used to encrypt the generated data. The encryption / decryption module performs corresponding encryption and decryption operations on the data. When a data source device generates data, it first retrieves its attribute set from the attribute management module, uses this attribute set to encrypt the generated data to obtain ciphertext data, and saves the ciphertext data to the storage server. When a user accesses the system to perform operations such as viewing data, the attribute management module constructs the user's attribute set. Only when the user's attribute set meets the access control structure of the data to be accessed can the ciphertext data be retrieved from the storage server and decrypted to obtain plaintext data.

[0042] This example presents a hybrid encryption method for data encryption and decryption in big data systems.

[0043] Reference Figure 2 The implementation steps for this example are as follows:

[0044] Step 1: Assign a set of attributes to the data source device.

[0045] (1.1) Set attributes t1, t2, ..., t for all data source devices in the big data system. n These attribute values ​​are divided into different subgroups according to logical relationships;

[0046] (1.2) For each subgroup ag i Connect the attributes based on the logical relationships between them in the subgroup:

[0047] If the relationship between attributes is a logical AND relationship, use the logical AND operator to connect the attributes in the subgroup, making ag i={t1 AND t2 AND … AND t m};

[0048] If the relationship between attributes is a logical OR relationship, use the logical OR operator to join the attributes in the subgroup, making ag i ={t1 OR t2 OR … OR t m};

[0049] (1.3) Using the subgroup ag obtained in step (1b) i This constitutes the attribute set U = {ag1, ag2, ..., ag...} i ,…,ag n} and assign them to the corresponding data source devices, where i = 1, 2, ..., n, and n is the number of attributes of the data source device. The assigned data source devices are stored in the storage server.

[0050] Step 2: Obtain the attribute set of the data source device.

[0051] In big data systems, data is continuously generated by data source devices. After receiving data generated by the data source devices, the system retrieves the attribute set U = {ag1, ag2, ..., ag...} of the corresponding data source devices from the storage server. i ,…,ag n}, where ag i Let i = 1, 2, ..., n be a subgroup of attributes in the attribute set, containing attributes t1, t2, ..., tn. m And the logical relationships between them, where m is the attribute subgroup ag i The number of attributes in the middle.

[0052] Step 3: Encrypt the data generated by the data source device using its set of properties.

[0053] Reference Figure 3 The specific implementation of this step is as follows:

[0054] (3.1) Encrypt the data generated by the data source device using the AES symmetric encryption algorithm to obtain ciphertext data:

[0055] (3.1.1) Randomly generate an AES symmetric key with a length of 128 bits;

[0056] (3.1.2) The data generated by the data source is grouped into 128-bit units to obtain grouped data. When the group size is less than 128 bits, the group is padded to meet the 128-bit length.

[0057] (3.1.3) Use a 4x4 identity matrix to convert the grouped data into a state matrix;

[0058] (3.1.4) Use a 4x4 identity matrix to convert the AES symmetric key into a key matrix, and use a key arrangement function to expand it into a 4x44 key matrix;

[0059] (3.1.5) Perform an initial transformation operation on the state matrix obtained in step (3.1.3), and use the first four bytes of the key matrix to perform an XOR operation on the transformed state matrix;

[0060] (3.1.6) Using the state matrix obtained in step (3.1.5) and the key matrix obtained in step (3.1.4), perform 9 rounds of loop operations. For each ciphertext matrix obtained, perform column mixing, row shifting, byte substitution and round key addition operations in sequence to obtain the transformed ciphertext matrix.

[0061] (3.1.7) Perform byte substitution, row shifting and round key addition on the ciphertext matrix obtained in step (3.1.6) in sequence to obtain the ciphertext data;

[0062] (3.2) Randomly generate a secret value as the secret value of the root node of the access control tree. Using the secret value of the root node and the attribute set of the data source device, construct the structure of the access control tree of the data source device:

[0063] (3.2.1) Randomly generate the secret value of the root node of the access control tree;

[0064] (3.2.2) Obtain the attribute set of the data source device;

[0065] (3.2.3) Set the attribute value and label of each leaf node in the access control tree, set the threshold and number of child nodes for each non-leaf node, and populate the attribute values ​​of the leaf nodes with the attribute set of the data source device;

[0066] (3.2.4) Set two parameters for each non-leaf node of the access control tree: threshold k and number of child nodes m. Assume the highest power of the polynomial is k-1, and the constant term is the secret value of the current node. Here, m represents the total number of child nodes of the non-leaf node, and k represents the condition that the non-leaf node can satisfy if k child nodes are satisfied. When k=1, it means that the logical relationship between the child nodes of the next level is an OR gate. When k=m, it means that the logical relationship between the child nodes of the next level is an AND gate.

[0067] (3.2.5) Let the threshold k of the root node be 2, then the highest power of the polynomial corresponding to the root node is 1. Use the secret value of the root node as the constant term, randomly generate the coefficients of the polynomial, and form the linear polynomial of the root node.

[0068] (3.2.6) Assign labels 1, 2, ..., m to the current child nodes in sequence, and substitute the labels of the child nodes into the polynomial of the current node for calculation. Use the result of the polynomial as the secret value of each child node.

[0069] (3.2.7) Perform the corresponding operation based on the child node type:

[0070] When a child node is a leaf node, its corresponding attribute value, label, and secret value are saved into the structure of the access control tree.

[0071] When the child node is not a leaf node, k-1 is used as the highest power of its polynomial. The secret value of the child node obtained in step (3.2.6) is used as the constant term. The coefficients of the polynomial are randomly generated to form a linear polynomial in one variable for the non-leaf node. Then, return to step (3.2.6).

[0072] (3.3) Initialize the common parameters used by the attribute encryption algorithm, and use these common parameters and the structure of the access control tree to encrypt the AES symmetric key to obtain the encryption key:

[0073] (3.3.1) Choose a bilinear group G0 of prime order p with generator g, and arbitrarily choose two numbers α, β∈Z. p Z p Let e(g,g) be a bilinear mapping function, generating bilinear pair parameters E, and using these parameters to form the initialization common parameters PK;

[0074] (3.3.2) Let the secret value of the root node of the access control tree be s. Calculate the s power of the bilinear pair E in the public parameter PK, and use the bilinear group G0 to map the AES symmetric key in the bilinear group.

[0075] (3.3.3) Multiply the mapped AES symmetric key obtained in step (3.3.2) with the bilinear pair E raised to the power of s to obtain the encryption key;

[0076] (3.4) Store the ciphertext data, the structure of the access control tree, the encryption key, the hash value of the secret value, and the hash value of the AES symmetric key in the database.

[0077] Step 4: Construct a set of attributes for the user.

[0078] When a user accesses the big data system to view data, a corresponding attribute set is constructed for the user based on the user's identity information and environment information. This set is used to determine whether the user has the corresponding access permissions during data decryption. The specific implementation of this step is as follows:

[0079] (4.1) Obtain user identity information s1, s2, ..., si ,…,s m Each information value is set to r1, r2, ..., r i ,…,r m When the i-th identity information item is not empty, let r i =1, otherwise r i =0, and use this information and its values ​​to construct the user's identity information set: SuA = {s1:r1,s2:r2,…,s m :r m}, where s i For the user's i-th identity information, r i Let i be the information value corresponding to the i-th identity information of the user, where i = 1, 2, ..., m, and m is the number of user identity information;

[0080] (4.2) For each piece of user identity information s i Assign corresponding weight values

[0081] (4.3) Transfer each information value r of the user i Multiply by weight value Calculate the attribute value corresponding to the user's information completeness attribute:

[0082] (4.4) Set the user's information completeness attribute p and the user's environmental information as se1, se2, ..., se n And for each term, take values ​​t1, t2, ..., t n This constitutes the user's security attribute set: SeA = {se1:t1, se2:t2, ..., se n :t n}, where n is the number of user security attributes;

[0083] (4.5) Use the identity information set SuA obtained in step (4.1) and the security attribute set SeA obtained in step (4.4) to form the user's attribute set U = {SuA, SeA}.

[0084] Step 5: Decrypt the ciphertext data using the user's attribute set.

[0085] Reference Figure 4 The specific implementation of this step is as follows:

[0086] (5.1) Read the structure of the access control tree for the data to be accessed from the database;

[0087] (5.2) Initialize the public parameters PK and master key MK used in the attribute encryption algorithm, and generate the user's private key SK using them and the user's attribute set U:

[0088] (5.2.1) Choose a bilinear group G0 of prime order p with generator g, and arbitrarily choose two numbers α, β∈Z. p Z p It is a field with a finite number of elements; let e(g,g) be a bilinear mapping function, and use these parameters to form the common parameters for initialization. and master key MK=(β,g α );

[0089] (5.2.2) Randomly generate parameter k, and perform operations on this parameter with the public parameter PK and the master key MK to obtain the key parameter.

[0090] (5.2.3) Randomly generate attribute values ​​for each attribute in the user's attribute set U, and calculate the hash value of the attribute values;

[0091] (5.2.4) Randomly generate a symmetric parameter r for each attribute in the user set. j Randomly generate a fixed parameter r, and use this symmetric parameter r j The hash value obtained in step (5.2.3) is mapped to the bilinear group G0 using the fixed parameter r and the master key MK. Then, the mapped hash value and the user's attribute set U are used to construct a dictionary D. H ={D1,D2,…,D j ,…,D n},in:

[0092] Let j be the correspondence between the j-th user attribute and its hash, where j = 1, 2, ..., n, and n is the number of user attribute sets.

[0093] (5.2.5) Use the symmetric parameter r generated in step (5.2.4) j Calculate the r of generator g in the common parameters PK obtained in step (5.2.1). j The result of the calculation is used to construct a dictionary D′ using the user's attribute set U. H :D′ H ={D1′,D′2,…,D′ j ,…,D′ n},in This represents the correspondence between the j-th user attribute and its corresponding result.

[0094] (5.2.6) Use the key parameter D obtained in step (5.2.2) and the dictionary D obtained in step (5.2.4). H The dictionary D′ obtained in step (5.2.5) H Given the user's attribute set U, generate the user's private key SK = (D, D)H ,D′ H ,U);

[0095] (5.3) Substitute the user's attribute set U into the structure of the access control tree, and use the Lagrange interpolation theorem to solve for the secret value of the root node:

[0096] (5.3.1) Select a leaf node of the access control tree and compare the attribute values ​​in the user attribute set U with the attribute values ​​of the leaf node:

[0097] If they match, then set the leaf node's label and secret value to index respectively. i and s i Execute step (5.3.2), where i is the position number of the leaf node among all leaf nodes;

[0098] Otherwise, compare the attribute value with the next leaf node;

[0099] (5.3.2) Use the index of the leaf node i Calculate the fundamental polynomial:

[0100] (5.3.3) Using the secret value s of the leaf node i f obtained in step (5.3.2) i (x), calculate the polynomial corresponding to the current node using the Lagrange interpolation theorem. The constant term coefficient of the polynomial is then used as the secret value of the parent node of the leaf node.

[0101] (5.3.4) Perform the corresponding operation based on the type of the parent node of the leaf node:

[0102] If the parent node is not the root node, then set the parent node's label and the parent node's secret value obtained in step (5.3.3) to index respectively. i ,s i Then, treat the parent node as a leaf node and return to step (5.3.2);

[0103] If the parent node is the root node, then the secret value of the parent node obtained in step (5.3.3) is used as the secret value of the root node that needs to be solved in the end.

[0104] (5.4) Determine whether the secret value of the root node can be solved.

[0105] If the root node secret value cannot be solved, the user does not have access to the current data, their actions are denied, and a corresponding error message is displayed.

[0106] If the secret value of the root node can be solved, then proceed to step (5.5);

[0107] (5.5) Calculate the hash value of the root node secret value obtained in step (5.4) using the SHA-1 secure hash algorithm:

[0108] (5.5.1) Initialize the five WORD type variables A, B, C, D, and E in the SHA-1 secure hash algorithm, and form these variables into an initial variable group;

[0109] (5.5.2) Convert the secret value into binary data;

[0110] (5.5.3) Divide the binary data into blocks of 512 bits each to obtain the block data. When the length is greater than 512 bits, first divide the binary data into blocks of 512 bits each, so that the length of the last block is 448 bits. When the length of the last block is less than 448 bits, first fill its first bit with 1 and fill the rest bits with 0, so that its length reaches 448 bits.

[0111] (5.5.4) For each data block obtained in step (5.5.3), divide it into 16 subgroups of 32 bits each, denoted as w0, w1, w2, ..., w 15 ;

[0112] (5.5.5) Using the 16 groups obtained in step (5.5.4), according to the algorithm... Generate 64 subgroups, denoted as w. 16 ,w 17 ,w 18 ,…,w 79 ;

[0113] (5.5.6) Copy the variable set obtained in step (5.5.1);

[0114] (5.5.7) Use the 16 subgroups generated in step (5.5.4) and the 64 subgroups generated in step (5.5.5) to form 80 subgroups. Use these subgroups to perform 80 operations on the copied variable group obtained in step (5.5.6), and use the operated variable group to update the value of the initial variable group in step (5.5.1).

[0115] (5.5.8) Determine whether the data block after the operations in steps (5.5.4)-(5.5.7) is the last data block:

[0116] If it is the last data block, the five variables in the updated initial variable group obtained in step (5.5.7) are combined to form the hash value for the final calculation of the secret value;

[0117] If this is not the last data block, return to step (5.5.4);

[0118] (5.6) Compare the hash value of the secret value obtained in step (5.5) with the hash value of the secret value stored in the database:

[0119] If the two are inconsistent, the user's action will be rejected and the corresponding error message will be displayed;

[0120] If the two match, the encrypted AES symmetric key is decrypted using the user's private key to obtain the original AES symmetric key.

[0121] (5.7) Calculate the hash value of the symmetric key obtained in step (5.6) using the same SHA-1 secure hash algorithm as the hash value of the secret value calculated in step (5.5);

[0122] (5.8) Compare the hash value of the symmetric key obtained in step (5.7) with the hash value of the symmetric key stored in the database:

[0123] If the two are inconsistent, the user's action will be rejected and the corresponding error message will be displayed;

[0124] If the two match, the ciphertext data is decrypted using the AES symmetric key to obtain the plaintext data.

[0125] The above description is merely a specific example of the present invention and does not constitute any limitation on the present invention. Obviously, those skilled in the art, after understanding the content and principles of the present invention, may make various modifications and changes in form and details without departing from the principles and structure of the present invention. However, these modifications and changes based on the ideas of the present invention are still within the scope of protection of the claims of the present invention.

Claims

1. A hybrid encryption and decryption method for big data based on attribute encryption, characterized in that, Includes the following steps: (1) In the big data system, each data source device is assigned a corresponding set of attributes so that the data generated by the data source device can only be accessed by users who meet its set of attributes. (2) Various data source devices continuously generate data. After receiving this data, the big data system reads the attribute set of the corresponding device from the database. (3) Big data systems use the attribute set of data source devices to perform encryption operations on the data they generate: (3a) Randomly generate an AES symmetric key and use the symmetric key to encrypt the data generated by the data source device to obtain ciphertext data; (3b) Randomly generate the secret value of the root node, and use the secret value of the root node and the attribute set of the data source device to construct the structure of the corresponding access control tree; (3c) Initialize the common parameters used by the attribute encryption algorithm, and use the common parameters and the structure of the access control tree to encrypt the AES symmetric key to obtain the encryption key; (3d) Store the ciphertext data, the structure of the access control tree, the encryption key, the hash value of the secret value, and the hash value of the AES symmetric key in the database; (4) When a user accesses the big data system to view data, a corresponding set of attributes is constructed for the user based on the user's identity information and environmental information; (5) Big data systems use pre-constructed attribute sets to perform decryption operations on encrypted data: (5a) The structure of the access control tree for reading data to be accessed from the database; (5b) Initialize the public parameters and master key used by the attribute encryption algorithm, and use them and the user's attribute set to generate the user's private key; (5c) Input the user's attribute set into the structure of the access control tree and use the Lagrange interpolation theorem to solve for the secret value of the root node; (5d) Based on the solution results If the secret value cannot be solved, the user does not have access to the current data, their actions are denied, and a corresponding error message is displayed. If the secret value can be determined, then calculate the hash value of that secret value; (5e) Compare the hash value of the secret value obtained in step (5d) with the hash value stored in the database: If the two are inconsistent, the user's action will be rejected and the corresponding error message will be displayed; If the two match, the encrypted AES symmetric key is decrypted using the user's private key to obtain the original AES symmetric key, and the hash value of the symmetric key is calculated before proceeding to step (5f). (5f) Compare the hash value of the symmetric key obtained in step (5e) with the hash value stored in the database: If the two are inconsistent, the user's action will be rejected and the corresponding error message will be displayed; If the two match, the ciphertext data is decrypted using the AES symmetric key to obtain the plaintext data.

2. The method according to claim 1, characterized in that, Step (1) Assign a corresponding set of attributes to each data source device in the big data system, as follows: (1a) Set properties t1, t2, ..., t for the data source device n These attribute values ​​are divided into different subgroups according to logical relationships; (1b) For each subgroup ag i Connect the attributes based on the logical relationships between them in the subgroup: If the relationship between attributes is a logical AND relationship, use the logical AND operator to connect the attributes in the subgroup, making ag i ={t1AND t2AND…AND t m }; If the relationship between attributes is a logical OR relationship, use the logical OR operator to join the attributes in the subgroup, making ag i ={t1OR t2OR…OR t m }; (1c) Using the subgroup ag obtained in step (1b) i This constitutes the attribute set U = {ag1, ag2, ..., ag...} i , ..., ag n } and assign them to the corresponding data source devices, where i = 1, 2, ..., n, and n is the number of attributes of the data source device.

3. The method according to claim 1, characterized in that, Step (3a) encrypts the data generated by the data source device using a randomly generated AES symmetric key, as follows: (3a1) Randomly generate an AES symmetric key with a length of 128 bits; (3a2) The data generated by the data source is grouped into 128-bit units to obtain grouped data. When the group size is less than 128 bits, the group is padded to meet the 128-bit length. (3a3) Use a 4x4 identity matrix to convert the grouped data into a state matrix; (3a4) Use a 4x4 identity matrix to convert the AES symmetric key into a key matrix, and use a key arrangement function to expand it into a 4x44 key matrix; (3a5) Perform an initial transformation operation on the state matrix and XOR the transformed state matrix using the first four bytes of the key matrix; (3a6) Using the state matrix obtained in step (3a5) and the key matrix obtained in step (3a4), perform 9 rounds of loop operations. For each ciphertext matrix obtained, perform column mixing, row shifting, byte substitution and round key addition operations in sequence to obtain the transformed ciphertext matrix. (3a7) Perform byte substitution, row shifting and round key addition on the ciphertext matrix obtained in step (3a6) in sequence to obtain ciphertext data.

4. The method according to claim 1, characterized in that, Step (3b) uses the randomly generated root node's secret value and the data source device's attribute set to construct the corresponding access control tree structure, as follows: (3b1) Randomly generate the secret value of the root node of the access control tree; (3b2) Obtain the set of attributes of the data source device; (3b3) Set the attribute value and label of each leaf node in the access control tree, set the threshold and number of child nodes for each non-leaf node, and populate the attribute values ​​of the leaf nodes with the attribute set of the data source device. (3b4) Set two parameters for each non-leaf node of the access control tree: threshold k and number of child nodes m. Assume the highest power of the polynomial is k-1, and the constant term is the secret value of the current node. Here, m represents the total number of child nodes of the non-leaf node, and k represents the condition that the non-leaf node can satisfy if k child nodes are satisfied. When k=1, it means that the logical relationship between the child nodes of the next level is an OR gate. When k=m, it means that the logical relationship between the child nodes of the next level is an AND gate. (3b5) Let the threshold of the root node be 2, then the highest power of the polynomial corresponding to the root node is 1. Use the secret value of the root node as the constant term, randomly generate the coefficients of the polynomial, and form the linear polynomial of the root node. (3b6) Assign labels 1, 2, ..., m to the current child nodes in sequence, and substitute the labels of the child nodes into the polynomial of the current node for calculation. Use the result of the polynomial as the secret value of each child node. (3b7) Perform the corresponding operation based on the child node type: When a child node is a leaf node, its corresponding attribute value, label, and secret value are saved into the structure of the access control tree. When the child node is not a leaf node, k-1 is used as the highest power of the polynomial, the secret value of the child node obtained in step (3b6) is used as the constant term, the coefficients of the polynomial are randomly generated, and a linear polynomial in one variable is formed for the non-leaf node. Then, the process returns to step (3b6).

5. The method according to claim 1, characterized in that, Step (3c) encrypts the AES symmetric key using the public parameters of the initialization attribute encryption algorithm and the structure of the access control tree, as follows: (3c1) Choose a bilinear group G0 of prime order p with generator g, and arbitrarily choose two numbers α, β∈Z. p Z p Let e(g, g) be a bilinear mapping function, generate bilinear pair parameters E, and use these parameters to form the initialization common parameters PK; (3c2) Let the secret value of the root node of the access control tree be s. Calculate the s power of the bilinear pair E in the public parameter PK, and use the bilinear group G0 to map the AES symmetric key in the bilinear group. (3c3) Multiply the mapped AES symmetric key obtained in step (3c2) with the bilinear pair E raised to the power of s to obtain the encryption key; (3c4) Store the ciphertext data, the structure of the access control tree, the encryption key, the hash value of the secret value, and the hash value of the AES symmetric key in the database.

6. The method according to claim 1, characterized in that, Step (4) Construct a corresponding attribute set for the user based on the user's identity information and environment information, as follows: (4a) Obtain the user's identity information s1, s2, ..., s i , ..., s m Let each information value be r1, r2, ..., r i ,...,r m When the i-th identity information item is not empty, let r i =1, otherwise r i =0, and use this information and its values ​​to construct the user's identity information set: SuA = {s1:r1, s2:r2, ..., s m :r m }, where s i For the user's i-th identity information, r i Let i be the information value corresponding to the i-th identity information of the user, where i = 1, 2, ..., m, and m is the number of user identity information. (4b) For each piece of user identity information s i Assign corresponding weight values (4c) Transfer each user's information value r i Multiply by weight value Calculate the attribute value corresponding to the user's information completeness attribute: (4d) Set the user's information completeness attribute p and the user's environmental information as se1, se2, ..., se n Set each attribute value to t1, t2, ..., t n This constitutes the user's security attribute set: SeA = {se1: t1, se2: t2, ..., se...} n :t n }, where n is the number of user security attributes; (4e) Use the identity information set SuA obtained in step (4a) and the security attribute set SeA obtained in step (4d) to form the user's attribute set U = {SuA, SeA}.

7. The method according to claim 1, characterized in that, Step (5b) generates the user's private key using the public parameters of the initialization attribute encryption algorithm, the master key, and the user's attribute set, as follows: (5b1) Choose a bilinear group G0 of prime order p with generator g, and arbitrarily choose two numbers α, β∈Z. p Z p Given a field with a finite number of elements, let e(g, g) be a bilinear mapping function. Use these parameters to construct the common initialization parameters. and master key MK = (β, g α ); (5b2) Randomly generate parameter k, and perform calculations on this parameter, the public parameter PK obtained in step (5b1), and the master key MK to obtain the key parameter. (5b3) Obtain the user's attribute set U, randomly generate an attribute value for each attribute, and calculate the hash value of the attribute value; (5b4) Randomly generate symmetric parameters r for each attribute in the user set. j Randomly generate a fixed parameter r, and use this symmetric parameter r j The hash value obtained in step (563) is mapped to the bilinear group G0 by fixing the parameter r and the master key MK. Then, the mapped hash value and the user's attribute set U are used to construct a dictionary D. H ={D1, D2, ..., D j , ..., D n },in: Let j represent the correspondence between the j-th user attribute and its hash, where j = 1, 2, ..., n, and n is the number of user attribute sets. (5b5) Using the symmetric parameter r generated in step (5b4) j Calculate the r-th power of the generator g in the common parameters PK obtained in step (5b1), and use the calculation result and the user's attribute set U to construct a dictionary D′. H : D′ H ={D′1,D′2,…,D′ j ,…,D′ n },in This represents the correspondence between the j-th user attribute and its corresponding result. (5b6) Using the key parameter D obtained in step (5b2) and the dictionary D obtained in step (5b4) H The dictionary D′ obtained in step (5b5) H Given the user's attribute set U, generate the user's private key SK = (D, D) H , D′ H U).

8. The method according to claim 1, characterized in that, Step (5c) uses the Lagrange interpolation theorem to solve for the secret value of the root node, as follows: (5c1) Select a leaf node of the access control tree and compare the attribute values ​​in the user attribute set U with the attribute values ​​of the leaf node: If they match, then set the leaf node's label and secret value to index respectively. i and s i Execute step (5c2), where i is the position number of the leaf node among all leaf nodes; Otherwise, compare the attribute value with the next leaf node; (5c2) Use the index of the leaf node i Calculate the fundamental polynomial: (5c3) Use the secret value s of the leaf node i f obtained from step (5c2) i (x), calculate the polynomial corresponding to the current node using the Lagrange interpolation theorem. The constant term coefficient of the polynomial is then used as the secret value of the parent node of the leaf node. (5c4) Perform the appropriate operation based on the type of the parent node of the leaf node: If the parent node is not the root node, then set the parent node's label and the secret value obtained in step (5c3) as index respectively. i s i Then, make the parent node a leaf node and return to step (5c2); If the parent node is the root node, then the secret value of the parent node obtained in step (5c3) is used as the secret value of the root node that needs to be solved in the end.

9. The method according to claim 1, characterized in that, Step (5d) calculates the hash value of the secret value using the SHA-1 secure hash algorithm, as detailed below: (5d1) Initialize the five WORD type variables A, B, C, D, and E in the SHA-1 secure hash algorithm and form these variables into an initial variable group; (5d2) Convert the secret value into binary data; (5d3) Divide the binary data into blocks of 512 bits each to obtain the block data. When the length is greater than 512 bits, first divide the binary data into blocks of 512 bits each, so that the length of the last block is 448 bits. When the length of the last block is less than 448 bits, first fill its first bit with 1 and fill the rest with 0, so that its length reaches 448 bits. (5d4) For each data block obtained in step (5d3), divide it into 16 subgroups of length 32 bits, denoted as w0, w1, w2, ..., w 15 ; (5d5) Using the 16 groups obtained in step (5d4), according to the algorithm... Generate 64 subgroups, denoted as w. 16 w 17 w 18 , ..., w 79 ; (5d6) Copy the variable set obtained in step (5d1); (5d7) Use the 16 subgroups generated in step (5.5.4) and the 64 subgroups generated in step (5.5.5) to form 80 subgroups. Use these subgroups to perform 80 operations on the copied variable group obtained in step (5d6), and use the operated variable group to update the value of the initial variable group in step (5d1). (5d8) Determine whether the data block after the operations in steps (5d4)-(5d7) is the last data block: If it is the last data block, the five variables in the updated initial variable group obtained in step (5d7) are combined to form the hash value for the final calculation of the secret value; If this is not the last data block, return to step (5d4).

10. The method according to claim 1, characterized in that, Step (5e) calculates the hash value of the symmetric key by using the same SHA-1 secure hash algorithm as the hash value of the secret value calculated in step (5d) to obtain the hash value of the symmetric key.