[英]Using HMAC-Whirlpool in Java
My program has to use HMAC-sha256
and HMAC-whirlpool
. 我的程序必须使用
HMAC-sha256
和HMAC-whirlpool
。 I use javax.crypto
for the HMAC-sha256
algorithm and it works without problems. 我将
javax.crypto
用于HMAC-sha256
算法,它可以正常工作。 But I got problems using HMAC-whirlpool
. 但是我在使用
HMAC-whirlpool
遇到了问题。 I only found whirlpool. 我只找到漩涡。 Is there a way how I can use the whirlpool library and change it to become a
HMAC-whirlpool
algorithm? 有没有一种方法可以使用漩涡库并将其更改为
HMAC-whirlpool
算法?
You can use HMacWhirpool class: 您可以使用HMacWhirpool类:
This class implements the HMAC (Keyed-Hashing for Message Authentication) algorithm as defined in RFC 2104 with WHIRLPOOL as message digest algorithm.
此类使用WHIRLPOOL作为消息摘要算法来实现RFC 2104中定义的HMAC(消息认证密钥哈希)算法。
Usage: 用法:
Mac hmac = Mac.getInstance("HMAC/WHIRLPOOL");
hmac.init(secret_key);
byte[] mac_data = hmac.doFinal(data);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.