79247503

Date: 2024-12-03 12:02:23
Score: 0.5
Natty:
Report link

Turns out I accidentally swapped the ikm and salt arguments in the NodeJS code, here is the corrected code:

import crypto from 'crypto';

const input = Buffer.from("helloworld");
const salt = Buffer.alloc(32, 0); // Explicit salt

const output = crypto.hkdfSync('sha256', input, salt, Buffer.alloc(0), 48); // Correct use of `input` as IKM

console.log(Buffer.from(output).toString("hex"));
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: ZeroByter