MAC and HMAC

来源:互联网 发布:《算法》第4版是java吗 编辑:程序博客网 时间:2024/05/16 00:38

MAC, (message authentication code), just a personal digest algorithm with a secret key.

HMAC, just a MAC with standard digest algorithm. Hashed twice. The secret key just do XOR operation.

Drawback of MAC:

a), hard to maintain 1 to n connection.

b), secret key exchange.

c), can’t provide strong authentication mechanism. Each side that holds the secret key can use the identity.

 

Advantage of MAC:

Provide a better way to do hash. Only the one who holds the secret key can digest the plain data.