A TrueCrypt decryption key extraction method, terminal device and storage medium
By loading the memory image and parsing the TrueCrypt.exe process information, extracting the master key of TrueCrypt encrypted data, solving the difficulty of decrypting TrueCrypt encrypted data, and achieving efficient and accurate extraction of the master key of the encryption container to meet the needs of electronic forensics.
Patent Information
- Application Number
- CN202111532514.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-12-15
AI Technical Summary
The decryption of TrueCrypt encrypted data has difficulties in electronic forensics, mainly because the encrypted files do not have fixed characteristics and diversity of encryption methods, which makes it a challenge to decrypt unknown passwords and encryption methods.
By loading the memory image, extracting TrueCrypt.exe process information, parsing the CRYPTO_INFO structure, calculating the character frequency, judging and extracting the master_keydata field as the master key of the TrueCrypt.exe process, realizing the master key extraction of the encrypted container without relying on the encryption of the encrypted container Method or password.
It realizes encryption container master key extraction with no password acquisition, fast speed and high accuracy, meets the needs of decryption of evidence sources and solves the difficulties of encrypted data decryption.
Smart Images

Figure CN114372277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a TrueCrypt decryption key extraction method, terminal equipment and storage medium. Background Art
[0002] TrueCrypt is a world-renowned, open-source, cross-platform virtual encrypted disk software. It is currently widely used in encryption systems. The software can ensure that data is automatically and quickly encrypted and decrypted before online loading and storage without user intervention. At the same time, it also uses virtual disk technology and high-strength cryptographic algorithms to protect user sensitive data, which is loved by the majority of users. The widespread use of this software has brought great challenges to data forensics. Therefore, decrypting TrueCrypt encrypted data is of great significance in the electronic forensics industry.
[0003] As a free and open source encryption software, TrueCrypt can be used across platforms and provides different encryption algorithms for users to choose from. These encryption algorithms include: AES, Twofish, Serpent and their various combinations. TrueCrypt has many important features, including: unbreakable (high security), transparent encryption, hidden partitions, etc. However, since the encrypted files have no fixed features and the encryption methods are diverse. As a result, how to decrypt when the password and encryption method are unknown has become a difficult point in electronic forensics. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes a TrueCrypt decryption key extraction method, terminal device and storage medium.
[0005] The specific plan is as follows:
[0006] A TrueCrypt decryption key extraction method comprises the following steps:
[0007] S1: Load the memory image, extract all TrueCrypt.exe process information from the memory image, and form a process information set K;
[0008] S2: for each element in the process information set K, parse its VAD address field to read the physical memory corresponding to the process information, read the CRYPTO_INFO structure corresponding to the process information from the physical memory, parse the CRYPTO_INFO structure, and determine whether the K2 field therein meets the format requirements of the verification parameters. If so, continue to process the next element in the process information set K. If not, remove the element from the process information set K. After processing all elements in the process information set K, proceed to step S3.
[0009] S3: For each element in the process information set K, if the content of the K2 field in the CRYPTO_INFO structure corresponding to the element is not all zero, calculate whether the frequency of each character in the content of the K2 field is less than the first frequency threshold, if so, continue to process the next element in the process information set K, otherwise, remove the element from the process information set K; after all elements in the process information set K are processed, go to step S4;
[0010] S4: for each element in the process information set K, extract the content of the master_keydata field in the CRYPTO_INFO structure corresponding to the element, and determine whether the frequency of each character in the content of the master_keydata field is less than the second frequency threshold. If so, continue to process the next element in the process information set K; otherwise, remove the element from the process information set K; after all elements in the process information set K are processed, proceed to step S5;
[0011] S5: for each element in the process information set K, extract the content of the SectorSize field in the CRYPTO_INFO structure corresponding to the element, and determine whether the content of the SectorSize field is equal to the set sector size. If so, continue to process the next element in the process information set K, otherwise, remove the element from the process information set K; after processing all elements in the process information set K, proceed to step S6;
[0012] S6: For each element in the process information set K, extract the content of the master_keydata field in the CRYPTO_INFO structure corresponding to the element as the master key of the TrueCrypt.exe process.
[0013] Furthermore, the frequency of occurrence of each character in the content is calculated as follows: define an integer array with a length of 256 and initialize the value to 0 to store the number of occurrences of each character in the 256 characters; traverse each character in the content, and when each character appears once, the value in the storage position corresponding to the character in the integer array is increased by 1. When the traversal is completed, the value of each element in the integer array is the frequency of occurrence of the character corresponding to the element.
[0014] Furthermore, the method for extracting the TrueCrypt.exe process information is as follows: open the image file, search the image file starting from the offset address of the Idle process, and find the EPROCESS with process ID 4 and process name System; according to the address of the EPROCESS corresponding to the System process, find the EPROCESS information corresponding to the TrueCrypt.exe process through the Flink pointer of the doubly linked list.
[0015] Furthermore, the method for obtaining the offset address of the Idle process is as follows: searching the EPROCESS structure with the process name Idle and the first 64-bit value in the EPROCESS structure from the image file, and then determining the type of the operating system; and calculating the offset address of the Idle process according to the type of the operating system and the EPROCESS structure with the process name Idle.
[0016] A TrueCrypt decryption key extraction terminal device comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method in an embodiment of the present invention when executing the computer program.
[0017] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described above in an embodiment of the present invention are implemented.
[0018] The present invention adopts the above technical solution, and extracts the master key of the encrypted container by processing and searching the memory image. It has the characteristics of secret-free acquisition, fast speed and high accuracy. It does not rely on the encryption method of the encrypted container, and does not need to know the encryption container password. The master key of the encrypted data of the encrypted container can be extracted, and the demand for decryption of the evidence source is also met. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Shown is a flow chart of the method in Embodiment 1 of the present invention.
[0020] Figure 2 FIG. 1 is a schematic diagram of paged memory management in the first embodiment of the present invention.
[0021] Figure 3 Shown is a schematic diagram of application results in Example 1 of the present invention. DETAILED DESCRIPTION
[0022] To further illustrate various embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementations and advantages of the present invention.
[0023] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.
[0024] Embodiment 1:
[0025] In the Windows kernel, the main research focuses on the method of obtaining operating system process information. In the kernel of the Microsoft system, there is an EPROCESS structure. All processes correspond to their respective EPROCESS structures. The operating system manages the processes through the EPROCESS structure. The EPROCESS structure stores a lot of important information, such as the executable file name of the process, the VAD root node of the virtual space, the number of threads, the page directory base address required for address translation, etc.
[0026] The Windows operating system uses a multi-level page table to manage memory. Each process has an independent virtual address space, and data is stored in physical memory by pages. These data are logical in the virtual space, but there is no obvious pattern in the physical memory.
[0027] A process is a program with certain independent functions and is a basic unit of dynamic execution of the operating system. In Windows systems, a process is both a basic execution unit and a basic allocation unit for memory allocation. From the perspective of a process, its virtual space can be analyzed to obtain the logical relationship of the corresponding physical memory and analyze the memory image.
[0028] Virtual address, also known as linear address, is the logical address used by Windows in protected mode. Physical address is the index of the storage unit in RAM. The CPU is connected to RAM through this set of address lines and reads and writes the corresponding memory unit by adding level signals to these address lines.
[0029] The allocation and usage of the virtual address space of each process are described by a set of VAD nodes. VAD nodes refer to virtual address descriptors. A VAD node is allocated a piece of virtual space. The size of the space is stored in the internal structure members of the VAD node itself. Through physical address conversion, each VAD node will obtain the physical space corresponding to the virtual address in the physical memory. All VAD nodes form a balanced binary tree. The process can allocate address space for program code, called files, etc. by accessing the VAD node. When the operating system allocates address space to the process, it divides the address space into system area and user area. The user area spaces of all processes are isolated from each other, that is, the VAD balanced trees of all processes are also isolated from each other. The address of the root node VADRoot of this binary tree is stored in the EPROCESS structure of the process. The process can traverse the entire binary tree by accessing this node.
[0030] The address spaces of different processes are isolated from each other. They can have the same virtual address, but the physical addresses corresponding to these virtual addresses are different. For example, one process accesses physical memory through virtual address V, and another process also uses virtual address V to access physical memory, but the physical addresses corresponding to the virtual addresses accessed by the two processes are different. The mutual independence of the virtual address spaces of different processes means that programmers do not need to care about the physical address of the memory space requested by the program when writing programs, and only need to leave it to the operating system itself. The reason why virtual address spaces are independent of each other is that virtual addresses need to be converted from virtual addresses to physical addresses through page directories and page tables, and the addresses of page directories and page tables of different processes are different.
[0031] refer to Figure 2 In paged memory management, the virtual address space is managed by pages, and the physical memory is divided according to the size of the page, and its size corresponds to the page in the virtual space. Therefore, the mapping relationship is based on the memory page management mechanism. The pages corresponding to continuous virtual pages in physical memory may not be continuous.
[0032] There is only one physical address space in a system, but the system can allocate multiple virtual address spaces to processes. In fact, only a small number of pages in a virtual address space are actually mapped to physical pages. The operating system maps virtual pages to physical pages as needed, which can greatly improve the efficiency of physical memory usage. At the same time, a physical page will generally only be mapped by the virtual page of one process. When a physical page is mapped by at least two or more virtual pages, then this physical page will be shared by these processes. If one of the processes modifies the data of this page, the corresponding changes can also be seen in the virtual address space of other processes.
[0033] Each process in the Windows system corresponds to an EPROCESS structure, which contains description information or characteristic values of the operating system type. Through analysis, it is found that for the EPROCESS structure of 32-bit Windows XP, the value of the first 64 bits must be 0x00000000 001b0003, for the EPROCESS structure of 64-bit Windows XP, the value of the first 64 bits must be 0x00000000 002e0003, the value of the first 64 bits of 32-bit Windows 7 must be 0x00000000 00260003, the value of the first 64 bits of 64-bit Windows 7 must be 0x00000000 00580003, the value of the first 64 bits of 32-bit Windows 8 must be 0x00000000 00280003, and the value of the first 64 bits of 64-bit Windows 8 must be 0x00000000 00b20003. This value and another field can be used together to determine the type of operating system. Of course, if multiple matching results appear, other fields (such as version number, process exit status, etc.) can be combined to increase the accuracy of the judgment.
[0034] Through research, it is found that all operating systems have a process named Idle, and the physical offset of the process in the memory image is close to the front of the image file, so it can be searched quickly. Multiple experiments have shown that the type of operating system can be accurately determined based only on whether the process name is Idle and the value of the first 64 bits of the EPROCESS structure.
[0035] Therefore, by combining the process name Idle in the EPROCESS structure and the value of the first 64 bits of the EPROCESS structure, the operating system type can be quickly determined, and the offset address of the Idle process can be obtained, providing an entry for finding other process information.
[0036] Since the TrueCrypt.exe of the Windows operating system caches the master key and related parameters for decryption in the process memory, and stores relevant information for verification in a specific location in the memory, the embodiment of the present invention provides a TrueCrypt decryption key extraction method, which searches through the flag bit of the key position, reads the memory offset data of the specific module for decryption verification, and thus obtains the master key information for decryption. Figure 1 As shown, the method comprises the following steps:
[0037] S1: Load the memory image, extract all TrueCrypt.exe process information from the memory image, and form a process information set K.
[0038] The process information set K = {K1, K2, K3...Kn} represents the set of TrueCrypt process information searched from the physical memory, wherein the attributes of each element Ki in the set include a VAD address field, which represents a node virtual address.
[0039] In the extraction of TrueCrypt process information, since EPROCESS is a doubly linked list, all process information can be traversed through the linked list by finding an EPROCESS, such as the address of the EPROCESS corresponding to the System process. Therefore, the method for extracting TrueCrypt process information in this embodiment is specifically as follows: open the image file, search the image file from the offset address of the Idle process, and find the EPROCESS with process ID 4 and process name System; since the System process is the first process in the doubly linked list, according to the address of the EPROCESS corresponding to the System process, find the EPROCESS information corresponding to the TrueCrypt process through the Flink pointer of the doubly linked list.
[0040] S2: For each element in the process information set K, parse its VAD address field to read the physical memory corresponding to the process information, read the CRYPTO_INFO structure corresponding to the process information from the physical memory, parse the CRYPTO_INFO structure, and determine whether the K2 field therein meets the format requirements of the verification parameters. If so, continue to process the next element in the process information set K. If not, remove the element from the process information set K. After processing all elements in the process information set K, go to step S3.
[0041] Through the analysis of TrueCrypt structure, we know that CRYPTO_INFO structure is the memory data structure used by TrueCrypt for decryption, with a total of 17472 bytes. The main contents of CRYPTO_INFO structure include: K2 (verification parameter), ea (encryption algorithm identifier), SectorSize (sector size), mode (decryption algorithm), master_keydata (master key).
[0042] S3: For each element in the process information set K, if the content of the K2 field in the CRYPTO_INFO structure corresponding to the element is not all zero, calculate whether the frequency of occurrence of each character in the content of the K2 field is less than the first frequency threshold; if so, continue to process the next element in the process information set K; otherwise, remove the element from the process information set K; after processing all elements in the process information set K, go to step S4.
[0043] S4: For each element in the process information set K, extract the content of the master_keydata field in the CRYPTO_INFO structure corresponding to the element, and determine whether the frequency of occurrence of each character in the content of the master_keydata field is less than the second frequency threshold. If so, continue to process the next element in the process information set K; otherwise, remove the element from the process information set K; after processing all elements in the process information set K, go to step S5.
[0044] Those skilled in the art can set the values of the first frequency threshold and the second frequency threshold according to their needs, and are not limited here.
[0045] The calculation method of the frequency of occurrence of each character in the content of the K2 field and the master_keydata field in this embodiment is as follows: define an integer array with a length of 256 and initialize the value to 0 to store the number of occurrences of each character in the 256 characters; traverse each character in the content, and when each character appears once, the value in the storage position corresponding to the character in the integer array is increased by 1. When the traversal is completed, the value of each element in the integer array is the frequency of occurrence of the character corresponding to the element. By comparing the size relationship between the frequency of each character and the frequency threshold, the complexity of the content can be judged.
[0046] S5: For each element in the process information set K, extract the content of the SectorSize field in the CRYPTO_INFO structure corresponding to the element, and determine whether the content of the SectorSize field is equal to the set sector size. If so, continue to process the next element in the process information set K, otherwise, remove the element from the process information set K; after processing all elements in the process information set K, go to step S6.
[0047] A person skilled in the art can set the sector size according to the sector size of the hard disk corresponding to the terminal device running the process.
[0048] S6: For each element in the process information set K, extract the content of the master_keydata field in the CRYPTO_INFO structure corresponding to the element as the master key of the TrueCrypt.exe process.
[0049] like Figure 3 As shown, in this embodiment, by loading the memory image, the VAD address field of the process is obtained, and then the virtual address to physical address algorithm of the memory is called to obtain the actual physical space of the process, and then the key search is performed on the actual physical storage memory space, so as to improve the efficiency of forensics. Only the memory image and the hard disk image need to be made on site, which can be processed in the laboratory later to effectively obtain the decrypted data.
[0050] In addition, since TrueCrypt will leave the master key in memory when the machine is asleep and operating normally, as long as you have physical access to the TrueCrypt-encrypted machine and the machine is not turned off, you will be able to extract the master key and related parameters from the memory.
[0051] Embodiment 2:
[0052] The present invention also provides a TrueCrypt decryption key extraction terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above-mentioned method embodiment of the first embodiment of the present invention when executing the computer program.
[0053] Further, as an executable solution, the TrueCrypt decryption key extraction terminal device can be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The TrueCrypt decryption key extraction terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the composition structure of the above-mentioned TrueCrypt decryption key extraction terminal device is only an example of a TrueCrypt decryption key extraction terminal device, and does not constitute a limitation on the TrueCrypt decryption key extraction terminal device. It may include more or less components than the above-mentioned, or a combination of certain components, or different components. For example, the TrueCrypt decryption key extraction terminal device may also include input and output devices, network access devices, buses, etc., and the embodiments of the present invention do not limit this.
[0054] Further, as an executable solution, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-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 any conventional processor, etc. The processor is the control center of the TrueCrypt decryption key extraction terminal device, and uses various interfaces and lines to connect various parts of the entire TrueCrypt decryption key extraction terminal device.
[0055] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the TrueCrypt decryption key extraction terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0056] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method in the embodiment of the present invention are implemented.
[0057] If the module / unit integrated in the TrueCrypt decryption key extraction terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory) and software distribution medium, etc.
[0058] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A TrueCrypt decryption key extraction method, It is characterized in that The following steps are involved: S1: Load the memory image, extract all TrueCrypt.exe process information from the memory image, and form a process information set K; S2: for each element in the process information set K, parse its VAD address field to read the physical memory corresponding to the process information, read the CRYPTO_INFO structure corresponding to the process information from the physical memory, parse the CRYPTO_INFO structure, and determine whether the K2 field therein meets the format requirements of the verification parameters. If so, continue to process the next element in the process information set K. If not, remove the element from the process information set K. After processing all elements in the process information set K, proceed to step S3. S3: For each element in the process information set K, if the content of the K2 field in the CRYPTO_INFO structure corresponding to the element is not all zero, calculate whether the frequency of each character in the content of the K2 field is less than the first frequency threshold, if so, continue to process the next element in the process information set K, otherwise, remove the element from the process information set K; after all elements in the process information set K are processed, go to step S4; S4: for each element in the process information set K, extract the content of the master_keydata field in the CRYPTO_INFO structure corresponding to the element, and determine whether the frequency of each character in the content of the master_keydata field is less than the second frequency threshold. If so, continue to process the next element in the process information set K; otherwise, remove the element from the process information set K; after all elements in the process information set K are processed, proceed to step S5; S5: for each element in the process information set K, extract the content of the SectorSize field in the CRYPTO_INFO structure corresponding to the element, and determine whether the content of the SectorSize field is equal to the set sector size. If so, continue to process the next element in the process information set K, otherwise, remove the element from the process information set K; after processing all elements in the process information set K, proceed to step S6; S6: For each element in the process information set K, extract the content of the master_keydata field in the CRYPTO_INFO structure corresponding to the element as the master key of the TrueCrypt.exe process.
2. The TrueCrypt decryption key extraction method according to claim 1, Features: The frequency of occurrence of each character in the content is calculated as follows: define an integer array with a length of 256 and initialize the value to 0 to store the number of occurrences of each character in the 256 characters; traverse each character in the content, and when each character appears once, the value in the storage position corresponding to the character in the integer array is increased by 1. When the traversal is completed, the value of each element in the integer array is the frequency of occurrence of the character corresponding to the element.
3. The TrueCrypt decryption key extraction method according to claim 1, Features: The method for extracting the TrueCrypt.exe process information is as follows: open the image file, search the image file starting from the offset address of the Idle process, and find the EPROCESS with process ID 4 and process name System; according to the address of the EPROCESS corresponding to the System process, find the EPROCESS information corresponding to the TrueCrypt.exe process through the Flink pointer of the doubly linked list.
4. The TrueCrypt decryption key extraction method according to claim 3, Features: The method for obtaining the offset address of the Idle process is as follows: find the EPROCESS structure with the process name Idle and the first 64-bit value in the EPROCESS structure from the image file, and then determine the type of operating system; calculate the offset address of the Idle process according to the type of operating system and the EPROCESS structure with the process name Idle.
5. A TrueCrypt decryption key extraction terminal device, Features: The method comprises a processor, a memory and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 4 when executing the computer program.
6. A computer-readable storage medium storing a computer program, Features: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
