harmony 鸿蒙HMAC Overview and Algorithm Specifications

  • 2025-06-12
  • 浏览 (4)

HMAC Overview and Algorithm Specifications

A message authentication code (MAC) is used for verifying the authenticity and integrity of information transmitted or stored on unreliable media. A hash-based message authentication code (HMAC) is a MAC involving a cryptographic has function and a secret cryptographic key. The HMAC can be used with any cryptographic hash function, such as MD5 and SHA-1. The universal keystore supports the use of HMAC with mainstream message digest (MD) algorithms.

Supported Algorithms

The following table lists the HMAC specifications supported by the system. The 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.

NOTE
You are advised to use mandatory specifications in your development for compatibility purposes.

MD Algorithm Supported Key Length (Bit) API Version Mandatory
MD5, SHA-1, SHA-224 8 to 1024 8+ No
SHA-256 192 to 1024 8+ Yes
SHA-384, SHA-512 256 to 1024 8+ Yes
SM3 8 to 4096 8+ Yes

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Universal Keystore Kit (Key Management Service)

harmony 鸿蒙Specifying the User for Key Operations (for System Applications Only)

harmony 鸿蒙Checking a Key (ArkTS)

harmony 鸿蒙Checking a Key (C/C++)

harmony 鸿蒙Basic Concepts of HUKS

harmony 鸿蒙Deleting a Key (ArkTS)

harmony 鸿蒙Deleting a Key (C/C++)

harmony 鸿蒙Encryption and Decryption (ArkTS)

harmony 鸿蒙Encryption and Decryption (C/C++)

harmony 鸿蒙Encryption and Decryption Overview and Algorithm Specifications

0  赞