I try to implement the MYRA Security Authentication for the API. The problem, is that the have a terrible authentication mechanism….
In the example/pseudo code they provide:
/**
* For example, if: secret is: 6b3a71954faf11e4b898001517fa8424
* then dateKey will be 1c2a270750de0cc1b8c3522494abd9a04e0b7801be6ece02755fa7bc9f8f5467
*/
dateKey := hmac_sha256("2014-04-26T13:04:00+0100", "MYRA" + secret)
I need generate the output “1c2a270750de0cc1b8c3522494abd9a04e0b7801be6ece02755fa7bc9f8f5467”, but my code gives me “1163917e9f9ed82b86bb46ba06bb0d636e7ab54423b7a1e9166ac4833a32a822” instead.
My node.js implementation:
const crypto = require("crypto");
console.log(crypto.createHmac('sha256', "MYRA6b3a71954faf11e4b898001517fa8424").update("2014-04-26T13:04:00+0100").digest('hex'))
Any idea/hint what my result is wrong?