Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 617 Bytes

File metadata and controls

13 lines (9 loc) · 617 Bytes

HMAC Java Python Hashing

HMAC SHA256 hash generation in Java and Python

Problem:

I had code in Python that was generating hash code using HMAC SHA265 that is need to be refactored into Java

Solution:

Gone through different stackoverflow Q&A and formulated the code in Java to produce the same hash code. Code is in HMAC.java

The calculated hash code of This is the hash message with key This is the secret in base64 string is KNQ4jcjNbLkoZ0dY4n4yIQv8nHwU2ZvbB1YRN3f9CYI=.

Reference:

Took some code from https://gist.github.com/MaximeFrancoeur/bcb7fc2db08c704f322a to generate hex string value.