Attribute-based encryption trusted data encapsulation, decryption and transmission method and system
By generating a trusted data format through policy-based attribute encryption technology, and combining access control policies and elliptic curve cryptography, the high computational and communication overhead of data sharing in existing technologies is solved, enabling efficient and secure multi-user data sharing and decryption, which is suitable for the field of digital office.
Patent Information
- Application Number
- CN202511013748.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-07-23
AI Technical Summary
Existing policy-based attribute encryption technologies have high computational and communication overhead in data sharing, making them unsuitable for high-performance requirements in real life. Furthermore, traditional public-key digital envelope schemes have high performance and complexity when sending data to multiple users, making it difficult to efficiently achieve multi-user data sharing.
The system employs policy-based attribute encryption technology. By generating trusted data in a specified format and combining access control policies with attribute cryptography algorithms, it encrypts and decrypts the data to generate trusted data. During transmission, it ensures that only users who meet the policy requirements can decrypt the data. Elliptic curve cryptography and HMAC checksums are used to ensure data integrity.
It enables efficient and secure data sharing in the field of digital office, reduces management complexity, reduces redundant encryption overhead, supports dynamic policy adjustment, improves overall efficiency and security, prevents data tampering, and is suitable for multi-user and complex permission environments.
Smart Images

Figure CN120528599B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information security, and particularly relates to a trusted data encapsulation, decryption and transmission method and system based on attribute cryptography. BACKGROUND
[0002] In recent years, with the rapid development of cloud computing, big data and mobile office, the demand for data sharing and collaboration has surged, and data security and privacy protection have become a key challenge. Traditional data security sharing is to encrypt the data to be shared and then share the ciphertext data with the receiver, but the distribution of data encryption keys is a problem. To solve the problem of key distribution, the public key system is introduced to encrypt the data encryption key with the public key of the receiver, which can ensure that only the specified receiver can decrypt the data, and the security aspect can be guaranteed. However, if the data needs to be shared with multiple people (such as mass mailing), the traditional public key digital envelope scheme has many defects, and the data encryption key needs to be asymmetrically encrypted with the public key of each data user to form a digital envelope for each data user, especially when the number of users for mass mailing is large, the performance and complexity will be very high.
[0003] Attribute-Based Encryption (ABE) based on attribute cryptography technology is a new technology in the field of cryptography, which combines access control policies with keys and can realize the problem of one-time encryption and multi-person decryption, which well solves the problem of group sharing. Therefore, data sharing based on attribute cryptography is a better technical solution for group sharing data. There are two implementation schemes of attribute cryptography: one is Ciphertext-Policy Attribute-Based Encryption (CP-ABE), which is defined by the data owner, and only users who meet the policy can decrypt the data; the other is Key Policy Attribute-Based Encryption (KP-ABE), which requires the decrypting party to have a key matching the attribute set specified by the encrypting party to decrypt the data, and the data is associated with the attribute.
[0004] In practical applications based on attribute-based encryption technology, there are great limitations in key-based attribute encryption. The encrypter cannot directly define the access policy, the key management is complex, the calculation and communication overhead is large, which limits its application range. The implementation scheme of policy-based attribute encryption is a widely used technical scheme at present, mainly applied to the secure storage of data in blockchains, and realizes the ability that users meeting the access control policy can decrypt the blockchain data. However, due to the large calculation overhead, communication overhead and storage overhead of policy-based attribute encryption, it can only be applied to blockchains with low performance requirements, and cannot be applied to data sharing in real life. SUMMARY
[0005] In view of the above analysis, the present application aims to disclose a trusted data packaging, decryption and transmission method and system based on attribute cryptography, which formats and packages the data to be shared into a trusted data sharing file or data stream according to a set trusted data format, ensures that only the receiver user meeting the access control policy specified by the data encrypter can decrypt, effectively prevents data leakage during transmission, and realizes efficient and secure sharing of data in the field of digitalization.
[0006] The present application provides a trusted data packaging method based on attribute cryptography, which specifically comprises the following steps:
[0007] Randomly selecting an element R on an elliptic curve according to a preset attribute cryptography security parameter;
[0008] Generating a data encryption key based on R and encrypting the data to be encrypted to obtain ciphertext data;
[0009] Generating a ciphertext policy by attribute encrypting R based on an access control policy and a system public key using an attribute cryptography algorithm;
[0010] Generating trusted data based on the access control policy, the ciphertext policy and the ciphertext data.
[0011] Further, the trusted data comprises a file type identifier, an access control policy length, a ciphertext policy length, an integrity check code, access control policy tree data, a ciphertext policy and ciphertext data.
[0012] The generation of trusted data based on the access control policy, the ciphertext policy and the ciphertext data comprises:
[0013] Determining a group key based on the data encryption key;
[0014] Calculating the integrity check code by taking the group key as the key and taking the access control policy, the ciphertext policy and the ciphertext data as data;
[0015] Obtaining access control policy tree data based on the access control policy;
[0016] determining an access control policy length based on the access control policy tree data.
[0017] Further, the generating the data encryption key based on the element R and encrypting the data to be encrypted to obtain the ciphertext data comprises:
[0018] transforming the value of the element R into byte stream data R of a length of 128 bytes B ;
[0019] calculating 32 bytes of digest data of the byte stream data R B , wherein the first 16 bytes are a group key Key and the last 16 bytes are an initialization vector IV;
[0020] performing group encryption on the data to be encrypted based on the group key Key and the initialization vector IV to obtain the ciphertext data.
[0021] Further, the access control policy is represented into the access control policy tree data based on the policy control tree, and the access control policy length is the length of the data after the access control policy tree data is serialized in json.
[0022] Further, the ciphertext policy is stored in a Hashtable structure, and the ciphertext policy length is the length of a string after the ciphertext policy corresponding Hashtable data is serialized in json.
[0023] The application further provides a trusted data decryption method based on attribute cryptography, specifically comprising the following steps:
[0024] parsing the trusted data to obtain an access control policy, a ciphertext policy and ciphertext data;
[0025] performing attribute decryption on the ciphertext policy based on the access control policy and an attribute private key of a data user by using an attribute cryptography algorithm to obtain an element R';
[0026] calculating a data encryption key based on the element R' and decrypting the ciphertext data to obtain data plaintext.
[0027] Further, the calculating the data encryption key based on the element R' and decrypting the ciphertext data to obtain the data plaintext comprises:
[0028] transforming the value of the element R' into byte stream data R B ' of 128 bytes
[0029] calculating a digital digest value of the byte stream data R B ' to obtain 32 bytes of digest data, wherein the first 16 bytes are a group key Key' and the last 16 bytes are an initialization vector IV';
[0030] The parsed access control policy, the ciphertext policy and the ciphertext data are calculated with a group key Key' to obtain an HMAC', which is compared with an HMAC value to determine whether the data is tampered with or not;
[0031] For the un-tampered data, the ciphertext data is decrypted with a group key Key' and an initialization vector IV' to obtain data plaintext.
[0032] Further, the attribute private key of the data user is generated by the key management center, including:
[0033] The key management center randomly generates a system key pair including a system public key and a system private key according to preset attribute cryptographic security parameters;
[0034] The corresponding attribute private key is calculated and generated by a bijective mapping algorithm based on the user attribute of the data user and the system private key;
[0035] The key management center sends the attribute private key to the data user through a secure distribution channel or protocol.
[0036] The application also provides a trusted data transmission method based on attribute cryptography, characterized by comprising trusted data encapsulation and trusted data decryption; wherein,
[0037] The trusted data is generated by using the trusted data encapsulation method;
[0038] The generated trusted data is decrypted by using the trusted data decryption method.
[0039] The application also provides a trusted data encapsulation system based on attribute cryptography, comprising:
[0040] A key management center for generating a system key pair, generating and distributing a user attribute private key;
[0041] A trusted data generation module for generating trusted data, including: randomly selecting an element R on an elliptic curve according to preset attribute cryptographic security parameters; generating a data encryption key based on R and encrypting the data to be encrypted to obtain ciphertext data; attribute encrypting R based on an access control policy and a system public key by using an attribute cryptography algorithm to generate a ciphertext policy; generating trusted data based on the access control policy, the ciphertext policy and the ciphertext data;
[0042] A trusted data distribution module for distributing the trusted data to a data user.
[0043] The application can achieve at least one of the following beneficial effects:
[0044] By generating the trusted data in the set trusted data format based on the attribute-based encryption technology, the binding relationship between the ciphertext policy and the ciphertext data is realized, and the efficient and safe sharing of data in the digital management field is realized. Compared with the traditional ciphertext policy and ciphertext data separation mode, the management complexity is simplified, the centralized ciphertext policy and ciphertext data management system is no longer dependent on the binding realized by the association mapping, the application difficulty is reduced, and the application scene is expanded, especially the offline application demand can be met. Compared with the attribute-based encryption technology based on the policy, the data content and the policy are separated, the repeated encryption overhead is reduced, the calculation amount is reduced, the policy dynamic adjustment is supported, and the overall efficiency is improved. Even in the case of a large number of users in group sending, the complexity of the user receiving trusted data is not improved, and efficient encryption, sending, receiving and decryption of data can still be realized.
[0045] By encapsulating the data items such as the access control policy, the ciphertext policy, the type identifier, the access control policy length, the ciphertext policy length and the integrity check code involved in the attribute-based encryption according to the format specification, the data parsing efficiency and accuracy can be improved.
[0046] By setting the data items of fixed length in the header part of the trusted data format, the type identifier, the access control policy length, the ciphertext policy length and the integrity check code can be quickly assigned through memory copying, and the offset of the access control policy, the ciphertext policy and the ciphertext data can be calculated through the length, so that the positioning efficiency of the data items is improved to improve the decryption performance.
[0047] The integrity check code is added in the trusted data format based on the attribute-based encryption, the binding relationship among the access control policy, the ciphertext policy and the ciphertext data is realized through the password technology, the illegal tampering of the included data items by the attacker is prevented, and the binding relationship and the integrity of the attribute encryption and the policy are ensured.
[0048] By setting the 16-byte type identifier in the trusted data format, the data can be prevented from being repeatedly encrypted according to the type identifier during encryption, and the legality of the data to be decrypted can be quickly judged through the type identifier during decryption, so that the decryption efficiency is improved.
[0049] In the present application, the above technical solutions can also be combined with each other to realize more preferred combination schemes. Other features and advantages of the present application will be described in the subsequent specification, and some advantages will become apparent from the specification, or will be understood by implementing the present application. The purpose and other advantages of the present application can be realized and obtained from the contents specifically pointed out in the specification and the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0050] The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and are not intended to limit the scope of the application, and together with the description serve to explain the principles of the application.
[0051] Figure 1 A flow chart of the trusted data encryption method of the present application;
[0052] Figure 2 A flow chart of the trusted data encryption method of the present application;
[0053] Figure 3 A flow chart of the trusted data decryption method of the present application;
[0054] Figure 4 A flow chart of the trusted data decryption method of the present application; DETAILED DESCRIPTION
[0055] The preferred embodiments of the present application will be described in detail below with reference to the drawings, which constitute a part of this application, and serve to explain the principles of the present application together with the embodiments of the present application, but are not intended to limit the scope of the present application.
[0056] Embodiment 1: Trusted data encryption method based on attribute-based cryptography
[0057] One embodiment of the present application discloses a trusted data encryption method based on attribute-based cryptography, as shown in the flow chart of FIG. 1, which specifically comprises steps S101-S104. Steps S102 and S103 are not limited in sequence and can be performed simultaneously. Figure 1
[0058] S101, randomly selecting an element R on an elliptic curve according to a preset attribute-based cryptography security parameter.
[0059] Specifically, the elliptic curve refers to an elliptic curve in elliptic curve cryptography (ECC). In the attribute-based encryption process, the preset attribute-based cryptography security parameter refers to a set of parameters related to security that are set in advance. Exemplary parameters include parameters of the elliptic curve, a generator G of the elliptic curve group, a security level, a seed of a random number generator, etc. The element R is a random point of the elliptic curve group .
[0060] S102, generating a data encryption key based on the element R and encrypting the data to be encrypted to obtain ciphertext data. Specifically, it comprises:
[0061] Converting the value of the element R into a byte stream data R B of length 128 bytes;
[0062] Calculating the byte stream data R B 32 bytes of digest data, and the digest data is used as a data encryption key; wherein the first 16 bytes are a group key Key, and the last 16 bytes are an initialization vector IV; specifically, the digest data of the byte stream data R B The digest data can be calculated by an SM3 or SHA256 digest algorithm.
[0063] The data to be encrypted is encrypted based on the group key Key and the initialization vector IV to obtain ciphertext data. The group encryption algorithm is an algorithm that divides data into fixed-size blocks and encrypts each block using a group key. The initialization vector is the same size as the group size and is an important parameter in the group encryption algorithm for increasing randomness and preventing ciphertext pattern leakage.
[0064] S103, attribute encryption of R is performed based on the access control policy Policy and the system public key MPK to generate a ciphertext policy Cipher Policy.
[0065] Specifically, the access control policy is a set of rules or logical expressions defined and specified by the data owner (i.e., the encryption party) according to actual business requirements and security policies, and is used to specify which data users can decrypt a certain ciphertext. It is usually stored together with the ciphertext and verified by the system when decrypting whether the user meets the policy requirements.
[0066] The system public key is a system public key generated according to attribute encryption security parameters when the attribute encryption system is initialized;
[0067] The attribute encryption algorithm refers to attribute-based encryption (ABE) algorithm. In this embodiment, a ciphertext policy is generated by performing attribute encryption based on the access control policy Policy and the system public key MPK using a policy-based attribute encryption (CP-ABE) algorithm.
[0068] S104, trusted data is generated based on the access control policy, the ciphertext policy, and the ciphertext data. Specifically, it includes:
[0069] A 32-byte HMAC value is calculated using the group key Key as the key and the access control policy, the ciphertext policy, and the ciphertext data as the data, and the obtained HMAC value is used as the integrity check code; wherein the HMAC algorithm can be SM3 or SHA256;
[0070] The access control policy tree data is obtained based on the policy control tree representation of the access control policy;
[0071] The access control policy length is determined based on the access control policy tree data. Specifically, the length of the data after json serialization of the access control policy tree data is the access control policy length.
[0072] The trusted data is generated based on the file type identifier, the access control policy length, the ciphertext policy length, the integrity check code, the access control policy tree data, the ciphertext policy, and the ciphertext data.
[0073] Further, in step S104, the trusted data is generated according to the set trusted data format. The format of the trusted data is a kind of nonlinear structured organization specification for the trusted data generated by using the attribute-based encryption, for identifying the file type (i.e., the data format type) of the encrypted data and quickly locating the required data items for decrypting the trusted data. As shown in FIG. 4, from the low address as the start address of the trusted data storage, the storage format specification of each data item in the trusted data is respectively shown, including P1-P7. Figure 2
[0074] P1: 0x0000-0x000F, used for storing the file type identifier (data format type identifier), with a length of 16 bytes, which can use a random number as the identifier. In the same application system of the attribute-based encryption trusted data, each file type identifier has a unique definition to avoid the same file type being repeatedly encrypted, and to ensure that the legality of the data can be quickly determined according to the file type identifier during decryption to improve the decryption performance.
[0075] P2: 0x0010-0x0013, used for storing the access control policy length (denoted as policyLen) specified during encryption. Specifically, the access control policy is represented based on the policy control tree, and the access control policy length is the length of the data after the policy control tree is serialized in json. Further, the policy length is stored in big-endian mode.
[0076] P3: 0x0014-0x0017, used for storing the ciphertext policy length (denoted as cpLen). Specifically, the ciphertext policy is usually stored in Hashtable structure, and the ciphertext policy length is the length of the string after the Hashtable data of the ciphertext policy is serialized in json, which is stored in big-endian mode.
[0077] P4: 0x0018-0x0037, used for storing the integrity check code, with a length of 32 bytes.
[0078] P5: 0x0038-policyLen+0x0037, used for storing the serialized string of the access control policy tree data, which is plaintext data and is stored in byte stream form, with a length of the access control policy length policyLen.
[0079] P6: 0x0038+policyLen-(policyLen+cpLen)+0x0037, used for storing the ciphertext policy. Specifically, the length of the ciphertext policy is related to the number of attributes contained in the specified policy during encryption, and each attribute corresponds to a ciphertext value of an element on an elliptic curve. Hashtable data structure is used for calculation, and the same json serialization is used for storage.
[0080] P7: 0x0038+(policyLen+cpLen)-…, used for storing the ciphertext data.
[0081] The trusted data encapsulation method based on attribute-based encryption disclosed in this embodiment generates trusted data in a set trusted data format based on attribute-based encryption technology, realizes the binding relationship between the ciphertext policy and the ciphertext data, and realizes efficient and secure sharing of data in the field of digitalization. Compared with the traditional separation mode of ciphertext policy and ciphertext data, the management complexity is simplified, the binding is realized through association mapping without relying on the centralized management system of the ciphertext policy and the ciphertext data, the application difficulty is reduced, the application scenarios are expanded, and the demand for offline application can be met. Compared with the attribute-based encryption technology based on policy, the data content and the policy are separated, the repeated encryption overhead is reduced, the calculation amount is reduced, the policy dynamic adjustment is supported, and the overall efficiency is improved.
[0082] The embodiment adds an integrity check code in the trusted data format based on attribute-based encryption, realizes the binding relationship among the access control policy, the ciphertext policy and the ciphertext data through the encryption technology, prevents illegal tampering of the included data items by attackers, and ensures the binding relationship and integrity of attribute encryption and policy.
[0083] The trusted data encapsulation method based on attribute-based encryption disclosed in this embodiment can encapsulate the access control policy, the ciphertext policy, the ciphertext data, the type identifier, the access control policy length, the ciphertext policy length and the integrity check code and other data items involved in attribute-based encryption according to the format specification, and can improve the data parsing efficiency and accuracy.
[0084] By setting a 16-byte type identifier in the trusted data format, the data can be prevented from being repeatedly encrypted according to the type identifier during encryption, and the legality of the data to be decrypted can be quickly judged by the type identifier during decryption, thereby improving the decryption efficiency.
[0085] The fixed-length data items are arranged in the header part of the trusted data format, the type identifier, the access control policy length, the cipher policy length and the integrity check code can be quickly assigned by memory copying, the offset of the access control policy, the cipher policy and the cipher data can be calculated by the length, the positioning efficiency of the data items is improved to improve the decryption performance.
[0086] Embodiment 2: Attribute-based cipher trusted data decryption method
[0087] Another embodiment of the present application discloses an attribute-based cipher trusted data decryption method for decrypting the trusted data generated by the above-mentioned embodiments. As shown in the figure, it specifically includes steps S201-S203. Figure 3
[0088] S201: Analyzing the trusted data to obtain the access control policy, the cipher policy and the cipher data.
[0089] Specifically, the data user analyzes the received trusted data according to the trusted data format set in step S104 to obtain the file type identifier, the access control policy length, the cipher policy length, the integrity check code, the access control policy tree data, the cipher policy and the cipher data.
[0090] Further, the data user determines whether the attribute cipher to be decrypted is the attribute cipher conforming to the set trusted data format according to the file type identifier obtained by the analysis, and if yes, goes to S202, otherwise returns a type error and exits the process.
[0091] S202: Attribute decrypting the cipher policy by using the attribute cipher algorithm based on the access control policy and the attribute private key of the data user to obtain the element R' of the elliptic curve selected during encryption.
[0092] S203: Calculating the data encryption key based on the element R' and decrypting the cipher data to obtain the data plaintext. Specifically, it includes:
[0093] Converting the value of the element R' into a 128-byte byte stream data R B ’;
[0094] Calculating the digital digest value of the byte stream data R B ’ to obtain a 32-byte digest data, and the digest data is the data encryption key; the first 16 bytes are the group key Key', and the last 16 bytes are the initialization vector IV'; optionally, the digest cipher algorithm can be SM3 or SHA256;
[0095] The parsed access control policy, the parsed ciphertext policy and the parsed ciphertext data are calculated using the group key Key' to obtain an HMAC', which is compared with the parsed integrity check code HMAC to determine whether the data is tampered with;
[0096] For the un-tampered data, the ciphertext data is decrypted using the group key Key' and the initialization vector IV' to obtain the data plaintext.
[0097] The trusted data decryption method based on attribute-based encryption disclosed in the embodiment can receive and decrypt the trusted data in the set trusted data format by the data user, so that multiple data users in the digital field can receive efficient and secure shared data. Even if the number of users in the group is large, the complexity of receiving the trusted data by the user is not increased, and efficient reception and decryption of the data can still be achieved.
[0098] By parsing the trusted data according to the trusted data format, the access control policy, the ciphertext policy, the ciphertext data and the type identifier, the access control policy length, the ciphertext policy length and the integrity check code involved in the attribute-based encryption can be parsed according to the format specification and the fixed length offset, so as to improve the data parsing efficiency and accuracy. The legality of the data to be decrypted can be quickly judged according to the 16-byte type identifier, so as to improve the decryption efficiency.
[0099] By calculating the integrity check code based on the parsed data, it is determined whether the data item is tampered with, so as to effectively ensure the data security and integrity.
[0100] It should be noted that the attribute-based encryption application needs a key management center to generate the system public key in step S103 and the attribute private key of the data user in step S202, as shown in the following table. Figure 4 The table includes S301-S303.
[0101] S301, the key management center randomly generates a system key pair including a system public key and a system private key according to preset attribute-based encryption security parameters. The system private key is a secret parameter, which is stored in the key management center of the attribute-based encryption and is used as a core parameter for calculating and generating the attribute private key of the user. The system private key is protected by referring to the root key protection scheme of the PKI CA; the system public key is a public parameter data, which is obtained by the data owner who needs to use the attribute-based encryption for encryption.
[0102] S302, the key management center calculates and generates the corresponding attribute private key based on the user attribute of the data user and the system private key through a bijective mapping algorithm.
[0103] The user attribute of the data user includes, for example, company, department, position, rank, etc., which is generally sent to the key management center by the user system.
[0104] It should be noted that the user attribute private key is calculated according to the system private key and the user attribute through a double-sex mapping algorithm, and if the user attribute changes, the attribute private key of the user needs to be updated. A random variable is introduced in the attribute private key generation process of the attribute password, so the attribute private key generated each time for the same attribute is also different.
[0105] S303, the key management center sends the attribute private key to the data user through a secure distribution channel or protocol.
[0106] For example, the secure distribution channel is an encrypted channel, such as SSL.
[0107] The data user receives the attribute private key and usually stores it in the data user client in an encrypted manner. The user password of the data user can be used to encrypt and store the attribute private key.
[0108] Embodiment 3: Attribute-based password trusted data transmission method
[0109] In one specific embodiment of the present application, an attribute-based password trusted data transmission method is disclosed, which comprises trusted data encapsulation and trusted data decryption; wherein,
[0110] The trusted data is generated by using any of the trusted data encapsulation methods in Embodiment 1.
[0111] The generated trusted data is decrypted by using any of the trusted data decryption methods in Embodiment 2.
[0112] The attribute-based password trusted data transmission method disclosed in this embodiment realizes the safe and efficient transmission of trusted data through trusted data encapsulation and trusted data decryption. Compared with the prior art, the other beneficial effects provided by the present embodiment are basically the same as those provided by the attribute-based password trusted data encapsulation method and the attribute-based password trusted data decryption method, and are not described here.
[0113] Embodiment 4: Attribute-based password trusted data encapsulation system
[0114] Another specific embodiment of the present application discloses an attribute-based password trusted data encapsulation system, which comprises:
[0115] A key management center for generating a system key pair, generating and distributing a user attribute private key; the system key pair comprises a system public key and a system private key; the generated user attribute private key is distributed to a data user through a secure distribution channel or protocol.
[0116] The trusted data generation module is configured to generate trusted data, including: randomly selecting an element R on an elliptic curve according to a preset attribute-cryptography security parameter; generating a data encryption key based on R and encrypting the data to be encrypted to obtain ciphertext data; generating a ciphertext policy by attribute-encrypting R based on an access control policy and a system public key using an attribute-cryptography algorithm; and generating trusted data based on the access control policy, the ciphertext policy and the ciphertext data.
[0117] The trusted data distribution module is configured to distribute the trusted data to a data user.
[0118] When the data user receives the trusted data, the trusted data is decrypted by using an attribute-cryptography based trusted data decryption method.
[0119] The attribute-cryptography based trusted data encapsulation system disclosed by the embodiment combines attribute encryption and trusted data encapsulation technology, and realizes fine-grained access control for users, is more flexible than traditional encryption and data sharing algorithms, and is suitable for complex environments with multiple users and multiple permissions. Data is always in an encrypted state during transmission and storage, and even if the data is intercepted, unauthorized users cannot decrypt it. Attribute encryption ensures that only users with correct attributes can access the data, effectively preventing internal leaks and external attacks.
[0120] By updating the access policy (such as adding or revoking user attributes) without re-encrypting the data, the attribute private key of the user is updated when the user attributes change. A random variable is introduced in the attribute private key generation process of the attribute cryptography, so that the attribute private keys generated by the same attribute are different each time. The flexibility, security and maintainability of the system are improved.
[0121] The data content and the access policy are separated by the trusted data encapsulation, and the policy change does not require re-encryption of the data body, which improves the system response speed and maintenance efficiency. The encapsulation structure supports integrity checking and policy analysis, facilitating system integration and automated processing.
[0122] It should be noted that the above embodiments are based on the same inventive concept, and the parts not repeated are mutually referenced.
[0123] The above is only a preferred embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.
Claims
1. An attribute-based encryption (ABE) based trusted data encapsulation method, characterized in that, The method comprises the following steps: Randomly selecting an element R on an elliptic curve according to a preset attribute-based encryption security parameter; The method comprises the following steps: converting the value of the element R into byte stream data R of 128 bytes in length B ; calculating 32-byte digest data of the byte stream data R B , taking the digest data as a data encryption key, wherein the first 16 bytes are a group key and the last 16 bytes are an initialization vector IV; and performing group encryption on the data to be encrypted based on the group key and the initialization vector IV to obtain ciphertext data. Generating a ciphertext policy by attribute-encrypting R based on an access control policy and a system public key using an attribute-based encryption algorithm; Generating trusted data based on the access control policy, the ciphertext policy, and the ciphertext data, comprising: determining a group key based on the data encryption key; calculating an HMAC value based on the group key, the access control policy, the ciphertext policy, and the ciphertext data, and taking the HMAC value as an integrity check code; obtaining access control policy tree data based on the access control policy; determining the length of the access control policy based on the access control policy tree data; wherein the trusted data comprises a file type identifier, the length of the access control policy, the length of the ciphertext policy, the integrity check code, the access control policy tree data, the ciphertext policy, and the ciphertext data.
2. The attribute-based encryption based trusted data encapsulation method according to claim 1, characterized in that, Expressing the access control policy to the access control policy tree data based on a policy control tree, and the length of the access control policy is the length of the data after the access control policy tree data is serialized in json.
3. The attribute-based encryption based trusted data encapsulation method according to claim 2, characterized in that, Storing the ciphertext policy in a Hashtable structure, and the length of the ciphertext policy is the length of the string after the Hashtable data corresponding to the ciphertext policy is serialized in json.
4. An attribute-based encryption method for trusted data decryption, characterized by, The method comprises the following steps: Obtaining the access control policy, the ciphertext policy, and the ciphertext data by parsing the trusted data, wherein the trusted data comprises a file type identifier, the length of the access control policy, the length of the ciphertext policy, an integrity check code, access control policy tree data, the ciphertext policy, and the ciphertext data; determining a group key based on the data encryption key; calculating an HMAC value based on the group key, the access control policy, the ciphertext policy, and the ciphertext data, and taking the HMAC value as an integrity check code; obtaining access control policy tree data based on the access control policy; determining the length of the access control policy based on the access control policy tree data; Attribute-decrypting the ciphertext policy based on the access control policy and the attribute private key of the data user to obtain an element R'; The data encryption key is calculated based on the element R' and the cipher text data is decrypted to obtain the data plaintext, including: converting the value of the element R' into a 128-byte byte stream data R B '; calculating the digital digest value of the byte stream data R B ' to obtain 32-byte digest data, taking the digest data as the data encryption key, wherein the first 16 bytes are a group key and the last 16 bytes are an initialization vector IV'; calculating the HMAC' of the parsed access control policy, cipher text policy and cipher text data using the group key, and comparing the HMAC' with the HMAC value to determine whether the data is tampered; and performing group decryption on the cipher text data based on the group key and the initialization vector IV' to obtain the data plaintext.
5. The attribute-based encryption based trusted data decryption method according to claim 4, characterized in that, Generating the attribute private key of the data user by the key management center, comprising: The key management center randomly generates a system key pair comprising a system public key and a system private key according to a preset attribute-based encryption security parameter; Generating the corresponding attribute private key by a bijective mapping algorithm based on the user attribute of the data user and the system private key; The key management center sends the attribute private key to the data user through a secure distribution channel or protocol.
6. An attribute-based encryption (ABE) based trusted data transmission method, characterized by, The trusted data encryption method comprises: The trusted data is generated by the trusted data encryption method of any one of claims 1-3 and is sent to the data user; The trusted data is decrypted by the trusted data decryption method of any one of claims 4-5.
7. An attribute-based encryption (ABE) based trusted data encapsulation system, comprising: The method comprises: The key management center is configured to generate a system key pair, generate and distribute a user attribute private key; The trusted data generation module is used for generating trusted data, comprising: randomly selecting an element R on an elliptic curve according to a preset attribute-based cryptography security parameter; generating a data encryption key based on R and encrypting to-be-encrypted data to obtain ciphertext data, comprising: converting the value of the element R into byte stream data R of a length of 128 bytes B ; calculating 32-byte summary data of the byte stream data R B , taking the summary data as the data encryption key, wherein the first 16 bytes are a group key and the last 16 bytes are an initialization vector IV; performing group encryption on the to-be-encrypted data based on the group key and the initialization vector IV to obtain the ciphertext data; performing attribute encryption on R based on an access control policy and a system public key by using an attribute-based cryptography algorithm to generate a ciphertext policy; and generating trusted data based on the access control policy, the ciphertext policy and the ciphertext data, comprising: determining the group key based on the data encryption key; taking the group key as a key, taking the access control policy, the ciphertext policy and the ciphertext data as data to calculate an HMAC value, and taking the HMAC value as an integrity check code; obtaining access control policy tree data based on the access control policy; determining an access control policy length based on the access control policy tree data; wherein the trusted data comprises a file type identifier, the access control policy length, a ciphertext policy length, the integrity check code, the access control policy tree data, the ciphertext policy and the ciphertext data; The trusted data distribution module is configured to distribute the trusted data to the data user.
Citation Information
Patent Citations
Encryption system based on attribute sets and relational predicates and access control method
CN105635135A
Lightweight access method and system based on block chain
CN113434875A