A trusted execution environment (TEE) is a secure area of a main processor. It protects code and data loaded inside with respect to confidentiality and integrity. Data integrity—prevents unauthorized entities from altering data when any entity outside the TEE processes data, Code integrity—the code in the TEE cannot be replaced or modified by unauthorized entities.