• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Key Derivation Overview and Algorithm Specifications
2
3<!--Kit: Universal Keystore Kit-->
4<!--Subsystem: Security-->
5<!--Owner: @wutiantian-gitee-->
6<!--Designer: @HighLowWorld-->
7<!--Tester: @wxy1234564846-->
8<!--Adviser: @zengyawen-->
9
10To stretch keys into longer keys or to obtain keys in the required format, you can use the HUKS APIs to derive one or more secrete keys from a key (base key) by using a pseudorandom function.
11
12> **NOTE**<br>
13> * In HUKS, only the keys managed by HUKS can be used for key derivation.
14> * Key derivation is not supported<!--RP2--> by mini-system devices<!--RP2End-->.
15> * Using an existing key alias as the alias of the key generated from derivation will overwrite the existing key.
16
17## Supported Algorithms
18
19The following table lists the supported key derivation specifications.
20<!--Del-->
21The key management service specifications include mandatory specifications and optional specifications. Mandatory specifications are algorithm specifications that must be supported. Optional specifications can be used based on actual situation. Before using the optional specifications, refer to the documents provided by the vendor to ensure that the specifications are supported.
22
23**You are advised to use mandatory specifications in your development for compatibility purposes.**
24<!--DelEnd-->
25
26A derived key is the key session result obtained using the Init-Update-Finish mechanism. It can be managed by HUKS (the key is always in a [TEE](huks-concepts.md)) or independently managed by the service based on service requirements.
27
28> **NOTE**<br>
29> PBKDF2 and HKDF do not support derivation based on non-HUKS-managed keys, for example, user passwords. For details about key escrow, see [Key Import Overview and Algorithm Specifications](huks-key-import-overview.md).
30
31| Algorithm/MD| Algorithm/Length of the Base Key| Available Algorithm/Length of the Derived Key| API Version| <!--DelCol5-->Mandatory|
32| -------- | -------- | -------- | -------- | -------- |
33| HKDF/SHA256 | AES/192-256 | AES/128/192/256<br>HMAC/8-1024<br>SM4/128 | 8+ | Yes|
34| HKDF/SHA384 | AES/256 | AES/128/192/256<br>HMAC/8-1024<br>SM4/128 | 8+ | Yes|
35| HKDF/SHA512 | AES/256 | AES/128/192/256<br>HMAC/8-1024<br>SM4/128 | 8+ | Yes|
36| PBKDF2/SHA256 | AES/192-256 | AES/128/192/256<br>HMAC/8-1024<br>SM4/128 | 8+ | Yes|
37| PBKDF2/SHA384 | AES/256 | AES/128/192/256<br>HMAC/8-1024<br>SM4/128 | 8+ | Yes|
38| PBKDF2/SHA512 | AES/256 | AES/128/192/256<br>HMAC/8-1024<br>SM4/128 | 8+ | Yes|
39<!--RP1--><!--RP1End-->
40