A hierarchical nested data encryption method supporting fine-grained access control
By employing layered nested encryption methods and key management, this approach addresses the challenges of combining automatic data sensitivity classification with encryption strategies in traditional encryption methods. It achieves fine-grained access control and enhanced data security, reduces the risk of sensitive data leakage, and supports audit traceability.
Patent Information
- Application Number
- CN202511730562.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-11-24
AI Technical Summary
Existing data encryption methods cannot achieve fine-grained access control, resulting in a large exposure of sensitive data, complex key management, and a lack of combination of automatic data sensitivity classification and encryption strategies, which cannot meet the data security needs of complex application scenarios.
A layered nested encryption method is adopted, which generates a master key to derive hierarchical keys, combines a data classifier and a key management service to achieve hierarchical data encryption, and ensures the integrity and order between encryption layers are immutable through ciphertext digest and authentication binding mechanisms, and generates hierarchical access tokens for access control.
It enables fine-grained access control based on data sensitivity, reduces the risk of sensitive information leakage, enhances the hierarchical security of the key system, and supports data security compliance auditing and traceability.
Smart Images

Figure CN121217463B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data security, in particular to a layered nested data encryption method supporting fine-grained access control. BACKGROUND
[0002] In today's digital age, data security and privacy protection are increasingly important. Encryption technology is the core means to protect data confidentiality and integrity. Traditional data encryption methods, such as using AES algorithm, usually treat a whole piece of data as a whole and use a single key for encryption and decryption. Although this method is simple and effective, it has obvious limitations in complex application scenarios, especially when differential access control is needed for data content.
[0003] In many business scenarios, a data document or record often contains information of different sensitivity levels. For example, the information about military and defense-related areas in an electronic map (such as military bases, strategic facilities, underground pipeline distribution) is highly sensitive data, while the information about street names, administrative boundaries, and public points of interest in low-resolution maps may be less sensitive. Using traditional bulk encryption methods, any authorized user accessing the data must have the key to decrypt the entire data block, which means that once authorized, the user can access all information, and the principle of least privilege on-demand key cannot be achieved. This undoubtedly expands the data exposure surface and increases the risk of large-scale data leakage due to internal data misuse or key leakage.
[0004] To address this issue, the industry has proposed some preliminary data layer encryption ideas, such as splitting data into different parts and encrypting them separately. However, these simple solutions have many shortcomings. First, the encryption between parts is often independent, lacking cryptographic correlation, and attackers may rearrange, replace, or partially delete the ciphertext without being detected, compromising the integrity and relevance of the data. Second, key management is complex, requiring the distribution and management of multiple independent keys for users, with poor scalability and usability. Finally, existing solutions lack a standardized, complete system that automatically classifies data sensitivity and closely integrates encryption strategies, audit tracing.
[0005] In view of the problems in the related art, no effective solutions have been proposed so far. SUMMARY
[0006] To address the problems in the related art, the present application proposes a layered nested data encryption method supporting fine-grained access control to overcome the above technical problems existing in the prior art.
[0007] To this end, the specific technical solutions adopted by the present application are as follows:
[0008] The application provides a hierarchical nested data encryption method supporting fine-grained access control, comprising:
[0009] generating a master key; receiving user data to be encrypted, performing data classification on the user data to be encrypted according to a predefined privacy sensitivity policy through a data classifier to obtain a hierarchical data set;
[0010] deriving a first layer key from the master key, and performing authenticated encryption on first layer data in the hierarchical data set by using the first layer key to obtain first layer ciphertext;
[0011] deriving a current layer key based on previous layer ciphertext and previous layer key and the hierarchical data set, performing byte connection operation on the previous layer ciphertext and current layer data, and performing authenticated encryption on associated data layer by layer by using the current layer key to obtain final nested ciphertext.
[0012] Further, the generating a master key; receiving user data to be encrypted, performing data classification on the user data to be encrypted according to a predefined privacy sensitivity policy through a data classifier to obtain a hierarchical data set comprises:
[0013] generating the master key through a key management service;
[0014] receiving the user data to be encrypted, performing rule matching on the user data to be encrypted according to a predefined privacy sensitivity policy through a data classifier, confirming a corresponding layer, and obtaining a matching result;
[0015] dividing the matching rule group according to the matching result, and generating corresponding metadata for the matching rule group.
[0016] Further, the predefined privacy sensitivity policy comprises:
[0017] if a classification label attribute of the user data contains a first preset rule, the user data is divided into first layer data;
[0018] if a resolution attribute of the user data is higher than a preset height or a data type is a second preset rule, the user data is divided into second layer data;
[0019] if the user data does not meet the rules of the first layer data and the second layer data, and a use attribute contains a third preset rule, the user data is divided into third layer data;
[0020] if the user data does not meet the rules of the first layer data, the second layer data and the third layer data at the same time, the user data is marked as to be audited, and waits for an administrator to manually divide.
[0021] Further, the metadata comprises:
[0022] policy identifier, classification confidence, timestamp, data level, data level data size, and hash value of the data level raw data.
[0023] Further, the first layer key is derived from the master key, and the first layer key is used to authenticate-encrypt the first level data in the hierarchical data set to obtain the first layer ciphertext.
[0024] The ciphertext digest is calculated, and the first layer key is derived from the master key and the byte concatenation operation through the key derivation function;
[0025] The binding value is calculated, and the first layer key is used to authenticate-encrypt the first level data through an encryption algorithm to obtain the first layer ciphertext.
[0026] Further, the current layer key is derived based on the previous layer ciphertext and the previous layer key in cooperation with the hierarchical data set, and the previous layer ciphertext and the current level data are subjected to a byte concatenation operation, and the current layer key is used to authenticate-encrypt the associated data layer by layer to obtain the final nested ciphertext.
[0027] The previous layer ciphertext digest is calculated, and the current layer key is derived from the previous layer key and the byte concatenation operation through the key derivation function;
[0028] The binding value is calculated, and the binding value is used as additional authentication data for the authentication-encrypted associated data, and the previous layer ciphertext and the current level data are authenticated layer by layer to obtain the final nested ciphertext.
[0029] Based on the final nested ciphertext, a hierarchical access token is generated for the final nested ciphertext to control access to the current layer key.
[0030] Further, the hierarchical access token is issued and verified in one of the following ways:
[0031] Threshold signature scheme, multi-party key management protocol, and centralized key management service.
[0032] Further, the formula for calculating the binding value is:
[0033] ;
[0034] In the formula, B i The binding value is represented by H b,i The binding key is represented by K len The byte length of the returned data is represented by C i The previous layer ciphertext is represented by L i The current level data is represented by D Indicates to concatenate the bytes on both sides of the symbol.
[0035] Further, the binding key comprises:
[0036] The key management unit dynamically issues according to a predefined access control policy, and the access control policy defines the access permission of different user roles to each level of data.
[0037] Further, the binding value is calculated, and the binding value is used as additional authentication data of the authentication encryption tape associated data, and the previous layer ciphertext and the current level data are authenticated layer by layer to obtain the final nested ciphertext.
[0038] The level data of each layer in the centralized level data is divided into independent data groups by using independent threads or processes;
[0039] Based on the current layer key, the independent data groups are encrypted in parallel by the authentication encryption tape associated data to generate the sub-ciphertext of the current layer;
[0040] After the parallel encryption of each layer is completed, the sub-ciphertext of the current layer is byte stream connected and encoded in the order of layers, and the digest value of the ciphertext digest is calculated;
[0041] The digest value of the ciphertext digest is used as the merging object of the current layer, and after the merging object is spliced with the previous layer ciphertext, the authentication encryption tape associated data encryption is performed through the previous layer key to form the final nested ciphertext.
[0042] The beneficial effects of the present application are:
[0043] 1) Compared with the traditional whole data encryption method, the present application realizes fine-grained access control according to the data sensitivity, and the authorized subject can only access the specific level data within the permission range, thereby effectively reducing the risk of core sensitive information leakage.
[0044] 2) The key derivation and authentication binding mechanism based on the ciphertext digest of the present application ensures the integrity and order of each encryption level, and avoids the data reorganization attack that may be suffered by simple block encryption.
[0045] 3) The level key of the present application is derived from the master key and is sequentially derived, so that even if a single layer key is leaked, the master key or high-level key cannot be reversely derived, thereby enhancing the hierarchical and forward security of the key system.
[0046] 4) The present application combines data classification, encryption strategy and key management, and supports audit traceability through metadata recording, thereby providing a technical basis for meeting the data security compliance requirements. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained based on these drawings without creative labor.
[0048] Figure 1 is a hierarchical nested data encryption method supporting fine-grained access control according to an embodiment of the present application;
[0049] Figure 2 is a main step diagram of the hierarchical nested data encryption method supporting fine-grained access control of the present application. DETAILED DESCRIPTION
[0050] In order to further illustrate the embodiments, the present application provides drawings which are part of the disclosure of the present application, mainly used to illustrate the embodiments, and can be used to explain the operating principle of the embodiments in conjunction with the related description of the specification. Those skilled in the art should understand other possible embodiments and advantages of the present application by referring to these contents.
[0051] According to an embodiment of the present application, a hierarchical nested data encryption method supporting fine-grained access control is provided.
[0052] The present application will be further described in conjunction with the drawings and specific embodiments. As shown in Figure 1 and Figure 2 According to an embodiment of the present application, a hierarchical nested data encryption method supporting fine-grained access control is provided.
[0053] Step S1, generating a master key K0; receiving user data to be encrypted, performing data classification on the user data to be encrypted according to a pre-defined privacy sensitivity policy through a data classifier, and obtaining a hierarchical data set;
[0054] In this optional embodiment, the step of generating a master key K0; receiving user data to be encrypted, performing data classification on the user data to be encrypted according to a pre-defined privacy sensitivity policy through a data classifier, and obtaining a hierarchical data set includes:
[0055] Generating the master key through a key management service (KMS);
[0056] Receiving user data to be encrypted, performing rule matching on the user data to be encrypted according to a pre-defined privacy sensitivity policy through a data classifier, confirming the corresponding level, and obtaining a matching result;
[0057] According to the matching result, dividing the matching rule group, and generating corresponding metadata for the matching rule group.
[0058] In this optional embodiment, the predefined privacy sensitivity policy comprises:
[0059] If the classification label attribute of the user data contains a first preset rule (keywords such as military, defense, and key departments), the user data is divided into first-level data L1;
[0060] If the resolution attribute of the user data is higher than a preset height (such as 1 meter), or the data type is a second preset rule (high-precision DEM (Digital Elevation Model), high-resolution image, and fine three-dimensional model), the user data is divided into second-level data L2;
[0061] If the user data does not meet the rules of the first-level data L1 and the second-level data L2, and the usage attribute contains a third preset rule (public, public service, and basic geography), the user data is divided into third-level data L3;
[0062] If the user data does not meet the rules of the first-level data L1, the second-level data L2, and the third-level data L3 at the same time, the user data is marked as to be audited, waiting for the administrator to manually divide.
[0063] In this optional embodiment, the metadata comprises:
[0064] Policy identification, classification confidence, timestamp, data level, data level data size, and hash value of the original data of the data level.
[0065] Specifically, a master key K0 is generated as a root key of the entire encryption process, and the generation method of the master key includes but is not limited to generation by a secure random number generator; receiving user data to be encrypted, and dividing the user data into a plurality of level data L1, L2, …, L n , arranged in order from high sensitivity to low sensitivity, according to privacy sensitivity, wherein the privacy sensitivity is determined based on at least one of the following standards: legal risk level of data leakage, commercial value level of data, or data access permission requirement level.
[0066] The division of the user data into a plurality of level data is performed by a predefined privacy sensitivity policy or a trained automatic classifier, wherein the privacy sensitivity policy determines the corresponding level based on available data meta information or descriptive features extracted from the data itself, and the data meta information or descriptive features include but are not limited to classification label, data type, source, or purpose; the automatic classifier is trained based on labeled data and performs layering according to the policy; and a level metadata structure is generated for each level, which includes at least policy identification, classification confidence, and timestamp for auditing and tracing.
[0067] The Key Management Service (KMS) generates a 256-bit master key K0=29787B9F01C461AD65DAFDD3A517C455C6C2AD3319A6E61F2B24A5C5AE363D33.
[0068] The data classifier classifies data according to the following pre-defined privacy sensitivity policy: the system reads the electronic map data and its metadata (such as classification label, resolution, data type, source, and purpose). The data classifier applies the following policy rules in sequence for matching:
[0069] Rule 1: If the "classification label" attribute of the data contains keywords such as "military", "national defense", "critical department", or the data source is "Ministry of National Defense Surveying and Mapping Bureau", it is classified as L1 level.
[0070] Rule 2: If the "resolution" attribute of the data is higher than "1 meter", or the "data type" is "high-precision DEM (Digital Elevation Model)", "high-resolution image", "fine three-dimensional model", it is classified as L2 level.
[0071] Rule 3: If the data does not meet the rules of L1 and L2, and its "purpose" attribute contains "public", "public service", "basic geography", it is classified as L3 level.
[0072] Default rule: For data that cannot be classified by the above rules, it is marked as "to be reviewed" by the system and handed over to the administrator for manual classification.
[0073] According to the matching results, the "underground military communication optical cable" data (matching rule 1) is classified as L1; the "0.2-meter resolution aerial image" and "building three-dimensional contour model" (matching rule 2) are classified as L2; the "main road network" and "administrative boundary" (matching rule 3) are classified as L3.
[0074] The system generates metadata for each layer of data, and the metadata content is created by calling the metadata generation module, containing the following fields:
[0075] Policy ID, such as PolicyID: "GIS_Policy_V1";
[0076] Classification confidence, such as ClassificationConfidence: 0.95;
[0077] Timestamp, such as Timestamp: "2025-09-15T09:42:00Z";
[0078] Data level, such as DataLevel: "L1" / "L2" / "L3";
[0079] The size of the level data, such as DataSize: 1073741824 bytes;
[0080] The hash value of the level original data, such as DataHash: 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08.
[0081] Step S2, derive the first layer key K1 from the master key K0, and perform authenticated encryption on the first level data L1 in the level data set with the first layer key K1 to obtain the first layer ciphertext C1.
[0082] In this optional embodiment, the first layer key K1 is derived from the master key K0, and the first layer key K1 is used to perform authenticated encryption on the first level data L1 in the level data set to obtain the first layer ciphertext C1, which includes:
[0083] Calculate the ciphertext digest D0, and derive the first layer key K1 based on the master key K0 and the byte concatenation operation through the key derivation function (KDF);
[0084] Calculate the binding value B1, and perform authenticated encryption on the first level data L1 with the first layer key K1 through the encryption algorithm (AEAD) to obtain the first layer ciphertext C1.
[0085] Specifically, for the first layer, the first layer key K1 is derived from the master key K0 and the subsequent level data, and the AEAD is used to perform authenticated symmetric encryption on L1 to obtain the first layer ciphertext C1, wherein the input of the AEAD includes a random initialization vector Nounce1, plaintext L1 and optional additional authentication data AAD1, and the output includes a ciphertext part and an authentication tag, which are combined to obtain the first layer ciphertext C1.
[0086] Derive the first layer key: Here, HMAC-Based KDF (HKDF) is used as the KDF function, "layer" and "initial" represent the byte sequences corresponding to the fixed strings "layer" and "initial" respectively, 1 represents the byte representation of the integer 1, and "||" represents the concatenation of the bytes on both sides of the symbol.
[0087] L1 (i.e. the vector data of "Underground Military Communication Optical Cable") is encrypted using K1 and AEAD encryption algorithm AES-256-GCM: C1 = AES-256-GCM-Encrypt(K1, Noncel, L1, AAD1), where AES-256-GCM-Encrypt is the AES-256-GCM encryption function, C1 is the ciphertext (containing an authentication tag), Noncel is a random number, and AAD1 is the metadata of the L1.
[0088] Step S3, based on the previous layer ciphertext C i -1 and the previous layer key K i -1, the current layer key K i is derived in coordination with the hierarchical data set, and the previous layer ciphertext C i -1 is concatenated with the current hierarchical data L i to perform layer-by-layer authenticated encryption through an authenticated encryption with associated data (AEAD) in combination with the current layer key, to obtain the final nested ciphertext.
[0089] In this optional embodiment, the previous layer ciphertext C i -1 and the previous layer key K i -1 are concatenated, and the current layer key K i is derived through a key derivation function (KDF) based on the previous layer key K i -1, and the previous layer ciphertext digest D i -1 is concatenated with the current hierarchical data L to perform layer-by-layer authenticated encryption through an authenticated encryption with associated data (AEAD) to obtain the final nested ciphertext, including:
[0090] i The previous layer ciphertext digest D i -1 is calculated, and the current layer key K i is derived through a key derivation function (KDF) based on the previous layer key K -1 and the byte concatenation operation.
[0091] i The binding value B i is calculated, and the binding value B i is used as additional authentication data for authenticated encryption with associated data (AEAD) to authenticate the previous layer ciphertext C -1 and the current hierarchical data L i layer by layer, to obtain the final nested ciphertext.
[0092] i Based on the final nested ciphertext, a hierarchical access token is generated for the final nested ciphertext to control access to the current layer key K
[0093] In this optional embodiment, the hierarchical access token is issued and verified through one of the following ways:
[0094] Threshold signature schemes, multi-party key management protocols, and centralized key management services.
[0095] In this optional embodiment, the calculation of the binding value B i The formula is:
[0096] ;
[0097] In the formula, B i Indicates the binding value; HMAC indicates the message authentication mechanism; K b,i Indicates the binding key; i (.) indicates the length of the returned data in bytes; C len ₋1 indicates the previous layer of ciphertext; L i Indicates the data at the current level; This indicates that the bytes on both sides of the symbol are concatenated.
[0098] In this optional embodiment, the binding key includes:
[0099] The key management unit dynamically issues access control policies based on predefined access control policies, which define the access permissions of different user roles to data at each level.
[0100] In this optional embodiment, the calculation of the binding value B i and bind value B i As additional authentication data to the Authentication Encryption Associated Data (AEAD), layer-by-layer authentication binds to the previous layer's ciphertext C. i ₋1 and the current level data L i The final nested ciphertext includes:
[0101] By using independent threads or processes, the hierarchical data of each level in the hierarchical dataset can be divided into independent data groups;
[0102] Based on the current layer key K i The authentication encryption band associated data is used to encrypt independent data groups in parallel to generate the sub-ciphertext of the current layer;
[0103] After each layer of parallel encryption is completed, the sub-ciphertext of the current layer is concatenated and encoded into byte streams in the order of the layer, and the ciphertext digest D is calculated. i The summary value;
[0104] The encrypted digest D i The digest value is used as the merge object of the current layer, and the merge object is combined with the ciphertext C of the previous layer. i After ₋1 is concatenated, it is passed through the previous layer key K i ₋1 Perform authentication encryption with associated data encryption to form the final nested ciphertext.
[0105] Specifically, fori =2 to n, based on previous layer ciphertext C i ₋1, previous layer key K i ₋1 and subsequent layer data L i derives the first layer key K i , and concatenates the previous layer ciphertext C i ₋1 with the first layer data L i i uses K i to perform AEAD encryption to obtain the first layer ciphertext C i ; the n-th layer ciphertext obtained after the n-th encryption is taken as the final encryption output of the user data. i
[0106] derives the first layer key K i , including: calculating the previous layer ciphertext digest i , and deriving K based on the previous layer key K i ₋1 and a byte concatenation operation derives K i as context information through a key derivation function KDF, in which “layer” represents a byte sequence corresponding to the fixed string “layer”, “layer_index” represents a byte representation of the current layer index, D i-1 represents a 32-byte SHA256 digest value of the previous layer ciphertext, and “||” represents concatenation of bytes on both sides of the symbol. i
[0107] For i = 2 to n, a value B i is calculated for binding; and the B i is used as additional authentication data of AEAD to ensure the authentication binding of C ₋1 and L i ; the metadata H i of the C i records the layer number, algorithm identifier and B i value. i
[0108] The binding key K b,i is derived in one of the following ways:
[0109] 1) derived from the master key K0 through KDF: K b,i =KDF(K0,“bind”|| i );
[0110] 2) derived from the corresponding layer key K i through KDF: K b,i =KDF(K i ,“bind”);
[0111] where "bind" represents the byte sequence corresponding to the fixed string "bind".
[0112] Binding key K b,i may also be dynamically issued by the key management unit according to a predefined access control policy, which defines the access rights of different user roles to the data at each level. Each level generates a level access token to control access to the corresponding K i , and the level access token is issued and verified in one of the following ways: a threshold signature scheme, a multi-party key management protocol, or a centralized key management service. The level data of each level is divided into several independent data units, and independent threads or processes are called respectively to perform AEAD encryption in parallel on each segment based on the level key K i corresponding to the level; after parallel encryption at each level is completed, the sub-ciphertexts of the level are concatenated in byte stream order, and a SHA256 digest value is calculated as the merged object of the level; after the merged object and the ciphertext of the previous level are spliced, AEAD encryption is performed via the key K i -1 of the previous level to form nested ciphertext; the SHA256 digest of the merged object is used as additional authentication data for AEAD encryption of the next level.
[0113] Second level encryption and nested binding:
[0114] 1) Calculate the digest of the first level ciphertext C1: D1 = SHA256(C1), to obtain a fixed length (256 bits) hash value;
[0115] 2) Derive the second level key: ;
[0116] 3) Derive the second level binding key: K b,2 = KDF(K2, "bind"), where "bind" represents the byte sequence corresponding to the fixed string "bind".
[0117] 4) Construct the plaintext input: ;
[0118] 5) Calculate the binding value: B2 = HMAC-SHA256(K b,2 , P2), where HMAC-SHA256 is a function for calculating SHA256-based HMAC;
[0119] 6) Perform AEAD encryption using K2, and pass B2 as part of AAD: C2 = AES-256-GCM-Encrypt(K2, Nonce2, C1 || L2, AAD2 || B2), where C2 is the ciphertext, Nonce2 is a random number, and AAD2 is the metadata of L2.
[0120] Third layer encryption is bound with nesting:
[0121] 1) Calculate the digest of the second layer ciphertext C2: D2 = SHA256(C2);
[0122] 2) Derive the third layer key: ;
[0123] 3) Derive the binding key: K b,3 = KDF(K3, "bind").
[0124] 4) Construct the plaintext input: ;
[0125] 5) Calculate the binding value: B3 = HMAC-SHA256(K b,3 , P3);
[0126] 6) Perform AEAD encryption using K3 and pass B3 as part of the AAD: C3 = AES-256-GCM-Encrypt(K3, Nonce3, C2 || L3, AAD3 || B3), the final ciphertext C3 contains the encryption results of all three layers of data and their binding relationship.
[0127] This embodiment takes the encryption storage and permission control of an electronic map data as an example. The electronic map contains three types of data with different sensitivity:
[0128] I. L1 (highest sensitive data): related to military and national defense, such as military bases, strategic facilities, underground pipeline distribution.
[0129] II. L2 (medium sensitive data): high-resolution geographic information required for urban planning, such as urban road network, terrain elevation model, building contour data.
[0130] III. L3 (lower sensitive data): low-resolution electronic map accessible to ordinary users, such as street names, administrative boundaries, public interest points, etc.
[0131] The surveying and mapping geographic information system (GIS) needs to encrypt the electronic map data and store it in the cloud, and implement hierarchical access control. For example, ordinary public users can only access L3 data for basic reference; urban planning personnel need to access L2 and L3 for planning analysis; only a few authorized security department personnel can access all data, including the most sensitive L1.
[0132] Suppose a city surveying and mapping institute obtains an electronic map data set containing the following specific elements:
[0133] L1 data: the precise coordinates, buried depth, and pipeline type data of the military communication optical cable in a certain area of the urban suburb. This data exists in the form of high-precision vector line elements.
[0134] L2 data: 0.2-meter resolution aerial image maps of the downtown area and three-dimensional contour models of all buildings in the area.
[0135] L3 data: the main road network and administrative boundary of the entire city.
[0136] When a city planner with access to L2 and L3 needs to consult the electronic map:
[0137] 1) The cloud returns the final ciphertext C3 and the related metadata AAD3||B3 to the client.
[0138] 2) The KMS confirms that the user role has L2 and L3 access rights through the access control list, and then issues K3 and K b,3 .
[0139] 3) The client uses K3 to decrypt C3 to obtain C2 and L3, and uses K b,3 to recalculate i (C2)||C2|| i (L3)||L3's HMAC and compare it with B3 in the metadata. If the verification is passed, the data integrity is ensured. The user can view L3 (the main road network and administrative boundary of the entire city).
[0140] 4) Then, the client applies to the KMS for decryption of C2. The KMS verifies the rights again and issues K2 and K b,2 .
[0141] 5) The client uses K2 to decrypt C2 to obtain C1 and L2, and uses K b,2 to recalculate len (C1)||C1|| len len len (L2)||L2's HMAC and compare it with B2 in the metadata. If the verification is passed, the data integrity is ensured. The user can access L2 (high-resolution images and building contours).
[0142] 6) Since the user has no right to obtain K1, he cannot apply to the KMS for decryption of C1. The highest sensitive L1 (military communication cable data) remains encrypted and cannot be accessed.
[0143] In the above way, the layered protection of GIS electronic map data is realized, ensuring that different roles can access corresponding levels of geographic information within the scope of their rights, thus meeting business needs and effectively preventing sensitive data leakage.
[0144] To sum up, by means of the technical scheme of the present application, the user data to be encrypted is divided into hierarchical data L1 to Ln from high to low privacy sensitivity by generating a master key K0; a key K1 is derived from K0 and the L1 is authenticated encryption to obtain C1; for the second to nth layers, K is derived based on the previous layer ciphertext C and / or key K, and C is obtained by encrypting C with K, and C is taken as the final output. n i The present application ensures the integrity and order of each encryption layer to be unalterable by nested derivation and authentication binding of the key and the ciphertext, realizes the hierarchical fine-grained access control to the data content, effectively reduces the risk of sensitive data leakage, and supports audit tracing. n
[0145] The above merely describes the preferred embodiments of the present application and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A hierarchical nested data encryption method supporting fine-grained access control, characterized by, The method comprises the following steps: generating a master key; receiving user data to be encrypted, and performing data classification on the user data to be encrypted according to a predefined privacy sensitivity policy by using a data classifier to obtain a hierarchical data set; deriving a first layer key from the master key, and performing authenticated encryption on first level data in the hierarchical data set by using the first layer key to obtain first layer ciphertext; comprising: calculating a ciphertext digest, and deriving the first layer key by using a key derivation function based on the master key and a byte concatenation operation; calculating a binding value, and performing authenticated encryption on the first level data by using the first layer key to obtain the first layer ciphertext; deriving a current layer key based on the previous layer ciphertext and the previous layer key in cooperation with the hierarchical data set, and performing authenticated encryption on the associated data layer by layer by using the previous layer ciphertext, the current level data and the current layer key through a byte concatenation operation to obtain the final nested ciphertext; comprising: calculating a digest of the previous layer ciphertext, and deriving the current layer key by using a key derivation function based on the previous layer key and a byte concatenation operation; calculating a binding value, and using the binding value as additional authentication data of the authenticated encryption associated data to authenticate the previous layer ciphertext and the current level data layer by layer to obtain the final nested ciphertext; based on the final nested ciphertext, generating a hierarchical access token for the final nested ciphertext to control access to the current layer key.
2. The hierarchical nested data encryption method supporting fine-grained access control according to claim 1, characterized in that, The method comprises the following steps: generating a master key; receiving user data to be encrypted, and performing data classification on the user data to be encrypted according to a predefined privacy sensitivity policy by using a data classifier to obtain a hierarchical data set comprising: generating a master key by using a key management service; receiving user data to be encrypted, and performing rule matching on the user data to be encrypted according to a predefined privacy sensitivity policy by using a data classifier to obtain a matching result; 3. The hierarchical nested data encryption method supporting fine-grained access control according to claim 2, characterized in that, according to the matching result, dividing the matching rule group, and generating corresponding metadata for the matching rule group. The predefined privacy sensitivity policy comprises: if the classification label attribute of the user data contains a first preset rule, the user data is divided into first level data; if the resolution attribute of the user data is higher than a preset height, or the data type is a second preset rule, the user data is divided into second level data; if the user data does not meet the rules of the first level data and the second level data, and the usage attribute contains a third preset rule, the user data is divided into third level data; 4. The hierarchical nested data encryption method supporting fine-grained access control according to claim 2, wherein, if the user data does not meet the rules of the first level data, the second level data and the third level data at the same time, the user data is marked as to be audited, waiting for the administrator to manually divide. The metadata comprises:
5. The hierarchical nested data encryption method supporting fine-grained access control according to claim 1, wherein, policy identifier, classification confidence, timestamp, data level, data level data size and hash value of the original data of the data level. The hierarchical access token is issued and verified by one of the following methods:
6. The hierarchical nested data encryption method supporting fine-grained access control according to claim 5, wherein, threshold signature scheme, multi-party key management protocol and centralized key management service. ; wherein, B i denotes a binding value; HMAC denotes a message authentication mechanism; K b,i denotes a binding key; The formula for calculating the binding value is: (.) denotes the length of the returned data in bytes; denotes the previous layer of ciphertext; L i denotes the current level of data; denotes concatenation of the bytes on both sides of the symbol.
7. The hierarchical nested data encryption method supporting fine-grained access control according to claim 6, wherein, len The binding key comprises: dynamically issued by a key management unit according to a predefined access control policy, the access control policy defines the access rights of different user roles to each level of data.
8. The hierarchical nested data encryption method supporting fine-grained access control according to claim 1, wherein, The calculation binding value and binding value as authentication encryption band associated data, layer by layer authentication binding previous layer ciphertext and current level data, get the final nested ciphertext includes: Using independent threads or processes, the hierarchical data of each layer of the hierarchical data is divided into independent data groups; Based on the current layer key, the independent data groups are encrypted in parallel by the authentication encryption band associated data to generate the sub-ciphertext of the current layer; When the parallel encryption of each layer is completed, the sub-ciphertext of the current layer is byte stream connected and encoded in the order of the layer, and the digest value of the ciphertext digest is calculated; The digest value of the ciphertext digest is taken as the merging object of the current layer, and the merging object is spliced with the previous layer ciphertext, and then the authentication encryption band associated data encryption is performed through the previous layer key to form the final nested ciphertext.
Citation Information
Patent Citations
Data grading protection method and system based on trusted data space
CN119830328A
Multi-level data encryption storage and access control method based on cloud computing
CN120316797A