自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
裝置 ID 組合引擎
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
裝置 ID 組合引擎 (DICE) 是信任運算群組 (TCG) 規格,已採用至 Android。並為啟動序列中載入的每個韌體建立一組強大且不可變更的密碼編譯身分。這些身分可讓系統從遠端驗證裝置的安全狀態,只有在 ROM 遭到入侵的情況下,才能規避這項驗證。
DICE 推導程序

圖 1. 簡化 DICE 推導程序。
DICE 衍生程序可確保任何韌體映像檔的任何變更,都會為該階段和後續每個階段產生新的專屬 ID。這是因為每個已載入的韌體階段都會評估及認證下一個階段,並產生獨特的 ID 和相關聯金鑰,以防範繞過或竄改。唯讀記憶體 (ROM) 會使用金鑰衍生函式 (KDF) 處理評估、設定和獨特裝置密鑰 (UDS),藉此衍生要載入的下一個階段密鑰。這個機密金鑰稱為複合裝置 ID (CDI)。
階段 0:初始化
DICE 程序的開始,是晶片組的 ROM 從一組不可變動資料 (通常是熔絲) 載入 UDS。在晶片製造程序中,這項 UDS 會透過密碼編譯隨機值安全地佈建。讀取 UDS 後,ROM 會使用供應商專屬的硬體鎖定機制 (例如鎖定裝置),鎖定 UDS 存取權,直到下次啟動為止。
階段 1:初始金鑰衍生
ROM 會將 UDS 做為金鑰衍生函式 (KDF) 的輸入值,產生可用於唯一識別該裝置的永久非對稱式金鑰組。它會評估下一個韌體階段,包括開機環境的中繼資料,例如是否已啟用安全啟動功能。接著,ROM 會結合 KDF 中的 UDS、韌體測量和設定資料,藉此衍生第一個 CDI,並以密碼的形式傳遞至下一個階段。
階段 2 至 n:遞迴索引鍵衍生
然後重複此程序。在後續所有階段中,前一階段的 CDI 會做為新 KDF 的輸入內容。這個 KDF 會使用 CDI 和下一個韌體映像檔的雜湊值,產生新的衍生 CDI。每個階段都會產生自己的金鑰組,並使用該金鑰組簽署憑證,其中包含階段專屬的評估資料和其他相關中繼資料。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Device Identifier Composition Engine\n\nThe Device Identifier Composition Engine (DICE) is a\n[Trusted Computing Group (TCG) specification](https://trustedcomputinggroup.org/what-is-a-device-identifier-composition-engine-dice/)\nthat has been [adopted into Android](https://pigweed.googlesource.com/open-dice/+/refs/heads/android16-release/docs/android.md).\nIt creates a set of strong, immutable cryptographic identities for each piece of firmware loaded\nduring the boot sequence. These identities enable remote verification of a device's security\nposture, which can only be evaded by compromising the ROM.\n\nDICE derivation process\n-----------------------\n\n***Figure 1.** Simplified DICE derivation process.*\n\n\nThe DICE derivation process ensures that any change to any firmware image results in a new unique\nidentifier for that stage and every stage thereafter. This is because each loaded firmware stage\nmeasures and certifies the next, generating unique identities and associated keys that prevent\nbypassing or tampering. The [read-only memory (ROM)](https://en.wikipedia.org/wiki/Read-only_memory)\nprocesses the measurement, configuration, and unique device secret (UDS) with a key derivation\nfunction (KDF) to derive the secret for the next stage to be loaded. This secret is referred to as\na compound device identifier (CDI).\n\n### Stage 0: Initialization\n\n\nThe DICE process begins with the chipset's ROM loading the UDS from a bank of immutable data,\ntypically fuses. This UDS is securely provisioned with a cryptographically random value during the\nchip production process. After reading the UDS, the ROM uses a vendor-dependent hardware-locking\nmechanism such as a latch to lock UDS access until the next boot.\n\n### Stage 1: Initial key derivation\n\n\nThe ROM uses the UDS as input to a [key derivation function (KDF)](https://en.wikipedia.org/wiki/Key_derivation_function)\nto generate the permanent asymmetric key pair that uniquely identifies that device. It measures\nthe next firmware stage, including metadata about the boot environment such as whether secure boot\nis enabled. The ROM then combines the UDS, firmware measurement, and configuration data in the KDF\nto derive the first CDI, which is passed to the next stage as a secret.\n\n### Stage 2 to n: Recursive key derivation\n\n\nThe process then repeats. In all subsequent stages, the CDI from the previous stage serves as the\ninput for a new KDF. This KDF uses the CDI and the hash of the next firmware image to produce a\nnew derived CDI. Each stage generates its own key pair and uses it to sign a certificate\ncontaining stage-specific measurements and other associated metadata."]]