Cloud data layered encryption storage method based on national secret algorithm

By constructing a four-level hierarchical encryption architecture based on a multi-dimensional semantic heat quantification model and dynamic migration mechanism using national cryptographic algorithms, and combining SM4 incremental encryption and hierarchical integrity verification, the problems of resource mismatch and key management in cloud storage are solved, achieving a balance between security and efficiency, and adapting to the needs of large-scale cloud storage environments.

CN123035033APending Publication Date: 2026-11-03SHANGHAI KUNXUAN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611387818.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing cloud storage encryption solutions cannot adapt to the dynamic changes in data access frequency, resulting in excessive encryption overhead for hot data, insufficient security strength for cold data, and the risk of plaintext exposure during data migration. Key management also poses a single point of leakage risk, making it difficult to meet the routine auditing needs of large-scale data.

Method used

A four-level hierarchical encryption architecture is constructed using a multi-dimensional semantic heat quantification model based on national cryptographic algorithms. Combined with a hysteresis dynamic migration mechanism and a differentiated ciphertext conversion method, the encryption strategy and data access characteristics are dynamically adapted through SM4 block-level incremental encryption and hierarchical integrity verification mechanism. A three-layer distributed threshold key escrow system is adopted to eliminate the risk of single-point key leakage.

Benefits of technology

It achieves dynamic adaptation of encryption strategies and data access characteristics, reduces the computational overhead of data updates and daily audits, improves security and operational efficiency, eliminates the risk of single point of key leakage, and adapts to cloud storage environments of different sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123035033A_ABST
    Figure CN123035033A_ABST
Patent Text Reader

Abstract

The application discloses a cloud data layered encryption storage method based on a national secret algorithm, and relates to the technical field of cloud storage data encryption. The method comprises the following steps: performing initial layered judgment on data, and obtaining a semantic heat value through multi-dimensional weighted calculation; dividing four storage levels according to a heat threshold value and matching corresponding national secret encryption strategies; triggering level migration by using a hysteresis threshold value, migrating upward to decrypt and re-encrypt, and migrating downward to use SM2 proxy re-encryption; updating data through layered granularity incremental encryption, and combining hierarchical SM3 hash chain to check integrity; and using a three-layer distributed key escrow system to manage the whole life cycle of keys. The application can balance encryption security strength and operation performance, reduce data update and migration overhead, eliminate the risk of key single-point leakage, and adapt to large-scale cloud storage scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud storage data encryption technology, specifically to a cloud data layered encryption storage method based on national cryptographic algorithms. Background Technology

[0002] With the widespread adoption of cloud storage services, a large amount of business and privacy data from enterprises and individual users has been transferred to cloud storage, making data storage security a core requirement of cloud services. The domestic industry is gradually adopting the SM series of national cryptographic algorithms as encryption compliance standards. Algorithms such as SM2, SM3, SM4, and SM9 cover application scenarios including asymmetric encryption, hash verification, symmetric encryption, and identifier cryptography, providing different dimensions of security protection for cloud-stored data. Based on this, tiered storage solutions employing differentiated encryption strategies for different types of data are gradually becoming a common optimization direction in the field of cloud storage encryption.

[0003] Most existing cloud storage encryption solutions employ fixed encryption strategies for all data or use static layering based on preset security levels. These solutions fail to adapt to dynamic changes in data access frequency, leading to resource mismatch issues such as excessive encryption overhead for hot data and insufficient security for cold data. Some dynamic layering solutions use access frequency as the sole criterion for layering, resulting in a single security dimension and a lack of boundary fluctuation suppression mechanisms. Fluctuations in data popularity around layer thresholds trigger numerous invalid migrations. Furthermore, data layer conversion typically involves decryption followed by re-encryption, posing a risk of plaintext exposure during migration. In addition, existing solutions often perform full re-encryption during data updates, resulting in high computational costs for small-scale modifications. The centralized key management architecture presents a single point of leakage vulnerability, and full integrity verification is ill-suited to the routine auditing needs of large-scale data. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a layered encrypted storage method for cloud data based on national cryptographic algorithms. This method constructs a four-level layered encryption architecture through a multi-dimensional semantic heat quantification model, coupled with a delayed dynamic migration mechanism and differentiated ciphertext conversion methods, to achieve dynamic adaptation between encryption strategies and data access characteristics, thus solving the resource mismatch problem of static layered schemes. Simultaneously, it employs SM4 block-level incremental encryption and hierarchical integrity verification mechanisms to reduce the computational overhead of data updates and daily audits. Combined with a three-layer distributed threshold key escrow system, it eliminates the risk of single-point key leakage from an architectural perspective. The entire solution is implemented based on standard national cryptographic algorithms, requiring no special hardware support, and can flexibly adapt to cloud storage environments of different sizes, balancing security compliance and operational efficiency.

[0005] S1. Initial stratification is performed on newly written data to cloud storage through semantic feature matching to quickly match the security level during the writing stage and reduce stratification bias caused by insufficient access data; for stored data units, access behavior, semantic attributes and business tag data are periodically collected, and the semantic heat value of each data unit is obtained through multi-dimensional weighted calculation. S2. Based on the preset heat threshold range, the data unit is divided into four storage layers: hot data layer, warm data layer, cold data layer, and archived data layer. The corresponding national cryptographic encryption strategy is matched for each layer to make the encryption strength compatible with the data access characteristics and security requirements. S3. Continuously monitor changes in semantic heat value, and use a hysteresis threshold to set migration trigger conditions to suppress frequent invalid migrations caused by heat boundary fluctuations; when the semantic heat value of a data unit exceeds the current level threshold boundary and crosses the hysteresis range for N consecutive monitoring cycles, a hierarchical migration is triggered; upward migration uses a decryption and re-encryption method, and downward migration uses a proxy re-encryption based on SM2 to complete the encryption strategy conversion in ciphertext state, avoiding plaintext exposure during the migration process, and storing it in the target level after migration; S4. Data at each level is updated using a hierarchical granular incremental encryption mechanism. The modification range is located according to the SM4 group boundary. Only the affected encrypted groups are re-encrypted, reducing the amount of encryption computation for data updates. Hierarchical integrity verification is performed through a hierarchical SM3 hash chain structure. S5. A three-layer distributed key escrow system is adopted to manage the entire key lifecycle. The root key layer is based on the SM2 threshold cryptography scheme for distributed storage. The master key layer and data key layer are generated unidirectionally through the SM3 key derivation function. The key lifecycle is linked with the data layer, eliminating the single point of leakage risk of centralized key management.

[0006] Furthermore, in step S1, the semantic heat value is calculated using a weighted summation formula, the formula expression of which is: In the formula, This represents the semantic popularity value. The normalized access frequency parameter within a set period is mapped to the range of 0 to 1 to unify the units. The normalized semantic sensitivity parameter is calculated by combining the proportion of sensitive fields and the data security level label. The normalized business value weight parameter is determined by the importance level of the business line to which the data belongs; , , These are the weighted coefficients corresponding to the three dimensions of access frequency, semantic sensitivity, and business value, respectively. + + The proportion can be flexibly adjusted according to the performance and security priorities of the business.

[0007] Furthermore, in step S2, the national cryptographic encryption strategies matched at each level are as follows: the hot data layer adopts the SM4-CTR encryption mode to adapt to high-frequency random read and write scenarios with streaming encryption; the warm data layer adopts the SM4-CBC encryption mode combined with HMAC-SM3 integrity verification to balance encryption strength and data integrity protection; the cold data layer adopts the SM2 and SM4 hybrid encryption mode to improve the storage security of low-frequency data through asymmetric key encapsulation; and the archived data layer adopts SM9 identifier cryptography encryption to reduce the key management cost of long-term archiving by identifying the public key.

[0008] Furthermore, in step S2, the heat threshold ranges corresponding to the four storage tiers can be dynamically adjusted according to the overall cluster load and security baseline; the hot data tier corresponds to the highest heat range, and the heat ranges of the warm data tier, cold data tier, and archived data tier decrease sequentially. During the adjustment process, the order of the ranges remains unchanged to avoid range overlap.

[0009] Furthermore, in step S3, the hysteresis threshold is set according to the following rules: each level is set with an independent upward migration threshold and a downward migration threshold, and a difference range is formed between the two thresholds; when the data unit's popularity increases, it must reach the upward migration threshold to trigger a level upgrade, and when the popularity decreases, it must be lower than the downward migration threshold to trigger a level downgrade. The influence of small fluctuations in popularity is offset by the bidirectional threshold difference.

[0010] Furthermore, this scheme adopts a one-way proxy re-encryption scheme based on the SM2 elliptic curve cryptography algorithm, following the GM / T 0003 series of national cryptographic standards. Constructed based on the elliptic curve discrete logarithm difficulty problem, it supports permission conversion between key and ciphertext in ciphertext state, without exposing the plaintext key throughout the process. In step S3, the SM2-based proxy re-encryption execution flow is as follows: SM2 public-private key pairs corresponding to each storage level are pre-generated; when downward migration is triggered, the key management node uses the SM2 private key of the current level and the SM2 public key of the target level to calculate and generate a re-encryption conversion factor. The conversion factor cannot be used to deduce the private key information of any level; the cloud storage node uses the re-encryption conversion factor to perform conversion operations on the SM4 key ciphertext corresponding to the data. The conversion process does not decrypt the plaintext data or obtain the original symmetric key. The converted ciphertext can be decrypted using the SM2 private key of the target level.

[0011] The data structure of the re-encryption conversion factor is as follows: a fixed-length 32-byte big-endian scalar value is used as the core operation factor, along with four metadata items: a unique identifier for the current level, a unique identifier for the target level, a generation timestamp, and an SM3 message authentication verification code; the conversion factor is bound to a single data migration task, is valid only once, and is destroyed immediately after the migration is completed.

[0012] The formula for calculating the conversion factor is as follows: Let the public base point of the SM2 elliptic curve be... The curve order is n; the SM2 private key for the current storage level is The corresponding public key is The target storage level's SM2 public key is The corresponding private key is The key management node performs calculations in a secure, encrypted environment. in For private key The multiplicative inverse in the modulo n domain, the final output This is the re-encryption conversion factor.

[0013] The steps for SM4 key ciphertext conversion are as follows: 1. The cloud storage node obtains the re-encryption conversion factor for the corresponding migration task. and the SM4 key ciphertext encrypted at the current level. The ciphertext conforms to the SM2 public-key encryption standard structure and consists of elliptic curve point components. Key ciphertext components Hash verification component Assembled in sequence; 2. For ciphertext components Perform scalar multiplication on elliptic curves to obtain the transformed point components. ; 3. Maintain , The components remain unchanged, and the transformed point components are... With the original , By concatenating the ciphertext in its original order, the SM4 key ciphertext at the target level is obtained. Complete the ciphertext conversion; 4. The entire conversion process is performed only in encrypted state. Cloud storage nodes cannot restore the plaintext SM4 key, nor can they derive the SM2 private key at any level.

[0014] The conversion factor leakage prevention verification mechanism includes four layers of protection: 1. Zero-knowledge validity verification: When the key management node generates the conversion factor, it simultaneously generates the corresponding zero-knowledge proof. Before use, the cloud storage node can verify that the conversion factor is generated by a legitimate public and private key at a specified level. The verification process does not disclose any private key information. 2. Single lifecycle management: The conversion factor is bound to a single data migration task and is only valid for one time. After the migration task is completed, it is destroyed on the storage node side immediately and is not stored persistently. 3. Operation permission isolation: The conversion factor is only issued to the specified storage node that performs this migration. The node only has the permission to call the ciphertext conversion operation and cannot read or export the plaintext data of the conversion factor. 4. Integrity verification protection: The conversion factor is accompanied by an SM3 message authentication code generated by the key management node. The storage node verifies the integrity before use to prevent the factor from being tampered with or forged.

[0015] Furthermore, in step S4, the execution rules of the layered granular incremental encryption mechanism are as follows: the data is divided into three levels according to logical granularity: file level, fixed-size data block level, and SM4 standard block level. The granularity is refined layer by layer to correspond to different modification scenarios. When the data is modified, the byte offset corresponding to the modified content is located first. After aligning with the SM4 block boundary, the affected block sequence number is calculated. Only the affected encrypted blocks are re-encrypted, while the unmodified encrypted blocks retain their original ciphertext state and encryption key.

[0016] Furthermore, in step S4, a Merkle tree is constructed using SM3 hashing to maintain the integrity verification value of data at each level. The leaf nodes of the Merkle tree correspond to the SM3 hash value of each data block. After the data is modified, the node hash value of the Merkle tree is updated only along the path corresponding to the affected data block, while the hash values ​​of the remaining branch nodes remain unchanged, thus avoiding the additional overhead caused by recalculating the hashes.

[0017] Further, in step S5, the three-layer distributed key escrow system includes a root key layer, a master key layer, and a data key layer. The root key layer adopts the (t,n) threshold SM2 scheme, which splits the system root key into n subkeys, which are distributed and stored on multiple physically isolated key management nodes. At least t nodes are required to participate in the operation when decrypting and recovering the root key. Nodes with fewer than the threshold number cannot obtain valid key information. The master key layer contains four sets of master keys, which correspond to four data storage levels. Each set of master keys is generated unidirectionally from the root key by combining the SM3 key derivation function with the level identifier. The data key layer contains the encryption key corresponding to a single data unit, which is generated unidirectionally from the master key of the corresponding level by combining the unique identifier of the data unit with the SM3 key derivation function.

[0018] The SM3 key derivation function conforms to the GM / T 0003.1-2012 national cryptographic standard, is based on SM3 hash iteration, and the general derivation formula is: in The derived input seed is composed of the upper-level key and a unique identifier; The bit length of the key to be derived.

[0019] The formula for calculating the derived iteration rounds is: That is, round up the 256 bits of a single output of SM3 to get the total number of iterations n.

[0020] The iterative execution process is as follows: in It is a 32-bit incrementing counter, initially set to 0x00000001, incrementing by 1 in each iteration; finally, the outputs of all iterations are concatenated. and cut off the front Bits, to obtain the target derived key.

[0021] When the master key is derived The value is 256, and the iteration round is 1; during data key derivation... The value is 128, which matches the key length of the SM4 algorithm, and the iteration round is 1.

[0022] The data structure definitions for each level of the three-layer key are as follows: 1. Root Key Layer: The system root key is a 256-bit SM2 master private key; each subkey after being secretly shared and split is a 256-bit large integer, with a fragment sequence number, threshold parameter, and fragment check hash value, and is independently stored in the hardware security module of the physically isolated key management node; 2. Master Key Layer: The master key for each layer is a 256-bit symmetric key, which includes a unique identifier for its layer, a derived salt value, an effective timestamp, and a rotation cycle identifier. It is distributed and stored in key service nodes in each region. 3. Data Key Layer: The key for a single data unit is a 128-bit SM4 symmetric key, which includes a globally unique identifier for the data unit, its hierarchical identifier, cache validity period, and derivation path identifier. It is cached in the memory of the compute node as needed.

[0023] The key lifecycle and data layer linkage mechanism is as follows: 1. After the initial layering of data is completed, the system automatically calls the master key of the corresponding layer and derives a unique data key by combining it with the unique data identifier. The validity period of the key is bound to the current layer of the data.

[0024] 2. After the data triggers a hot migration and completes the ciphertext conversion, the data key corresponding to the original level immediately becomes invalid and is cleared from all cache nodes; the system automatically uses the master key of the target level and combines it with the same unique data identifier to derive a new data key, and subsequent encryption and decryption operations uniformly use the new key.

[0025] 3. When the root key performs sub-key rotation, the master key and data key are automatically synchronized and updated through the derivation mechanism. The rotation process does not require re-encryption of all data and does not interrupt the operation of upper-layer services.

[0026] This system eliminates the single point of leakage risk of centralized key management at the architectural level. The core principle is: 1. Root key threshold distribution: The complete root key is never stored in plaintext form; the split sub-keys are stored in physical isolation; collusion by fewer than a threshold number of nodes cannot recover the root key; leakage of a single node will not cause the root key to be leaked. 2. Irreversible one-way derivation: Both the master key and data keys are derived one-way through the SM3 hash function, and the lower-level key cannot be used to derive the upper-level key in reverse; even if a single data key is leaked, it is impossible to trace back to obtain the master key and root key. 3. Hierarchical key isolation: The master keys for the four storage levels are independent of each other. The leakage of a key in a single level will only affect the data in that level, and the risk will not spread to other levels. 4. On-demand derivation without centralized storage: Data keys are derived on demand and cleared as needed, eliminating the risk of mass leakage from the source by eliminating the need for a centralized full data key library.

[0027] Furthermore, in step S4, the hierarchical SM3 hash chain structure is divided into three verification levels: file layer, data block layer, and sector layer. During verification, the top-level hash value of the file layer is verified first. If further investigation is needed, drill down to the data block layer and locate abnormal data blocks through the Merkle tree path. When data corruption is confirmed, perform full-scale, group-by-group hash verification of the sector layer to determine the scope of corruption. Through hierarchical verification, the verification capability is guaranteed while reducing the computational overhead of routine auditing.

[0028] Compared with existing technologies, this cloud data hierarchical encryption storage method based on national cryptographic algorithms has the following advantages: I. This invention obtains the semantic heat value of data through multi-dimensional weighted calculation and divides it into four storage levels. It sets the trigger conditions for level migration in combination with the hysteresis threshold rule. At the same time, it adopts differentiated ciphertext conversion methods for different migration directions. This enables the encryption strength of data at each level to match its own access characteristics and security attributes, suppresses frequent invalid migrations caused by heat fluctuations, and does not decrypt plaintext when data migrates to a low heat level. On the basis of meeting the national cryptographic compliance requirements, it balances the security strength and operation performance of encrypted storage.

[0029] Second, this invention processes data updates through a layered granular incremental encryption mechanism based on SM4 group boundaries. Combined with a three-layer distributed key escrow system and a hierarchical SM3 hash verification structure, it can re-encrypt only the smallest encryption unit involved in the modification, eliminating the risk of single-point key leakage. At the same time, it can perform integrity verification at different depths as needed, significantly reducing the computational overhead of data updates, key management and daily auditing, and adapting to the high-frequency update and routine operation and maintenance needs of large-scale cloud storage scenarios.

[0030] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0032] Figure 1 This is a schematic diagram of the overall process of the cloud data hierarchical encryption storage method based on national cryptographic algorithms of the present invention. Figure 2 This is a schematic diagram of the execution flow of the delayed dynamic hierarchical migration of the present invention; Figure 3 This is a schematic diagram of the architecture of the three-layer distributed key escrow system of the present invention. Detailed Implementation

[0033] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0034] This embodiment is applied to a distributed cloud storage cluster environment, fully implementing a layered encrypted storage method for cloud data based on national cryptographic algorithms. The method uses data semantic popularity as the core criterion to achieve dynamic matching between encryption strategies and storage levels. It suppresses frequent level fluctuations through hysteresis rules, ensures data security through differentiated ciphertext migration methods, and includes fine-grained incremental updates and hierarchical integrity verification mechanisms. Furthermore, it completes full lifecycle key management through a three-layer distributed key system, achieving a dynamic balance between encryption security strength and system performance while complying with cryptographic security standards. The overall execution flow of the method is as follows: Figure 1 As shown.

[0035] The system first performs initial layering determination and semantic popularity value quantification. Each independent file serves as the basic data unit, and all layering, encryption, and migration operations are performed on a file-by-file basis. When new data is written to cloud storage, the system first performs a rapid initial layering determination to avoid layering deviations caused by insufficient data access in the early stages of writing. During the initial layering determination, the system first reads the business tags and content summaries of the data file, scans sensitive fields in the file content using a lightweight semantic recognition engine, and calculates the proportion of sensitive fields to the total content. When the proportion of sensitive fields exceeds a preset threshold, or when a business tag is marked as high importance, the data is directly classified into the cold data layer or higher security level; ordinary non-sensitive business data is classified into the warm data layer by default; and publicly available non-sensitive data is classified into the hot data layer by default. The initial layering is only a temporary configuration during the writing phase. After the data writing is completed, the system will recalculate the popularity value and correct the layer at fixed intervals.

[0036] For stored data units, the system synchronously updates evaluation parameters across three dimensions with a 24-hour statistical cycle. The access frequency parameter has a 30-day statistical cycle, accumulating the total number of accesses to the corresponding data file over 30 days to calculate the average daily access count. Then, a maximum-minimum normalization method is used to map the average daily access count to a range of 0 to 1. The maximum normalized value is the historical peak of the average daily access count for a single file within the cluster, and the minimum value is 0. The normalized access frequency parameter is denoted by F, with higher values ​​indicating more frequent data access. The semantic sensitivity parameter is calculated jointly by the proportion of sensitive fields and the data security level label. The system first matches the file content using a pre-defined sensitive field library, calculating the proportion of characters in sensitive fields to the total number of characters in the file to obtain a basic sensitivity score. Then, it overlays the pre-defined security level label coefficients: 1 for ordinary security level, 1.2 for internal security level, and 1.5 for core security level. Finally, the calculation result is normalized to a range of 0 to 1 to obtain the semantic sensitivity parameter S, with higher values ​​indicating more important data security attributes. The business value weight parameter is determined based on the importance level of the business line to which the data belongs. All business lines in the system are uniformly divided into three levels: ordinary, important, and core, corresponding to normalized values ​​of 0.2, 0.6, and 1.0, respectively. The corresponding parameter is denoted as V.

[0037] The semantic popularity score is calculated using a weighted summation formula, the expression of which is: In the formula, This is the semantic popularity value, ranging from 0 to 1; This is the normalized access frequency parameter within a given period. The normalized semantic sensitivity parameter, These are the normalized business value weight parameters; , , These are the weighting coefficients for the three dimensions, and the sum of the three coefficients is 1. The weighting coefficients can be flexibly adjusted according to the performance and security requirements of the business side. In this embodiment... The value is 0.5. The value is 0.3. The value is 0.2, which prioritizes matching the impact of access frequency on storage read and write performance, while also taking into account the security attributes and business value of the data itself.

[0038] After calculating the semantic heat value, the system matches the data units to the corresponding four storage levels and configures the corresponding national cryptographic encryption strategy for each level. The system presets four heat threshold ranges, corresponding to the four storage levels. In this embodiment, the initial basic thresholds are set as follows: hot data layer corresponds to a heat value greater than or equal to 0.7; warm data layer corresponds to a heat value greater than or equal to 0.4 and less than 0.7; cold data layer corresponds to a heat value greater than or equal to 0.15 and less than 0.4; and archived data layer corresponds to a heat value less than 0.15. The heat threshold ranges support dynamic adjustment, based on the overall cluster computing load and security baseline requirements. When the average CPU load of the cluster's encryption computing nodes continuously exceeds 80%, the system appropriately raises the lower limit of the hot data layer threshold, with each adjustment step being 0.02, gradually reducing the scale of hot data and lowering the overall pressure of encryption computing. When the security baseline level is improved, the system lowers the lower limit of the cold data layer threshold, allowing more data to enter a higher security level storage level. The heat ranges of the four levels always maintain a sequentially decreasing order, without any overlap.

[0039] The four storage tiers are each matched with an independent national cryptographic encryption strategy, and all algorithms are implemented using standard cryptographic algorithms. The hot data tier uses the SM4 algorithm's CTR (Counter Mode) working mode. Each data block corresponds to an independent initialization vector and counter value. The initialization vector is randomly generated by the system and stored separately from the ciphertext. CTR mode supports random access; reading data at any position does not require decrypting all preceding data, resulting in fast encryption and decryption speeds suitable for high-frequency read / write scenarios. Files in the hot data tier are deployed on high-performance storage nodes within the cluster, prioritizing read / write latency. The warm data tier uses the SM4 algorithm's CBC (Cipher Block Chaining) working mode. The encryption of each block depends on the encryption result of the previous block, and the first block uses a random initialization vector. The warm data tier also attaches an HMAC-SM3 message authentication code. The system calculates the HMAC-SM3 value for each data block's ciphertext. When reading data, the authentication code is verified before decryption, balancing encryption strength and integrity verification capabilities. Files in the warm data tier are deployed on ordinary-performance storage nodes. The cold data layer employs a hybrid SM2 and SM4 encryption mode. Plaintext data is encrypted using the SM4 algorithm to generate ciphertext, and the symmetric key used for SM4 is encrypted with the SM2 public key and stored along with the ciphertext. Decryption requires first using the SM2 private key to obtain the SM4 key, then decrypting the plaintext. This dual encryption ensures the storage security of infrequently accessed data. Cold data layer files are deployed on high-capacity storage nodes. The archive data layer uses the SM9 identifier cryptography algorithm, encrypting data using the globally unique identifier of the data file as the public key. Decryption uses the corresponding SM9 private key. This mode eliminates the need to manage public key certificates for each file; it only requires maintaining the mapping between identifiers and private keys, significantly reducing the key management costs of long-term archive storage. Archive data layer files are deployed on high-capacity archive storage media.

[0040] The system continuously monitors changes in data popularity and achieves smooth hierarchical adjustments through a delayed dynamic hierarchical migration mechanism. The complete execution flow of hierarchical migration is as follows: Figure 2As shown, the system updates the semantic heat value of all data units on a 24-hour monitoring cycle, determining whether hierarchical migration is triggered for each unit. To avoid frequent invalid migrations caused by small fluctuations in heat values ​​near hierarchical boundaries, the system introduces a hysteresis threshold rule. The hysteresis threshold is set as follows: each hierarchical level has an independent upward migration threshold and a downward migration threshold, with the difference between the two thresholds forming a hysteresis range. Taking the warm data layer as an example, the basic range is 0.4 to 0.7, the upward migration threshold is set to 0.72, and the downward migration threshold is set to 0.38. When the data heat value increases, it will only be upgraded to the hot data layer if it exceeds 0.72 for several consecutive periods; when the data heat value decreases, it will only be downgraded to the cold data layer if it is below 0.38 for several consecutive periods. When the heat value fluctuates within the range of 0.38 to 0.72, the warm data layer remains unchanged. The width of the hysteresis range can be adjusted according to business needs; in this embodiment, the width of the hysteresis range accounts for 5% of the current hierarchical heat range.

[0041] The trigger condition for hierarchical migration is that the semantic popularity value of a data unit exceeds the corresponding migration threshold of the current level and crosses the hysteresis range for three consecutive monitoring periods. In this embodiment, the number of monitoring periods is set to 3, corresponding to the number of periods parameter in the method. After the condition is met, the system officially adds the data to the migration queue and executes the migration operation sequentially according to priority. Migration is divided into two scenarios: upward migration and downward migration, each employing different ciphertext conversion methods.

[0042] Upward migration refers to moving data to a higher-priority level, specifically from the archive layer to the cold data layer, from the cold data layer to the warm data layer, and from the warm data layer to the hot data layer. During upward migration, the encryption strength of the target layer is lower, and the algorithm's operating mode differs, making direct ciphertext conversion impossible. During migration, the system first obtains the decryption key corresponding to the current layer from the key management node and decrypts the ciphertext data in the memory of the computing node. After obtaining the plaintext, it then calls the encryption algorithm and encryption key of the target layer to re-encrypt the plaintext. After the new ciphertext is written to the storage node corresponding to the target layer, the system calculates the integrity check value of the new ciphertext. If it matches the check value of the original plaintext, the ciphertext in the original storage location is marked as pending deletion, and physical deletion is delayed.

[0043] Downward migration refers to moving data to a lower-priority level, specifically from the hot data layer to the warm data layer, the warm data layer to the cold data layer, and the cold data layer to the archive layer. Downward migration is performed using a proxy re-encryption method based on SM2, without decrypting the plaintext data throughout the entire process.

[0044] This embodiment adopts a one-way proxy re-encryption scheme based on the SM2 elliptic curve cryptography algorithm, which follows the GM / T 0003 series of national cryptographic standards. It is constructed based on the elliptic curve discrete logarithm problem and can complete the access permission conversion of ciphertext without decrypting the plaintext. The symmetric key and data plaintext are not exposed throughout the process.

[0045] The system pre-generates independent SM2 public-private key pairs for each of the four storage tiers. The private key for each tier is securely stored by an independent key management node, while the public key is publicly available within the cluster. When a downward migration is triggered, the key management node receives the migration request and uses the SM2 private key of the current tier and the SM2 public key of the target tier to calculate the re-encryption conversion factor through elliptic curve operations.

[0046] The formula for calculating the conversion factor is as follows: Let the public base point of the SM2 elliptic curve be... The curve order is n; the SM2 private key for the current storage level is The corresponding public key is The target storage level's SM2 public key is The corresponding private key is The key management node performs calculations in a secure, encrypted environment. in For private key The multiplicative inverse in the modulo n domain, the final output This is the re-encryption conversion factor.

[0047] The data structure of the re-encryption conversion factor is as follows: a fixed-length 32-byte big-endian scalar value is used as the core operation factor, along with four metadata items: a unique identifier for the current level, a unique identifier for the target level, a generation timestamp, and an SM3 message authentication verification code. The conversion factor is bound to a single data migration task, is only valid for one time, and is destroyed on all nodes immediately after the migration is completed, without being persistently stored.

[0048] The conversion factor only contains the computational parameters required for ciphertext conversion and cannot deduce the private key at any level. The key management node sends the conversion factor to the corresponding storage node. After receiving the conversion factor, the storage node directly performs the conversion operation on the SM4 key ciphertext corresponding to the data.

[0049] The steps for SM4 key ciphertext conversion are as follows: 1. The cloud storage node obtains the re-encryption conversion factor for the corresponding migration task. and the SM4 key ciphertext encrypted at the current level. The ciphertext conforms to the SM2 public-key encryption standard structure and consists of elliptic curve point components. Key ciphertext components Hash verification component Assembled in sequence; 2. For ciphertext components Perform scalar multiplication on elliptic curves to obtain the transformed point components. ; 3. Maintain , The components remain unchanged, and the transformed point components are... With the original , By concatenating the ciphertext in its original order, the SM4 key ciphertext at the target level is obtained. Complete the ciphertext conversion; 4. The entire conversion process is performed only in encrypted state. Cloud storage nodes cannot restore the plaintext SM4 key, nor can they derive the SM2 private key at any level.

[0050] It also includes a conversion factor leakage prevention and verification mechanism, comprising four layers of protection: 1. Zero-knowledge validity verification: When the key management node generates the conversion factor, it simultaneously generates the corresponding zero-knowledge proof. Before using the cloud storage node, the conversion factor can be verified by the proof to be generated by a legitimate public and private key at a specified level. The verification process does not disclose any private key information.

[0051] 2. Single lifecycle management: The conversion factor is bound to a single data migration task and is only valid once. After the migration task is completed, it is destroyed on the storage node side immediately and is not persisted.

[0052] 3. Operation permission isolation: The conversion factor is only issued to the designated storage node that performs this migration. The node only has the permission to call the ciphertext conversion operation and cannot read or export the plaintext data of the conversion factor.

[0053] 4. Integrity verification protection: The conversion factor is accompanied by an SM3 message authentication code generated by the key management node. The storage node verifies the integrity before use to prevent the factor from being tampered with or forged.

[0054] After the conversion, the new key ciphertext can only be decrypted using the target level's SM2 private key, while the ciphertext of the data itself remains unchanged. The entire conversion process is performed in ciphertext state, without decrypting the plaintext data or obtaining the original symmetric key, thus avoiding the risk of plaintext exposure during migration.

[0055] After all migration operations are completed, the system updates the metadata information of the corresponding data unit, recording the current level, corresponding key identifier, storage location and migration timestamp, and updates the data index synchronously.

[0056] During data updates, the system reduces re-encryption overhead through a layered granular incremental encryption mechanism, while simultaneously ensuring data accuracy through hierarchical integrity checks. When a user modifies encrypted data, the system activates the layered granular incremental encryption mechanism to avoid the performance overhead of full file re-encryption. The system divides data into three levels according to logical granularity: file level, fixed-size data block level, and SM4 standard packet level. The fixed size of the data block is set to 64 kilobytes, and each data block contains 4096 SM4 standard packets; the SM4 standard packet length is 16 bytes, consistent with the algorithm's native packet length. After data modification is triggered, the system first reads the start and end byte offsets from the modification request, aligns them according to the 16-byte SM4 packet boundaries, and calculates the affected start and end packet sequence numbers. The system only performs re-encryption operations on encrypted packets within the sequence number range; unmodified encrypted packets retain their original ciphertext state and encryption key. For cross-data block modification operations, the system only re-encrypts the corresponding packets within the affected data block, without performing full re-encryption on the entire data block or the entire file. The key used for re-encryption is the same as the original block key, and only the ciphertext content of the corresponding block is updated.

[0057] The system simultaneously constructs a Merkle tree based on SM3 hashes for each file to maintain integrity checksums at each level. The Merkle tree is a binary tree structure. The leaf nodes at the bottom level correspond to the SM3 hash values ​​of each 64-kilobyte data block, and the hash value of each leaf node is calculated from the complete ciphertext content of the corresponding data block. Intermediate-level nodes are obtained by concatenating the hash values ​​of their two child nodes into a string and then recalculating the SM3 hash. This process is repeated layer by layer upwards, ultimately generating a unique root node hash value, which is the top-level hash value of the file layer. After data modification, the system locates the leaf node corresponding to the affected data block, updates its hash value, and then updates the hash values ​​of the corresponding parent nodes layer by layer along the path from the leaf node to the root node until the root node is updated. The remaining unaffected branch nodes retain their original hash values, eliminating the need to recalculate the hash for the entire file.

[0058] Integrity verification employs a three-tiered execution mode, corresponding to a layered SM3 hash chain structure. The first level is file-level verification, which in routine inspections only verifies the top-level root hash value of the file. Each verification requires only one SM3 operation, resulting in extremely short processing time and supporting batch daily verification of millions of files. The second level is data block-level verification. When access anomalies occur or audit sampling is required, the system drills down to the data block level, verifying the hash value of each data block one by one through the Merkle tree path to quickly locate the specific abnormal data block and narrow down the investigation scope. The third level is sector-level verification. When a data tampering risk is confirmed, the system performs a full, block-by-block hash verification at the sector level. It calculates and compares the SM3 hash value of each SM4 block within the abnormal data block to determine the specific range of corrupted bytes.

[0059] The entire system adopts a three-layer distributed key escrow architecture. All key derivation is based on standard cryptographic algorithms, and the derivation process is unidirectional and irreversible; lower-layer keys cannot be used to derive upper-layer keys. The key system, from top to bottom, consists of the root key layer, the master key layer, and the data key layer. The overall architecture of the three-layer key system is as follows: Figure 3 As shown.

[0060] This system eliminates the single point of leakage risk of centralized key management at the architectural level, which is achieved through four mechanisms: threshold decentralization, one-way derivation, hierarchical isolation, and on-demand generation.

[0061] The root key layer is the highest key layer in the entire system, employing a threshold SM2 scheme with a threshold value of 3 and a total number of shares of 5. The system uses a secret sharing algorithm to split the system root key into 5 subkeys, which are stored in 5 physically isolated key management nodes. The networks of each node are independent, with no direct data path between them.

[0062] Each subkey is a 256-bit large integer, accompanied by a fragment sequence number, threshold parameters, and fragment check hash value. It is stored independently in the hardware security module of the key management node and cannot be directly exported or read.

[0063] Decrypting and recovering the root key requires at least three nodes to participate in the computation. Each node outputs its subkey share, and the complete root key is then recovered using a secret-sharing reconstruction algorithm. If fewer than three nodes participate, no valid key information can be obtained. The root key is only used to derive the master key and does not directly participate in any data encryption or decryption operations. The root key's subkeys support periodic lossless rotation; in this embodiment, rotation occurs every 90 days. During rotation, the system updates the polynomial coefficients of the secret sharing, generating a new subkey share for each key management node. The atomic key immediately becomes invalid after the rotation is complete. Throughout the entire rotation process, the root key itself remains unchanged, and the derived lower-level keys are unaffected, ensuring no interruption to upper-layer business operations.

[0064] The master key layer contains four master keys, corresponding to four data storage levels. Each master key is generated unidirectionally from the root key using the SM3 key derivation function and combined with the unique identifier of the corresponding level.

[0065] The single-level master key is a 256-bit symmetric key, with a unique identifier for its level, a derived salt value, an effective timestamp, and a rotation cycle identifier, and is distributed and stored in key service nodes in various regions.

[0066] The SM3 key derivation function conforms to the GM / T 0003.1-2012 national cryptographic standard, is based on SM3 hash iteration, and the general derivation formula is: in The derived input seed is composed of the upper-level key and a unique identifier; The bit length of the key to be derived.

[0067] The formula for calculating the derived iteration rounds is: That is, round up the 256 bits of a single output of SM3 to get the total number of iterations n.

[0068] The iterative execution process is as follows: in It is a 32-bit incrementing counter, initially set to 0x00000001, incrementing by 1 in each iteration; finally, the outputs of all iterations are concatenated. and cut off the front Bits, to obtain the target derived key.

[0069] When the master key is derived The value is 256, and the iteration round is 1; during data key derivation... The value is 128, which matches the key length of the SM4 algorithm, and the iteration round is 1.

[0070] The key derivation function takes the root key and the hierarchy identifier string as input, and outputs a fixed-length master key after multiple rounds of SM3 hash iterations. The master key is stored in the key service nodes of each region and is only used to derive the data key for the corresponding hierarchy; it does not directly participate in data encryption and decryption.

[0071] Each data key layer corresponds to an encryption key for a single data unit, and each file has an independent data key. The data key is generated unidirectionally from the master key of the corresponding layer, combined with the globally unique identifier of the data file, through the SM3 key derivation function.

[0072] The single data unit key is a 128-bit SM4 symmetric key, which includes a globally unique identifier for the data unit, its hierarchical identifier, cache validity period, and derivation path identifier. It is cached in the memory of the compute node as needed.

[0073] Data keys are cached in the memory of compute nodes as needed based on business access requirements. The cache is valid for 24 hours and is automatically cleared upon expiration.

[0074] The key lifecycle is deeply linked to the data layer, and the specific mechanism is as follows: 1. After the initial layering of data is completed, the system automatically calls the master key of the corresponding layer and derives a unique data key by combining it with the unique data identifier. The validity period of the key is bound to the current layer of the data.

[0075] 2. After the data triggers a hot migration and completes the ciphertext conversion, the data key corresponding to the original level immediately becomes invalid and is cleared from all cache nodes; the system automatically uses the master key of the target level and combines it with the same unique data identifier to derive a new data key, and subsequent encryption and decryption operations uniformly use the new key.

[0076] 3. When the root key performs sub-key rotation, the master key and data key are automatically synchronized and updated through the derivation mechanism. The rotation process does not require re-encryption of all data and does not interrupt the operation of upper-layer services.

[0077] After the data hierarchy migration is completed, the data key corresponding to the original hierarchy immediately becomes invalid. The system derives a new data key from the master key of the target hierarchy and the unique identifier of the same data file.

[0078] This embodiment comprehensively covers the entire data flow from writing, layering, encryption, dynamic migration, incremental updates to key management. All algorithms and operational logic are implemented based on standard cryptographic components, requiring no special hardware support. The method achieves dynamic adaptation of encryption strategies through multi-dimensional semantic heat quantification, solving the problem of security and performance resource mismatch in static layering schemes. The hysteresis mechanism and differentiated migration methods significantly reduce the additional overhead of layer migration and the risk of plaintext exposure. Fine-grained incremental encryption and hierarchical verification mechanisms adapt to high-frequency data updates and large-scale routine auditing scenarios. The distributed threshold key system eliminates the risk of single-point key leakage from an architectural perspective. This method can be directly applied to scenarios requiring cryptographic compliance, such as government cloud, enterprise private cloud, and financial cloud storage, and can also support the encrypted storage needs of different businesses such as document collaboration, cloud databases, and cold data archiving.

[0079] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A cloud data hierarchical encrypted storage method based on national cryptographic algorithms, characterized in that, The specific steps of this method are as follows: S1. Initial stratification is performed on newly written data to cloud storage through semantic feature matching; for existing data units, access behavior, semantic attributes and business tag data are periodically collected, and the semantic heat value of each data unit is obtained through multi-dimensional weighted calculation. S2. Based on the preset heat threshold range, the data unit is divided into four storage layers: hot data layer, warm data layer, cold data layer, and archived data layer, and the corresponding national cryptographic encryption strategy is matched for each layer. S3. Continuously monitor changes in semantic heat value and set migration trigger conditions using hysteresis threshold; when the semantic heat value of a data unit exceeds the current level threshold boundary and crosses the hysteresis range for N consecutive monitoring cycles, trigger level migration. Upward migration uses decryption and re-encryption, while downward migration uses SM2-based proxy re-encryption to complete the encryption strategy conversion in ciphertext state, and then stores it in the target level after migration; S4. Data at each level is updated using a hierarchical granular incremental encryption mechanism. The modification range is located according to the SM4 group boundary, and only the affected encrypted groups are re-encrypted. Hierarchical integrity verification is performed through a hierarchical SM3 hash chain structure. S5. A three-layer distributed key escrow system is adopted to manage the entire key lifecycle. The root key layer is based on the SM2 threshold cryptography scheme for distributed storage. The master key layer and data key layer are generated unidirectionally through the SM3 key derivation function. The key lifecycle is linked with the data layer.

2. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S1, the semantic heat value is calculated using a weighted summation formula, the expression of which is: In the formula, This represents the semantic popularity value. This is the normalized access frequency parameter within a given period. The normalized semantic sensitivity parameter is calculated by combining the proportion of sensitive fields and the data security level label. The normalized business value weight parameter is determined by the importance level of the business line to which the data belongs; , , These are the weighted coefficients corresponding to the three dimensions of access frequency, semantic sensitivity, and business value, respectively. + + .

3. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S2, the specific national cryptographic encryption strategies matched at each level are as follows: the hot data layer uses the SM4-CTR encryption mode, the warm data layer uses the SM4-CBC encryption mode combined with HMAC-SM3 integrity verification, the cold data layer uses the SM2 and SM4 hybrid encryption mode, and the archived data layer uses the SM9 identifier password encryption.

4. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S2, the heat threshold ranges corresponding to the four storage tiers can be dynamically adjusted according to the overall cluster load and security baseline; the hot data tier corresponds to the highest heat range, and the heat ranges of the warm data tier, cold data tier, and archived data tier decrease in that order.

5. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S3, the hysteresis threshold is set according to the following rules: each level is set with an independent upward migration threshold and a downward migration threshold, and a difference range is formed between the two thresholds; when the data unit popularity increases, it must reach the upward migration threshold to trigger the level upgrade, and when the popularity decreases, it must fall below the downward migration threshold to trigger the level downgrade.

6. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S3, the SM2-based proxy re-encryption execution process is as follows: SM2 public-private key pairs corresponding to each storage level are pre-generated; when the downward migration is triggered, the key management node uses the SM2 private key of the current level and the SM2 public key of the target level to calculate and generate a re-encryption conversion factor; the cloud storage node uses the re-encryption conversion factor to perform conversion operations on the SM4 key ciphertext corresponding to the data. The conversion process does not decrypt the plaintext data and does not obtain the original symmetric key. The converted ciphertext can be decrypted using the SM2 private key of the target level.

7. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S4, the execution rules of the layered granular incremental encryption mechanism are as follows: the data is divided into three levels according to logical granularity: file level, fixed-size data block level, and SM4 standard group level. When data is modified, first locate the byte offset corresponding to the modified content, align it according to the SM4 group boundary, calculate the affected group sequence number, and only perform re-encryption operation on the affected encrypted groups. Unmodified encrypted groups retain their original ciphertext state and encryption key.

8. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S4, a Merkle tree is constructed using SM3 hashing to maintain the integrity verification value of data at each level. The leaf nodes of the Merkle tree correspond to the SM3 hash value of each data block. After the data is modified, the node hash value of the Merkle tree is updated only along the path corresponding to the affected data block, while the hash values ​​of the other branch nodes remain unchanged.

9. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S5, the three-layer distributed key escrow system includes the root key layer, the master key layer, and the data key layer; The root key layer adopts the (t,n) threshold SM2 scheme, which splits the system root key into n subkeys and distributes them across multiple physically isolated key management nodes. At least t nodes are required to participate in the operation when decrypting and recovering the root key. The master key layer contains four sets of master keys, which correspond to four data storage levels. Each set of master keys is generated unidirectionally from the root key by combining the level identifier with the SM3 key derivation function. The data key layer contains the encryption key corresponding to each data unit, which is generated unidirectionally by the master key of the corresponding layer combined with the unique identifier of the data unit through the SM3 key derivation function.

10. The cloud data hierarchical encrypted storage method based on national cryptographic algorithms according to claim 1, characterized in that, In step S4, the hierarchical SM3 hash chain structure is divided into three verification levels: file layer, data block layer, and sector layer. During verification, the top-level hash value of the file layer is verified first. If further investigation is needed, drill down to the data block layer, locate the abnormal data block through the Merkle tree path, and perform a full block-by-block hash verification of the sector layer when the data is confirmed to be corrupted to determine the scope of corruption.