Score:2

HMAC SHA256 walkthrough examples

bs flag

I'm trying to implement HMAC SHA256 (I've implemented SHA256 successfully).

I am trying to find examples where they show the results after each HMAC stage (XOR, append, H etc).

Does anyone know of any resources which contain examples with the results from each step?

Maarten Bodewes avatar
in flag
"Date" is just the singular form of "data" here, derived from the Latin "datum": *a given, or that which we take for granted and use as the basis of our calculations*. It's not a date in the temporal sense.
Paul Uszak avatar
cn flag
I've found the basic wiki [page](https://en.wikipedia.org/wiki/HMAC) to be sufficient as it has the workflow. And you can verify against the test inputs. It's really not that hard if you use a proven version of the hash rather than writing that bit yourself.
DannyNiu avatar
vu flag
@MaartenBodewes-onstrike I'm pretty sure it's a typo, and "Input data" is what's intended. (Datum is the singular form of data btw.)
ye flag
You can get test data from the [Nist](https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/example-values), see [here for HMAC-SHA256](https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA256.pdf).
Score:3
za flag

When I have been in this situation, I have found it helpful to find someone else's implementation, and instrument it with print statements. It's not clear what langauge you are using, but it never hurts to get exposed to a new one anyway :). Take this example in C perhaps? https://github.com/h5p9sl/hmac_sha256/blob/master/hmac_sha256.c

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.