Bytecode
Bytecode

Reputation: 6591

JAVA -HMACSHA256

HI i need to perform HMACSHA256 encryption please help me;

 sha256 = MessageDigest.getInstance("HMACSHA1"); //I get exception in this line (No algorithm found)

Upvotes: 1

Views: 7034

Answers (2)

President James K. Polk
President James K. Polk

Reputation: 41958

Mac hmacSha256 = Mac.getInstance("hmacSHA256");

Hashing and Mac-ing are not encryption.

Upvotes: 8

Sergey Vedernikov
Sergey Vedernikov

Reputation: 7744

try:

sha256 = MessageDigest.getInstance("HMAC-SHA1");

Proof link

Upvotes: -3

Related Questions