Add encoding for decryption of HMAC

This commit is contained in:
adityankannan-tw
2023-07-12 16:28:09 +05:30
parent 4b9f9d5a73
commit 6010dda9a7

View File

@@ -25,9 +25,9 @@ class Storage {
const HMACofCurrentVC = CryptoJS.AES.decrypt(
encryptedHMACofCurrentVC,
encryptionKey
).toString();
const HMACofVC = CryptoJS.HmacSHA256(encryptionKey, data).toString();
).toString(CryptoJS.enc.Utf8);
const HMACofVC = CryptoJS.HmacSHA256(encryptionKey, data).toString();
if (HMACofVC === HMACofCurrentVC) {
return data;
} else {