基本硬件安全的身份认证是指通过硬件设备来验证用户或系统的身份,以确保只有授权的实体可以访问特定资源。与基于软件的身份认证方式相比,硬件安全身份具有更高的安全性,因为它通常难以被复制、篡改或绕过。

常见的硬件安全身份认证方式包括智能卡(Smart Card)、USB安全密钥(如YubiKey)、Trusted Platform Module(TPM)、Secure Element (SE)、Trusted Execution Environment (TEE)、Hardware Security Module(HSM)以及生物识别硬件等。这些设备通常内置加密芯片,用于存储私钥或执行安全操作,从而防止密钥泄露和中间人攻击。

总体而言,硬件安全身份认证通过将身份信息绑定到不可更改的物理设备上,大大提升了系统的安全性和抗攻击能力,是保护敏感数据和关键基础设施的重要手段。

Secure Element(SE)是一种基于硬件的安全芯片,旨在为敏感数据和关键操作提供一个高度安全的执行环境。它广泛应用于需要高安全性要求的场景中,如移动支付、数字身份认证、物联网设备、公共交通卡系统等。

SE 的核心功能是在一个隔离的环境中存储和处理敏感信息,例如加密密钥、证书和个人身份信息。其设计遵循国际标准(如 GlobalPlatform 标准),确保不同厂商之间的兼容性和安全性。SE 内部通常具备独立的处理器、内存和操作系统,能够运行特定的安全应用,并通过加密算法保护数据的完整性和机密性。

在智能手机中,SE 常用于支持 NFC 支付功能,如 Apple Pay 和 Google Pay。用户的银行卡信息被安全地存储在 SE 中,交易过程中密钥不会被泄露到外部系统,从而有效防止中间人攻击和数据窃取。此外,在物联网设备中,SE 可用于设备身份认证、固件更新签名验证等,增强系统的整体安全性。

SE 的物理安全性也非常高,具备抗侧信道攻击、防篡改和故障注入攻击的能力。即使设备被恶意用户物理获取,SE 也能有效保护内部数据不被非法读取或篡改。

The Secure Enclave is a dedicated secure subsystem integrated into Apple system on a chip (SoC). The Secure Enclave is isolated from the main processor to provide an extra layer of security and is designed to keep sensitive user data secure even when the Application Processor kernel becomes compromised. It follows the same design principles as the SoC does—a boot ROM to establish a hardware root of trust, an AES engine for efficient and secure cryptographic operations, and protected memory. Although the Secure Enclave doesn’t include storage, it has a mechanism to store information securely on attached storage separate from the NAND flash storage that’s used by the Application Processor and operating system.

The Secure Enclave is a hardware feature of most versions of iPhone, iPad, Mac, Apple TV, Apple Watch, Apple Vision Pro, and HomePod—namely:

  • All iPhone models starting with iPhone 5s or later
  • All iPad models starting with iPad Air or later
  • All Mac computers with Apple silicon
  • MacBook Pro computers with Touch Bar (2016 and 2017) that contain the Apple T1 Chip
  • All Intel-based Mac computers that contain the Apple T2 Security Chip
  • All Apple TV models starting with Apple TV HD or later
  • All Apple Watch models starting with Apple Watch series 1 or later
  • Apple Vision Pro
  • All HomePod models

Devices running Android 9 (API level 28) or higher can include a StrongBox KeyMint, an implementation of the KeyMint HAL that is backed by StrongBox. While hardware security modules (HSMs) broadly refer to secure key storage solutions resistant to Linux kernel compromises, StrongBox specifically denotes implementations in embedded SEs or integrated Secure Enclaves (iSE), providing stronger isolation and tamper resistance compared to the TEE.

An implementation of StrongBox KeyMint must contain the following:

  • Its own CPU
  • Secure storage
  • A true random-number generator
  • Additional mechanisms to resist package tampering and unauthorized sideloading of apps
  • A secure timer
  • A reboot notification pin (or equivalent), like general-purpose input/output (GPIO)

A subset of algorithms and key sizes are supported to accommodate low-power StrongBox implementations:

  • RSA 2048
  • AES 128 and 256
  • ECDSA, ECDH P-256
  • HMAC-SHA256 (supports key sizes between 8 bytes and 64 bytes, inclusive)
  • Triple DES
  • Extended length APDUs

StrongBox also supports key attestation.

Key attestation gives you more confidence that the keys you use in your app are stored in a device's hardware-backed keystore. The following sections describe how to verify the properties of hardware-backed keys and how to interpret the attestation certificates' extension data.

可信执行环境(Trusted Execution Environment,简称 TEE)是一种基于硬件的安全技术,旨在为敏感任务提供一个隔离且安全的执行环境。TEE 通常与设备的主操作系统(如 Android 或 Linux)并行运行,通过硬件隔离机制(如 ARM TrustZone 技术)确保其内部的数据和代码不会被外部访问或篡改。

TEE 的核心理念是“隔离即安全”。它允许在设备上同时运行两个世界:普通世界(Normal World) 和 安全世界(Secure World) 。普通世界处理常规应用,而 TEE 所在的安全世界专门用于执行高安全级别的操作,例如指纹识别、支付验证、数字版权管理(DRM)等。即使主操作系统被恶意软件感染,TEE 内部的数据和程序依然保持安全。

TEE 的功能由一组标准化 API 支持,开发者可以在其中部署“可信应用”(Trusted Applications),这些应用可以直接访问 TEE 提供的安全服务,包括加密运算、密钥管理、完整性验证等。常见的 TEE 实现方案包括 ARM TrustZone、Intel SGX(Software Guard Extensions)、AMD 的 SEV(Secure Encrypted Virtualization)等。

TEE 在移动设备、云计算、物联网等领域具有广泛应用。例如,在智能手机中,TEE 被用来保护生物识别数据(如人脸或指纹信息)不被泄露;在云环境中,TEE 可以确保敏感数据在处理时不被云服务商或其他用户窥探。

相比 Secure Element(SE),TEE 具有更高的灵活性和可编程性,但它依赖于平台的信任根和硬件实现的安全性。因此,TEE 通常作为系统级安全架构的重要组成部分,与 SE 等其他安全模块协同工作,共同构建多层次的安全防护体系。

可信平台模块(Trusted Platform Module,简称 TPM)是一种基于硬件的安全芯片,通常以独立芯片或集成于主板的形式存在于计算机、服务器或嵌入式设备中。TPM 由可信计算组织(TCG, Trusted Computing Group)定义和标准化,旨在为设备提供底层安全功能,增强系统的完整性与数据保护能力。

TPM 的核心功能包括安全密钥生成与存储、平台完整性度量、加密操作支持等。它能够生成并保护加密密钥,确保密钥不会被外部直接读取,即使系统被入侵也难以窃取关键信息。此外,TPM 支持“平台认证”机制,通过记录启动过程中的关键组件哈希值(如 BIOS、引导加载程序、操作系统内核),实现对系统完整性的验证。若检测到系统被篡改,TPM 可阻止系统启动或限制敏感操作,防止恶意软件持久化运行。

在实际应用中,TPM 被广泛用于全盘加密(如 Windows BitLocker)、身份认证、虚拟化安全、远程证明等场景。例如,在企业环境中,TPM 可用于安全地存储用户证书和密钥,实现无密码登录;在云计算中,TPM 可协助完成虚拟机的可信启动和远程验证,提升基础设施安全性。

TPM 相比于 Secure Element(SE)和 TEE 更偏向平台级信任根的建立,强调对设备整体状态的信任评估和安全保障。其优势在于标准化程度高、兼容性强,并已成为现代操作系统(如 Windows、Linux)安全架构的重要组成部分。



https://github.com/google/certtostore Github Repo Stars: google/certtostore - Hardware Backed Keys and Certificate Store Management on Windows 演示在 Windows 平台上创建并使用硬件密钥对。