LibOS file time verification method and device
By encrypting and verifying file time information in LibOS, the problem of file time inconsistency and compatibility in the Intel SGX system is solved, double verification of file time is achieved, and data security and reliability are improved.
Patent Information
- Application Number
- CN202310190686.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-08-27
AI Technical Summary
In the Intel SGX security system, file time information cannot be effectively verified, leading to file time inconsistency and compatibility issues. Especially when files are mounted from the outside into the enclave, existing technology cannot ensure the accuracy and security of the file time. .
In LibOS, by obtaining the relevant time of the file in a trusted execution environment, hashing and encrypting it, and saving it to the host hard disk and encrypted database, double verification of the file time is achieved to ensure the consistency and security of the file time information.
By encrypting and verifying the relevant time of files, it prevents file tampering and copying, improves file time consistency verification in the Intel SGX security system, and enhances data security and reliability.
Smart Images

Figure CN118555084A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of LibOS, and in particular to a file time verification method and device for LibOS. Background Art
[0002] In many security systems based on Intel instruction set extensions (Software Guard Extension, hereinafter referred to as "SGX"), there is a security issue that is often forgotten or tolerated, that is, the time problem of files. When the file system in the enclave needs to mount some files from the outside, the time information of these files is either copied to the enclave intact or directly ignored. The former may cause some businesses that rely on accurate file time information to be attacked (Intel SGX technology cannot ensure the verification of file time consistency), while the latter will cause great compatibility problems. Generally speaking, many businesses need to rely on the timestamp of files for processing. For example, the time of some files is related to the stored table. If there is no time, it is easy to cause confusion (the timestamp of the file and the content together constitute the data of the database); or in some temporary certificate scenarios, after the temporary certificate is issued, the other party may copy the temporary certificate, or repeatedly generate temporary certificates. At this time, the time of the temporary certificate changes. If the technical solution of only verifying the certificate in the prior art is still adopted, it may cause the temporary certificate to be used unlimited times. Summary of the invention
[0003] Based on the above situation of the prior art, the purpose of the embodiments of the present invention is to provide a file time verification method and device for LibOS, so as to realize the internal and external penetration of file time information in the library operating system (Library Operating System, hereinafter referred to as "LibOS") without causing compatibility problems.
[0004] To achieve the above object, according to a first aspect of the present invention, a LibOS file time verification method is provided, comprising:
[0005] Obtaining a first file from outside the LibOS in the trusted execution environment, and recording a relevant time of the first file;
[0006] Hash the first file in the trusted execution environment, encrypt relevant information of the first file using a symmetric key, and save the hash value of the first file and the encrypted relevant information to the host machine hard disk corresponding to the LibOS; the relevant information includes the relevant time, file name and file path of the first file;
[0007] storing the first file and its associated time in an encrypted database;
[0008] Reading a first file related to the data to be processed and its related time from the encryption database, and obtaining a hash value of the first file and related information of the encrypted first file from the host hard disk;
[0009] Verifying the first file using a hash value in the trusted execution environment, and verifying the relevant time of the first file using the encrypted relevant information of the first file;
[0010] The data to be processed is processed in the trusted execution environment according to the verification result.
[0011] Furthermore, the verifying the relevant time of the first file using the encrypted relevant information of the first file includes:
[0012] After decrypting the encrypted related information in the trusted execution environment, the related time therein is matched and verified with the related time of the first file; or,
[0013] In the trusted execution environment, the relevant time, file name and file path of the first file obtained from the encryption database are encrypted using the symmetric key, and then matched and verified with the encrypted relevant information saved in the host machine hard disk.
[0014] Furthermore, the matching check includes:
[0015] The two relevant times for matching are the same; or;
[0016] The difference between the two correlation times to be matched is not greater than the first time threshold.
[0017] Furthermore, the relevant time includes creation time, modification time and access time.
[0018] Furthermore, the processing of the data to be processed according to the verification result includes:
[0019] After verifying the first file and its related time, if the verification passes, the data to be processed is processed; if the verification fails, the data processing is refused.
[0020] A second aspect of the present invention provides a LibOS file time verification method, comprising:
[0021] Acquire multiple first files from outside LibOS in a trusted execution environment, and generate a second file with the relevant time of each first file;
[0022] Hash the second file in the trusted execution environment, and save the hash value of the second file to the host machine hard disk corresponding to the LibOS;
[0023] storing a plurality of first files and second files in an encrypted database;
[0024] Reading a plurality of first files and a second file related to the data to be processed from the encrypted database;
[0025] Obtaining relevant time of each of the plurality of first files in the trusted execution environment, and generating a to-be-verified file with the relevant time of each file;
[0026] Verifying the file to be verified in the trusted execution environment using a hash value of a second file saved to a hard disk of the host machine;
[0027] The data to be processed is processed in the trusted execution environment according to the verification result.
[0028] Furthermore, the method further comprises:
[0029] Hash the multiple first files in the trusted execution environment, and save the hash values of the multiple first files to the host machine hard disk corresponding to the LibOS;
[0030] In the trusted execution environment, the hash values of the multiple first files saved to the hard disk of the host machine are used to verify the multiple first files.
[0031] Furthermore, the relevant time includes creation time, modification time and access time.
[0032] A third aspect of the present invention provides a file time verification device for LibOS, comprising:
[0033] A file acquisition module, used for acquiring a first file from outside the LibOS in a trusted execution environment, and recording a relevant time of the first file;
[0034] A time encryption module, used to hash the first file in a trusted execution environment, encrypt relevant information of the first file using a symmetric key, and save the hash value of the first file and the encrypted relevant information to a host hard disk corresponding to the LibOS; the relevant information includes the relevant time, file name and file path of the first file;
[0035] A storage module, used for storing the first file and its related time in an encrypted database;
[0036] A file reading module, used to read a first file related to the data to be processed and its related time from the encrypted database, and obtain a hash value of the first file and related information of the encrypted first file from the host hard disk;
[0037] A verification module, configured to verify the first file in a trusted execution environment by using a hash value, and verify the relevant time of the first file by using the encrypted relevant information of the first file;
[0038] The data processing module is used to process the data to be processed according to the verification result in the trusted execution environment.
[0039] A fourth aspect of the present invention provides a file time verification device for LibOS, comprising:
[0040] A file acquisition module, which acquires a plurality of first files from outside the LibOS in the trusted execution environment, and generates a second file based on the relevant time of each first file;
[0041] A time encryption module, used for hashing the second file in a trusted execution environment, and saving the hash value of the second file to a host machine hard disk corresponding to the LibOS;
[0042] A storage module, used for storing a plurality of first files and second files in an encrypted database;
[0043] A file reading module, used for reading a plurality of first files and a second file related to the data to be processed from the encrypted database;
[0044] A verification module, used for obtaining relevant time of each file in a plurality of first files in a trusted execution environment, generating a to-be-verified file based on the relevant time of each file, and verifying the to-be-verified file using a hash value of a second file saved in a hard disk of a host machine;
[0045] The data processing module is used to process the data to be processed according to the verification result in the trusted execution environment.
[0046] In summary, the embodiment of the present invention provides a file time verification method and device for LibOS, the method comprising: obtaining a first file from outside LibOS in a trusted execution environment, and recording the relevant time of the first file; hashing the first file in the trusted execution environment, encrypting the relevant information of the first file with a symmetric key, and saving the hash value of the first file and the encrypted relevant information to the host hard disk corresponding to the LibOS; storing the first file and its relevant time in an encrypted database; reading the first file and its relevant time related to the data to be processed from the encrypted database, and obtaining the hash value of the first file and the relevant information of the encrypted first file from the host hard disk; verifying the first file using the hash value in the trusted execution environment, and verifying the relevant time of the first file using the encrypted relevant information of the first file; processing the data to be processed according to the verification result in the trusted execution environment. The technical solution provided by the embodiment of the present invention, by encrypting the relevant time information of the file and saving it to the host hard disk, can realize double verification of the file and the relevant time when LibOS needs to use the file next time, so as to prevent the file from being tampered with or copied by other databases, realize the verification of file time consistency in the Intel SGX security system, and improve the security and reliability of data use. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a flow chart of a file time verification method for LibOS provided by an embodiment of the present invention;
[0048] Figure 2 is a flowchart of a file time verification method for LibOS provided by another embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of interaction between file reading and time verification in LibOS in an embodiment of the present invention;
[0050] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0052] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present invention should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in one or more embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and other similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and other similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0053] The Intel SGX instruction set extension uses a new set of instruction set extensions and access control mechanisms to achieve isolated operation between different programs, ensuring the confidentiality and integrity of user key codes and data from being compromised by malware. This approach encapsulates the security operations of legitimate software in an enclave to protect it from malware attacks. Privileged or non-privileged software cannot access the enclave. The enclave created by SGX can also be understood as a trusted execution environment (Trusted Execution Environment, hereinafter referred to as "TEE"). In response to the problem that the time information of a file cannot be verified when the file system in the enclave needs to mount a portion of the file from the outside, an embodiment of the present invention provides a file time verification method and device, which achieves the penetration of file time information inside and outside LibOS without causing compatibility issues.
[0054] The technical solution of the present invention is described in detail below with reference to the accompanying drawings. The embodiment of the present invention provides a file time verification method of LibOS, Figure 1 The flowchart of the verification method is shown in FIG. , which comprises the following steps:
[0055] S202: Obtain a first file from outside LibOS in TEE, and record the relevant time of the first file, which may include but is not limited to the creation time, modification time, and access time of the first file.
[0056] S204. Hash the first file in the TEE. The hash algorithm used in this embodiment can select a hash algorithm commonly used in the field to hash the first file according to actual needs; use a symmetric key to encrypt the relevant information of the first file, and save the hash value of the first file and the encrypted relevant information to the host hard disk corresponding to the LibOS; the relevant information includes the relevant time, file name and file path of the first file.
[0057] S206: Store the first file and its related time in an encrypted database.
[0058] S208: Read the first file related to the data to be processed and its related time from the encryption database, and obtain the hash value of the first file and the related information of the encrypted first file from the hard disk of the host machine.
[0059] S210. In TEE, the first file is verified by using a hash value, and the relevant time of the first file is verified by using the relevant information of the encrypted first file. The relevant time of the first file is verified by using the relevant information of the encrypted first file. After the encrypted relevant information is decrypted in TEE, the relevant time therein can be matched and verified with the relevant time of the first file, that is, a matching verification between plaintexts; or the relevant time, file name and file path of the first file obtained from the encryption database can be encrypted in TEE using the symmetric key, and then matched and verified with the encrypted relevant information saved to the host hard disk, that is, a matching verification between ciphertexts. The matching verification of the relevant time can be that the two relevant times to be matched are the same; or the difference between the two relevant times to be matched is not greater than the first time threshold. In other words, there can be a range for the verification of the relevant time. For example, a difference of several minutes or hours between the two relevant times can also be regarded as a verification pass, and it does not need to be completely consistent. The value of the above-mentioned first time threshold can be adjusted according to actual needs.
[0060] S212. Process the data to be processed in TEE according to the verification results. After verifying the first file and its related time, if the verification passes, that is, the hash value of the first file is consistent, and the related time verification results are also consistent, then the data to be processed can be processed subsequently; if the verification fails, it means that the first file has been tampered with, or copied by other databases, and the related time has changed, then the data processing can be refused.
[0061] The embodiment of the present invention further provides a LibOS file time verification method, Figure 2 The flowchart of the verification method is shown in FIG. , which comprises the following steps:
[0062] S402, in TEE, obtain multiple first files from outside LibOS, and generate a second file with the relevant time of each first file. The technical solution provided by this embodiment is mainly different from the above embodiment in that this embodiment is mainly aimed at the situation where multiple files are obtained at the same time. In this case, the relevant time of each file in the multiple files is additionally generated into a second file, and the second file is hashed as a whole, and a hash verification method is used to determine whether the file has been tampered with.
[0063] S404, hashing the second file in the TEE, and saving the hash value of the second file to the host hard disk corresponding to the LibOS. In this embodiment, the verification process of the first file can also be included at the same time. Specifically, multiple first files can be hashed in the trusted execution environment, and the hash values of the multiple first files can be saved to the host hard disk corresponding to the LibOS.
[0064] S406: Store the plurality of first files and second files into an encrypted database.
[0065] S408, reading the first file and the second file related to the data to be processed from the encrypted database. When there is data to be processed according to demand, the first file and the second file related to the data to be processed are read from the encrypted database to verify them before processing.
[0066] S410, obtaining the relevant time of each file in the multiple first files in the TEE, and generating a to-be-verified file with the relevant time of each file, and verifying the to-be-verified file using the hash value of the second file saved to the host machine hard disk. In the case where the first files need to be verified simultaneously, the hash values of the multiple first files saved to the host machine hard disk can be used in the TEE to verify the multiple first files simultaneously.
[0067] S412: Process the data to be processed in TEE according to the verification result. Figure 3 The interactive diagram of file reading and time verification in LibOS is shown in FIG. Figure 3As shown, it includes the host kernel and the LibOS kernel. The enclave file system obtains the file time by initiating a system call (stat / fstat / statx) from the outside through ocall (ocall is a call type for the enclave to call an external method of the enclave), and then returns to the enclave. The enclave encrypts the corresponding file time, file name, and file path and saves them to the external host hard disk through data sealing. When the enclave needs to process file data and read files, it obtains the file name and file path related to the data to be processed, and reads the external list through data sealing. When the enclave generates files: the files are generated normally, and the corresponding file time, file name and file path are encrypted through data sealing. When the enclave is loaded, the file time information is taken from the result of the file reading step and compared with the file information to be read. If they are consistent, they are read in. If they are inconsistent or the external data sealing file is lost, an alarm or error is issued to exit. In addition, it also provides the situation of loading multiple files. When the enclave program is compiled, an additional manifest.fs file is generated, which stores the time information of the files to be mounted internally, and then signs it with the sgx key. When the enclave is loaded, the file information in manifest.fs is checked. If they are consistent, it is loaded. If they are inconsistent, an alarm or error is issued to exit. Among them, fs represents the relevant file storage area. The stat system call series includes fstat, stat and statx, which are all used to return "relevant file status information"; stat (ctime, atime, mtime) means returning the creation time, modification time and access time.
[0068] An embodiment of the present invention further provides a file time verification device for LibOS, comprising:
[0069] A file acquisition module, used for acquiring a first file from outside the LibOS in a trusted execution environment, and recording a relevant time of the first file;
[0070] A time encryption module, used to hash the first file in a trusted execution environment, encrypt relevant information of the first file using a symmetric key, and save the hash value of the first file and the encrypted relevant information to a host hard disk corresponding to the LibOS; the relevant information includes the relevant time, file name and file path of the first file;
[0071] A storage module, used for storing the first file and its related time in an encrypted database;
[0072] A file reading module, used to read a first file related to the data to be processed and its related time from the encrypted database, and obtain a hash value of the first file and related information of the encrypted first file from the host hard disk;
[0073] A verification module, configured to verify the first file in a trusted execution environment by using a hash value, and verify the relevant time of the first file by using the encrypted relevant information of the first file;
[0074] The data processing module is used to process the data to be processed according to the verification result in the trusted execution environment. The embodiment of the present invention also provides a file time verification device of LibOS, which is characterized by comprising:
[0075] A file acquisition module, which acquires a plurality of first files from outside the LibOS in the trusted execution environment, and generates a second file based on the relevant time of each first file;
[0076] A time encryption module, used for hashing the second file in a trusted execution environment, and saving the hash value of the second file to a host machine hard disk corresponding to the LibOS;
[0077] A storage module, used for storing a plurality of first files and second files in an encrypted database;
[0078] A file reading module, used for reading a plurality of first files and a second file related to the data to be processed from the encrypted database;
[0079] A verification module, used for obtaining relevant time of each file in a plurality of first files in a trusted execution environment, generating a to-be-verified file based on the relevant time of each file, and verifying the to-be-verified file using a hash value of a second file saved in a hard disk of a host machine;
[0080] The data processing module is used to process the data to be processed according to the verification result in the trusted execution environment.
[0081] The specific process of each module in the file time verification device of LibOS provided by the above embodiment of the present invention to realize its function is the same as the steps of the file time verification method of LibOS provided by the above embodiment of the present invention, so its repeated description will be omitted here.
[0082] An embodiment of the present invention further provides an electronic device, Figure 4 FIG. 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 4As shown, the electronic device includes: one or more processors 401 and a memory 402; and computer program instructions stored in the memory 402, and when the computer program instructions are executed by the processor 401, the processor 401 executes the file time verification method of the LibOS in any of the above embodiments. The processor 401 can be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions.
[0083] The memory 402 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may execute the program instructions to implement the steps in the file time verification method of the LibOS of each embodiment of the present invention described above and / or other desired functions.
[0084] In some embodiments, the electronic device may further include: an input device 403 and an output device 404, which are connected via a bus system and / or other forms of connection mechanisms ( Figure 4 (not shown) interconnection. For example, when the electronic device is a stand-alone device, the input device 403 can be a communication network connector, which is used to receive the collected input signal from an external removable device. In addition, the input device 403 can also include, for example, a keyboard, a mouse, a microphone, etc. The output device 404 can output various information to the outside, for example, it can include, for example, a display, a speaker, a printer, and a communication network and a remote output device connected thereto.
[0085] In addition to the above methods and devices, an embodiment of the present invention may also be a computer program product, including computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the file time verification method of LibOS in any of the above embodiments.
[0086] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present invention, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0087] In addition, an embodiment of the present invention may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the file time verification method of LibOS in various embodiments of the present invention.
[0088] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0089] It should be understood that the processor in the embodiment of the present invention 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), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0090] In summary, the embodiment of the present invention relates to a file time verification method and device for LibOS, the method comprising: obtaining a first file from outside LibOS in a trusted execution environment, and recording the relevant time of the first file; hashing the first file in the trusted execution environment, encrypting the relevant information of the first file with a symmetric key, and saving the hash value of the first file and the encrypted relevant information to the host hard disk corresponding to the LibOS; storing the first file and its relevant time in an encrypted database; reading the first file and its relevant time related to the data to be processed from the encrypted database, and obtaining the hash value of the first file and the relevant information of the encrypted first file from the host hard disk; verifying the first file with a hash value in the trusted execution environment, and verifying the relevant time of the first file with the encrypted relevant information of the first file; processing the data to be processed according to the verification result in the trusted execution environment. . The technical solution provided by the embodiment of the present invention, by encrypting the relevant time information of the file and saving it to the host hard disk, can realize double verification of the file and the relevant time when LibOS needs to use the file next time, so as to prevent the file from being tampered with or copied by other databases, realize the verification of file time consistency in the Intel SGX security system, and improve the security and reliability of data use.
[0091] It should be understood that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present invention (including claims) is limited to these examples; under the idea of the present invention, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other changes in different aspects of one or more embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity. The above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the scope of protection of the present invention. In addition, the claims attached to the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the attached claims, or the equivalent forms of such scope and boundaries.
Claims
1. A file time verification method for LibOS, characterized in that: include: Obtaining a first file from outside the LibOS in the trusted execution environment, and recording a relevant time of the first file; Hash the first file in the trusted execution environment, encrypt relevant information of the first file using a symmetric key, and save the hash value of the first file and the encrypted relevant information to the host machine hard disk corresponding to the LibOS; the relevant information includes the relevant time, file name and file path of the first file; storing the first file and its associated time in an encrypted database; Reading a first file related to the data to be processed and its related time from the encryption database, and obtaining a hash value of the first file and related information of the encrypted first file from the host hard disk; Verifying the first file using a hash value in the trusted execution environment, and verifying the relevant time of the first file using the encrypted relevant information of the first file; The data to be processed is processed in the trusted execution environment according to the verification result.
2. The method according to claim 1, characterized in that The verifying the relevant time of the first file using the encrypted relevant information of the first file includes: After decrypting the encrypted related information in the trusted execution environment, the related time therein is matched and verified with the related time of the first file; or, In the trusted execution environment, the relevant time, file name and file path of the first file obtained from the encryption database are encrypted using the symmetric key, and then matched and verified with the encrypted relevant information saved in the host machine hard disk.
3. The method according to claim 2, characterized in that The matching check includes: The two relevant times for matching are the same; or; The difference between the two correlation times to be matched is not greater than the first time threshold.
4. The method according to any one of claims 1 to 3, characterized in that: The relevant time includes creation time, modification time and access time.
5. The method according to claim 4, characterized in that The processing of the data to be processed according to the verification result includes: After verifying the first file and its related time, if the verification passes, the data to be processed is processed; if the verification fails, the data processing is refused.
6. A file time verification method for LibOS, characterized in that: include: Acquire multiple first files from outside LibOS in a trusted execution environment, and generate a second file with the relevant time of each first file; Hash the second file in the trusted execution environment, and save the hash value of the second file to the host machine hard disk corresponding to the LibOS; storing a plurality of first files and second files in an encrypted database; Reading a plurality of first files and a second file related to the data to be processed from the encrypted database; Obtaining relevant time of each of the plurality of first files in the trusted execution environment, and generating a to-be-verified file with the relevant time of each file; Verifying the file to be verified in the trusted execution environment using a hash value of a second file saved to a hard disk of the host machine; The data to be processed is processed in the trusted execution environment according to the verification result.
7. The method according to claim 6, characterized in that The method further comprises: Hash the multiple first files in the trusted execution environment, and save the hash values of the multiple first files to the host machine hard disk corresponding to the LibOS; In the trusted execution environment, the hash values of the multiple first files saved to the hard disk of the host machine are used to verify the multiple first files.
8. The method according to claim 6 or 7, characterized in that: The relevant time includes creation time, modification time and access time.
9. A file time verification device for LibOS, characterized in that: include: A file acquisition module, used for acquiring a first file from outside the LibOS in a trusted execution environment, and recording a relevant time of the first file; A time encryption module, used to hash the first file in a trusted execution environment, encrypt relevant information of the first file using a symmetric key, and save the hash value of the first file and the encrypted relevant information to a host hard disk corresponding to the LibOS; the relevant information includes the relevant time, file name and file path of the first file; A storage module, used for storing the first file and its related time in an encrypted database; A file reading module, used to read a first file related to the data to be processed and its related time from the encrypted database, and obtain a hash value of the first file and related information of the encrypted first file from the host hard disk; A verification module, configured to verify the first file in a trusted execution environment by using a hash value, and verify the relevant time of the first file by using the encrypted relevant information of the first file; The data processing module is used to process the data to be processed according to the verification result in the trusted execution environment.
10. A file time verification device for LibOS, characterized in that: include: A file acquisition module, which acquires a plurality of first files from outside the LibOS in the trusted execution environment, and generates a second file based on the relevant time of each first file; A time encryption module, used for hashing the second file in a trusted execution environment, and saving the hash value of the second file to a host machine hard disk corresponding to the LibOS; A storage module, used for storing a plurality of first files and second files in an encrypted database; A file reading module, used for reading a plurality of first files and a second file related to the data to be processed from the encrypted database; A verification module, used to obtain relevant time of each file in a plurality of first files in a trusted execution environment, generate a to-be-verified file based on the relevant time of each file, and verify the to-be-verified file using a hash value of a second file saved in a hard disk of a host machine; The data processing module is used to process the data to be processed according to the verification result in the trusted execution environment.
