Unreliable Environment Key Management Method

By generating random salt values in an untrusted terminal environment, adding salt to the plaintext feature library and program source code, establishing a trusted channel to transmit dense feature library and salt-containing programs, the problem of easy leakage of feature library data and high risk of attack is solved, efficient feature matching and network data packet management are achieved, and data security and smooth communication are ensured.

CN119696765BActive Publication Date: 2025-07-29BEIJING ZHONGKE NETWORK CORE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411755074.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-07-29
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In an untrusted terminal environment, the feature database data is prone to leakage, the risk of being attacked is high, the feature matching performance is low, and the network data packet management lacks an effective mechanism.

Method used

Generate random salt values to calculate the plaintext feature library and program source code, establish a trusted channel to transmit the dense feature library and salt-containing programs to an untrusted terminal environment, and manage network data packets based on the dense feature library and salt-containing programs.

Benefits of technology

Ensure data security in an untrusted terminal environment, improve feature matching performance, and ensure normal and orderly network communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696765B_ABST
    Figure CN119696765B_ABST
Patent Text Reader

Abstract

The present invention discloses a key management method for an untrusted environment, which relates to the technical field of key management. The method includes: generating a random salt value; performing salt addition calculation on the plaintext feature library and the program source code based on the random salt value to determine the ciphertext feature library and the salt-containing program; establishing a trusted channel, and sending the ciphertext feature library and the salt-containing program to the untrusted terminal environment through the trusted channel for loading; obtaining the input network data packet, and managing the input network data packet in the untrusted terminal environment based on the ciphertext feature library and the salt-containing program. The present invention solves the technical problems in the prior art that the feature library data in the untrusted terminal environment is prone to leakage, the risk of being attacked is high, the feature matching performance is low, and there is a lack of an effective mechanism for managing network data packets, and achieves the technical effects of ensuring data security, improving the feature matching performance, and ensuring the normal and orderly network communication in the untrusted terminal environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of key management, and particularly to a key management method for an untrusted environment. Background Art

[0002] In today's digital age, the widespread application of network technology has posed many severe challenges to data processing of various terminal devices in an untrusted environment. With the rapid development of information technology, a large number of terminal devices have emerged continuously. During their daily operation, these terminal devices frequently interact with external networks and process a large amount of sensitive information, such as user data, device operation status data, and various business-related data, etc. However, there are many security risks in the untrusted terminal environment. On the one hand, these terminal devices are often exposed to a complex and changeable network environment and are vulnerable to various external attack means. For example, an attacker may use reverse tracking technology to analyze the programs running on the terminal device, attempting to obtain the internal logic, algorithms, and sensitive data of the program; dynamic analysis technology enables the attacker to monitor and analyze the behavior of the program during its operation, thereby discovering potential vulnerabilities; memory perspective attacks directly threaten the data security in the memory of the terminal device and may lead to data leakage. On the other hand, in the untrusted terminal environment, there are also huge challenges in the management of network data packets. Traditional security protection measures often fail to achieve efficient feature matching and cannot quickly and accurately identify potential threats in network data packets.

[0003] There are technical problems in the prior art such as easy leakage of feature library data, high risk of being attacked, low feature matching performance, and lack of an effective mechanism for network data packet management in an untrusted terminal environment. Summary of the Invention

[0004] This application provides a key management method for an untrusted environment, which is used to solve the technical problems in the prior art such as easy leakage of feature library data, high risk of being attacked, low feature matching performance, and lack of an effective mechanism for network data packet management in an untrusted terminal environment.

[0005] In view of the above problems, this application provides a key management method for an untrusted environment, and the method includes:

[0006] Generate a random salt value, where the random salt value is generated based on a cloud feature library distribution system, and the cloud feature library distribution system is a cloud platform for data salting and encryption; based on the random salt value, perform salting calculations on the plaintext feature library and program source code to determine a ciphertext feature library and a salted program, where the salting calculation includes salting hash processing of the plaintext feature library and obfuscating compilation of the program source code; establish a trusted channel, and through the trusted channel, send the ciphertext feature library and the salted program to an untrusted terminal environment for loading, where the trusted channel connects the cloud feature library distribution system and the untrusted terminal environment; obtain an input network data packet, and based on the ciphertext feature library and the salted program, manage the input network data packet in the untrusted terminal environment.

[0007] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0008] Generate a random salt value; based on the random salt value, perform salting calculations on the plaintext feature library and program source code to determine a ciphertext feature library and a salted program; establish a trusted channel, and through the trusted channel, send the ciphertext feature library and the salted program to an untrusted terminal environment for loading; obtain an input network data packet, and based on the ciphertext feature library and the salted program, manage the input network data packet in the untrusted terminal environment. It achieves the technical effects of ensuring data security, improving feature matching performance, and ensuring normal and orderly network communication in an untrusted terminal environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0010] Figure 1 It is a flowchart of the key management method for an untrusted environment provided by an embodiment of this application;

[0011] Figure 2 It is a flowchart of the salting calculation process for the plaintext feature library of the key management method for an untrusted environment provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0012] This application provides a key management method for an untrusted environment, which is used to solve the technical problems in the prior art such as easy leakage of feature library data, high risk of being attacked, low feature matching performance, and lack of an effective mechanism for managing network data packets in an untrusted terminal environment.

[0013] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.

[0014] Embodiment, such as Figure 1 As shown, the present application provides a method for managing keys in an untrusted environment. The method includes:

[0015] Step S100: Generate a random salt value, where the random salt value is generated based on a cloud feature library distribution system, and the cloud feature library distribution system is a cloud platform for data salting encryption.

[0016] Specifically, the generation of the random salt value relies on the cloud feature library distribution system. As the key platform for executing data salting encryption, this system uses a mature pseudo-random number generation algorithm in the field of cryptography to generate the random salt value. It uses a cryptographically secure hash function combined with dynamic factors such as the current system time and system process ID as the seed value, and generates the random salt value through a series of complex calculation processes. This method can ensure that the generated random salt value has a high degree of randomness and unpredictability in theory, meeting the strict requirements for random elements in the encryption process. This random salt value will be the key basis for subsequent salting calculations on the plaintext feature library and program source code. It can effectively increase the security of the encrypted data, greatly increasing the difficulty for attackers to crack the encrypted information, and laying a solid and reliable foundation for the data security protection system in the entire untrusted terminal environment.

[0017] Step S200: Based on the random salt value, perform salting calculations on the plaintext feature library and the program source code to determine the encrypted feature library and the salt-containing program, where the salting calculation includes the salting hash processing of the plaintext feature library and the obfuscating compilation of the program source code.

[0018] Specifically, based on the random salt values generated by the cloud-based feature library distribution system, key salt addition calculation operations are performed on the plaintext feature library and the program source code. For the plaintext feature library, each feature therein needs to be traversed as the encryption object, and with the random salt value as the parameter, the MD5 salted hash algorithm is used for processing. This process converts the features into irreversible encrypted features, and then these encrypted features are integrated to determine the encrypted feature library. For the program source code, the random salt value is written into the corresponding salt macro, and then the GCC compiler is called for obfuscating compilation. During the obfuscating compilation, algorithms such as control flow obfuscation and data obfuscation are introduced to change the source code structure and replace identifiers. After generating the intermediate code, it is fused to obtain the salt-containing program. Through such a salt addition calculation process, while converting the plaintext feature library into an encrypted feature library to enhance security, the obfuscating compilation of the program source code increases the difficulty of reverse analysis, effectively protecting the data and algorithm logic, and providing strong support for data security and efficient processing in an untrusted terminal environment.

[0019] Step S300: Establish a trusted channel. Through the trusted channel, the encrypted feature library and the salt-containing program are sent to the untrusted terminal environment for loading, where the trusted channel connects the cloud-based feature library distribution system and the untrusted terminal environment.

[0020] Specifically, establishing a trusted channel is a key link to achieve the secure transmission and loading of the encrypted feature library and the salt-containing program to the untrusted terminal environment. As the data sender, the cloud-based feature library distribution system and the untrusted terminal environment (the receiver) first perform two-way identity authentication, which involves the use of traditional asymmetric encryption algorithms such as RSA and digital certificates to ensure the authenticity of the terminal identity. After successful authentication, the two parties negotiate a temporary session key, which is randomly generated and used for subsequent encrypted transmission. The encrypted feature library is encrypted using the temporary session key to generate the encrypted text of the encrypted feature library, and the salt-containing program is encrypted to generate the encrypted text of the salt-containing program. Then, the encrypted texts are transmitted to the untrusted terminal environment through the established trusted channel. After the untrusted terminal environment receives the encrypted texts, decryption operations are performed according to the temporary session key. For the encrypted text of the encrypted feature library, the encrypted features therein are read and inserted into the feature hash table. For the encrypted text of the salt-containing program, the program is restored and loaded into memory for running, and after the loading is completed, the decrypted encrypted feature library and the salt-containing program are deleted according to the security policy to avoid security risks brought by data residue, thus completely realizing the secure transmission and effective loading of data from the cloud to the untrusted terminal environment.

[0021] Step S400: Obtain the input network data packet, and manage the input network data packet in the untrusted terminal environment based on the encrypted feature library and the salt-containing program.

[0022] Specifically, when the untrusted terminal environment obtains the input network data packet, it starts the management work on the packet based on the loaded confidential feature library and the salted program. First, the salted program extracts the content of the network data packet according to the embedded feature value algorithm, such as URL content extraction. Then, in combination with the confidential feature library, the corresponding embedded salted hash algorithm is used to perform salted hash calculation based on the extracted content and the preset salt value macro in the program, so as to determine the matching confidential feature corresponding to the network data packet. Then, taking the packet confidential feature as the key index, it is queried and located in the feature hash table by means of hash modulo search, and it is determined whether the feature is hit through an efficient single query. If it is hit, the salted program processes it according to the embedded hit behavior corresponding to the feature item in the confidential feature library, such as performing operations like intercepting the packet; if it is not hit, it is processed according to the embedded miss behavior, such as normally forwarding the packet, etc., so as to achieve precise management of the network data packets input in the untrusted terminal environment and ensure the security and compliance of network communication.

[0023] In a possible implementation manner, as Figure 2 shown, step S200 further includes:

[0024] Step S210: Traverse the plaintext feature library to determine N encryption objects, where N is the number of plaintext features.

[0025] Step S220: Perform salted hash processing on the N encryption objects based on the random salt value to determine N confidential features, where the N confidential features are irreversible encryptions.

[0026] Step S230: Integrate and combine the N confidential features to determine the confidential feature library.

[0027] Specifically, for the important task of accurately locating the elements to be encrypted from the plaintext feature library, the plaintext feature library contains various types of feature information such as domain name features, IP address features, URL features, etc. These information are the basis for real-time matching and control of network packets in and out. When starting to traverse the plaintext feature library, each individual feature is checked one by one. For example, a specific domain name record, an IP address segment, or a complete URL link is regarded as an independent element. Through the systematic traversal process, each item of feature can be clearly identified, and the number of these identified features is N, that is, the number of plaintext features. In actual operation, each domain name information is sequentially read from the massive domain name feature library, or URL links are individually extracted from the URL feature library to ensure no omission. This process provides clear operation objects for the subsequent encryption processing based on the random salt value and is the primary and key step in constructing a secure confidential feature library, jointly working towards improving the security and reliability of the feature library in the untrusted terminal environment.

[0028] Based on the random salt value generated by the cloud-based feature library distribution system, perform salted hashing on the previously determined N encrypted objects. This is the core step of converting plaintext features into highly secure ciphertext features. This process aims to enhance the security of the feature library in an untrusted terminal environment. Using the MD5 hashing algorithm, the random salt value is used as an additional input parameter and combined with each encrypted object (such as domain name features, IP address features, etc.) for calculation. For each encrypted object, its original feature value and the random salt value jointly participate in the hashing operation. This process is like mixing a unique key (random salt value) with the original data (encrypted object) and then putting it into a complex encryption machine (hashing algorithm) for processing. After such salted hashing calculation, the resulting N ciphertext features are irreversible, that is, it is almost impossible to reverse-derive the original plaintext features from the ciphertext features. This means that even if an attacker obtains the ciphertext features, it is difficult to restore the original feature information, thus effectively preventing the feature library from information leakage due to attacks such as memory introspection in an untrusted terminal environment, and strongly guaranteeing the security of the data, which highly matches the goal of the technical disclosure document of safe operation and high-performance matching compatibility in an untrusted terminal environment.

[0029] Perform integration and consolidation operations on the N ciphertext features obtained after salted hashing to determine the ciphertext feature library. These ciphertext features each carry important information after encryption conversion, and they are the key components for constructing a secure and efficient feature library. During the consolidation process, these N ciphertext features will be orderly combined together according to a certain logic and structure. For example, they will be classified and arranged according to factors such as the type, source, or application scenario of the features, just like storing different types of encrypted files into a general encrypted database according to a specific folder classification method. Through such integration and consolidation, the scattered ciphertext features are constructed into a complete ciphertext feature library, providing a data basis for high-performance ciphertext feature matching in an untrusted terminal environment in the future. This ciphertext feature library can effectively protect the security of the rule data in the rule library without affecting the normal forwarding of network data packets, and reduce the risk of rule library leakage caused by various attacks.

[0030] In a possible implementation manner, step S200 further includes:

[0031] Step S240: Based on the random salt value, write the salt macro corresponding to the program source code, where the salt macro is used to store the random salt value in the program source code.

[0032] Step S250: Call the GCC compiler to perform obfuscating compilation on the program source code after writing the salt macro to determine the salt-containing program.

[0033] Step S260: Among them, the obfuscation compilation step includes:

[0034] Introduce an obfuscation algorithm to obfuscate the program source code after the salt value macro is written, and determine the obfuscated source code. Among them, the obfuscation process includes at least changing the source code structure and identifier replacement.

[0035] Compile the obfuscated source code to generate intermediate code, and fuse the intermediate code with the obfuscated source code to generate the salt-containing program. Among them, the intermediate code assembly is based on lexical-syntactic-semantic analysis.

[0036] Specifically, writing the random salt value into the salt value macro corresponding to the program source code is an important basic operation for constructing the salt-containing program. The program source code contains key elements such as the feature value extraction algorithm, the feature salted hash algorithm, and the feature search algorithm, which are the core parts for implementing the feature library function. The random salt value, as a randomly generated and highly secure element, is written into the salt value macro at this time. The salt value macro is like a special marker bit or storage unit in the program source code, specifically used to accommodate this random salt value. By accurately writing the random salt value into the salt value macro, the random salt value is closely associated with other important algorithms in the program source code. This association provides a key guarantee for subsequent obfuscation compilation and the secure operation of the entire feature library in an untrusted terminal environment. For example, in subsequent salted hash calculations, the random salt value in the salt value macro will participate in the operation as an important parameter, ensuring that the encryption process of the feature has higher security and unpredictability. Together, they are committed to enhancing the security of the feature library and its related programs in an untrusted terminal environment, preventing attackers from obtaining key information through means such as reverse tracking and memory perspective, and effectively protecting the integrity and confidentiality of data and algorithms.

[0037] Invoke the GCC compiler to perform obfuscation compilation on the program source code after the salt value macro is written to determine the salted program. This operation is a key link in strengthening the program security in the entire key management method for untrusted environments. The GCC compiler, as a widely used and powerful compilation tool in the software development field, undertakes the core mission in this obfuscation compilation task. When it receives the program source code with the salt value macro successfully written with random salt values, it starts a series of complex obfuscation compilation processes. During the obfuscation compilation process, GCC uses a variety of advanced obfuscation algorithms. First, in terms of control flow obfuscation, it adopts algorithms such as basic block splitting and recombination. This algorithm splits the basic blocks (i.e., a continuous execution code segment without branches) in the program source code and then recombines these basic blocks according to a complex and unpredictable rule. For example, the originally sequentially executed basic blocks A, B, and C in the original program may become B, A, C after processing, and some additional jump instructions that seem reasonable but actually do not affect the normal logic of the program may be inserted during the recombination process, making the control flow of the program intricate and difficult for attackers to understand the true intention of the program by analyzing the control flow. At the same time, at the data obfuscation level, GCC enables data encryption and encoding algorithms. For sensitive data in the program, such as key parameters related to the feature library, intermediate calculation results, etc., encryption processing is performed. For example, symmetric encryption algorithms are used to encrypt this data, and decryption operations are only performed when the program runs to specific decryption points to ensure the confidentiality of the data during static storage and transmission. In addition, data encoding conversion will also be performed, such as converting integer data into a custom encoding format and then decoding and restoring it during program operation, so that even if attackers obtain the encoded data, it is difficult for them to directly understand its true meaning. In addition, GCC will also obfuscate the identifiers in the program source code during the obfuscation compilation process. Using the randomized naming algorithm, identifiers such as variable names and function names in the program are replaced with strings without any rules. For example, a variable "userInput" that originally clearly represents user input data may be replaced with a completely random name like "x1y2z3a4", making it impossible for attackers to obtain any useful information about the program logic and function from the identifier names. After completing the above series of obfuscation operations, GCC compiles the obfuscated program source code according to the syntax rules and semantic logic of the programming language to generate intermediate code. This intermediate code contains both the obfuscated program logic and follows the instruction format that the target machine can understand. Finally, GCC fuses the intermediate code with the obfuscated program source code, and after subsequent processing steps such as optimization and linking, the salted program is finally determined.This salt-containing program not only incorporates random salt values but also undergoes deep obfuscation compilation, greatly enhancing its security. It can effectively resist attacks such as reverse analysis and memory perspective that may be suffered in an untrusted terminal environment, providing a solid program-level guarantee for the key management and data security protection system in the entire untrusted environment.

[0038] Introducing an obfuscation algorithm to obfuscate the program source code after writing the salt value macro is a key operation to enhance program security. In this process, the obfuscation algorithm, as the core driving tool, deeply transforms the program source code from multiple dimensions to jointly address potential threats in an untrusted terminal environment. In terms of changing the source code structure, taking the example of changing a loop to a recursion, assume that there is originally a loop structure in the program that traverses the elements of an array and performs specific operations. Normally, the loop would access each element in the array through a counter variable. However, after being processed by the obfuscation algorithm, this loop structure will be converted into a recursive form. A recursive function will be defined, and inside the function, after processing the current element, it will call itself again with modified parameters to process the next element until the recursive termination condition is met. This change makes the execution logic of the program no longer intuitive, and it is difficult for attackers to clarify the program's running process through conventional analysis means. For the operation of changing a simple function call to inline code, if there is a function in the program that calculates the sum of two numbers and the result is obtained through a function call in the original code, during the obfuscation process, the obfuscation algorithm will directly embed the calculation code in the function body into the position where the function is called, thus eliminating the trace of the function call. In this way, the code structure of the program becomes more compact and complex, hiding the original clear function call relationship and increasing the difficulty for attackers to analyze the program's functions and logic. In the identifier replacement link, the obfuscation algorithm will randomize identifiers such as variable names and function names in the program. For example, a variable "userLoginData" used to store user login information may be replaced with a meaningless character combination such as "x1y2z3a4". Similarly, a function "encryptData" used to perform data encryption operations may be renamed to "f1g2h3i4". This replacement makes the program code extremely difficult to read and understand because the identifiers no longer have intuitive semantic information, and attackers cannot easily infer their represented functions and data uses based on the names, thus effectively protecting the internal logic and data processing flow of the program, highly consistent with the goal of the technical disclosure document to improve the program's anti-reverse analysis ability, and providing an important guarantee for program security in an untrusted terminal environment.

[0039] After the generation of the obfuscated source code is completed, the subsequent operations are crucial for building the final salted program. First, compile the obfuscated source code to generate intermediate code. In this process, the GCC compiler, based on its powerful compilation capabilities, works according to the code language characteristics of the program source code (such as C, C++ etc.) and the data characteristics therein (for example, whether it contains binary data in a specific format, etc.). Suppose the program source code contains a large amount of binary data for image processing. The GCC compiler will identify these data characteristics and optimize the processing method for them during compilation, converting the obfuscated source code into intermediate code. This intermediate code is an intermediate representation form between the source code and the machine code. It has already performed a preliminary abstraction and optimization on the source code, containing the logical structure and data processing flow of the program, but it cannot be directly executed by the machine. Subsequently, based on the characteristics of the program source code and the requirements of the target machine, the intermediate code is further converted into machine code. For a program containing binary data, the relevant parts in the intermediate code will be converted into a machine code form with binary identifiers suitable for the target machine to process, and at the same time, some metadata describing the code structure, data layout, and information required during program operation will be generated. These metadata help to correctly interpret and execute the machine code during program operation, ensuring the logical correctness of the program and the accuracy of data processing. For example, the metadata may contain information such as the storage location of variables, function call conventions, etc. During the intermediate code assembly stage, based on lexical-syntactic-semantic analysis, the GCC compiler carefully checks the lexical structure of the intermediate code (such as the correct use of identifiers, keywords, etc.), syntax rules (ensuring that the code conforms to the syntax specifications of the programming language), and semantic logic (ensuring that the behavior of the program meets expectations). Through this strict analysis, the intermediate code is optimized and adjusted to make it more efficient and accurate. Finally, the converted and optimized intermediate code is merged with the obfuscated source code. During the merging process, the key information in the intermediate code is matched and integrated with the corresponding parts in the obfuscated source code to ensure that the generated salted program contains both the obfuscated program logic and the efficiently executable machine code part, thus achieving a balance between the security and performance of the program. The entire process is driven by the GCC compiler, making full use of its open source, flexible, and powerful features to ensure that in an untrusted terminal environment, the generated salted program can effectively resist attacks while maintaining good running performance.

[0040] In a possible implementation manner, step S300 further includes:

[0041] Step S310: The plaintext feature library and the program source code are the operation information libraries in the untrusted terminal environment, and the program source code is the feature processing code matching the plaintext feature library.

[0042] Specifically, the important status and associated nature of the plaintext feature library and the program source code in the untrusted terminal environment are clarified. The plaintext feature library, as an operating information library, is a key resource for data processing and control in the untrusted terminal environment. It contains a rich variety of feature information such as domain name features, IP address features, URL features, etc. These information are the basic basis for accurately matching and effectively managing network packets in and out. For example, in the network security protection scenario, the information in the domain name feature library can help identify and filter malicious domain name access requests, ensuring the security of network communication. The program source code, on the other hand, is the feature processing code that closely matches the plaintext feature library. It is the core engine that drives the entire feature library to function, defining how to operate and utilize the information in the plaintext feature library. The program source code contains a series of key algorithms, such as the feature value extraction algorithm for accurately extracting information related to the feature library from network data packets; the feature salted hash algorithm to ensure the security and irreversibility of features during processing; the feature search algorithm that can quickly locate the required features in the feature library; and the feature corresponding behavior that specifies the operations to be taken in different feature matching cases, such as intercepting specific packets or allowing normal forwarding, etc. These algorithms cooperate with the plaintext feature library to jointly form a complete system for operating information processing in the untrusted terminal environment, which highly coincides with the protection strategy described in the technology disclosure document, aiming to achieve efficient management and security protection of network data packets and ensure the stable and reliable operation of the system in the untrusted terminal environment.

[0043] In a possible implementation manner, step S300 further includes:

[0044] Step S320: Establish the trusted channel with the cloud feature library distribution system as the sending end and the untrusted terminal environment as the receiving end, where the trusted channel assists in the encrypted transmission management of the temporary session key.

[0045] Step S330: Among them, the encrypted transmission management based on the temporary session key includes:

[0046] Authenticate the terminal identity of the untrusted terminal environment. If the authentication is successful, generate a temporary session key, where the temporary session key is a randomly generated key pair.

[0047] Based on the temporary session key, encrypt the encrypted feature library and the salted program to generate the encrypted text of the encrypted feature library and the encrypted text of the salted program.

[0048] Through the trusted channel, transmit the encrypted text of the encrypted feature library and the encrypted text of the salted program to the untrusted terminal environment.

[0049] Specifically, establishing a trusted channel with the cloud feature library distribution system as the sender and the untrusted terminal environment as the receiver is a key measure to achieve secure data transmission. As the source of data, the cloud feature library distribution system holds important information resources such as the encrypted feature library and the salted program. Due to numerous security risks in the untrusted terminal environment, such as being vulnerable to reverse tracking, dynamic analysis, memory perspection attacks, etc., data transmission faces severe challenges. The trusted channel established at this time is like building a secure information highway between these two endpoints. It is not just a simple communication link, but more importantly, it can assist in the encrypted transmission management of the temporary session key. Through the trusted channel, both parties can securely negotiate the relevant parameters of the temporary session key to ensure the security of the temporary session key during generation, exchange, and use. This temporary session key will play a core role in subsequent data encryption and decryption processes, just like adding a strong lock to data transmission. Only with the correct temporary session key can the encrypted feature library and the salted program be encrypted at the sender and the received ciphertext be decrypted at the receiver, thus ensuring that the data is not stolen or tampered with during transmission and effectively resisting potential security threats from the untrusted terminal environment, providing a solid foundation for the security of data transmission in the entire untrusted environment key management system.

[0050] Terminal identity authentication of the untrusted terminal environment is the primary task of data transmission. Since untrusted terminal environments such as vehicle networking T-Box terminals, drone terminals, and Android smartphone terminals are vulnerable to various attacks, it is crucial to implement two-way identity authentication using traditional asymmetric encryption algorithms (such as RSA) and digital certificates. During the authentication process, the cloud feature library distribution system and the untrusted terminal environment mutually verify the authenticity of each other's identity credentials. If the authentication is successful, the system will randomly generate a temporary session key, which is a pair of random values. The randomness of this key ensures its security and makes it difficult for attackers to predict. This temporary session key will be used for subsequent data encryption and decryption operations to ensure the security of data transmission.

[0051] Based on the generated temporary session key, encrypt the encrypted feature library and the salted program. The encrypted feature library contains key feature information after salted hashing processing, which is an important basis for network data packet management in the untrusted terminal environment. Using the temporary session key, encrypt the encrypted feature library through an encryption algorithm to convert it into the ciphertext of the encrypted feature library. This process ensures the confidentiality of the encrypted feature library during transmission. Even if the ciphertext is stolen, attackers cannot obtain the feature information without the correct key. For the salted program, since it contains important logics such as feature value algorithms, salted hashing algorithms, etc., as well as random salt values, it is also encrypted using the temporary session key to generate the ciphertext of the salted program. This effectively protects the key algorithms and data in the program and prevents them from being leaked during transmission.

[0052] Finally, through the pre-established trusted channel, the ciphertext of the encrypted feature library and the ciphertext of the salted program are transmitted to the untrusted terminal environment. The trusted channel ensures the integrity of the data transmission process and prevents the ciphertext from being tampered with. The entire encrypted transmission management process, from identity authentication to data encryption and then to transmission, each link collaborates closely, effectively resisting various security threats in the untrusted terminal environment, such as information leakage and man-in-the-middle attacks, etc., which is highly consistent with the goal of the technical disclosure document to ensure data security, laying a solid foundation for subsequent data processing and protection in the untrusted terminal environment.

[0053] In a possible implementation manner, step S300 further includes:

[0054] Step S340: The untrusted terminal environment receives the ciphertext of the encrypted feature library and the ciphertext of the salted program.

[0055] Step S350: Based on the temporary session key, decrypt the ciphertext of the encrypted feature library, read N encrypted features and insert them into the feature hash table, decrypt the ciphertext of the salted program, restore the program and load it into the memory for running, and delete the decrypted encrypted feature library and salted program.

[0056] Specifically, the untrusted terminal environment, as the receiving end, receives the ciphertext of the encrypted feature library and the ciphertext of the salted program transmitted from the cloud feature library distribution system. This receiving process is the basis for subsequent operations, ensuring that the data can reach the destination accurately and preparing for subsequent decryption and loading and running.

[0057] Based on the temporary session key, the untrusted terminal environment first decrypts the ciphertext of the encrypted feature library. The temporary session key, as a key factor ensuring confidentiality during data transmission, plays an accurate decryption role here. Once the decryption is successful, the ciphertext of the encrypted feature library is restored to N encrypted features. These encrypted features are important data after being processed by salted hashing, and they will be used as the basis for subsequent hash identification and insertion into the feature hash table. During the process of inserting into the feature hash table, each encrypted feature calculates its position in the hash table according to a specific hash algorithm and then is accurately inserted into the corresponding position. This operation constructs an efficient feature query structure, enabling quick search and matching in the hash table according to the packet features when processing network data packets subsequently, greatly improving the efficiency of feature matching.

[0058] Meanwhile, decrypt the encrypted program text with salt. After the decrypted program source code is restored, it returns to an executable program state. Subsequently, it is loaded into memory for execution. Various key algorithms included in the program with salt, such as the feature value extraction algorithm, the feature salted hash algorithm, the feature search algorithm, and the corresponding feature behaviors, take effect during program execution. These algorithms work together to effectively process network data packets. For example, when a network data packet enters an untrusted terminal environment, the feature value extraction algorithm in the program with salt extracts key information from the packet according to preset rules, then uses the feature salted hash algorithm to process the extracted information, generates a hash value that can be matched with the encrypted features in the feature hash table, quickly locates in the hash table through the feature search algorithm, and finally processes the packet according to the corresponding feature behaviors, such as interception or forwarding operations. Finally, to minimize security risks, after the above operations are completed, the untrusted terminal environment immediately deletes the decrypted encrypted feature library and the program with salt. This measure effectively prevents the possibility of attackers obtaining such sensitive information through means such as memory side-channel attacks in the untrusted terminal environment, ensures that the encrypted features and program code do not leave traces in memory that can be exploited by attackers, further strengthens the security of the entire system in the untrusted terminal environment, and is consistent with the concept of the technical disclosure document to protect the security of the feature library data and prevent various attacks, providing a solid guarantee for data processing and security protection in the untrusted terminal environment.

[0059] In a possible implementation manner, step S400 further includes:

[0060] Step S410: Identify the network data packet, perform content extraction based on the program with salt running in the untrusted terminal environment, and perform salted hash processing on the extracted content in combination with the encrypted feature library to determine the encrypted features of the packet.

[0061] Step S420: Query and locate the encrypted features of the packet based on the feature hash table to determine the matching result.

[0062] Step S430: Manage the network data packet based on the matching result.

[0063] Specifically, when a network data packet enters an untrusted terminal environment, it must first be identified. Based on the salt-containing program running in the untrusted terminal environment, the content extraction operation is initiated. The feature value extraction algorithm in the salt-containing program comes into play and accurately extracts relevant content from the network data packet according to preset rules and logic. These extracted contents are the basis for subsequent processing and contain key information related to matching the feature library, such as the source address, destination address, port number, protocol type, etc. of the packet. Then, in combination with the encrypted state feature library, the feature salted hash algorithm in it is used to perform salted hash processing on the extracted content. During this process, the random salt value generated during the construction of the encrypted state feature library before (or a suitable salt value dynamically generated during program operation) is combined with the extracted content, and the packet encrypted state feature is calculated through a hash function. This packet encrypted state feature is an encrypted representation of the original extracted content and has irreversibility. Even if an attacker obtains the packet encrypted state feature, it is difficult to reverse-derive the original extracted content, thus protecting the security of the data.

[0064] Based on the feature hash table, the packet encrypted state feature is queried and located. As an efficient data structure, the feature hash table uses a hash function to quickly map the encrypted state feature to a specific location, thereby achieving fast query. When the packet encrypted state feature enters the feature hash table for query, the system can quickly search for a matching or similar encrypted state feature in the table. In this way, the matching result is determined to judge whether the packet matches the rules in the feature library and the degree of matching. This process makes full use of the efficiency of the feature hash table and can process a large number of packet encrypted state feature query requests in a short time, meeting the performance requirements for real-time processing of network data packets in the untrusted terminal environment and conforming to the high-performance feature matching goal pursued by the technical disclosure document.

[0065] The network data packet is managed according to the determined matching result. If the matching result indicates that the packet conforms to specific rules, such as a normal packet allowed to pass, then it will be normally forwarded or other corresponding operations will be performed according to the preset rules; if the packet is determined to be contrary to the security policy, such as it may be a malicious attack packet, then corresponding blocking measures will be taken, such as discarding the packet or recording relevant information and issuing an alarm, etc. This management process is based on accurate matching results, ensuring the safe and orderly flow of network data packets in the untrusted terminal environment, realizing the effective control of network communication, and keeping consistent with the goal of ensuring data security and network stability in the untrusted terminal environment, providing comprehensive protection for the network data processing in the entire untrusted environment.

[0066] In a possible implementation manner, step S430 further includes:

[0067] Step S431: If the matching result is not empty, the first directional management of the network data message is performed based on the embedded behavior of the feature item in the secret feature library matched by the feature hash table.

[0068] Step S432: If the matching result is empty, perform second directional management based on the original destination of the network data message.

[0069] Specifically, when the match result is non-empty, it means that the network data packet successfully matches the secret signature library in the feature hash table. At this point, the network data packet is first directed and managed using the embedded behavior of the signature item in the secret signature library matched by the feature hash table. First, the hash signature is used to accurately determine the matching message features and the corresponding item in the signature library. This process is like finding the exact record in a complex indexing system. The message is then processed based on the behavioral instructions embedded in the corresponding item. For example, if the embedded behavioral instruction is intercept, the message will be decisively blocked from further transmission, effectively preventing potential security threats such as malicious attack messages or communications that violate security policies. This operation is based on the precise rules preset in the signature library and reflects the system's proactive defense capabilities against specific types of messages. If no match is successful, it indicates that the current message has not triggered the rules in the signature library. At this time, the message will continue to be processed according to its original direction and normal transmission or forwarding process, ensuring that legitimate network communications are not interfered with and maintaining the normal operation of the network.

[0070] When the matching result is empty, that is, the network data message does not find a match in the feature hash table, the second directional management will be carried out according to the original source target of the network data message. The original source target of the network data message is determined by its source address, destination address, port number and protocol, etc. This information clarifies the original transmission path or intended recipient of the message. In this case, it is determined that the message does not trigger the rules in the feature library and is normal network communication data. Therefore, the message will continue to be processed according to its established original source target, such as continuing to be transmitted to the next network node or forwarded to its original destination. This operation ensures that the normal network business process is not affected, and reflects the characteristics of taking into account the normal function of the network while ensuring security. Through this method of flexibly managing network data messages based on matching results, efficient and secure processing of network data is achieved in an untrusted terminal environment, ensuring the stable operation of the entire network system.

[0071] It should be noted that the order in which the embodiments of the present application are presented is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the foregoing descriptions of specific embodiments of this specification are provided. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential sequence shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0072] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

[0073] This specification and the drawings are only exemplary descriptions of the present application and are considered to have covered any and all modifications, variations, combinations, or equivalents within the scope of the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalent technologies, the present application is intended to include these changes and modifications.

Claims

1. A method for managing keys in an untrusted environment, characterized in that The method includes: Generating a random salt value, where the random salt value is generated based on a cloud feature library distribution system, and the cloud feature library distribution system is a cloud platform for data salting and encryption; Based on the random salt value, performing salting calculations on the plaintext feature library and the program source code to determine the encrypted feature library and the salted program, where the salting calculation includes salting hash processing of the plaintext feature library and obfuscating compilation of the program source code; Establishing a trusted channel, and through the trusted channel, sending the encrypted feature library and the salted program to an untrusted terminal environment for loading, where the trusted channel connects the cloud feature library distribution system and the untrusted terminal environment; Obtaining the input network data packet, and based on the encrypted feature library and the salted program, managing the input network data packet in the untrusted terminal environment; Performing salting calculation on the plaintext feature library, including: Traversing the plaintext feature library to determine N encryption objects, where N is the number of plaintext feature entries; Based on the random salt value, performing salting hash processing on the N encryption objects to determine N encrypted features, where the N encrypted features are irreversible encryptions; Integrating and combining the N encrypted features to determine the encrypted feature library; Performing obfuscating compilation on the program source code, including: Based on the random salt value, writing a salt value macro corresponding to the program source code, where the salt value macro is used to store the random salt value in the program source code; Invoking the GCC compilation program to perform obfuscating compilation on the program source code after writing the salt value macro to determine the salted program; Among them, the obfuscating compilation step includes: Introducing an obfuscation algorithm to perform obfuscation processing on the program source code after writing the salt value macro to determine the obfuscated source code, where the obfuscation processing at least includes source code structure change and identifier replacement; Compiling the obfuscated source code to generate intermediate code, fusing the intermediate code and the obfuscated source code to generate the salted program, where intermediate code assembly is performed based on lexical-syntactic-semantic analysis; The managing the input network data packet in the untrusted terminal environment includes: Identifying the network data packet, performing content extraction based on the salted program running in the untrusted terminal environment, and combining with the encrypted feature library to perform salting hash processing on the extracted content to determine the packet encrypted feature; Querying and locating the packet encrypted feature based on the feature hash table to determine the matching result; Managing the network data packet based on the matching result.

2. The untrusted environment key management method according to claim 1, characterized in that, The plaintext feature library and the program source code are the running information libraries in the untrusted terminal environment, and the program source code is the feature processing code matching the plaintext feature library.

3. The untrusted environment key management method according to claim 1, characterized in that Sending the encrypted feature library and the salted program to the untrusted terminal environment includes: Taking the cloud feature library distribution system as the sending end and the untrusted terminal environment as the receiving end to establish the trusted channel, where the trusted channel assists in the encrypted transmission management of the temporary session key; Among them, the encrypted transmission management based on the temporary session key includes: Perform terminal identity authentication on the untrusted terminal environment. If the authentication is successful, generate a temporary session key, where the temporary session key is a randomly generated key pair; Based on the temporary session key, perform encryption processing on the encrypted feature library and the salted program to generate an encrypted feature library ciphertext and a salted program ciphertext; Through the trusted channel, transmit the encrypted feature library ciphertext and the salted program ciphertext to the untrusted terminal environment.

4. The untrusted environment key management method according to claim 3, characterized in that, The "performing loading" includes: The untrusted terminal environment receives the encrypted feature library ciphertext and the salted program ciphertext; Based on the temporary session key, decrypt the encrypted feature library ciphertext, read N encrypted features and insert them into the feature hash table, decrypt the salted program ciphertext, perform program restoration and load it into memory for running, and delete the decrypted encrypted feature library and salted program.

5. The untrusted environment key management method according to claim 1, characterized in that, Based on the matching result, manage the network data packet, including: If the matching result is non-empty, perform the first directional management of the network data packet with the embedded behavior of the feature item in the encrypted feature library matched by the feature hash table; If the matching result is empty, perform the second directional management with the original destination of the network data packet.

Citation Information

Patent Citations

  • High-performance protection method for untrusted terminal environment feature library

    CN119135455A