A post-quantum cryptography-based trusted execution environment reinforcement system

CN121561908BActive Publication Date: 2026-08-18HANGZHOU INNOVATION RES INST OF BEIJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511578954.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-08-18
Estimated Expiration
2045-10-31

AI Technical Summary

Technical Problem

鉴于现有技术的上述缺点、不足,本申请提供一种基于后量子密码的可信执行环境加固系统及方法,其解决了现有技术中难以兼顾传统算法与后量子算法的平滑迁移的技术问题

Benefits of technology

本申请实施例提供的基于后量子密码的可信执行环境加固方法及系统,通过在可信执行环境的安全世界中引入选择器模块,能够实现对普通世界转发的待加密数据进行灵活解析,并结合预设选择策略在固有的密码学库与后量子密码算法库之间自动确定适用的加密算法,从而避免因算法单一导致的安全风险与兼容性不足,并通过在不同应用场景下动态选择传统算法或后量子算法,使系统能够在保障长期数据安全的同时兼顾性能与互操作性,这样即便在量子计算威胁逼近、系统资源受限或需要跨代兼容的复杂环境下,依然能够平稳完成加密处理与结果输出,确保整体安全机制的高效、可靠。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121561908B_ABST
    Figure CN121561908B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of information security, in particular to a trusted execution environment reinforcement system based on a post-quantum cryptography, which further comprises a selector module and a post-quantum cryptography algorithm library arranged in a security world of a trusted execution environment; the selector module is used for receiving encrypted data instruction information forwarded by an application module in the security world of the normal world of the trusted execution environment, determining corresponding final encryption algorithms in an inherent cryptography library of the trusted execution environment and / or the post-quantum cryptography algorithm library based on the encrypted data instruction information by adopting a pre-set selection strategy, and encrypting to-be-encrypted data existing in a shared memory based on the final encryption algorithms to obtain corresponding encryption results; the cryptography library comprises a plurality of traditional encryption algorithms arranged in a pre-set first order; and the post-quantum cryptography algorithm library comprises a plurality of post-quantum encryption algorithms arranged in a pre-set second order.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information security technology, and in particular to a trusted execution environment hardening system based on post-quantum cryptography. Background Technology

[0002] A Trusted Execution Environment (TEE) is an isolated, secure region created within a computing device, operating in parallel with the main operating system. It is primarily used to process and store sensitive data such as encryption keys, digital rights management licenses, and biometric information. Current TEEs rely heavily on traditional cryptographic algorithms for authentication, key exchange, and data encryption. These algorithms provide reliable security under classical computing conditions and are therefore widely used in TEEs for authentication, secure channel establishment, and data protection. However, with the rapid development of quantum computing technology, the security foundation of traditional cryptographic systems is facing unprecedented challenges. Once general-purpose quantum computers are deployed, the encryption algorithms used extensively in TEEs could be cracked in a very short time. Even more seriously, attackers could intercept encrypted data in the TEE at the current stage and decrypt it using a quantum computer in the future, leading to the leakage of sensitive information.

[0003] To address this threat, existing technologies have publicly disclosed post-quantum cryptography (PQC) algorithms. While PQC is theoretically resistant to quantum attacks, its application in TEE (Trusted Execution Environment) scenarios still faces several challenges: First, existing TEE cryptography libraries are mostly statically compiled, lacking flexible algorithm upgrade and switching mechanisms. Supporting new PQC algorithms typically requires large-scale modifications to the core library and key management module, resulting in complex engineering and high compatibility risks. Second, PQC algorithms generally have larger key sizes, longer signatures, and higher computational overhead. Directly replacing traditional algorithms would significantly increase the limited memory and CPU load of TEEs, leading to performance degradation and response latency. Third, simply introducing PQC through insertion or replacement not only fails to meet the flexible adaptation requirements of different business scenarios but also masks the differences between traditional algorithms and PQC, reducing the ability to perceive performance overhead and security risks. In conclusion, existing trusted execution environments have significant shortcomings in addressing the potential threats posed by quantum computing. Summary of the Invention

[0004] (a) Technical problems to be solved In view of the above-mentioned shortcomings and deficiencies of the prior art, this application provides a trusted execution environment hardening system and method based on post-quantum cryptography, which solves the technical problem in the prior art of being unable to smoothly migrate between traditional algorithms and post-quantum algorithms.

[0005] (II) Technical Solution To achieve the above objectives, the main technical solutions adopted in this application include: This application provides a trusted execution environment hardening system based on post-quantum cryptography. The system includes an application module, a cryptography library, and shared memory. The system further includes a selector module and a post-quantum cryptography algorithm library set in the secure world of the trusted execution environment. The selector module receives encrypted data instruction information forwarded by the application module in the secure world from the ordinary world of the trusted execution environment. Based on the encrypted data instruction information, it uses a pre-set selection strategy to determine the corresponding final encryption algorithm from the cryptography library inherent in the trusted execution environment and / or the post-quantum cryptography algorithm library. Based on the final encryption algorithm, it encrypts the data to be encrypted in the shared memory to obtain the corresponding encryption result. The cryptography library includes multiple traditional encryption algorithms arranged in a preset first order. The post-quantum cryptography algorithm library includes multiple post-quantum encryption algorithms arranged in a preset second order.

[0006] Preferably, in some embodiments of this application, after completing encryption, the trusted execution environment sends the obtained encryption result through the ordinary world to the ordinary world of the first trusted execution environment with which it is communicatively connected.

[0007] Preferably, in some embodiments of this application, the encrypted data instruction information carries algorithm identification information of the target encryption algorithm obtained during the process of establishing a secure channel between the ordinary world of the trusted execution environment and the ordinary world of the first trusted execution environment; Accordingly, based on the encrypted data instruction information, a pre-set selection strategy is adopted to determine the corresponding final encryption algorithm. Specifically, when the encrypted data instruction information contains the algorithm identification information of the target encryption algorithm, the selector module selects the algorithm corresponding to the algorithm identification information from the cryptography library and the post-quantum cryptography algorithm library as the final encryption algorithm.

[0008] Preferably, in some embodiments of this application, the selector module is further configured to send an inquiry message to the ordinary world of the first trusted execution environment regarding whether it supports the post-quantum encryption algorithm type, and is further configured to receive an encryption algorithm type switching instruction fed back by the ordinary world of the first trusted execution environment after receiving the inquiry message, in the case that it determines that it does not support the post-quantum encryption algorithm type; the encryption algorithm type includes the traditional encryption algorithm type and the post-quantum encryption algorithm type.

[0009] Preferably, in some embodiments of this application, the corresponding final encryption algorithm is determined based on the encrypted data instruction information using a pre-set selection strategy. Specifically, this includes: when the encrypted data instruction information does not carry the algorithm identifier information of the target encryption algorithm, the selector module uses the post-quantum cryptography algorithm library as the designated cryptography algorithm library and selects the first algorithm in the designated cryptography algorithm library as the final encryption algorithm according to the second order; if the encrypted data instruction information does not carry the algorithm identifier information of the target encryption algorithm and an encryption algorithm type switching instruction is received, the selector module uses the cryptography library as the designated cryptography algorithm library and selects the first algorithm in the designated cryptography algorithm library as the final encryption algorithm according to the first order. or, When the encrypted data instruction information does not carry the algorithm identification information of the target encryption algorithm, the selector module uses the post-quantum cryptography algorithm library as the designated cryptography algorithm library and selects the first algorithm in the designated cryptography algorithm library as the final encryption algorithm according to the second order; if the encrypted data instruction information does not carry the algorithm identification information of the target encryption algorithm and an encryption algorithm type switching instruction is received, the selector module ends the encryption of the data to be encrypted in the shared memory.

[0010] Preferably, in some embodiments of this application, a pre-set selection strategy is used to determine the corresponding final encryption algorithm based on the encrypted data instruction information, specifically including: When the encrypted data instruction information obtained by the selector module carries first type identification information, the first algorithm among a plurality of conventional encryption algorithms arranged in a first order in the cryptographic library inherent in the trusted execution environment is used as the final encryption algorithm; the encrypted data instruction information also carries type identification information of the data to be encrypted; wherein, the first type identification information is information that identifies the data to be encrypted as any type of data among streaming media session key, anonymous authentication of IoT devices, software update package verification, small transaction bill of payment system, and online bank query data; When the selector module obtains the encrypted data instruction information carrying the second type of identification information, the selector module selects the first algorithm from the cryptography library and the post-quantum cryptography algorithm library in their respective order, and uses them as the corresponding final encryption algorithms; wherein, the second type of identification information is information that identifies the data to be encrypted as any type of data among the following: digital signature of the root certificate authority, legal electronic contract, state secret archives, military plan, master key of biometric template, and large transaction bill of payment system.

[0011] Preferably, in some embodiments of this application, a pre-set selection strategy is adopted based on the encrypted data instruction information to determine the corresponding final encryption algorithm. Specifically, this includes: when the system load of the trusted execution environment obtained in real time by the selector module is within a preset range, the first algorithm among the multiple post-quantum encryption algorithms arranged in the second order in the post-quantum cryptography algorithm library is used as the final encryption algorithm; the system load includes: CPU utilization and memory utilization; when the system load of the trusted execution environment obtained in real time by the selector module exceeds a preset threshold, and the encrypted data instruction information obtained by the selector module carries third type identification information, the first algorithm among the multiple traditional encryption algorithms arranged in the first order in the cryptography library inherent in the trusted execution environment is used as the final encryption algorithm; wherein, the third type identification information is information that identifies the data to be encrypted as any type of data among non-classified website login authentication data, anonymous authentication of IoT devices, software update package verification, and protection of non-critical user data.

[0012] Preferably, in some embodiments of this application, the encryption of data to be encrypted residing in shared memory is performed based on the final encryption algorithm to obtain the corresponding encryption result, specifically including: When the final encryption algorithm is a traditional encryption algorithm from the inherent cryptography library, the selector module uses the final encryption algorithm to encrypt the data to be encrypted, obtaining the corresponding encryption result. When the final encryption algorithm is a post-quantum cryptography algorithm from the post-quantum cryptography algorithm library, the selector module uses the final encryption algorithm to encrypt the data to be encrypted, obtaining the corresponding encryption result. When the final encryption algorithm includes both a traditional encryption algorithm from the inherent cryptography library and a post-quantum cryptography algorithm from the post-quantum cryptography algorithm library, the selector module first uses the traditional encryption algorithm to encrypt the data to be encrypted, obtaining an initial encryption result, and then uses the post-quantum cryptography algorithm to encrypt the initial encryption result, obtaining the corresponding encryption result.

[0013] Preferably, in some embodiments of this application, the selector module is further configured to receive encryption algorithm support instruction information forwarded by the application module in the secure world through the ordinary world of the trusted execution environment; The encryption algorithm support instruction information is the encryption algorithm support status information fed back by the ordinary world of the first trusted execution environment in response to the received encryption result. The encryption algorithm support status information is information on whether the first trusted execution environment supports the final encryption algorithm corresponding to the encryption result. When the encryption algorithm supports the instruction information represented as being connected to the ordinary world of the first trusted execution environment, and the final encryption algorithm corresponding to the encryption result is not supported by this algorithm, the selector module performs an algorithm replacement process, specifically including: If the final encryption algorithm belongs to the cryptography library inherent in the trusted execution environment, the selector module selects the next traditional encryption algorithm after the current algorithm in a preset first order in the cryptography library, and sends a support query instruction for the selected traditional encryption algorithm to the ordinary world of the first trusted execution environment; after receiving a confirmation response from the ordinary world of the first trusted execution environment that supports the selected traditional encryption algorithm, the selector module uses the selected traditional encryption algorithm as the new final encryption algorithm to encrypt the data to be encrypted in the shared memory; if the ordinary world of the first trusted execution environment returns a response that does not support the selected traditional encryption algorithm, the selector module continues to select the next traditional encryption algorithm in sequence and repeats the above query and confirmation steps until a confirmation response that supports the selected traditional encryption algorithm is received, or until all traditional encryption algorithms in the cryptography library are not supported and the encryption of the data to be encrypted in the shared memory ends. If the final encryption algorithm belongs to the post-quantum cryptography algorithm library, the selector module sequentially selects the next post-quantum encryption algorithm after the current algorithm according to the preset second order in the post-quantum cryptography algorithm library, and sends a support query instruction for the selected post-quantum encryption algorithm to the ordinary world of the first trusted execution environment; after receiving a confirmation response from the ordinary world of the first trusted execution environment that supports the selected post-quantum encryption algorithm, the selector module uses the selected post-quantum encryption algorithm as the new final encryption algorithm to encrypt the data to be encrypted in the shared memory; if the ordinary world of the first trusted execution environment returns a response that does not support the selected post-quantum encryption algorithm, the selector module continues to sequentially select the next post-quantum encryption algorithm and repeats the above query and confirmation steps until a confirmation response that supports the selected post-quantum encryption algorithm is received, or until all post-quantum encryption algorithms in the post-quantum cryptography algorithm library are not supported and the encryption of the data to be encrypted in the shared memory ends.

[0014] Preferably, in some embodiments of this application, the system further includes: a cryptographic coprocessor set up in the secure world of the trusted execution environment; The selector module is also used in the case where a cryptographic coprocessor is set up in the secure world of a trusted execution environment. When the determined final encryption algorithm is a post-quantum cryptography algorithm in the post-quantum cryptography algorithm library, the encryption coprocessor is controlled to implement the final encryption algorithm, encrypt the data to be encrypted, and obtain the corresponding encryption result. When the determined final encryption algorithm includes both the traditional encryption algorithm in the inherent cryptography library and the post-quantum cryptography algorithm in the post-quantum cryptography algorithm library, the selector module controls the encryption coprocessor to execute the final encryption algorithm using the post-quantum cryptography algorithm as the final encryption algorithm, and further encrypts the initial encrypted data obtained by encrypting the data to be encrypted using the traditional encryption algorithm to obtain the final encryption result.

[0015] (III) Beneficial Effects The trusted execution environment hardening method and system based on post-quantum cryptography provided in this application introduces a selector module into the secure world of the trusted execution environment. This enables flexible parsing of data to be encrypted forwarded from the ordinary world. By combining a preset selection strategy, it automatically determines the applicable encryption algorithm between the inherent cryptography library and the post-quantum cryptography algorithm library, thereby avoiding security risks and insufficient compatibility caused by a single algorithm. Furthermore, by dynamically selecting traditional or post-quantum algorithms in different application scenarios, the system can ensure long-term data security while taking into account performance and interoperability. Thus, even in complex environments where quantum computing threats are approaching, system resources are limited, or cross-generational compatibility is required, the encryption processing and result output can still be completed smoothly, ensuring the efficiency and reliability of the overall security mechanism. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of a trusted execution environment hardening system based on post-quantum cryptography according to an embodiment of this application; Figure 2 This is a schematic diagram illustrating the connection between a post-quantum cryptography-based trusted execution environment and a first trusted execution environment in the ordinary world according to an embodiment of this application. Detailed Implementation

[0017] To better explain and facilitate understanding of this application, the following detailed description of the application is provided in conjunction with the accompanying drawings and specific embodiments.

[0018] Among related technologies, the hardening of Trusted Execution Environments (TEEs) under quantum computing threats can be mainly categorized as follows: The first category is hardening schemes based on traditional cryptography enhancements. These schemes rely on existing public-key algorithms and symmetric algorithms such as AES (Advanced Encryption Standard), extending the security lifetime by optimizing parameters, increasing key length, or incorporating hardware security modules. However, this approach only provides limited improvements under classical computing conditions. Once quantum computers reach practical scale, they can still break existing public-key algorithms in polynomial time, rendering the core security mechanism of the TEE ineffective. Therefore, this scheme is insufficient to fundamentally resist quantum attacks.

[0019] The second category is replacement schemes that directly introduce post-quantum cryptography (PQC) algorithms. This approach directly replaces traditional algorithms in the TEE with post-quantum algorithms such as lattice cryptography, hash signatures, and encoded cryptography to ensure quantum-resistant security. However, PQC generally suffers from large key sizes, long signatures, and high computational complexity. Direct replacement significantly increases the limited CPU and memory load of the TEE, leading to performance degradation and response latency. Furthermore, most TEE cryptography libraries (such as libutee and libtomcrypt) are statically compiled, lacking flexible dynamic switching mechanisms. The replacement process requires deep modification of the core interface, resulting in complex engineering and high compatibility risks, making large-scale deployment difficult.

[0020] To address this, this application provides a method and system for hardening a Trusted Execution Environment (TEE) based on post-quantum cryptography. By introducing a selector module into the secure world of the TEE, it can flexibly parse the data to be encrypted from the ordinary world and dynamically select the appropriate algorithm between the inherent cryptography library and the post-quantum cryptography algorithm library using a preset strategy, achieving smooth compatibility and switching between traditional algorithms and PQC. Simultaneously, it adaptively schedules based on system load and the type of data to be encrypted, prioritizing the use of post-quantum algorithms in critical security scenarios while allowing the use of traditional algorithms in resource-constrained or non-critical tasks, thus balancing security and performance. Furthermore, this application supports the simultaneous use of traditional and post-quantum algorithms to encrypt the same data to meet the needs of high-security scenarios. Thus, even in complex environments where quantum computing threats are increasingly imminent, system resources are limited, or cross-generational compatibility requirements are stringent, the TEE security mechanism can still be ensured to be efficient, reliable, and scalable, not only achieving resistance to quantum attacks but also improving the system's versatility and flexibility.

[0021] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.

[0022] Figure 1 This is a schematic diagram of a trusted execution environment hardening system based on post-quantum cryptography according to one embodiment of this application. Figure 1 As shown, the trusted execution environment hardening system based on post-quantum cryptography includes an application module, a cryptography library, and shared memory. The system also includes a selector module and a post-quantum cryptography algorithm library set in the secure world of the trusted execution environment. The selector module is used to receive encrypted data instruction information forwarded by the application module in the secure world through the ordinary world of the trusted execution environment, and based on the encrypted data instruction information, adopt a pre-set selection strategy to determine the corresponding final encryption algorithm in the cryptography library inherent in the trusted execution environment and / or the post-quantum cryptography algorithm library, and encrypt the data to be encrypted in the shared memory based on the final encryption algorithm to obtain the corresponding encryption result. The cryptography library includes: multiple traditional encryption algorithms arranged in a preset first order; In this application embodiment, the traditional encryption algorithms include: ECC algorithm, RSA algorithm, AES algorithm, DSA algorithm, etc. The post-quantum cryptography algorithm library includes multiple post-quantum encryption algorithms arranged in a preset second order. Specifically, in the embodiments of this application, the post-quantum encryption algorithms include: ML-KEM algorithm, ML-DSA algorithm, CRYSTALS-Kyber algorithm, CRYSTALS-Dilithium algorithm, Falcon algorithm, etc.

[0023] The system in this embodiment consists of an application module in the ordinary world, a built-in traditional cryptography library (arranged in a preset first order), shared memory, and a selector module and a post-quantum cryptography algorithm library (arranged in a preset second order) within a Trusted Execution Environment (TEE, secure world). The ordinary world forwards encryption-related "encryption data instruction information" to the selector module through the application module in the secure world. The selector module, based on the instruction content and a preset selection strategy, determines the final encryption algorithm to be used between the traditional encryption library and the post-quantum algorithm library available in the TEE. Then, it performs encryption / encapsulation / signing operations on the data (e.g., session keys, certificates, signature plaintext, etc.) located in the shared memory and returns the encryption result. This retains two sets of candidate implementations—traditional and post-quantum algorithms—supporting a smooth transition and facilitating dynamic algorithm switching based on the strategy.

[0024] See Figure 2 In this context, after completing the encryption, the trusted execution environment sends the encrypted result to the ordinary world of the first trusted execution environment with which it is connected through the ordinary world.

[0025] For example, in this embodiment, the "ordinary world of the first trusted execution environment" refers to the ordinary world of another trusted execution environment that is communicatively connected to the secure world of this trusted execution environment. Specifically, after the secure world of a trusted execution environment (TEE A) completes the encryption operation on sensitive data, the encryption result is not stored in the ordinary world or local storage of TEE A, but is securely sent to the ordinary world corresponding to another trusted execution environment (TEE B) through a secure communication channel. For example, assuming the system is deployed on two servers with ARM TrustZone enabled, after the secure world of TEE A performs post-quantum encryption on the user's sensitive data, it sends the ciphertext to the ordinary world of TEE B through an encryption channel. The ordinary world application module receives the ciphertext and performs further processing, such as storage, analysis, or forwarding to the cloud. In this way, the plaintext data is always confined to the secure world throughout the entire transmission process, and the ordinary world can only access the encryption result. This method enhances cross-node data security. Even if the ordinary world or communication link is attacked, it cannot directly obtain the plaintext or key, thereby preventing data from being leaked or tampered with in a multi-TEE collaborative environment. Secondly, this mechanism ensures the integrity of the trusted path. Encrypted results are transmitted through a secure channel provided by the TEE, possessing authentication, integrity verification, and anti-replay capabilities, thus ensuring reliable and trustworthy data interaction across TEEs. Thirdly, by restricting the plaintext of sensitive data to appear only in the secure world and transmitting it in ciphertext between TEEs, the system's trust boundaries are clearer, and auditability is significantly enhanced, helping to meet security certification and compliance requirements (such as CC EAL, FIPS 140-3). Furthermore, this cross-TEE data interaction mechanism enables flexible security architecture layering. For example, in multi-node collaborative cloud computing or distributed industrial control scenarios, each TEE instance can independently perform encrypted computations and deliver the results only to the target TEE's corresponding ordinary world, achieving a multi-level trust structure. This not only ensures secure isolation of data during transmission and processing but also improves the overall scalability and attack resistance of the system, providing reliable support for large-scale distributed trusted computing.

[0026] Preferably, in one specific embodiment of this application, the encrypted data instruction information carries algorithm identification information of the target encryption algorithm obtained during the process of establishing a secure channel between the ordinary world of the trusted execution environment and the ordinary world of the first trusted execution environment; Accordingly, based on the encrypted data instruction information, a pre-set selection strategy is adopted to determine the corresponding final encryption algorithm, specifically including: When the encrypted data instruction information contains the algorithm identification information of the target encryption algorithm, the selector module selects the algorithm corresponding to the algorithm identification information from the cryptography library and the post-quantum cryptography algorithm library as the final encryption algorithm.

[0027] Specifically, the encrypted data instruction information preferably carries the algorithm identification information of the target encryption algorithm obtained during the establishment of a secure channel between the ordinary world of the first trusted execution environment and the ordinary world of the first trusted execution environment. That is, in cross-TEE data interaction scenarios, when sensitive data needs to be transmitted between two TEE instances, the communicating parties will negotiate a target encryption algorithm during the handshake phase of establishing the secure channel and embed the algorithm's identification information into subsequent encryption request instructions. For example, assuming that the ordinary world of TEE A and the ordinary world of TEE B establish a quantum-resistant hybrid encryption channel via TLS or a custom security protocol, and negotiate to use the CRYSTALS-Kyber algorithm as the target encryption algorithm for this communication, the encrypted data instruction information received in the secure world of TEE A will carry the algorithm's identification information, such as "Kyber-512" or the corresponding internal algorithm ID. Based on the encrypted data instruction information, the selector module uses a pre-set selection strategy in the secure world to determine the final encryption algorithm. Specifically, when the encrypted data instruction information contains the algorithm identifier information of the target encryption algorithm, the selector module searches for the algorithm corresponding to the algorithm identifier information in the cryptography library and the post-quantum cryptography algorithm library, and directly uses it as the final encryption algorithm. Taking the previous example, after TEEA Security World receives an encryption request carrying the identifier "Kyber-512", the selector module will directly call the CRYSTALS-Kyber algorithm instance in the post-quantum cryptography algorithm library to process the data to be encrypted, without the need for policy comparison or algorithm selection. This ensures that the encryption operation is consistent with the pre-negotiated secure channel, avoiding data decryption failure or communication errors caused by inconsistent selection policies, and improving system reliability and interoperability. Secondly, by carrying the target algorithm identifier with the encryption instruction, the selector module can directly call the corresponding algorithm without having to judge or select it again at runtime, thereby reducing the computation and policy judgment overhead and improving the encryption processing efficiency, especially in high-frequency data transmission scenarios. Thirdly, this mechanism strengthens the controllability and auditability of security policies. System administrators can clearly record the algorithm identifier used in each cross-TEE communication, which facilitates security auditing and compliance checks, while reducing security risks caused by incorrect policy selection. Furthermore, embedding the target encryption algorithm identifier into the instruction and executing it within the secure world ensures that sensitive information remains in a protected environment throughout the entire transmission process, reducing the risk of plaintext exposure or intermediate tampering.

[0028] Preferably, in another specific embodiment of this application, the selector module is further configured to send an inquiry message to the ordinary world of the first trusted execution environment regarding whether it supports the post-quantum encryption algorithm type, and is further configured to receive an encryption algorithm type switching instruction fed back by the ordinary world of the first trusted execution environment after receiving the inquiry message and determining that it does not support the post-quantum encryption algorithm type; Encryption algorithm types include traditional encryption algorithm types and post-quantum encryption algorithm types.

[0029] Specifically, the selector module first sends an inquiry message to the ordinary world of the first trusted execution environment (TEX) asking whether it supports post-quantum encryption algorithms. Upon receiving this inquiry message, the ordinary world of the TEX determines its support based on the availability of its internal encryption library. For example, if the ordinary world's security library only contains traditional encryption algorithms (such as RSA, ECC, and AES) and not post-quantum encryption algorithms (such as ML-KEM, CRYSTALS-Kyber, or Falcon), the ordinary world can determine that it does not support post-quantum encryption algorithms and sends an "encryption algorithm type switching instruction" to the selector module. Upon receiving this switching instruction, the selector module switches from "post-quantum encryption algorithm type" to "traditional encryption algorithm type," thereby ensuring that the encrypted communication process can still be executed normally in the existing computing environment.

[0030] Specifically, based on the encrypted data instruction information, a pre-set selection strategy is used to determine the corresponding final encryption algorithm, including: When the encrypted data instruction information does not carry the algorithm identification information of the target encryption algorithm, the selector module uses the post-quantum cryptographic algorithm library as the designated cryptographic algorithm library, and selects the first algorithm in the designated cryptographic algorithm library as the final encryption algorithm according to the second order. If the encrypted data instruction information does not carry the algorithm identifier information of the target encryption algorithm, and an encryption algorithm type switching instruction is received, the selector module will use the cryptography library as the specified cryptographic algorithm library, and select the first algorithm in the specified cryptographic algorithm library as the final encryption algorithm in the first order. For example, when determining the final encryption algorithm, the selector module employs a pre-defined selection strategy based on the encryption data instruction information. If the encryption data instruction information does not carry the algorithm identifier information of the target encryption algorithm, the selector module will default to using the post-quantum cryptography algorithm library as the specified cryptographic algorithm library, and select the first algorithm in the library according to its second order as the final encryption algorithm. For instance, assuming that the post-quantum cryptography algorithm library contains algorithms such as ML-KEM, CRYSTALS-Kyber, and Falcon in sequence, when the instruction information does not specify a specific algorithm, the selector module will automatically select ML-KEM as the final encryption algorithm to encrypt sensitive data in shared memory, thereby ensuring the security of data transmission and storage.

[0031] Furthermore, if the encrypted data instruction information does not carry the algorithm identification information of the target encryption algorithm, and simultaneously a cryptographic algorithm type switching instruction is received from the ordinary world of the first trusted execution environment (e.g., the instruction requires the use of a traditional encryption algorithm type), the selector module will use the cryptographic library as the specified cryptographic algorithm library and select the first algorithm in the library as the final encryption algorithm according to its first order. For example, assuming that the cryptographic library contains ECC, RSA, and AES in sequence, the selector module will select ECC as the final encryption algorithm to perform the encryption operation, thereby satisfying the encryption type adjustment requirements of both communicating parties and ensuring the automatic decision-making capability of the encryption operation. Even if the encryption data instruction information does not specify an algorithm or the algorithm identification information is missing, the selector module can still automatically determine a reasonable final encryption algorithm according to the preset strategy, thereby avoiding the risk of encryption operation failure or communication blockage. Secondly, it takes into account both security and flexibility. By default using the post-quantum cryptographic algorithm library, algorithms with strong resistance to quantum attacks can be prioritized for protection; while when receiving an encryption algorithm type switching instruction, it can flexibly switch to the traditional algorithm type to meet compatibility or strategy adjustment requirements. Furthermore, by completing the algorithm selection and switching within the secure world, sensitive information is always protected, and plaintext and keys are not exposed to the ordinary world, thereby improving the overall security of the system.

[0032] Alternatively, when the encrypted data instruction information does not carry the algorithm identification information of the target encryption algorithm, the selector module will use the post-quantum cryptographic algorithm library as the designated cryptographic algorithm library, and select the first algorithm in the designated cryptographic algorithm library as the final encryption algorithm according to the second order. If the encrypted data instruction information does not carry the algorithm identifier information of the target encryption algorithm, and an encryption algorithm type switching instruction is received, the selector module ends the encryption of the data to be encrypted that exists in the shared memory.

[0033] For example, when determining the final encryption algorithm, if the encryption data instruction information does not carry the algorithm identifier information of the target encryption algorithm, the selector module will default to using the post-quantum cryptography algorithm library as the specified cryptographic algorithm library, and select the first algorithm in the library according to the preset second order as the final encryption algorithm. For example, assuming that the post-quantum cryptography algorithm library contains algorithms such as ML-KEM, CRYSTALS-Kyber, and Falcon in sequence, when the instruction information does not specify a specific algorithm, the selector module will automatically select ML-KEM as the final encryption algorithm to encrypt the sensitive data in the shared memory. In this way, even if the communicating parties do not explicitly specify the encryption algorithm, the security of the data during transmission or storage can be guaranteed, and algorithms with stronger resistance to quantum attacks are given priority for protection. Furthermore, if the encryption data instruction information does not carry the algorithm identifier information of the target encryption algorithm, and at the same time a cryptographic algorithm type switching instruction is received from the ordinary world of the first trusted execution environment, the selector module will end the encryption operation on the data to be encrypted in the shared memory, that is, it will no longer perform encryption processing. For example, suppose TEE A, the secure world, is preparing to encrypt a batch of sensitive data, but receives a switching instruction from TEE B, the ordinary world, requesting a change in the encryption strategy. The selector module, because its configuration policy forces the use of post-quantum cryptography, will stop the current encryption operation and wait for a new encryption algorithm instruction or the next encryption task. This prevents blind encryption when the algorithm strategy is unclear or there are potential security risks, ensuring the security and controllability of system behavior. It also guarantees the system's default security behavior when algorithm identification information is lacking. By default selecting the preferred algorithm from the post-quantum cryptography algorithm library for encryption, sensitive data is ensured to be protected by a strong security algorithm under any circumstances. Secondly, terminating the encryption operation upon receiving an encryption algorithm type switching instruction avoids using inappropriate or potentially insecure algorithms, reducing security risks and providing intervention time for system administrators or upper-level control logic, thereby improving system controllability and the flexibility of security policy execution.

[0034] Preferably, in another specific embodiment of this application, the corresponding final encryption algorithm is determined based on the encrypted data instruction information using a pre-set selection strategy, specifically including: When the encrypted data instruction information obtained by the selector module carries first type identification information, the first algorithm among a plurality of conventional encryption algorithms arranged in a first order in the cryptographic library inherent in the trusted execution environment is used as the final encryption algorithm. The encrypted data instruction information also carries the type identification information of the data to be encrypted; The first type of identification information is information that identifies the data to be encrypted as any of the following: streaming media session key, anonymous authentication of IoT devices, software update package verification, small transaction bills of payment systems, and online bank query data. When the encryption data instruction information obtained by the selector module carries the second type of identification information, the selector module selects the first algorithm from the cryptography library and the post-quantum cryptography algorithm library in their respective order, and uses them as the corresponding final encryption algorithms. The second type of identification information identifies the data to be encrypted as any type of data, such as digital signatures of root certificate authorities, legal electronic contracts, state secret archives, military plans, master keys of biometric templates, or large transaction bills from payment systems.

[0035] For example, when the encrypted data instruction message carries first-type identification information, the selector module will select the first algorithm from multiple traditional encryption algorithms arranged in the first order in the cryptographic library inherent in the trusted execution environment as the final encryption algorithm. The first-type identification information is used to identify that the data to be encrypted belongs to a data type with relatively low security requirements but still needs protection, such as streaming media session keys, anonymous authentication information of IoT devices, software update package verification data, small transaction bills in payment systems, and online banking query data. For example, assuming the cryptographic library arranges algorithms such as ECC, RSA, and AES in order, when the selector module receives encrypted data instruction message carrying the "streaming media session key," it will automatically select ECC as the final encryption algorithm to encrypt the streaming media session key in shared memory, ensuring the security of the data during transmission and storage while avoiding unnecessary high computational overhead. Furthermore, when the encrypted data instruction message carries second-type identification information, the selector module will select the first algorithm from both the cryptographic library and the post-quantum cryptographic algorithm library in their respective orders as the corresponding final encryption algorithms. The second type of identification information is used to identify whether the data to be encrypted is high-security or high-sensitivity, such as digital signatures of root certificate authorities, legal electronic contracts, state secrets, military plans, master keys for biometric templates, and large transaction records from payment systems. For example, assuming the first algorithm in the cryptographic library is ECC and the first algorithm in the post-quantum cryptographic algorithm library is ML-KEM, the selector module will choose ECC and ML-KEM respectively to encrypt the sensitive data. This achieves dual protection between traditional encryption and post-quantum encryption, ensuring data security during transmission and storage, while also meeting the requirements for resistance to quantum computing attacks. Furthermore, it implements classified management of encryption strategies, automatically selecting the appropriate encryption algorithm based on data sensitivity and security level, balancing security and performance. For example, using traditional algorithms for low-sensitivity data reduces computational overhead and improves processing efficiency; using dual encryption or post-quantum algorithms for high-sensitivity data effectively prevents future quantum computing attacks and ensures long-term data security. Secondly, this mechanism enhances the system's flexibility and controllability. By carrying data type identification information in the encrypted data instruction information, administrators can flexibly specify encryption strategies in different application scenarios, while the selector module automatically executes the decision, avoiding security risks caused by human error or inappropriate algorithm selection. Thirdly, the entire algorithm selection and encryption process is completed within a secure environment, ensuring that sensitive information remains protected at all times, significantly improving the reliability of data protection.

[0036] Preferably, in another specific embodiment of this application, the corresponding final encryption algorithm is determined based on the encrypted data instruction information using a pre-set selection strategy, specifically including: When the system load of the trusted execution environment obtained in real time by the selector module is within a preset range, the first algorithm among the multiple post-quantum encryption algorithms arranged in the second order in the post-quantum cryptography algorithm library is used as the final encryption algorithm. The system load includes: CPU utilization and memory utilization; When the system load of the trusted execution environment obtained by the selector module in real time exceeds a preset threshold, and the encrypted data instruction information obtained by the selector module carries a third type of identification information, the first algorithm among the multiple traditional encryption algorithms arranged in the first order in the cryptographic library inherent in the trusted execution environment shall be used as the final encryption algorithm. The third type of identification information identifies data to be encrypted as any of the following: non-classified website login authentication data, anonymous authentication of IoT devices, software update package verification, or protection of non-critical user data.

[0037] For example, when the system load acquired in real time by the selector module is within a preset range, it will prioritize selecting the first algorithm from multiple post-quantum cryptography algorithms arranged in the second order in the post-quantum cryptography algorithm library as the final encryption algorithm. System load can include CPU utilization and memory utilization; for example, a preset range might be set where CPU utilization is below 70% and memory usage is below 60%. For instance, assuming the post-quantum cryptography algorithm library contains algorithms such as ML-KEM, CRYSTALS-Kyber, and Falcon arranged in order, when the system load is low, the selector module will select ML-KEM as the final encryption algorithm to encrypt sensitive data in shared memory, providing quantum resistance protection without affecting the system's real-time performance. Furthermore, when the system load exceeds a preset threshold, such as CPU utilization exceeding 90% or memory usage exceeding 80%, the selector module will consider the load situation and adjust its selection based on the data type identification information to be encrypted. If the acquired encrypted data instruction information carries a third type of identification information, such as identification data for non-classified website login authentication, IoT device anonymous authentication, software update package verification, or protection of non-critical user data, the selector module will select the first algorithm from the multiple traditional encryption algorithms arranged in the first order in the cryptographic library inherent in the trusted execution environment as the final encryption algorithm. For example, assuming that the cryptographic library is arranged in the order of ECC, RSA, and AES, the selector module will select ECC to encrypt non-critical data, thereby reducing computational overhead while ensuring security and avoiding system performance degradation or processing delays caused by post-quantum algorithms under high load conditions. This embodiment achieves load-adaptive capability for encryption algorithm selection through the above method, and can dynamically adjust the algorithm usage strategy according to the system operating status, taking into account both data security and system performance. For example, under low load, post-quantum algorithms are given priority to provide quantum attack protection, while under high load, traditional algorithms can be switched for non-critical data to avoid performance bottlenecks or resource exhaustion. Secondly, it also improves the reliability and availability of the system, avoiding system response delays or anomalies caused by excessive use of computationally intensive algorithms in high-load scenarios, and ensuring continuous and stable service operation. Furthermore, by completing the algorithm selection and switching operations within a secure world, sensitive data is always kept in a protected environment, preventing plaintext or key leakage and improving overall security.

[0038] In the practical application of this embodiment, the final encryption algorithm is used to encrypt the data to be encrypted that exists in shared memory, and the corresponding encryption result is obtained. Specifically, this includes: When the final encryption algorithm is a traditional encryption algorithm from an inherent cryptographic library, the selector module uses the final encryption algorithm to encrypt the data to be encrypted, obtaining the corresponding encryption result. Specifically, when the final encryption algorithm is a traditional encryption algorithm from an inherent cryptographic library in the trusted execution environment, such as ECC, RSA, or AES, the selector module will directly use this algorithm to process the data to be encrypted. For example, when protecting user login authentication information or software update package verification data, the selector module uses ECC to encrypt the data in shared memory, converting plaintext data into ciphertext, thereby ensuring the security of the data during transmission or storage.

[0039] When the final encryption algorithm is a post-quantum cryptography algorithm from the post-quantum cryptography algorithm library, the selector module uses the final encryption algorithm to encrypt the data to be encrypted, obtaining the corresponding encryption result. Specifically, when the final encryption algorithm is a post-quantum cryptography algorithm from the post-quantum cryptography algorithm library, such as ML-KEM, CRYSTALS-Kyber, or Falcon, the selector module will use this algorithm to process the data to be encrypted. For example, for sensitive data involving state secrets or military plans, the selector module will use ML-KEM to encrypt the data in shared memory, thereby providing resistance to quantum attacks and ensuring the data remains secure under future quantum computing threats.

[0040] When the final encryption algorithm includes both traditional encryption algorithms from the inherent cryptography library and post-quantum cryptography algorithms from the post-quantum cryptography algorithm library, the selector module first uses the traditional encryption algorithm to encrypt the data to be encrypted, obtaining an initial encryption result. Then, it uses the post-quantum cryptography algorithm to encrypt the initial encryption result to obtain the corresponding encryption result. For example, when the final encryption algorithm includes both traditional and post-quantum cryptography algorithms, the selector module first uses the traditional encryption algorithm to encrypt the data to be encrypted, obtaining an initial encryption result, and then uses the post-quantum cryptography algorithm to perform a second encryption on the initial encryption result. For instance, for the master key of a large transaction bill or biometric template in a payment system, the selector module first uses ECC to encrypt the data, obtaining an initial ciphertext, and then uses Aigis to perform a second encryption on the initial ciphertext, obtaining the final ciphertext. Through this "double encryption" mechanism, the computational efficiency of traditional encryption and the high security of post-quantum encryption can be simultaneously achieved, forming a multi-layered security protection.

[0041] The selector module described in this embodiment is also used to receive encryption algorithm support instruction information forwarded by the application module in the secure world from the ordinary world of the trusted execution environment; The encryption algorithm support instruction information is the encryption algorithm support status information fed back by the ordinary world of the first trusted execution environment in response to the received encryption result. The encryption algorithm support status information is information on whether the first trusted execution environment supports the final encryption algorithm corresponding to the encryption result. When the encryption algorithm supports the instruction information represented as being connected to the ordinary world of the first trusted execution environment, and the final encryption algorithm corresponding to the encryption result is not supported by this algorithm, the selector module performs an algorithm replacement process, specifically including: If the final encryption algorithm belongs to the cryptography library inherent in the trusted execution environment, the selector module selects the next traditional encryption algorithm after the current algorithm in a preset first order in the cryptography library, and sends a support query instruction for the selected traditional encryption algorithm to the ordinary world of the first trusted execution environment; after receiving a confirmation response from the ordinary world of the first trusted execution environment that supports the selected traditional encryption algorithm, the selector module uses the selected traditional encryption algorithm as the new final encryption algorithm to encrypt the data to be encrypted in the shared memory; if the ordinary world of the first trusted execution environment returns a response that does not support the selected traditional encryption algorithm, the selector module continues to select the next traditional encryption algorithm in sequence and repeats the above query and confirmation steps until a confirmation response that supports the selected traditional encryption algorithm is received, or until all traditional encryption algorithms in the cryptography library are not supported and the encryption of the data to be encrypted in the shared memory ends. If the final encryption algorithm belongs to the post-quantum cryptography algorithm library, the selector module sequentially selects the next post-quantum encryption algorithm after the current algorithm according to the preset second order in the post-quantum cryptography algorithm library, and sends a support query instruction for the selected post-quantum encryption algorithm to the ordinary world of the first trusted execution environment; after receiving a confirmation response from the ordinary world of the first trusted execution environment that supports the selected post-quantum encryption algorithm, the selector module uses the selected post-quantum encryption algorithm as the new final encryption algorithm to encrypt the data to be encrypted in the shared memory; if the ordinary world of the first trusted execution environment returns a response that does not support the selected post-quantum encryption algorithm, the selector module continues to sequentially select the next post-quantum encryption algorithm and repeats the above query and confirmation steps until a confirmation response that supports the selected post-quantum encryption algorithm is received, or until all post-quantum encryption algorithms in the post-quantum cryptography algorithm library are not supported and the encryption of the data to be encrypted in the shared memory ends.

[0042] To illustrate specifically, suppose the system in this embodiment is deployed on two servers, A (the current trusted execution environment) and B (the first trusted execution environment), both enabled by ARM TrustZone. Server A's selector module selects ECC (assuming the algorithms in the cryptographic library are arranged in the order of ECC, RSA, and the Chinese national standard SM2) as the final encryption algorithm to encrypt the non-confidential transaction data in shared memory, and then sends the encryption result to Server B's normal world for decryption. Upon receiving the encryption result, Server B discovers that ECC is not supported by the current decryption module, and therefore returns an "unsupported" encryption algorithm support status to Server A's selector module.

[0043] At this point, the selector module of server A performs an algorithm replacement process. This involves selecting RSA as a candidate algorithm from the inherent cryptographic library in a preset order and sending a support query command for RSA to server B. If server B returns a support confirmation, the selector module uses RSA as the new final encryption algorithm to encrypt the data to be encrypted in shared memory and generates a new encryption result, which is then sent to server B. If server B does not support RSA, the selector module continues to select the next algorithm (the Chinese national standard SM2 algorithm) and repeats the query until a supported algorithm is found or all algorithms have been traversed before ending the encryption process. Similarly, if the initial final encryption algorithm belongs to a post-quantum cryptography algorithm library, such as ML-KEM, the selector module will also select the next algorithm in the order of the post-quantum cryptography algorithm library (such as CRYSTALS-Kyber, Falcon, etc.) and query the first trusted execution environment for support status until a supported post-quantum cryptography algorithm is found and the encryption process is completed.

[0044] The system in this embodiment ensures data compatibility across trusted execution environments, guaranteeing that encrypted data can be correctly decrypted and used when sent to other trusted execution environments, avoiding data transmission failures or service interruptions due to algorithm incompatibility. Secondly, this mechanism improves the system's flexibility and robustness. Through dynamic querying and algorithm switching, it can seamlessly adapt to different environments and system versions, meeting the needs of future system upgrades or algorithm updates. Furthermore, even if the initially selected algorithm is not supported by the target environment, the selector module still completes the algorithm replacement and encryption operations within the secure world, ensuring that sensitive data remains protected and is not exposed to plaintext or keys in the ordinary world or external networks. Thirdly, this method supports combinations of multiple encryption strategies, applicable to both traditional and post-quantum encryption algorithms, or a combination of both, forming multi-layered protection and enhancing resistance to attacks.

[0045] Preferably, the system in this embodiment further includes: a cryptographic coprocessor set in the secure world of the trusted execution environment; The selector module is also used in the case where a cryptographic coprocessor is set up in the secure world of a trusted execution environment. When the determined final encryption algorithm is a post-quantum cryptography algorithm in the post-quantum cryptography algorithm library, the encryption coprocessor is controlled to implement the final encryption algorithm, encrypt the data to be encrypted, and obtain the corresponding encryption result. When the determined final encryption algorithm includes both the traditional encryption algorithm in the inherent cryptography library and the post-quantum cryptography algorithm in the post-quantum cryptography algorithm library, the selector module controls the encryption coprocessor to execute the final encryption algorithm using the post-quantum cryptography algorithm as the final encryption algorithm, and further encrypts the initial encrypted data obtained by encrypting the data to be encrypted using the traditional encryption algorithm to obtain the final encryption result.

[0046] Specifically, in this embodiment, the system preferably employs a cryptographic coprocessor within the secure world of a trusted execution environment to assist in handling encryption operations, particularly computationally intensive post-quantum cryptographic algorithms, thereby improving encryption performance and system efficiency. In this case, the selector module can assign encryption tasks to the cryptographic coprocessor based on the type of the final encryption algorithm. Assuming the system is deployed on a server with ARM TrustZone enabled, and the secure world is equipped with a cryptographic coprocessor supporting post-quantum cryptographic algorithms, when the selector module determines that the final encryption algorithm is a post-quantum cryptographic algorithm, such as CRYSTALS-Kyber, used to encrypt sensitive data in shared memory, the selector module controls the cryptographic coprocessor to execute the CRYSTALS-Kyber algorithm, encrypt the data, obtain the encryption result, and return it to the normal world or for further transmission. Through dedicated hardware acceleration by the cryptographic coprocessor, the computation speed is significantly improved compared to executing the same post-quantum cryptographic algorithm on a general-purpose CPU, while reducing CPU load and avoiding impact on the operation of other system tasks.

[0047] Furthermore, when the final encryption algorithm combines traditional encryption algorithms and post-quantum cryptography algorithms—for example, first using RSA to perform initial encryption on non-critical transaction data, and then using ML-KEM to perform secondary encryption on the initial ciphertext—the selector module sends the initial ciphertext to the encryption coprocessor, which executes the ML-KEM algorithm to complete the final encryption process. This approach achieves combined encryption of traditional and post-quantum algorithms, balancing the computational efficiency of traditional algorithms with fully utilizing the quantum attack resistance provided by post-quantum algorithms, thereby improving data security.

[0048] In this embodiment, the encryption coprocessor is specifically designed to handle complex computational tasks related to post-quantum algorithms. Compared to pure software implementations, it is faster, has a shorter system response time, and reduces the load on the CPU and main memory. The traditional CPU can continue processing other business logic, avoiding performance degradation or increased latency due to high-intensity encryption tasks. Furthermore, it enhances system security and resistance to attacks: sensitive data undergoes end-to-end encryption within a secure environment, ensuring plaintext data never leaves this environment. The hardware isolation of the encryption coprocessor also reduces the potential attack surface.

[0049] The cryptographic coprocessor specifically includes: a hardware acceleration unit for implementing post-quantum cryptography algorithms, and a secure storage unit for generating and storing keys within the cryptographic coprocessor.

[0050] In summary, this embodiment, by introducing a cryptographic coprocessor into a secure world and combining it with the dynamic control of the final encryption algorithm by a selector module, achieves a high-performance, low-load, and quantum-threat-resistant flexible encryption processing mechanism, effectively ensuring the security of sensitive data in a trusted execution environment and the overall system operating efficiency.

[0051] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0052] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0053] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first and second features are in direct contact, or that they are in indirect contact through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0054] In the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0055] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A trusted execution environment hardening system based on post-quantum cryptography, the system comprising an application module, a cryptography library, and shared memory, characterized in that, The system also includes: a selector module and a post-quantum cryptography algorithm library set up in the secure world of a trusted execution environment; The selector module is used to receive encrypted data instruction information forwarded by the application module in the secure world through the ordinary world of the trusted execution environment, and based on the encrypted data instruction information, adopt a pre-set selection strategy to determine the corresponding final encryption algorithm in the cryptography library inherent in the trusted execution environment and / or the post-quantum cryptography algorithm library, and encrypt the data to be encrypted in the shared memory based on the final encryption algorithm to obtain the corresponding encryption result. The cryptography library includes: multiple traditional encryption algorithms arranged in a preset first order; The post-quantum cryptography algorithm library includes: multiple post-quantum encryption algorithms arranged in a preset second order; Based on the encrypted data instruction information, a pre-set selection strategy is used to determine the corresponding final encryption algorithm, specifically including: When the encrypted data instruction information obtained by the selector module carries first type identification information, the first algorithm is selected as the final encryption algorithm from a plurality of conventional encryption algorithms arranged in a first order in the cryptographic library inherent in the trusted execution environment. The encrypted data instruction information also carries the type identification information of the data to be encrypted; The first type of identification information is information that identifies the data to be encrypted as any of the following: streaming media session key, anonymous authentication of IoT devices, software update package verification, small transaction bills of payment systems, and online bank query data. When the encryption data instruction information obtained by the selector module carries the second type of identification information, the selector module selects the first algorithm from the cryptography library and the post-quantum cryptography algorithm library in their respective order, and uses them as the corresponding final encryption algorithms. The second type of identification information identifies the data to be encrypted as any type of data, such as digital signatures of root certificate authorities, legal electronic contracts, state secret archives, military plans, master keys of biometric templates, or large transaction bills from payment systems. Based on the encrypted data instruction information, a pre-set selection strategy is used to determine the corresponding final encryption algorithm, specifically including: When the system load of the trusted execution environment obtained in real time by the selector module is within a preset range, the first algorithm among the multiple post-quantum encryption algorithms arranged in the second order in the post-quantum cryptography algorithm library is used as the final encryption algorithm. The system load includes: CPU utilization and memory utilization; When the system load of the trusted execution environment obtained by the selector module in real time exceeds a preset threshold, and the encrypted data instruction information obtained by the selector module carries a third type of identification information, the first algorithm among the multiple traditional encryption algorithms arranged in the first order in the cryptographic library inherent in the trusted execution environment shall be used as the final encryption algorithm. The third type of identification information identifies data to be encrypted as any of the following: non-classified website login authentication data, anonymous authentication of IoT devices, software update package verification, or protection of non-critical user data.

2. The trusted execution environment hardening system based on post-quantum cryptography according to claim 1, characterized in that, in, After completing the encryption, the trusted execution environment sends the encrypted result through the ordinary world to the ordinary world of the first trusted execution environment with which it is connected.

3. The trusted execution environment hardening system based on post-quantum cryptography according to claim 2, characterized in that, The encrypted data instruction information carries the algorithm identification information of the target encryption algorithm obtained during the process of establishing a secure channel between the ordinary world of the trusted execution environment and the ordinary world of the first trusted execution environment; Accordingly, based on the encrypted data instruction information, a pre-set selection strategy is adopted to determine the corresponding final encryption algorithm, specifically including: When the encrypted data instruction information contains the algorithm identification information of the target encryption algorithm, the selector module selects the algorithm corresponding to the algorithm identification information from the cryptography library and the post-quantum cryptography algorithm library as the final encryption algorithm.

4. The trusted execution environment hardening system based on post-quantum cryptography according to claim 2, characterized in that, The selector module is further configured to send an inquiry message on whether the post-quantum encryption algorithm type is supported to the ordinary world of the first trusted execution environment through the ordinary world, and is further configured to receive an encryption algorithm type switching instruction fed back by the ordinary world of the first trusted execution environment after receiving the inquiry message and determining that the post-quantum encryption algorithm type is not supported; Encryption algorithm types include traditional encryption algorithm types and post-quantum encryption algorithm types.

5. The trusted execution environment hardening system based on post-quantum cryptography according to claim 4, characterized in that, Based on the encrypted data instruction information, a pre-set selection strategy is used to determine the corresponding final encryption algorithm, specifically including: When the encrypted data instruction information does not carry the algorithm identification information of the target encryption algorithm, the selector module uses the post-quantum cryptographic algorithm library as the designated cryptographic algorithm library, and selects the first algorithm in the designated cryptographic algorithm library as the final encryption algorithm according to the second order. If the encrypted data instruction information does not carry the algorithm identifier information of the target encryption algorithm, and an encryption algorithm type switching instruction is received, the selector module will use the cryptography library as the specified cryptographic algorithm library, and select the first algorithm in the specified cryptographic algorithm library as the final encryption algorithm in the first order. or, When the encrypted data instruction information does not carry the algorithm identification information of the target encryption algorithm, the selector module uses the post-quantum cryptographic algorithm library as the designated cryptographic algorithm library, and selects the first algorithm in the designated cryptographic algorithm library as the final encryption algorithm according to the second order. If the encrypted data instruction information does not carry the algorithm identifier information of the target encryption algorithm, and an encryption algorithm type switching instruction is received, the selector module ends the encryption of the data to be encrypted that exists in the shared memory.

6. The trusted execution environment hardening system based on post-quantum cryptography according to any one of claims 3-5, characterized in that, The final encryption algorithm is used to encrypt the data to be encrypted in shared memory, and the corresponding encryption result is obtained, specifically including: When the final encryption algorithm is a traditional encryption algorithm in the inherent cryptography library, the selector module uses the final encryption algorithm to encrypt the data to be encrypted and obtain the corresponding encryption result. When the final encryption algorithm is a post-quantum cryptography algorithm from the post-quantum cryptography algorithm library, the selector module uses the final encryption algorithm to encrypt the data to be encrypted and obtain the corresponding encryption result. When the final encryption algorithm includes traditional encryption algorithms from the inherent cryptography library and post-quantum cryptography algorithms from the post-quantum cryptography algorithm library, the selector module first uses the traditional encryption algorithm to encrypt the data to be encrypted to obtain an initial encryption result, and then uses the post-quantum cryptography algorithm to encrypt the initial encryption result to obtain the corresponding encryption result.

7. The trusted execution environment hardening system based on post-quantum cryptography according to claim 6, characterized in that, The selector module is also used to receive encryption algorithm support instruction information forwarded by the application module in the secure world from the ordinary world of the trusted execution environment; The encryption algorithm support instruction information is the encryption algorithm support status information fed back by the ordinary world of the first trusted execution environment in response to the received encryption result. The encryption algorithm support status information is information on whether the first trusted execution environment supports the final encryption algorithm corresponding to the encryption result. When the encryption algorithm supports the instruction information represented as being connected to the ordinary world of the first trusted execution environment, and the final encryption algorithm corresponding to the encryption result is not supported by this algorithm, the selector module performs an algorithm replacement process, specifically including: If the final encryption algorithm belongs to the cryptography library inherent in the trusted execution environment, the selector module selects the next traditional encryption algorithm after the current algorithm in a preset first order in the cryptography library, and sends a support query instruction for the selected traditional encryption algorithm to the ordinary world of the first trusted execution environment; after receiving a confirmation response from the ordinary world of the first trusted execution environment that supports the selected traditional encryption algorithm, the selector module uses the selected traditional encryption algorithm as the new final encryption algorithm to encrypt the data to be encrypted in the shared memory; if the ordinary world of the first trusted execution environment returns a response that does not support the selected traditional encryption algorithm, the selector module continues to select the next traditional encryption algorithm in sequence and repeats the above query and confirmation steps until a confirmation response that supports the selected traditional encryption algorithm is received, or until all traditional encryption algorithms in the cryptography library are not supported and the encryption of the data to be encrypted in the shared memory ends. If the final encryption algorithm belongs to the post-quantum cryptography algorithm library, the selector module selects the next post-quantum encryption algorithm after the current algorithm in the second preset order in the post-quantum cryptography algorithm library, and sends a support query instruction for the selected post-quantum encryption algorithm to the ordinary world of the first trusted execution environment. Upon receiving a confirmation response from the ordinary world of the first trusted execution environment acknowledging support for the selected post-quantum encryption algorithm, the selector module uses the selected post-quantum encryption algorithm as the new final encryption algorithm to encrypt the data to be encrypted in the shared memory. If the ordinary world of the first trusted execution environment returns a response indicating that it does not support the selected post-quantum encryption algorithm, the selector module continues to select the next post-quantum encryption algorithm in sequence and repeats the above query and confirmation steps until it receives a confirmation response indicating support for the selected post-quantum encryption algorithm, or until all post-quantum encryption algorithms in the post-quantum cryptographic algorithm library are found to be unsupported, thus ending the encryption of the data to be encrypted in the shared memory.

8. The trusted execution environment hardening system based on post-quantum cryptography as described in claim 1, characterized in that, The system also includes: a cryptographic coprocessor set up in the secure world of the trusted execution environment; The selector module is also used in the case where a cryptographic coprocessor is set up in the secure world of a trusted execution environment. When the determined final encryption algorithm is a post-quantum cryptography algorithm in the post-quantum cryptography algorithm library, the encryption coprocessor is controlled to implement the final encryption algorithm, encrypt the data to be encrypted, and obtain the corresponding encryption result. When the determined final encryption algorithm includes both the traditional encryption algorithm in the inherent cryptography library and the post-quantum cryptography algorithm in the post-quantum cryptography algorithm library, the selector module controls the encryption coprocessor to execute the final encryption algorithm using the post-quantum cryptography algorithm as the final encryption algorithm, and further encrypts the initial encrypted data obtained by encrypting the data to be encrypted using the traditional encryption algorithm to obtain the final encryption result.

Citation Information

Patent Citations

  • Quantum and classical password fusion encryption transmission equipment

    CN115987514A

  • Confusion encryption method and device, equipment, medium and program product

    CN120602181A

  • Extensible encryption network protocol implementation method, cryptographic algorithm negotiation method, system, equipment and medium

    CN120785530A