Encryption algorithm loop body identification method, system, device and medium
By dynamic symbolic execution and cryptographic analysis of the assembly instruction flow after the program is executed, the encryption algorithm and obfuscation situation is identified, and the problem of difficulty in analyzing the internal changes and obfuscation behavior of the encryption algorithm in the prior art is solved, and the effectiveness of the encryption algorithm is achieved Identification and confirmation of the nature of confusion.
Patent Information
- Application Number
- CN202411707372.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-11-27
AI Technical Summary
The existing encryption algorithm loop analysis technology is difficult to carefully observe the changes and obfuscation behavior of the data inside the encryption algorithm, and it is impossible to effectively identify the encryption algorithm and its obfuscation situation.
By dynamic symbolic execution of the assembly instruction stream after the program is executed, combining cryptographic knowledge, analyzing operation behavior and input and output positions, a cryptographic algorithm analysis library is built, and encryption algorithms and obfuscations are identified using input and output bit analysis.
The fine-grained analysis of the encryption algorithm and its obfuscation properties is realized, and the encryption algorithm and obfuscation conditions in the program can be confirmed, which improves the security evaluation ability of the encryption algorithm.
Smart Images

Figure CN119210689A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to network security, and in particular relates to an encryption algorithm loop body recognition method, system, device and medium. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] The analysis technology of encryption algorithm loop is an important research field, which is usually used to evaluate the security of encryption algorithms. With the rise of ransomware, it uses encryption algorithms to lock files to extort money, so analyzing whether the program contains encryption algorithms is an effective way to identify ransomware.
[0004] At present, the analysis techniques for the loop of encryption algorithms mainly include differential analysis, linear analysis, high-order differential cryptanalysis, and channel analysis. Some of the above analysis techniques, such as differential analysis, study how the difference of the plaintext pair, that is, the XOR value of two plaintexts, propagates in multiple loops of the encryption algorithm to infer part or all of the key. Or, such as channel analysis, observes the indirect information leaked during the execution of the encryption algorithm to infer the internal state of the algorithm and the key. Existing analysis techniques are committed to finding a breakthrough in key information in complex encryption structures, and do not carefully observe how the internal data of the encryption algorithm flows and changes, nor do they analyze the obfuscation behavior in the algorithm.
[0005] Therefore, how to analyze the encryption algorithm to identify the encryption algorithm and its obfuscation is a problem that needs to be solved at present. Summary of the invention
[0006] To overcome the above-mentioned deficiencies of the prior art, the present invention provides a method, system, device and medium for identifying an encryption algorithm loop body, which can confirm the encryption algorithm existing in a program and the obfuscation existing in the algorithm.
[0007] In order to achieve the above object, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for identifying a loop body of an encryption algorithm, comprising: Perform dynamic symbolic execution on the suspected loop body fragments in the assembly instruction stream after the program is executed. Combined with cryptographic knowledge, different components are constructed to analyze the suspected loop body assembly instruction stream to obtain the corresponding operation behavior and input and output locations. According to the obtained operation behavior and input-output position, the input is constructed in sequence for dynamic execution, and the results of the dynamic execution are compared with the cryptographic algorithm analysis library to identify the encryption algorithm and obfuscation situation corresponding to the loop body; wherein, based on different cryptographic algorithms, input and output bit analysis methods are used to obtain the output results for constructing the cryptographic algorithm analysis library.
[0008] In a second aspect, the present invention provides an encryption algorithm loop body recognition system, comprising: The analysis module is configured to: perform dynamic symbolic execution on the suspected loop body fragments in the assembly instruction stream after the program is executed, and build different components to analyze the suspected loop body assembly instruction stream in combination with cryptographic knowledge to obtain the corresponding operation behavior and input and output positions; The analysis and confirmation module is configured to: dynamically execute the input of the loop construction according to the obtained operation behavior and input and output positions, compare the result of each dynamic execution with the cryptographic algorithm analysis library, and identify the encryption algorithm and obfuscation situation corresponding to the loop body; wherein, based on different cryptographic algorithms, input and output bit analysis methods are used respectively to obtain the output results used to construct the cryptographic algorithm analysis library.
[0009] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is performed.
[0010] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.
[0011] One or more of the above technical solutions have the following beneficial effects: In the present invention, dynamic symbolic execution is performed on the fragments of suspected loop bodies in the assembly instruction stream after the program is executed to confirm the loop body, and the necessary data is identified in combination with cryptographic knowledge. Through the constructed cryptographic algorithm analysis library, a more fine-grained analysis of the loop body is performed to confirm the loop body structure and data obfuscation and control obfuscation. The scheme of the present invention can confirm the encryption algorithm existing in the program and the obfuscation existing in the algorithm.
[0012] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0014] Figure 1 This is a flow chart of the encryption algorithm loop body identification method in Example 1 of the present invention. DETAILED DESCRIPTION
[0015] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0016] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.
[0017] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0018] Embodiment 1 This embodiment discloses a method for identifying a loop body of an encryption algorithm, including: Perform dynamic symbolic execution on the suspected loop body fragments in the assembly instruction stream after the program is executed. Combined with cryptographic knowledge, different components are constructed to analyze the suspected loop body assembly instruction stream to obtain the corresponding operation behavior and input and output locations. The input of the loop construction is dynamically executed according to the obtained operation behavior and input and output positions, and the result of each dynamic execution is compared with the cryptographic algorithm analysis library to identify the encryption algorithm and obfuscation situation corresponding to the loop body; wherein, input and output bit analysis methods are used based on different cryptographic algorithms to obtain the output results used to construct the cryptographic algorithm analysis library.
[0019] Among them, confusion specifically refers to control confusion and data confusion.
[0020] In this embodiment, the input model constructed for the first time is fixed, and the output matrix is obtained through the symbolic executor. By distinguishing the output matrix, a new round of input matrix is constructed until the output matrix is no longer divisible. In addition to the fixed input of the first construction, the remaining input models are reconstructed based on the results of the previous execution. Specifically, the input is constructed by counting the same bits according to the output of the last dynamic execution, fixing the same bits, setting the remaining bits to 1, constructing a unit matrix for the same bits, and using the constructed unit matrix as the input for the next dynamic execution. For example, if 128 bits are constructed for dynamic execution, and the bits of the 1-digit number and the 2-digit number are the same in the result of the dynamic execution, the bits of the remaining 126-digit number are set to 1, and the bits of the 1-digit number and the 2-digit number are used to construct the unit matrix, and the bit data of the remaining 126-digit number are used as the constructed input for the next dynamic execution.
[0021] Exemplarily, first of all, the first input of each loop body is fixed, and the cryptographic algorithm analysis library contains different output results of multiple encryption algorithms, so the first input is fixed, but the output is not fixed. When the suspected loop body output 1 is the same as the output result of the established cryptographic algorithm analysis library, such as the AES algorithm, then the contingency cannot be ruled out. Therefore, according to the matrix of the first output, the second input is redesigned, and a new execution is performed to obtain output 2. Output 2 is compared with output 2 in the encryption algorithm analysis library. When they are the same again, the above steps can be performed again until the result cannot be divided. At this time, the results of the previous several times are completely matched, so this algorithm can be completely confirmed. In addition, for confusion, since some confusion may be inserted in the middle of the data input, such as confusion of null pointers, data sorting, data merging, etc., this input can effectively judge the confusion of the algorithm, and even if there is such confusion, the encryption algorithm contained therein can be identified.
[0022] The encryption algorithm loop body identification method proposed in this embodiment includes constructing an assembler program loop body symbolic executor to create an assembler program symbolic executor that can process multiple implementations of assembly instruction streams; the study of assembler program input and output methods includes confirming plaintext, keys, linear operations, nonlinear operations, ciphertext and other contents of the loop body assembler program in combination with the characteristics of the cryptographic algorithm; studying the assembler program and comparing it with the cryptographic algorithm loop body analysis library to confirm the loop body structure and data obfuscation and control obfuscation.
[0023] An assembler symbolic executor refers to a program that performs dynamic symbolic execution on the data stream text obtained after executing a program, converting the assembly language trace stream into executable statements.
[0024] Assembler symbolic executor: It is used to perform symbolic execution on the initially identified loop body to achieve the purpose of later identifying the loop body. The assembler symbolic executor includes analyzing the assembly fragment language, simulating assembly execution, and building different assembly translation programs based on different operation instructions, registers, and data size factors.
[0025] The specific contents are: identifying assembly instructions, identifying registers, establishing assembly data flow and other operations, reading and storing the addresses and data contents in the assembly instruction stream as the necessary conditions for the symbolic executor to dynamically execute the assembly instruction stream.
[0026] This embodiment establishes an assembly program symbolic executor that can be executed dynamically. It is necessary to construct different register sizes based on the commonly used registers RAX, RBX, ..., and AX, AH, AL, etc. in the assembly language, which have different storage bits. According to different assembly data instructions and register operations, registers with different storage bits are established, and data is stored in the specified size and corresponding registers. This implementation method is not limited to loop body execution, and can effectively execute commonly used assembly instructions. The purpose is to ensure that the algorithm value is correct during the dynamic execution of the loop body.
[0027] This embodiment uses INTEL's PIN tool to extract the assembly language trace stream of the executable file. The trace stream contains necessary data instructions such as content operation instructions, addresses, and data. The loop body is preliminarily confirmed by the assembly language trace features, which specifically include instruction jumps and component feature extraction methods. According to the assembly language trace stream, an assembler symbolic executor can be constructed according to the assembly language trace, and corresponding dynamic execution can be constructed according to different instructions and different registers in the assembler, and the suspected loop body assembler in the analysis file can be analyzed.
[0028] Loop body structure analysis: Combine the assembly instruction stream with cryptography knowledge to identify the positions and operations of suspected algorithm loop plaintext, keys, linear operations, nonlinear operations, and ciphertext in the assembly program segment. Loop body structure analysis includes analyzing the assembly instruction stream in combination with cryptography knowledge to confirm the plaintext input position, key input position, ciphertext output position, S-box reading position, linear operation and other addresses, instructions, and data needed in other programs in the assembly segment, and distinguish the above data addresses and instructions.
[0029] Specifically, based on the characteristics of the loop body, there are two forms of plaintext input in assembly: one is that the plaintext data is read from the address, and the other is that the plaintext data is stored in the register. When the address is stored in the address, the ciphertext is written to the corresponding address after the single execution of the loop body ends; when the address is stored in the register, the ciphertext is not written to the address. The S-box component confirms the corresponding address by address continuity and 8-bit input. The round key RK distinguishes between the address reading and the address that does not meet the above conditions; other operations do not operate on the address and are dynamically executed according to the symbolic executor. Compare the characteristics of the cryptographic algorithm, analyze the assembly program data and structure, and confirm the suspected plaintext input, key input, linear operation, nonlinear operation and ciphertext output contained in the suspected assembly program.
[0030] In the analysis of the loop structure, combined with cryptographic knowledge, the plaintext input, key input, nonlinear layer operation, linear layer operation, ciphertext output and other behaviors in the execution of the encryption algorithm in a single round are identified and analyzed. The read address content in the suspected loop body is determined as a certain input, and then certain addresses are stored. The two items are combined to confirm the input and output addresses of the loop body. The behavior of reading data from a certain address but not outputting it is defined as the key. By defining the behavior of reading a fixed address plus an offset address as a nonlinear operation of the encryption algorithm, combined with cryptographic knowledge, the nonlinear operation of the symmetric encryption algorithm today is generally to extract the S-box content, and each S-box in the symmetric encryption algorithm is a unique generation method. Therefore, it is necessary to intercept the data in the entire data stream, extract the data suspected of S-box behavior and save it. The linear layer operation is generally implemented by circular shift, which can be implemented through normal execution. When writing data in the simulated symbolic executor, the address and corresponding content are stored for the use of data in subsequent execution.
[0031] To analyze and construct the necessary components of a cryptographic algorithm, a combination of methods is required to analyze the necessary components and input and output of the cryptographic algorithm. Symbolic execution is constructed for the analyzed necessary components and input and output of the cryptographic algorithm. Through the algorithm characteristics of the cryptographic algorithm loop and the identification of the assembly program operation instructions, the constructed input model is connected to obtain the output data. Among them, the same input model is constructed, but the algorithm is confirmed according to different outputs.
[0032] Confirmation of components to assist the symbolic executor in dynamic execution: extract fixed values based on the characteristics of the cryptographic algorithm loop body, usually in the assembly trace stream. Generally speaking, for a symmetric encryption algorithm loop body, two of them must be extracted from a fixed address, namely RK, the round key, and the value data, namely the S box and T box. Therefore, these two parts need to be effectively distinguished through the characteristics of the cryptographic algorithm. During the dynamic execution process, according to the mark, when the value operation is executed, the corresponding value is removed according to the address. When the RK is executed, the data can be accessed according to the constructed identification method.
[0033] The differences in the various implementation methods of the components are due to the fact that the generation characteristics of the assembly trace stream are not manually controlled, but are generated according to the system CPU. Therefore, there may be plain text read into the address, or the plain text data may be placed in the register during the execution of the loop body. Therefore, in order to comprehensively analyze the algorithm, it is necessary to build a component confirmation method to confirm the input and output. The value operation, namely the S box, T box, and RK, is read in a block of addresses.
[0034] Component confirmation is a mark. When a statement in the current trace flow is dynamically executed, for example, the meaning of this statement is to take a value. At this time, through component confirmation, it is known that this is the value of the S box, not other values, so it goes to the corresponding extracted data to search for it.
[0035] The calling method is to calculate the current value address, check the mark, find the corresponding data address, and extract the data. The data address is extracted based on the initial trace flow. Because the value address is fixed during the execution process, it is necessary to extract all the necessary data before the program starts.
[0036] Loop body analysis confirmation method: execute the suspected assembly program with a symbolic executor, use a bit-level input method to compare the symbolic executor with the constructed cryptographic algorithm analysis library to confirm what encryption algorithm the loop body contains.
[0037] The loop body analysis and confirmation method includes segmenting the plaintext, ciphertext and other data obtained from the structural analysis, constructing an input for the plaintext input, statistically analyzing the ciphertext data, storing and reading the necessary data, and processing the key. The input is reconstructed through the ciphertext output data until the specified conditions are met to stop the program execution, compare the encryption algorithm analysis library, and confirm the encryption algorithm implementation form and the confusion in the loop body.
[0038] The specific implementation method of the loop body analysis confirmation method is: by inputting the input model constructed by the input position in the suspected encryption algorithm mentioned above, in the process of the assembler symbolic executor executing the instruction stream, the necessary content used, such as nonlinear layer data, is extracted from the overall data stream to obtain unchangeable data. After the assembler symbolic executor uses this single-round loop body, the encryption algorithm library is constructed by comparing the output of the ciphertext. When its output is the same as the cryptographic algorithm analysis library, the algorithm is preliminarily confirmed, and the input matrix is reset according to the output. The constructed input matrix is the same as the construction method of the cryptographic algorithm analysis library. The constructed input is input into the assembler symbolic executor again, and finally multiple output files are obtained and compared with the encryption algorithm analysis library again. When the input model cannot be reconstructed according to the output data, the input model reconstruction is stopped, and the algorithm symbolic execution ends. Finally, it is confirmed what kind of encryption algorithm the loop body is and the input variables in the cryptographic algorithm analysis library are compared. It can be confirmed which bit in the encryption algorithm the input and output in the loop body correspond to, and finally the confusion in the loop body is identified.
[0039] It is understandable that the first input model is an input constructed to build a comparison library. Because the input of the comparison library is the same as the assembler symbol executor, if its output is also the same, then the first comparison is successful. However, due to data obfuscation, control obfuscation, etc. that may exist in the algorithm, it is possible that the position corresponding to the input bit has changed, so it is necessary to dynamically build a new input based on the output of the assembler symbol executor.
[0040] The purpose of constructing the input model is to effectively distinguish the use of the algorithm. Here, it is not limited to a fixed input model, as long as the algorithm for building the library can be distinguished by the constructed input model. The method for constructing the input model in this embodiment is to design an input matrix, i.e., a 128-bit binary number, because the 128-bit encryption algorithm loop body is analyzed. The input matrix A is brought into a normal encryption algorithm execution, the influence of the round key RK is removed, and an output O, i.e., a 128-bit binary number, is obtained. Then, according to the output O, those input matrices A have the same output O, and then those with the same output are re-input until the analysis result cannot be divided any more.
[0041] The output is obtained by dynamically executing the assembled data stream, and the algorithm is confirmed by comparing the encryption algorithm library with different outputs. A general method for identifying the necessary positions of the loop body of the cryptographic algorithm is constructed.
[0042] The encryption algorithm library is an input and output data used to compare the trace algorithm. The construction method is to execute it in a known algorithm, such as AES, design a set of inputs that can distinguish 128-bit input data, get a set of outputs, and extract the inputs with the same output data in this group for input reconstruction, repeating the steps until no new input can be split.
[0043] This embodiment constructs input for the identified suspected loop body, obtains ciphertext through the assembler symbolic executor, analyzes the ciphertext and compares it with the encryption algorithm analysis library, and then constructs another input. After multiple analysis, comparison and reconstruction of the input, it is finally confirmed what encryption algorithm the loop body contains, as well as the control obfuscation, data obfuscation and other operations in the loop body. Among them, the analysis is multiple cycles of comparing the encryption algorithm library. Control obfuscation and data obfuscation will not affect the output value, but only the output position. Therefore, the final result is compared with the algorithm libraries of multiple different algorithms. If the same result is obtained, the algorithm is confirmed.
[0044] Embodiment 2 The purpose of this embodiment is to provide an encryption algorithm loop body recognition system, including: The analysis module is configured to: perform dynamic symbolic execution on the suspected loop body fragments in the assembly instruction stream after the program is executed, and build different components to analyze the suspected loop body assembly instruction stream in combination with cryptographic knowledge to obtain the corresponding operation behavior and input and output positions; The analysis and confirmation module is configured as follows: constructing different inputs in a loop according to the obtained operation behaviors and input and output positions, dynamically executing the constructed different inputs in sequence and comparing them with the cryptographic algorithm analysis library to identify the confusion of the loop body; wherein, based on different cryptographic algorithms, input and output bit analysis methods are respectively adopted to obtain the output results used to construct the cryptographic algorithm analysis library.
[0045] In the analysis and confirmation module, it specifically includes: A first analysis and confirmation submodule is configured to: dynamically execute the input position in the suspected loop body by constructing a plaintext input to obtain a corresponding ciphertext output, compare the first output with the cryptographic algorithm analysis library, and when the ciphertext output is the same as the ciphertext existing in the cryptographic algorithm analysis library, determine the encryption algorithm corresponding to the suspected loop body; The second analysis and confirmation submodule is configured to: reconstruct the input of the ciphertext output and then perform dynamic execution to obtain the corresponding output, and then compare the obtained output with the cryptographic algorithm analysis library. When the input cannot be constructed according to the output, the dynamic execution ends, and finally the confusion situation corresponding to the suspected loop body is determined.
[0046] In further embodiments, there is also provided: An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, no further description is given here.
[0047] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0048] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0049] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method described in embodiment 1 is completed.
[0050] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0051] A computer program product includes a computer program, and when the computer program is executed by a processor, the method described in the first embodiment is implemented.
[0052] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer executable instructions, such as instructions included in a program module, which are executed in a device on a real or virtual processor of the target to perform the process / method as described above. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided between program modules as needed. Machine executable instructions for program modules can be executed in local or distributed devices. In distributed devices, program modules can be located in local and remote storage media.
[0053] The computer program code for implementing the method of the present invention can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the computer or other programmable data processing device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.
[0054] In the context of the present invention, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, etc. Examples of signals may include electrical, optical, radio, acoustic or other forms of propagation signals, such as carrier waves, infrared signals, etc.
[0055] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0056] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for identifying a loop body of an encryption algorithm, characterized in that: include: Perform dynamic symbolic execution on the suspected loop body fragments in the assembly instruction stream after the program is executed. Combined with cryptographic knowledge, different components are constructed to analyze the suspected loop body assembly instruction stream to obtain the corresponding operation behavior and input and output locations. The input of the loop construction is dynamically executed according to the obtained operation behavior and input and output positions, and the result of each dynamic execution is compared with the cryptographic algorithm analysis library to identify the encryption algorithm and obfuscation situation corresponding to the loop body; wherein, input and output bit analysis methods are used based on different cryptographic algorithms to obtain the output results used to construct the cryptographic algorithm analysis library.
2. The encryption algorithm loop body identification method according to claim 1, characterized in that: The assembly instruction stream is dynamically instrumented through the Intel PIN tool to generate the assembly language trace stream of the executable file. Different assembly translation programs are constructed for different operation instructions, registers, and data sizes. The constructed assembly translation program is used to analyze the assembly language trace stream.
3. A method for identifying a loop body of an encryption algorithm as claimed in claim 1, characterized in that: Different components are constructed to identify the plaintext, key, linear operation, non-linear operation and ciphertext position in the assembly instruction stream of the suspected loop body.
4. A method for identifying a loop body of an encryption algorithm as claimed in claim 3, characterized in that: Construct different components to identify the plaintext, key, linear operation, nonlinear operation and ciphertext position in the assembly instruction stream of the suspected loop body, specifically: According to the characteristics of the loop body, there are two forms of plaintext input in assembly: one is that the plaintext data is read from the address, and the other is that the plaintext data is stored in the register; when the address is stored in the address, after the single execution of the loop body ends, the ciphertext is written to the corresponding address; When the address is stored in a register, the ciphertext is not written to the address; The S-box component confirms the corresponding address by address continuity and 8-bit input; The round key RK is distinguished by the address reading method; Linear layer operation recognition is achieved through cyclic shift.
5. A method for identifying a loop body of an encryption algorithm as claimed in claim 1, characterized in that: According to the obtained operation behavior and input and output positions, different inputs are constructed in a loop. The constructed different inputs are dynamically executed in sequence and compared with the cryptographic algorithm analysis library to identify the obfuscation of the loop body, specifically: For the input position in the suspected loop body, dynamic execution is performed by constructing plaintext input to obtain the corresponding ciphertext output, and the first output is compared with the cryptographic algorithm analysis library. When the ciphertext output is the same as the ciphertext existing in the cryptographic algorithm analysis library, the ciphertext output is reconstructed into the input and then dynamically executed to obtain the corresponding output, and the obtained output is compared with the cryptographic algorithm analysis library again. When the input cannot be constructed according to the output, the dynamic execution ends, and the encryption algorithm and obfuscation situation corresponding to the suspected loop body are determined.
6. A method for identifying a loop body of an encryption algorithm as claimed in claim 5, characterized in that: Except for the construction of plain text input, the construction of other inputs is based on the results of the previous dynamic execution.
7. An encryption algorithm loop body recognition system, characterized in that: include: The analysis module is configured to: perform dynamic symbolic execution on the suspected loop body fragments in the assembly instruction stream after the program is executed, and build different components to analyze the suspected loop body assembly instruction stream in combination with cryptographic knowledge to obtain the corresponding operation behavior and input and output positions; The analysis and confirmation module is configured to: dynamically execute the input of the loop construction according to the obtained operation behavior and input and output positions, compare the result of each dynamic execution with the cryptographic algorithm analysis library, and identify the encryption algorithm and obfuscation situation corresponding to the loop body; wherein, based on different cryptographic algorithms, input and output bit analysis methods are used respectively to obtain the output results used to construct the cryptographic algorithm analysis library.
8. An encryption algorithm loop body recognition system as claimed in claim 7, characterized in that: The analysis and confirmation module specifically includes: A first analysis and confirmation submodule is configured to: dynamically execute the input position in the suspected loop body by constructing a plaintext input to obtain a corresponding ciphertext output, compare the first output with the cryptographic algorithm analysis library, and when the ciphertext output is the same as the ciphertext existing in the cryptographic algorithm analysis library, determine the encryption algorithm corresponding to the suspected loop body; The second analysis and confirmation submodule is configured to: reconstruct the input of the ciphertext output and then perform dynamic execution to obtain the corresponding output, and then compare the obtained output with the cryptographic algorithm analysis library. When the input cannot be constructed according to the output, the dynamic execution ends, and finally the confusion situation corresponding to the suspected loop body is determined.
9. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 6 is completed.
10. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Instruction-level password algorithm identification method and system
CN105426707A
Data encryption method and device based on encryption algorithm and computer equipment
CN110855433A
Encryption method based on AES encryption algorithm
CN113206736A
Encryption algorithm identification device and method for generating data flow diagram based on symbolic execution
CN115659376A
Cryptographic algorithm dynamic library security assessment method based on bit fault model
CN117150498A
Cited By
Ransomware detection method, system and equipment and medium
CN119416219A