

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 7
click for more info
Not enough gems
Cost: 6 gems
1: What Is a Message Integrity?
incomplete
2: Message Authentication Code (MAC)
incomplete
3: Message Authentication Code (MAC)
incomplete
4: Hash-Based Message Authentication Code
incomplete
5: Toy HMAC
incomplete
6: MACs and JWTs
incomplete
7: Asymmetric JWTs
incomplete
8: Asymmetric JWT Review
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
At Passly, we use HMACs to authenticate messages between our internal servers when they need to make requests to each other over the public internet.
To demonstrate to our Luddite manager why we should use an open-source crypto library instead of writing our own HMAC implementation, we decided to write our own and then prove its inferiority. Hopefully we don't get fired instead of getting our way.
Complete the hmac function. It should:
sha256(keyFirstHalf + sha256(keySecondHalf + message)) as a string in lowercase hexCast strings directly to slices of bytes and don't use any delimiters when concatenating the data.