CN111737659A - TEE-based code reinforcement method and device - Google Patents

TEE-based code reinforcement method and device Download PDF

Info

Publication number
CN111737659A
CN111737659A CN202010580295.XA CN202010580295A CN111737659A CN 111737659 A CN111737659 A CN 111737659A CN 202010580295 A CN202010580295 A CN 202010580295A CN 111737659 A CN111737659 A CN 111737659A
Authority
CN
China
Prior art keywords
code
tee
code segment
segment
stub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010580295.XA
Other languages
Chinese (zh)
Inventor
严兴潮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202010580295.XA priority Critical patent/CN111737659A/en
Publication of CN111737659A publication Critical patent/CN111737659A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a method and a device for realizing code reinforcement based on TEE, wherein the embodiment of the invention sets a code segment to be processed in the TEE in a binary program, so that the code segment can be identified when the REE runs the binary program, and after the code segment is decrypted in the TEE when the code segment is run to the code segment, the decrypted code segment is covered with the code segment in the binary program in the REE, so that the REE can continuously run the code segment; when the code segment is run, after the code segment is encrypted in the TEE, the encrypted code segment is covered in the decrypted code segment in the binary program in the REE, so that the safety of the code segment in the binary program is ensured. Therefore, the embodiment of the invention realizes code reinforcement based on TEE on the premise of improving safety.

Description

TEE-based code reinforcement method and device
Technical Field
The invention relates to the technical field of data encryption and decryption, in particular to a method and a device for realizing code reinforcement based on a Trusted Execution Environment (TEE).
Background
With the development of mobile devices, the functions of the mobile devices become more powerful, and the mobile devices can store assets of users and process payment and other operations. At present, a system operating Environment of a mobile device is called a multifunctional operating Environment (REE, rich execution Environment), an operating system based on Android (Android), IOS and Linux is supported in the REE, the REE has a strong function and good openness and expansibility, all functions of the device can be provided for an application layer of the mobile device, such as a camera, a touch screen and the like, and various applications seen by a user at present can be realized.
The operating system in the REE can obtain all data of the carried application, but it is difficult to verify whether the operating system is tampered, and the operating system is attacked and has a bug (bug) to generate a security risk for the carried data. Therefore, a TEE needs to be set in a set area of a Central Processing Unit (CPU) of the mobile device, the TEE is isolated from the REE, the TEE can acquire data in the REE for performing corresponding security processing, the REE cannot acquire the data of the TEE, and a safer space is provided for the data of the mobile terminal under the TEE, so that confidentiality and integrity are ensured. Since data of the mobile terminal is represented by binary codes, a security technology for implementing data based on the TEE technology is called a code hardening technology.
Currently, TrustZone technology is adopted to construct TEE, and TrustZone provides soft and hard combined TEE security architecture for data in a large number of applications of mobile devices, including data in secure payment, Digital Rights Management (DRM), enterprise services, internet-based services, and the like.
An operating system based on the TrustZone technology and conforming to the TEE standard is called an OPTEE (open portable TEE), as shown in fig. 1, fig. 1 is a schematic diagram of an OPTEE architecture provided in the prior art, and as shown in the figure, the architecture is composed of three layers of a user space, a kernel space and a hard disk. The Application programs (CA) set based on the REE and the Trusted Application programs (TA) set based on the TEE are executed in the Application space, and the business functions provided by various applications are completed. When there is code to be processed by the TEE in the CA, the execution of the CA needs to depend on an option driver unit (option driver) in the core space of the REE, the CA interacts with the option driver through an option client library (option client library), and the option driver adopts a stack transfer (std call) mode and interacts with an option operating system (option os) in the core space of the TEE through a switch unit (monitor) between the TEE and the REE to inform the code to be processed. The option os driver in the TEE realizes the operation of the TA corresponding to the CA, acquires a code to be processed from a shared register (shared memory) according to the notification, and performs the TEE technology processing on the acquired code. During the execution of TA and the corresponding CA, it is decided by the std call approach that the code access in the shared register is done in user space.
As can be seen from fig. 1, the code involved in CA execution can be handled by TA control in the TEE, achieving its security, i.e. using TEE technology to implement code hardening in the REE. However, how to specifically implement code reinforcement by using the TEE technology to ensure that the reinforced code is not attacked and tampered, and improve the security of the reinforced code in the REE still remains a problem to be solved urgently.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a method for implementing code reinforcement based on a TEE, where the method can implement code reinforcement based on the TEE on the premise of improving security.
The invention also provides a device for realizing code reinforcement based on the TEE, which realizes code reinforcement based on the TEE on the premise of improving safety.
The embodiment of the invention is realized as follows:
a method of implementing code hardening based on TEE, the method comprising:
running a binary program in the multifunctional running environment REE, and when running to a front stub code in the binary program, determining a code segment which is positioned between the front stub code and a rear stub code and is to be processed in the TEE by identifying the rear stub code;
sending the code segment to a TEE for decryption, and overwriting the decrypted code segment received from the TEE with the code segment in the binary program;
continuing to run the code segment in the REE, upon running to a post stub code of the code segment, determining the code segment by identifying a pre stub code of the code segment;
and after the code sections are sent to the TEE to be encrypted, the encrypted code sections received from the TEE are covered by the code sections in the binary program.
Preferably, the code segment further comprises a padding code, and the padding code enables the byte number of the code segment to meet the byte alignment requirement of an encryption and decryption algorithm adopted in the TEE processing;
sending the code segment into the TEE for decryption further comprises:
carrying out decryption operation on the filling code in the code section and the code to be processed in the code section;
sending the code segment to the TEE for encryption further comprises:
performing an encryption operation on the filler code in the code section together with the code to be processed in the code section.
Preferably, before the obtaining the code segment, the method further includes:
triggering the running interruption of the binary program;
after the code segment in the overlay binary program, the method further comprises:
and ending the interruption and continuing to run the binary program.
Preferably, before sending the code segment to the TEE, the method further includes:
establishing communication between the REE and the TEE in a kernel space;
and the REE interacts and responds with the TEE in a fast call mode, and the code segment is transferred through a shared register arranged in the kernel space.
A method of implementing code hardening based on TEE, the method comprising:
determining a code segment to be processed in the TEE in a source code, respectively inserting a breakpoint instruction corresponding to a front stub code, a breakpoint instruction corresponding to a filling code and a breakpoint instruction corresponding to a rear stub code into the front end, the filling position and the rear end of the code segment, and compiling to obtain a first binary program;
scanning the first binary program to obtain the breakpoint instruction, and respectively replacing the breakpoint instruction with a corresponding front stub code, a corresponding filling code and a corresponding back stub code;
and encrypting the code segment which can be processed in the TEE to obtain a second binary program.
Preferably, the stuffing code makes the number of bytes of the code segment meet the byte alignment requirement of the encryption and decryption algorithm adopted in the TEE processing.
Preferably, the breakpoint instruction is identified by a breakpoint identifier and includes breakpoint sequence numbers of inserted pre-stub codes, filling codes or post-stub codes, the breakpoint sequence numbers of the pre-stub codes and the post-stub codes of the same code segment are the same and are arranged according to the sequence of the first binary program where the code segment is located, and the breakpoint sequence number of the filling code is set to be a fixed value;
the breakpoint instruction is respectively replaced by a corresponding front pile code, a corresponding filling code and a corresponding back pile code, and the breakpoint instruction comprises the following steps:
and filling the breakpoint sequence number in the breakpoint instruction into the 2 nd to 3 rd bytes in the corresponding pre-pile code, filling code or post-pile code, and setting a pre-pile code identifier, a filling code identifier or a post-pile code identifier in the 1 st byte of the corresponding pre-pile code, filling code or post-pile code.
In a binary program to be run, a code segment to be processed in the TEE is set, the code segment comprising:
a pre-stub code, a TEE processable code, a fill code, and a post-stub code, wherein the pre-stub code is disposed at a front end of the code segment, identifying a beginning of the code segment; the filling code is arranged in the code segment, so that the byte number of the code segment meets the byte alignment requirement of an encryption and decryption algorithm adopted in TEE processing; the post stub code is arranged at the rear end of the code segment and marks the end of the code segment;
the binary program is run in the REE.
Preferably, the binary program is an encrypted executable and linkable format ELF file.
An apparatus for implementing code hardening based on TEE, comprising: an operation module arranged at an application layer of the REE, a core module and a TEE interaction module arranged in a kernel space of the REE, and an encryption and decryption module arranged in the kernel space of the TEE, wherein,
the running module is used for running a binary program in the REE and entering the core module for processing when running to the front stub code in the REE; continuing to run the code segment in the binary program upon ending the first interrupt; when the post-stub code of the code segment is operated, the core module is started to process; continuing to run the binary program when the second interrupt is ended;
the core module is used for triggering a first interrupt, determining the code segment which is positioned between the front stub code and the rear stub code and is to be processed in the TEE through the identified rear stub code, and sending the code segment to the TEE interaction module; overwriting the decrypted code segment received from the TEE interaction module with the running code segment, and ending the first interrupt; triggering a second interrupt, determining the code segment by identifying a pre-stub code of the code segment, and sending the code segment to the TEE interaction module; overwriting the encrypted code segment received from the TEE interaction module with the run-out code segment, and ending the second interrupt;
the TEE interaction module is used for sending the code segment to the encryption and decryption module under the first interrupt; sending the decrypted code segment returned by the encryption and decryption module to the core module; sending the code segment to the encryption and decryption module under a second interrupt; sending the encrypted code segment returned by the encryption and decryption module to the core module;
the encryption and decryption module is used for decrypting the code segment under the first interruption and returning the decrypted code segment to the TEE interaction module; and under the second interruption, the code segment is encrypted and then returned to the TEE interaction module.
Preferably, the TEE interaction module and the encryption and decryption module interact with each other through a shared register arranged in a kernel space by adopting a fast call mode.
Preferably, the code segment further comprises a padding code, and the padding code enables the byte number of the code segment to meet the byte alignment requirement of an encryption and decryption algorithm adopted in the TEE processing;
the encryption and decryption module is further used for carrying out decryption operation on the filling codes in the code segments and the codes to be processed in the code segments in the decryption process of the code segments; and in the process of encrypting the code sections, carrying out encryption operation on the filling codes in the code sections and the codes to be processed in the code sections.
An apparatus for implementing code hardening based on TEE, comprising: a pile inserting module and a scanning module, wherein,
the instrumentation module is used for determining a code segment to be processed in the TEE in a source code, inserting a breakpoint instruction corresponding to a front stub code, a breakpoint instruction corresponding to a filling code and a breakpoint instruction corresponding to a back stub code into the front end, the filling position and the back end of the code segment respectively, and compiling to obtain a first binary program;
the scanning module is used for scanning the first binary program to obtain the breakpoint instruction, and replacing the breakpoint instruction with a corresponding front stub code, a corresponding filling code and a corresponding back stub code respectively; and encrypting the code segment which can be processed in the TEE to obtain a second binary program.
Preferably, the stuffing code makes the number of bytes of the code segment meet the byte alignment requirement of the encryption and decryption algorithm adopted in the TEE processing.
Preferably, the plug-in module is configured to identify the breakpoint instruction by a breakpoint identifier, and includes breakpoint sequence numbers of inserted pre-stub codes, filling codes or post-stub codes, where the breakpoint sequence numbers of the pre-stub codes and the post-stub codes of the same code segment are the same and are arranged according to the sequence of the first binary program in which the code segments are located, and the breakpoint sequence number of the filling code is set to a fixed value;
the scanning module is further configured to, when the breakpoint instruction is replaced with the corresponding front pile code, the corresponding filling code, and the corresponding rear pile code, fill the breakpoint sequence number in the breakpoint instruction into bytes 2 to 3 of the corresponding front pile code, filling code, or rear pile code, and set a front pile code identifier, a filling code identifier, or a rear pile code identifier in byte 1 of the corresponding front pile code, filling code, or rear pile code.
As can be seen from the above, the embodiment of the present invention sets the code segment to be processed in the TEE in the binary program, so that the code segment can be recognized when the REE runs the binary program, and after the code segment is decrypted in the TEE when the code segment is run to the code segment, the decrypted code segment is overwritten on the code segment in the binary program in the REE, so that the REE can continue to run the code segment; when the code segment is run, after the code segment is encrypted in the TEE, the encrypted code segment is covered in the decrypted code segment in the binary program in the REE, so that the safety of the code segment in the binary program is ensured. Therefore, the embodiment of the invention realizes code reinforcement based on TEE on the premise of improving safety.
Drawings
FIG. 1 is a schematic diagram of an OPEE architecture provided by the prior art;
FIG. 2 is a flowchart of a method for implementing code hardening based on TEE according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of invoking the code segment according to an embodiment of the present invention
Fig. 4 is a schematic structural diagram of an ETF file and an encrypted ETF file according to an embodiment of the present invention;
FIG. 5 is a block diagram of a binary program according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an apparatus for implementing code hardening based on TEE according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a method for REE to run a binary program according to an embodiment of the present invention;
FIG. 8 is a second diagram illustrating a method for REE to run a binary program according to an embodiment of the present invention;
FIG. 9 is a flowchart of a method for compiling a binary program according to an embodiment of the present invention;
fig. 10 is a schematic diagram of an encoding format of a breakpoint instruction according to an embodiment of the present invention;
fig. 11 is a schematic diagram of converting a breakpoint instruction into a corresponding custom code according to an embodiment of the present invention;
FIG. 12 is a diagram illustrating a structure of inserting a filler code into the code segment according to an embodiment of the present invention;
FIG. 13 is a block diagram of an apparatus for compiling a second binary program according to an embodiment of the present invention;
fig. 14 is a flowchart of a method for obtaining a second binary program by compiling after a scanning module scans a first binary program according to an embodiment of the present invention;
fig. 15 is a schematic diagram illustrating a processing procedure of a core module in an REE according to an embodiment of the present invention;
fig. 16 is a schematic diagram of an execution structure of the TEE encryption/decryption module according to the embodiment of the present invention during encryption/decryption.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and examples.
It can be seen from the background art that although the code in the CA in the REE can be encrypted and decrypted in the TEE through the interaction between the REE and the TEE, so that the CA continues to run in the REE on the premise of ensuring security, how to perform encryption and decryption specifically in the TEE can still ensure that the code reinforced in the CA is not attacked and tampered, and not only is simply handed over to the TEE for processing, but is not mentioned. Furthermore, since the shared register for storing the code is disposed in the user space of the device, and the interaction between the REE and the TEE is implemented in the kernel space of the device, multiple times of calling and called of the code instruction are required, the processing is complex, and the security is not high.
Therefore, in order to overcome the above problems, in the embodiment of the present invention, a code segment to be processed in the TEE in the binary program is set, so that the code segment can be identified when the REE runs the binary program, and after the code segment is decrypted in the TEE when the code segment is run to the code segment, the decrypted code segment is overwritten on the code segment in the binary program in the REE, so that the REE can continue to run the code segment; when the code segment is run, after the code segment is encrypted in the TEE, the encrypted code segment is covered in the decrypted code segment in the binary program in the REE, so that the safety of the code segment in the binary program is ensured.
Therefore, the embodiment of the invention realizes code reinforcement based on TEE on the premise of improving safety.
Fig. 2 is a flowchart of a method for implementing code hardening based on TEE according to an embodiment of the present invention, which includes the following specific steps:
step 201, running a binary program in the REE, and when running to a front stub code therein, determining a code segment which is located between the front stub code and a rear stub code and is to be processed in the TEE by identifying the rear stub code;
step 202, after sending the code segment to the TEE for decryption, overwriting the decrypted code segment received from the TEE with the code segment in the binary program;
step 203, continuing to run the code segment in the REE, and determining the code segment by identifying the pre-stub code of the code segment when the code segment is run to the post-stub code of the code segment;
and step 204, after the code segment is sent to the TEE to be encrypted, the encrypted code segment received from the TEE is covered on the code segment in the binary program.
In step 201 and step 203 of fig. 2, before determining the code segment and subsequently processing the code segment in the REE, in order to protect the running binary program from normal execution in the process of the REE, the method further includes: triggering the running interruption of the binary program; after the code segment in the overlay binary program, the method further comprises: and ending the interruption and continuing to run the binary program.
As can be seen from fig. 2, the interaction of the code segments is directly performed between the REE and the TEE, and therefore, the method further includes: establishing communication between the REE and the TEE in a kernel space; and the REE interacts and responds with the TEE in a fast call mode, and the code segment is transferred through a shared register arranged in the kernel space. The fast call mode is a fast interaction and response mode between the REE and the TEE, which is equivalent to that a shared register for transferring the code segment is arranged in a kernel space between the REE and the TEE, and the REE accesses the code segment from the shared register and the TEE encrypts and decrypts the code segment in the shared register through the interaction response between the REE and the TEE. As shown in fig. 3, fig. 3 is a schematic structural diagram of invoking the code segment according to an embodiment of the present invention. The method has the advantage that code interaction can be realized in the user space without calling layer by layer in an std call mode as shown in fig. 1, so that the performance is improved.
As can be seen from fig. 2, when a code segment to be processed in the TEE in the binary program running in the REE runs, the code segment is subjected to TEE decryption processing, so that the binary program continues to run; and when the execution is finished, covering the executed code segment in the binary program after the encryption processing of the TEE, and ensuring the safety of the code segment in the binary program.
In the embodiment of the present invention, the binary program may be an encrypted Executable and Linkable Format (ELF) file, which is an encryption operation that is performed on a part of code segments in the ELF file and can be processed by the TEE. Fig. 4 is a schematic structural diagram of an ETF file and an encrypted ETF file provided in an embodiment of the present invention, as shown in the drawing: the structure of the original ELF file includes an ELF header, a program header table, a code segment, a data segment, other and section header tables, and the ELF file is processed so that its code segment includes encrypted code (security assurance) that can be processed by the TEE, and the encrypted code segment is called an encryption block. The number of the encryption blocks is set to be 65535 or less, the order of magnitude is enough to meet the actual engineering requirement, the positions of the encryption blocks in the code segments of the encryption ELF file are determined according to the requirement, and certain randomness is generally set to ensure that the encryption ELF file is not easy to attack and tamper.
The embodiment of the present invention changes the code segments in the set binary program, and the structure of the code segments is shown in fig. 5, where fig. 5 is a schematic structural diagram of the binary program provided in the embodiment of the present invention. In a binary program to be run, setting a code segment to be processed in a TEE, the code segment comprising:
a pre-stub code, a TEE processable code, a fill code, and a post-stub code, wherein the pre-stub code is disposed at a front end of the code segment, identifying a beginning of the code segment; the filling code is arranged in the code segment, so that the byte number of the code segment meets the byte alignment requirement of an encryption and decryption algorithm adopted in TEE processing; the post stub code is arranged at the back end of the code segment and marks the end of the code segment. The binary program runs in REE.
The code section shown in fig. 5 may be provided in a code section of an encrypted ELF file, wherein one encrypted ELF file may have a plurality of code sections shown in fig. 5 therein.
As can be seen from fig. 5, the code segment to be processed by REE, which is set in the binary program, includes a padding code, so that the byte number of the code segment meets the byte alignment requirement of the encryption and decryption algorithm used in TEE processing, so that the REE can process the code segment in processing (generally, TEE uses AES encryption and decryption algorithm, which needs to guarantee 16 byte alignment). In this case, sending the code segment into the TEE for decryption further comprises: carrying out decryption operation on the filling code in the code section and the code to be processed in the code section; sending the code segment to the TEE for encryption further comprises: performing an encryption operation on the filler code in the code section together with the code to be processed in the code section.
Fig. 6 is a schematic structural diagram of an apparatus for implementing code hardening based on TEE according to an embodiment of the present invention, including: an operation module arranged at an application layer of the REE, a core module and a TEE interaction module arranged in a kernel space of the REE, and an encryption and decryption module arranged in the kernel space of the TEE, wherein,
the running module is used for running a binary program in the REE and entering the core module for processing when running to the front stub code in the REE; continuing to run the code segment in the binary program upon ending the first interrupt; when the post-stub code of the code segment is operated, the core module is started to process; continuing to run the binary program when the second interrupt is ended;
the core module is used for triggering a first interrupt, determining the code segment which is positioned between the front stub code and the rear stub code and is to be processed in the TEE through the identified rear stub code, and sending the code segment to the TEE interaction module; overwriting the decrypted code segment received from the TEE interaction module with the running code segment, and ending the first interrupt; triggering a second interrupt, determining the code segment by identifying a pre-stub code of the code segment, and sending the code segment to the TEE interaction module; overwriting the encrypted code segment received from the TEE interaction module with the run-out code segment, and ending the second interrupt;
the TEE interaction module is used for sending the code segment to the encryption and decryption module under the first interrupt; sending the decrypted code segment returned by the encryption and decryption module to the core module; sending the code segment to the encryption and decryption module under a second interrupt; sending the encrypted code segment returned by the encryption and decryption module to the core module;
the encryption and decryption module is used for decrypting the code segment under the first interruption and returning the decrypted code segment to the TEE interaction module; and under the second interruption, the code segment is encrypted and then returned to the TEE interaction module.
In the device, the TEE interaction module and the encryption and decryption module realize the interaction of the code segments by adopting a fast call mode through a shared register arranged in a kernel space.
In the device, the code segment also comprises a filling code, and the filling code enables the byte number of the code segment to meet the byte alignment requirement of an encryption and decryption algorithm adopted in TEE processing;
the encryption and decryption module is further used for carrying out decryption operation on the filling codes in the code segments and the codes to be processed in the code segments in the decryption process of the code segments; and in the process of encrypting the code sections, carrying out encryption operation on the filling codes in the code sections and the codes to be processed in the code sections.
That is, the filler code in the code section may partially participate in the encryption/decryption operation of the code section. As an example, a pad code corresponds to a binary code of 4 bytes, and the number of bytes of the code to be TEE processed in a code segment is an integer multiple of 4, such as a 4-byte, 8-byte, 12-byte or 16-byte code segment. If the code needing TEE processing in one code segment is 4 bytes, three filling codes are needed to participate in the encryption and decryption processing of the code segment; if the code needing TEE processing in one code segment is 8 bytes, two filling codes are needed to be filled to participate in the encryption and decryption processing of the code segment; if the code needing TEE processing in a code segment is 12 bytes, a filling code needs to be filled to participate in the encryption and decryption processing of the code segment; if the code requiring TEE processing in one code segment is 16 bytes, there is no need for padding code to participate in the encryption/decryption process of the code segment.
When the binary program is operated in the REE, the embodiment of the invention sets the process for operating the binary program, copies the binary program into the process memory space, and executes the binary program under the control of the execution pointer of the process. The process of the REE running the binary program is described in detail below with reference to FIGS. 7 and 8.
Fig. 7 is a schematic diagram of a method for REEs to run binary programs according to an embodiment of the present invention, as shown in the figure, including:
step 701, when an execution pointer PC1 of the binary program runs to the stub code, triggering interruption by a core module of the REE, and entering the core module for processing;
step 702, when the core module judges that the code is a pre-stub code, the core module identifies a post-stub code to confirm the length of a code segment to be processed by TEE so as to acquire the code segment;
step 703, copying the code segment in the process memory space to a kernel space by the core module, and transmitting the code segment to the TEE interaction module;
step 704, the TEE interaction module transmits the code segment to an encryption and decryption module of the TEE through a shared register between the REE and the TEE;
step 705, the encryption and decryption module of the TEE decrypts the code segment through a security chip arranged under the TEE, and the encryption and decryption module of the TEE sends the decrypted code segment to the TEE interaction module;
step 706, the TEE interaction module sends the decrypted code segment to the core module;
step 707, the core module overlays the decrypted code segment on the code segment in the process memory space, ends the interrupt, and the subsequent execution pointer PC2 points to the code segment to run the decrypted code segment;
when the execution pointer points to the filling code for executing the code section, the execution pointer is directly skipped without any processing.
Fig. 8 is a second schematic diagram of a method for REEs to run binary programs according to an embodiment of the present invention, as shown in the figure, the method includes:
step 801, when an execution pointer PC4 of the binary program runs to the post-stub code, triggering interruption by a running module in the REE, and entering a core module for processing;
step 802, when the core module judges that the code is a post-stub code, the core module identifies a pre-stub code to confirm the length of a code segment which is subjected to TEE processing so as to obtain the code segment;
step 803, copying the code segment in the process memory space to a kernel space by the core module, and transmitting the code segment to the TEE interaction module;
step 804, the TEE interaction module transmits the code segment to an encryption and decryption module of the TEE through a shared register between the REE and the TEE;
step 805, the encryption and decryption module of the TEE encrypts the code segment through a security chip arranged under the TEE; the encryption and decryption module of the TEE sends the encrypted code segment to the TEE interaction module;
step 806, the TEE interaction module sends the encrypted code segment to the core module;
in step 807, the core module overwrites the encrypted code segment with the processed code segment in the process memory space.
Thus, the mechanism described in fig. 8 can be used to realize that only one part of the code segment processed by TEE in the binary program executed at a certain time is in plaintext, and the mechanism can prevent the maximum length from preventing hackers from peeping and stealing the code segment through the memory.
In the embodiment of the invention, the self-defined codes (the front stub code, the rear stub code and the filling code) are set in the binary program, and if the self-defined codes are directly inserted into the source code of the binary program to calibrate the code segment to be processed by TEE, the problem of compiling and identifying can be caused, and the binary program can not be obtained. The code segment length processed by the REE and the position of the code segment length processed by the REE in the binary program are identified through the self-defined front pile code and the self-defined rear pile code, however, if the front pile code and the rear pile code are set to be the same breakpoint instruction, when a plurality of code segments needing TEE processing exist in the binary program, the code segments cannot be identified according to the set front pile code and the set rear pile code.
Therefore, in order to solve the above two problems, how to set the custom code in the compiled binary program is critical. As shown in fig. 9, fig. 9 is a flowchart of a method for compiling a binary program according to an embodiment of the present invention, which includes the following specific steps:
step 901, determining a code segment to be processed in the TEE in a source code, respectively inserting a breakpoint instruction corresponding to a front stub code, a breakpoint instruction corresponding to a filling code and a breakpoint instruction corresponding to a rear stub code into the front end, the filling position and the rear end of the code segment, and compiling to obtain a first binary program;
step 902, scanning the first binary program to obtain the breakpoint instruction, and respectively replacing the breakpoint instruction with a corresponding front stub code, a corresponding filling code and a corresponding back stub code;
and step 903, encrypting the code segment which can be processed in the TEE to obtain a second binary program.
As can be seen from fig. 9, in order to solve the problem that the custom code cannot be compiled, breakpoint instructions with different meanings are inserted into the source code by using the breakpoint instruction as a relay, where the breakpoint instruction includes breakpoint identifiers bkpt and breakpoint sequence numbers, and the breakpoint sequence numbers are sequence numbers of the inserted piles in the source code, so that it is ensured that the breakpoint sequence numbers of the front pile code and the rear pile code of the same code segment are the same, and are arranged according to the sequence of the first binary program in which the code segment is located. Here, a binary program can support 65535 instrumentation at most, that is, 65535 code segments can be inserted. In a code segment of a binary program to be processed by a TEE, the breakpoint sequence number of the padded padding code is set to a fixed value, which may be set to 0 xFFFF.
Fig. 10 is a schematic diagram of an encoding format of a breakpoint instruction according to an embodiment of the present invention. This example is illustrated by taking breakpoint sequence number 0x1234 in the breakpoint instruction as an example. The source code bkpt 0x1234 of a breakpoint instruction is converted into a binary format 0xE1212374 after being encoded, and the lower half grid area in the figure represents the breakpoint sequence number of the breakpoint instruction, which needs to be set in the corresponding custom code after being extracted.
Fig. 11 is a schematic diagram of converting a breakpoint instruction into a corresponding custom code according to an embodiment of the present invention, as shown in the figure, in the custom code, the high 4 bit of the 4 th byte is set to 0xF, because in the encoding specification of an ARM instruction (the device in the embodiment of the present invention uses an ARM system), the field of 0x7 represents an undefined instruction, and when the undefined instruction can be run by a binary program, an undefined interrupt of the system is caused to enter into a kernel module for processing. The 4 th byte has the low 4 bits set to 0x4, has no specific meaning, and can be set to other values for replacement; the 2 nd to 3 rd bytes record a sequence number within the interval of 0 to 65535, namely extracted from the corresponding breakpoint instruction; the high 4 bits of the 1 st byte are used to distinguish whether the custom code is a pre-stub code or a post-stub code, the field 0x7 indicates that the corresponding custom code is a pre-stub code, and 0xF indicates that the corresponding custom code is a post-stub code.
In the embodiment of the invention, a code segment to be processed in the TEE in the binary program needs to meet the length requirement of the code segment to be processed in the TEE, the encryption and decryption data length of the code segment needs to be set to be byte aligned, such as 16 byte aligned, but the length for encrypting the code segment has randomness. Fig. 12 is a schematic structural diagram of inserting a filling code into the code segment according to an embodiment of the present invention: the stuff code is also to be relayed by a breakpoint instruction whose breakpoint sequence number 0xFFFF is used as the characteristic identifier of the stuff code, and the high bit of the first byte is set to 0 xF.
In order to simplify instrumentation operation, the length of the code segment between the pre-stub code and the post-stub code is 4 × n, and n is a natural number, in the embodiment of the present invention, by inserting 3 padding codes, the length of which is 4 × 3, at the encrypted code position in each code segment, it can be satisfied that the length of the code segment can be supplemented to 16 byte alignment when n is any natural number.
It can be seen that the replacing of the breakpoint instruction in the embodiment of the present invention with the corresponding pre-stub code, the corresponding padding code, and the corresponding post-stub code respectively includes: and filling the breakpoint sequence number in the breakpoint instruction into the 2 nd to 3 rd bytes in the corresponding pre-pile code, filling code or post-pile code, and setting a pre-pile code identifier, a filling code identifier or a post-pile code identifier in the 1 st byte of the corresponding pre-pile code, filling code or post-pile code.
Fig. 13 is a block diagram of an apparatus for generating a second binary program by compiling according to an embodiment of the present invention, including: a pile inserting module and a scanning module, wherein,
the instrumentation module is used for determining a code segment to be processed in the TEE in a source code, inserting a breakpoint instruction corresponding to a front stub code, a breakpoint instruction corresponding to a filling code and a breakpoint instruction corresponding to a back stub code into the front end, the filling position and the back end of the code segment respectively, and compiling to obtain a first binary program;
the scanning module is used for scanning the first binary program to obtain the breakpoint instruction, and replacing the breakpoint instruction with a corresponding front stub code, a corresponding filling code and a corresponding back stub code respectively; and encrypting the code segment which can be processed in the TEE to obtain a second binary program.
In the device, the filling code enables the byte number of the code segment to meet the byte alignment requirement of an encryption and decryption algorithm adopted during TEE processing.
In the device, the plug-in module is used for identifying the breakpoint instruction by a breakpoint identifier, and includes breakpoint sequence numbers of inserted pre-pile codes, filling codes or post-pile codes, the breakpoint sequence numbers of the pre-pile codes and the post-pile codes of the same code segment are the same and are arranged according to the sequence of the first binary program in which the code segments are located, and the breakpoint sequence numbers of the filling codes are set to be fixed values;
the scanning module is further configured to, when the breakpoint instruction is replaced with the corresponding front pile code, the corresponding filling code, and the corresponding rear pile code, fill the breakpoint sequence number in the breakpoint instruction into bytes 2 to 3 of the corresponding front pile code, filling code, or rear pile code, and set a front pile code identifier, a filling code identifier, or a rear pile code identifier in byte 1 of the corresponding front pile code, filling code, or rear pile code.
Taking the breakpoint serial number of the breakpoint instruction as 0x1234 as an example, the instrumentation operation process of the breakpoint instruction is described.
Figure BDA0002552107060000121
The instrumentation operation process can be dispersed in the whole first binary program, has certain randomness for hackers, and increases the difficulty of cracking the second binary program obtained by subsequent compiling.
In the embodiment of the present invention, the scanning module is responsible for scanning the breakpoint instruction corresponding to the front stub code, the breakpoint instruction corresponding to the back stub code, and the breakpoint instruction corresponding to the padding code in the first binary program, and replacing these breakpoint instructions with corresponding custom instructions, and then replacing the code segments (including the padding instruction to ensure 16-byte alignment) between the front stub code and the back stub code with the encrypted code segments of the AES encryption algorithm.
Fig. 14 is a flowchart of a method for obtaining a second binary program by compiling after a scanning module scans a first binary program according to an embodiment of the present invention, where the first binary program is a first ELF file, and the method includes the following specific steps:
step 1401, scanning a breakpoint instruction with a breakpoint sequence number of 0xFFFF in a first ELF file;
1402, replacing the breakpoint instruction with the breakpoint sequence number 0xFFFF in the scanned first ELF file with a filling code;
step 1403, scanning a breakpoint instruction with a breakpoint sequence number smaller than the breakpoint sequence number 0xFFFF in the first ELF file, and recording the breakpoint sequence number and the position S-POS of the breakpoint instruction;
step 1404, continuing to scan the breakpoint instruction in the first ELF file, and recording the breakpoint sequence number and the position E-POS of the breakpoint instruction;
step 1405, encrypting the code segment between the position S-POS and the position E-POS by a 16-byte alignment length algorithm;
step 1406, replacing the breakpoint instruction obtained by scanning in step 1403 with a pre-stub code, and reserving a breakpoint sequence number of the pre-stub code; and replacing the breakpoint instruction obtained by scanning in the step 1404 with a post-pile code, and reserving the breakpoint serial number of the post-pile code.
It can be seen from the embodiments of the present invention that the core module in the core space in the REE is the key for implementing the embodiments of the present invention, and the core module determines the instruction entering the module and performs different operation processes according to different instructions. As shown in fig. 15, fig. 15 is a schematic diagram of a processing process of a core module in an REE according to an embodiment of the present invention, which includes the following specific steps:
step 1501, the execution module runs the binary file, identifies an undefined instruction from the binary file, interrupts the process of executing the binary program, and sends the undefined instruction to the core module for processing;
step 1502, when the core module determines that the undefined instruction is a pre-stub code, executing step 1503; if the undefined instruction is judged to be post-stub code, execute step 1509; if the undefined instruction is determined to be a stuff instruction, go to step 1515;
step 1503, the core module records the serial number index and the position s-pos of the front pile code;
step 1504, the core module searches a post-pile code of the sequence number index after the position s-pos in the process memory space, and records the position e-pos of the post-pile code;
step 1505, the core module sends the length-aligned-by-16-bytes code segment between the position s-pos and the position e-pos to the TEE interaction module;
step 1506, waiting for an interactive response between the TEE interactive module and the TEE encryption and decryption module, decrypting the code, and receiving a returned decrypted code;
step 1507, covering the decrypted code with the code in the process memory space, ending the interruption, and indicating the execution module to continue to run the code;
step 1508, skipping the executed pre-stub code, and executing the next instruction;
step 1509, the core module records the serial number index and the position e-pos of the post-pile code;
step 1510, the core module searches the pre-pile code of the sequence number index before the position e-pos in the process memory space, and records the position s-pos of the pre-pile code;
step 1511, the core module sends the length code segment aligned by 16 bytes between the position s-pos and the position e-pos to the TEE interaction module;
step 1512, waiting for an interactive response between the TEE interactive module and the TEE encryption and decryption module, encrypting the code, and receiving a returned encrypted code;
step 1513, the encrypted code is covered over the code in the process memory space, the interrupt is ended, and the execution module is instructed to continue running the binary program;
step 1514, skipping the executed post-stake code, and executing the next instruction;
step 1515, the core module does not process, skips the instruction, and executes the next instruction.
In the embodiment of the invention, the TEE interaction module mainly transmits the code to be processed by the TEE to the TEE encryption and decryption module, and the TEE encryption and decryption module completes the encryption and decryption of the code and then transmits the code back to the TEE interaction module. And the code is transferred between the TEE interaction module and the TEE encryption and decryption module through a shared register.
In the embodiment of the present invention, the TEE encryption and decryption module is an execution entity of a kernel space of the TEE, and is implemented in the TEE, and except for an interaction interface with the TEE interaction module, the TEE encryption and decryption module drives a security chip arranged in the TEE to complete an encryption and decryption operation on a code, and the structure of the TEE is shown in fig. 16. The secret key for encrypting and decrypting the code in the TEE encryption and decryption module can be implanted into the TEE encryption and decryption module or a security chip in a set security mode. For example, in the production of devices, in particular security chips.
It can be seen that, in the embodiment of the present invention, the breakpoint instruction is replaced with the custom instruction (the pre-stub code, the padding code, and the post-stub code) in a scanning manner, so that the problem of failure in compiling the binary program can be solved, and the breakpoint sequence number of the breakpoint instruction can be used as the sequence number of the second stub of the custom instruction. The embodiment of the invention solves the problem that an AES encryption and decryption algorithm adopted by TEE can only process 16-byte aligned code segments through the setting of the padding instruction. When a binary program with code segments to be processed by TEE is executed in REE, the embodiment of the invention is a dynamic process, and the code segments are decrypted when the binary program runs to a pre-stub code; when the post-stub code is run, the code segment is encrypted, the code segment in the binary program is guaranteed to be kept in an encrypted state when not executed, a hacker cannot obtain the complete decrypted code segment by peeping at any time, and the possibility that the binary program is analyzed by reverse engineering is greatly reduced. In the embodiment of the invention, when REE and TEE are interacted, a fast call mode is adopted in the kernel space, and the code segment to be processed in the TEE is transferred through the shared register in the kernel space, so that the service function of the TEE is directly called.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for implementing code hardening based on a Trusted Execution Environment (TEE), the method comprising:
running a binary program in the multifunctional running environment REE, and when running to a front stub code in the binary program, determining a code segment which is positioned between the front stub code and a rear stub code and is to be processed in the TEE by identifying the rear stub code;
sending the code segment to a TEE for decryption, and overwriting the decrypted code segment received from the TEE with the code segment in the binary program;
continuing to run the code segment in the REE, upon running to a post stub code of the code segment, determining the code segment by identifying a pre stub code of the code segment;
and after the code sections are sent to the TEE to be encrypted, the encrypted code sections received from the TEE are covered by the code sections in the binary program.
2. The method of claim 1, wherein the code segment further comprises a stuff code, the stuff code causes the number of bytes of the code segment to satisfy the byte alignment requirement of the encryption and decryption algorithm used in TEE processing;
sending the code segment into the TEE for decryption further comprises:
carrying out decryption operation on the filling code in the code section and the code to be processed in the code section;
sending the code segment to the TEE for encryption further comprises:
performing an encryption operation on the filler code in the code section together with the code to be processed in the code section.
3. The method of claim 1, wherein said obtaining said code segment further comprises, prior to:
triggering the running interruption of the binary program;
after the code segment in the overlay binary program, the method further comprises:
and ending the interruption and continuing to run the binary program.
4. The method of claim 1, wherein prior to sending the code segment into the TEE, further comprising:
establishing communication between the REE and the TEE in a kernel space;
and the REE interacts and responds with the TEE in a fast call mode, and the code segment is transferred through a shared register arranged in the kernel space.
5. A method for implementing code hardening based on TEE, the method comprising:
determining a code segment to be processed in the TEE in a source code, respectively inserting a breakpoint instruction corresponding to a front stub code, a breakpoint instruction corresponding to a filling code and a breakpoint instruction corresponding to a rear stub code into the front end, the filling position and the rear end of the code segment, and compiling to obtain a first binary program;
scanning the first binary program to obtain the breakpoint instruction, and respectively replacing the breakpoint instruction with a corresponding front stub code, a corresponding filling code and a corresponding back stub code;
and encrypting the code segment which can be processed in the TEE to obtain a second binary program.
6. The method of claim 5, wherein the padding code is such that the number of bytes of the code segment meets the byte alignment requirements of the encryption and decryption algorithm employed during TEE processing.
7. The method of claim 1, wherein the breakpoint instruction is identified by a breakpoint identifier and includes breakpoint sequence numbers of inserted pre-stub codes, padding codes or post-stub codes, the breakpoint sequence numbers of the pre-stub codes and the post-stub codes of the same code segment are the same and are arranged according to the order of the first binary program in which the code segments are located, and the breakpoint sequence number of the padding code is set to a fixed value;
the breakpoint instruction is respectively replaced by a corresponding front pile code, a corresponding filling code and a corresponding back pile code, and the breakpoint instruction comprises the following steps:
and filling the breakpoint sequence number in the breakpoint instruction into the 2 nd to 3 rd bytes in the corresponding pre-pile code, filling code or post-pile code, and setting a pre-pile code identifier, a filling code identifier or a post-pile code identifier in the 1 st byte of the corresponding pre-pile code, filling code or post-pile code.
8. A method for implementing code hardening based on TEE, wherein, in a binary program to be run, a code segment to be processed in TEE is set, the code segment comprises: pre-stake code, TEE processable code, padding code, and post-stake code, wherein,
the front stub code is arranged at the front end of the code segment and identifies the beginning of the code segment;
the filling code is arranged in the code segment, so that the byte number of the code segment meets the byte alignment requirement of an encryption and decryption algorithm adopted in TEE processing;
the post stub code is arranged at the rear end of the code segment and marks the end of the code segment;
the binary program is run in the REE.
9. The method of claim 8, wherein the binary is an encrypted executable and linkable format ELF file.
10. An apparatus for implementing code hardening based on TEE, comprising: an operation module arranged at an application layer of the REE, a core module and a TEE interaction module arranged in a kernel space of the REE, and an encryption and decryption module arranged in the kernel space of the TEE, wherein,
the running module is used for running a binary program in the REE and entering the core module for processing when running to the front stub code in the REE; continuing to run the code segment in the binary program upon ending the first interrupt; when the post-stub code of the code segment is operated, the core module is started to process; continuing to run the binary program when the second interrupt is ended;
the core module is used for triggering a first interrupt, determining the code segment which is positioned between the front stub code and the rear stub code and is to be processed in the TEE through the identified rear stub code, and sending the code segment to the TEE interaction module; overwriting the decrypted code segment received from the TEE interaction module with the running code segment, and ending the first interrupt; triggering a second interrupt, determining the code segment by identifying a pre-stub code of the code segment, and sending the code segment to the TEE interaction module; overwriting the encrypted code segment received from the TEE interaction module with the run-out code segment, and ending the second interrupt;
the TEE interaction module is used for sending the code segment to the encryption and decryption module under the first interrupt; sending the decrypted code segment returned by the encryption and decryption module to the core module; sending the code segment to the encryption and decryption module under a second interrupt; sending the encrypted code segment returned by the encryption and decryption module to the core module;
the encryption and decryption module is used for decrypting the code segment under the first interruption and returning the decrypted code segment to the TEE interaction module; and under the second interruption, the code segment is encrypted and then returned to the TEE interaction module.
CN202010580295.XA 2020-06-23 2020-06-23 TEE-based code reinforcement method and device Pending CN111737659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010580295.XA CN111737659A (en) 2020-06-23 2020-06-23 TEE-based code reinforcement method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010580295.XA CN111737659A (en) 2020-06-23 2020-06-23 TEE-based code reinforcement method and device

Publications (1)

Publication Number Publication Date
CN111737659A true CN111737659A (en) 2020-10-02

Family

ID=72650615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010580295.XA Pending CN111737659A (en) 2020-06-23 2020-06-23 TEE-based code reinforcement method and device

Country Status (1)

Country Link
CN (1) CN111737659A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318135A (en) * 2014-10-27 2015-01-28 中国科学院信息工程研究所 Java code safety dynamic loading method on basis of trusted execution environment
US9762385B1 (en) * 2015-07-20 2017-09-12 Trend Micro Incorporated Protection of program code of apps of mobile computing devices
US20180181764A1 (en) * 2016-12-27 2018-06-28 Barry E. Huntley System, apparatus and method for trusted channel creation using execute-only code
CN108446535A (en) * 2018-02-12 2018-08-24 北京梆梆安全科技有限公司 Source code reinforcement means based on code execution sequence and device
CN109960903A (en) * 2017-12-26 2019-07-02 中移(杭州)信息技术有限公司 A kind of method, apparatus, electronic equipment and storage medium that application is reinforced

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318135A (en) * 2014-10-27 2015-01-28 中国科学院信息工程研究所 Java code safety dynamic loading method on basis of trusted execution environment
US9762385B1 (en) * 2015-07-20 2017-09-12 Trend Micro Incorporated Protection of program code of apps of mobile computing devices
US20180181764A1 (en) * 2016-12-27 2018-06-28 Barry E. Huntley System, apparatus and method for trusted channel creation using execute-only code
CN109960903A (en) * 2017-12-26 2019-07-02 中移(杭州)信息技术有限公司 A kind of method, apparatus, electronic equipment and storage medium that application is reinforced
CN108446535A (en) * 2018-02-12 2018-08-24 北京梆梆安全科技有限公司 Source code reinforcement means based on code execution sequence and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘丁丽;张大方;宁佐廷;李友朋;: "基于SM1算法的文件安全机制设计与实现", 计算机应用与软件, no. 12, pages 316 - 320 *
田东海: "面向虚拟化环境的软件安全关键技术", 北京理工大学出版社, pages: 111 *

Similar Documents

Publication Publication Date Title
JP5775738B2 (en) Information processing apparatus, secure module, information processing method, and information processing program
CN101072097B (en) System and method for trusted data processing
KR101216995B1 (en) A code encryption and decryption device against reverse engineering based on indexed table and the method thereof
CN102163268B (en) The term of execution verifying software code the method and apparatus of integrality
US7299363B2 (en) Method for using shared library in tamper resistant microprocessor
JP4892167B2 (en) Digital data protection configuration
WO2002065287A1 (en) Data processing method and its apparatus
JP2006522387A (en) System and method for managing the execution of computer software
KR19990037007A (en) Security processor with external memory using block chaining and block reordering
JPH06104929A (en) Computer network of type for changing of code key of host-to-host
WO2011134207A1 (en) Method for protecting software
CN102576391A (en) Software license embedded in shell code
CN106372497B (en) Application programming interface API protection method and protection device
CN111431718B (en) TEE expansion-based computer universal security encryption conversion layer method and system
CN114547558B (en) Authorization method, authorization control device, equipment and medium
CN102799815B (en) A kind of method and apparatus of safe loading procedure storehouse
JP2007233426A (en) Application execution device
CN105975867A (en) Data processing method
JP2007310688A (en) Microcomputer and software tampering prevention method thereof
CN115442032A (en) Data processing method, system on chip and readable storage medium
CN117201120A (en) Information encryption method, device, computer equipment and storage medium
CN111737659A (en) TEE-based code reinforcement method and device
CN116841571A (en) Chip burning method and related device
JP2013045277A (en) Program obfuscation method and remote debug system
CN115688120A (en) Secure chip firmware importing method, secure chip and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination