Trusted execution environment
A trusted execution environment (TEE) is a secure area of a main processor. It guarantees code and data loaded inside to be protected with respect to confidentiality and integrity[clarification needed]. A TEE as an isolated execution environment provides security features such as isolated execution, integrity of applications executing with the TEE, along with confidentiality of their assets. In general terms, the TEE offers an execution space that provides a higher level of security for trusted applicationsTemplate:For whom than a rich operating system (OS) and more functionality than a 'secure element' (SE).
Open Mobile Terminal Platform (OMTP) first defined TEE in their "Advanced Trusted Environment:OMTP TR1" standard, defining it as a "set of hardware and software components providing facilities necessary to support Applications" which had to meet the requirements of one of two defined security levels. The first security level, Profile 1, was targeted against only software attacks and while Profile 2, was targeted against both software and hardware attacks.
Commercial TEE solutions based on ARM TrustZone technology which conformed to the TR1 standard such as Trusted Foundations, developed by Trusted Logic, were later launched.
The OMTP standards, including those defining a TEE, are hosted by GSMA.
The TEE is a standard which creates an isolated environment that runs in parallel with the operating system, providing security for the rich environment. It is intended to be more secure than the User-facing OS. ARM TrustZone TEE is an implementation of the TEE standard. TrustZone TEE is a hybrid approach that utilizes both hardware and software to protect data.  It therefore offers a level of security sufficient for many applications. Only trusted applications running in a TEE have access to the full power of a device's main processor, peripherals and memory, while hardware isolation protects these from user installed apps running in a main operating system. Software and cryptographic isolation inside the TEE protect the trusted applications contained within from each other.
Service providers, mobile network operators (MNO), operating system developers, application developers, device manufacturers, platform providers and silicon vendors are the main stakeholders contributing to the standardization efforts around the TEE.
To prevent simulation of hardware with user-controlled software, a so-called "hardware root of trust" is used. This is a set of private keys (so-called "endorsement keys" or "provisioned secrets") which are embedded directly into the chip during manufacturing (one-time programmable memory such as eFuses are usually used, despite the large area on the chip they take), cannot be changed, and whose public counterparts reside in a manufacturer database, together with a non-secret hash of a public key belonging to the trusted party (usually a chip vendor) which is used to sign trusted firmware alongside the circuits doing cryptographic operations and controlling access. The hardware is designed in a way which prevents all software not signed by the trusted party's key from accessing the privileged features. The public key of the vendor is provided at runtime and hashed; this hash is then compared to the one embedded in the chip. If the hash matches, the public key is used to verify a digital signature of trusted vendor-controlled firmware (such as a chain of bootloaders on Android devices or 'architectural enclaves' in SGX). The trusted firmware is then used to implement remote attestation.
An untrusted component of an application required to be attested loads the trusted one into memory. The trusted application is protected from modification by untrusted components with hardware. A nonce is requested by the untrusted party from verifier's server, and is used as a part of a cryptographic authentication protocol, proving integrity of the trusted application. The proof is passed to the verifier, which verifies it. A valid proof cannot be computed in a simulated hardware (i.e. QEMU) because in order to construct it, access to the keys baked into hardware is required; only trusted firmware has access to these keys and/or the keys derived from them or obtained using them. Because only the platform owner is meant to have access to the data recorded in the foundry, the verifying party must interact with the service set up by the vendor. If the scheme is implemented improperly, the chip vendor can track which applications are used on which chip and selectively deny service by returning a message indicating that authentication has not passed.
To simulate hardware in a way which enables it to pass remote authentication, an attacker would have to extract keys from the hardware, which is costly because of equipment and reverse-engineering skills required (focused ion beam, scanning electron microscope, microprobing, decapsulation) or even impossible, if the hardware is designed in such a way that reverse-engineering destroys the keys. In some cases, the keys are unique for each piece of hardware, so that a key extracted from one chip is useless for another ones.
Though deprivation of ownership is not an inherent property of TEEs (it is possible to design the system in a way that allows only the user who has obtained ownership of the device first to control the system), in practice all such systems in consumer electronics are intentionally designed so as to allow chip manufacturers to control access to attestation and its algorithms. It allows manufacturers to grant access to TEEs only to software developers who have a (usually commercial) business agreement with the manufacturer, and to enable such use cases as tivoization and DRM.
There are a number of use cases for the TEE. Though not all possible use cases exploit the deprivation of ownership, TEE is usually used exactly for this.
Premium Content Protection/Digital Rights Management
Note: Much TEE literature covers this topic under the definition "premium content protection" which is the preferred nomenclature of many copyright holders. Premium content protection is a specific use case of Digital Rights Management (DRM), and is controversial among some communities, such as the Free Software Foundation. It is widely used by copyrights holders to restrict the ways in which end users can consume content such as 4K high definition films.
The TEE is a suitable environment for protecting digitally encoded information (for example, HD films or audio) on connected devices such as smart phones, tablets and HD televisions. This suitability comes from the ability of the TEE to deprive owner of the device from reading stored secrets, and the fact that there is often a protected hardware path between the TEE and the display and/or subsystems on devices.
The TEE is used to protect the content once it is on the device: while the content is protected during transmission or streaming by the use of encryption, the TEE protects the content once it has been decrypted on the device by ensuring that decrypted content is not exposed to the environment not approved by app developer OR platform vendor.
Mobile financial services
Mobile Commerce applications such as: mobile wallets, peer-to-peer payments, contactless payments or using a mobile device as a point of sale (POS) terminal often have well-defined security requirements. TEEs can be used, often in conjunction with near field communication (NFC), SEs and trusted backend systems to provide the security required to enable financial transactions to take place.
In some scenarios, interaction with the end user is required, and this may require the user to expose sensitive information such as a PIN, password or biometric identifier to the mobile OS as a means of authenticating the user. The TEE optionally offers a trusted user interface which can be used to construct user authentication on a mobile device.
The TEE is well-suited for supporting biometric ID methods (facial recognition, fingerprint sensor and voice authorization), which may be easier to use and harder to steal than PINs and passwords. The authentication process is generally split into three main stages:
- Storing a reference "template" identifier on the device for comparison with the "image" extracted in next stage.
- Extracting an "image" (scanning the fingerprint or capturing a voice sample, for example).
- Using a matching engine to compare the "image" and the "template".
A TEE is a good area within a mobile device to house the matching engine and the associated processing required to authenticate the user. The environment is designed to protect the data and establish a buffer against the non-secure apps located in mobile OS. This additional security may help to satisfy the security needs of service providers in addition to keeping the costs low for handset developers.
Enterprise, government, and cloud
The TEE can be used by governments, enterprises, and cloud service providers to enable the secure handling of confidential information on mobile devices and on server infrastructure. The TEE offers a level of protection against software attacks generated in the mobile OS and assists in the control of access rights. It achieves this by housing sensitive, ‘trusted’ applications that need to be isolated and protected from the mobile OS and any malicious malware that may be present. Through utilizing the functionality and security levels offered by the TEE, governments and enterprises can be assured that employees using their own devices are doing so in a secure and trusted manner. Likewise, server-based TEEs help defend against internal and external attacks against backend infrastructure.
Secure modular programming
With the rise of software assets and reuses, modular programming is the most productive process to design software architecture, by decoupling the functionalities into small independent modules. As each module contains everything necessary to execute its desired functionality, the TEE allows to organize the complete system featuring a high level of reliability and security, while preventing each module from vulnerabilities of the others.
In order for the modules to communicate and share data, TEE provide means to securely have payloads sent/received between the modules, using mechanisms such as objects serialization, in conjunction with proxies.
The following hardware technologies can be used to support TEE implementations:
- Open Mobile Terminal Platform
- Trusted Computing Group
- FIDO Alliance
- Java Card
- Intel Management Engine
- Next-Generation Secure Computing Base
- "Trusted Execution Environment, millions of users have one, do you have yours?". 2014-02-18. https://poulpita.com/2014/02/18/trusted-execution-environment-do-you-have-yours/. Retrieved 2017-05-17.
- Ram Kumar Koppu (26 October 2013). "The benefits of Trusted Execution Environment (TEE)". YouTube. https://www.youtube.com/watch?v=PmtQtWpfW3w.
- "Omtp Hardware Requirements And Defragmentation". http://www.gsma.com/newsroom/wp-content/uploads/2012/03/omtpadvancedtrustedenvironmentomtptr1v11.pdf. Retrieved 2017-05-17.
- "OMTP announces final documents prior to transition into Wholesale Application Community". http://www.mobileeurope.co.uk/Press-Wire/omtp-announces-final-documents-prior-to-transition-into-wholesale-application-community.
- "OMTP documents". May 2012. http://www.gsma.com/newsroom/gsmadocuments/omtp-documents/. Retrieved 12 September 2014.
- Sabt, M; Achemlal, M; Bouabdallah, A (2015). "Trusted Execution Environment: What It Is, and What It Is Not". 2015 IEEE Trustcom/BigDataSE/ISPA. IEEE. pp. 57–64. doi:10.1109/Trustcom.2015.357. ISBN 978-1-4673-7952-6. https://hal.archives-ouvertes.fr/hal-01246364/file/trustcom_2015_tee_what_it_is_what_it_is_not.pdf.
- Lee, S; Lee, JH (2018). "TEE based session key establishment protocol for secure infotainment systems". Design Automation for Embedded Systems (Springer) 22 (3): 215–224. doi:10.1007/s10617-018-9212-5.
- "Solutions - Trustonic- Securing Smart Devices & Mobile Applications". https://www.trustonic.com/products-services/trusted-execution-environment.
- "Digital Restrictions Management and Treacherous Computing Free Software Foundation working together for free software". https://www.fsf.org/campaigns/drm.html. Retrieved 2019-08-20.
- "AMD Secure Processor (Built-in technology)". https://www.amd.com/en-us/innovations/software-technologies/security.
- "Secure Hardware and the Creation of an Open Trusted Ecosystem". https://classic.regonline.com/custImages/360000/369552/TCC%20PPTs/TCC2013_VanDoorn.pdf. Retrieved 2017-05-17.
- Chiappetta, Marco (2014-04-29). "AMD Beema and Mullins Low Power 2014 APUs Tested - Page 2". HotHardware. http://hothardware.com/Reviews/AMD-Beema-and-Mullins-Mainstream-and-LowPower-2014-APUs-Tested/?page=2#!bFIw4K. Retrieved 2017-05-17.
- "ARM TrustZone Software - Open Virtualization FAQ". http://www.openvirtualization.org/open-source-arm-trustzone.html.
- "GlobalPlatform based Trusted Execution Environment and TrustZone Ready". https://community.arm.com/cfs-file/__key/telligent-evolution-components-attachments/01-2142-00-00-00-00-51-36/GlobalPlatform-based-Trusted-Execution-Environment-and-TrustZone-R.pdf.
- "IBM Secure Service Container". https://www.ibm.com/us-en/marketplace/secure-service-container.
- "Family 2965+01 IBM z13s Models N10 and N20". https://www-01.ibm.com/common/ssi/ShowDoc.wss?docURL=/common/ssi/rep_sm/1/877/ENUS2965-_h01/index.html&lang=en&request_locale=en.
- "Technical overview of Secure Execution for Linux on IBM Z". https://developer.ibm.com/blogs/technical-overview-of-secure-execution-for-linux-on-ibm-z/.
- "The Trusted Execution Environments on Mobile Devices". http://www.cs.helsinki.fi/group/secures/CCS-tutorial/tutorial-slides.pdf. Retrieved 2017-05-17.
- "WW46_2014_MCG_Tablet_Roadmap_图文_百度文库". http://wenku.baidu.com/view/cb01a885c8d376eeaeaa31a9.html.
- "CyanogenMod/android_device_asus_mofd-common". https://github.com/CyanogenMod/android_device_asus_mofd-common/blob/b52bb27be47485df8646340b43a97f2dda974385/sepolicy/file.te.
- "heidiao/sfp_m2_bt". https://github.com/heidiao/sfp_m2_bt/blob/master/source/device/intel/cherrytrail/cht_cr_rvp/init.rc.
- "Hex Five Security Adds MultiZone™ Trusted Execution Environment to the SiFive Software Ecosystem". https://hex-five.com/press/hex-five-adds-multizone-security-to-sifive-software-ecosystem. Retrieved 2018-09-13.
- "Keystone Paper and Customizable TEEs". https://keystone-enclave.org/2019/07/22/Keystone-Paper.html. Retrieved 2020-05-17.
Original source: https://en.wikipedia.org/wiki/ Trusted execution environment. Read more