Introduction to HMAC algorithm and calculation process

1. Application of
HMAC algorithm : At present, the HMAC algorithm is mainly used in the authentication process of the server to the visitor.
2. Introduction to
HMAC algorithm: HMAC is the abbreviation of Hash-based Message Authentication Code related to the key. The H in HMAC refers to the Hash hash algorithm. HMAC can use a variety of single-item hash formulas. For example, SHA-1 is used to form HMAC-1, and SHA-256 hash algorithm is used to form HMAC-256.
3. Calculation steps:
see the figure below for details.
Introduction to HMAC algorithm and calculation process
Supplementary explanation:
(1) If the key is shorter than the one-way hash function group length, it needs to be filled with 0 at the end until its length reaches the one-way hash function group length.
If the key is longer than the packet length, a one-way hash function is used to find the hash value of the key, and then this hash value is used as the HMAC key.
(2) ipad is a loop of 00110110 until the packet length of the single-item hash function is reached.
opad is a loop of 01011100 until the packet length of the single-item hash function is reached.

Summary: Some users will apply HMAC algorithm to embedded copyright protection, that is, MCU and encryption chip complete authentication based on HMAC algorithm, and some users will apply it to remote login authentication, storing the key in the encryption chip of the terminal device In, after starting the network, the identity authentication with the background server is completed based on the encryption chip. Lingke can flexibly set the algorithm in the encryption chip according to different customer needs. In addition to HMAC, it can also support various encryption and decryption, signature verification algorithms such as 3DES, AES, RSA, ECC, and national secret SM2. It is protected by the software and hardware of the security chip. Mechanism to implement security protection for keys used by HMAC or other algorithms to ensure the security of key storage and operation. At the same time, the hardware coprocessor is used to accelerate the algorithm and improve the computing performance.

Guess you like

Origin blog.51cto.com/15047354/2562150