Hello, I am using crypto-js to perform sha256 hashing on data. The algorithm works fine without key like
CryptoJS.SHA256(message).toString(CryptoJS.enc.Hex)
But when I use a key for hashing it is generating wrong data.
Here is full code
import CryptoJS from 'crypto-js';
let key = 'the shared secret key here';
let message = 'the message to hash here';
console.log(message,key)
let ans = CryptoJS.SHA256(message,key).toString(CryptoJS.enc.Hex)
console.log(ans)
What I am doing wrong?
Thank you in advance