HMAC散列算法

HMAC是密钥相关的哈希运算消息认证码(Hash-based Message Authentication Code),HMAC运算利用哈希算法,以一个密钥和一个消息为输入,生成一个消息摘要作为输出。

它同时兼具MD和SHA的算法特性,并在这个基础上加上了密钥。

guava中定义了的方法有:

基本的用法:

Hashing.hmacMd5("keys".getBytes()).newHasher().putBytes("abc".getBytes()).hash().toString();

results matching ""

    No results matching ""