1# Key Generation Overview and Algorithm Specifications 2 3You can use the HUKS APIs to generate a key randomly and store the key in HUKS. 4> **NOTE**<br> 5> Key aliases must not contain sensitive information, such as personal data. 6 7- Random generation: HUKS uses a cryptographically secure pseudorandom number generator (PRNG) to generate keys. The PRNG helps improve the randomness, unpredictability, and non-reproducibility of the keys, making the generated keys difficult to infer. 8 9- Secure storage: Except the public keys in asymmetric key pairs, the keys generated by HUKS can be used only in the secure storage area throughout their lifecycle (from generation to destruction). In addition, the generated key file cannot be directly accessed by any service except HUKS. Even the services that generate the keys can perform key operations and obtain the operation result only using the HUKS APIs. 10 11 12## Supported Algorithms 13 14The following table lists the supported key generation specifications. 15<!--Del--> 16The 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. 17 18**You are advised to use mandatory specifications in your development for compatibility purposes.** 19<!--DelEnd--> 20 21| Algorithm| Supported Key Length (Bit)| API Version| <!--DelCol4-->Mandatory| 22| -------- | -------- | -------- | -------- | 23| AES | 128, 192, 256| 8+ | Yes| 24| <!--DelRow-->RSA | 512, 768, 1024| 8+ | No| 25| RSA | 2048, 3072, 4096| 8+ | Yes| 26| HMAC | An integer multiple of 8, ranging from 8 to 1024 (inclusive)| 8+ | Yes| 27| <!--DelRow-->ECC | 224 | 8+ | No| 28| ECC | 256, 384, 521| 8+ | Yes| 29| ED25519 | 256 | 8+ | Yes| 30| X25519 | 256 | 8+ | Yes| 31| <!--DelRow-->DSA | An integer multiple of 8, ranging from 512 to 1024 (inclusive) | 8+ | No| 32| DH | 2048 | 8+ | Yes| 33| <!--DelRow-->DH | 3072, 4096| 8+ | No| 34| SM2 | 256 | 9+ | Yes| 35| SM4 | 128 | 9+ | Yes| 36 37> **NOTE**<br> 38> The DH algorithm uses the FFDHE named safe prime groups. 39