{ "data": "bea4343c5d815cba55c6e1bcb835bcbea43432abc014f7b48a63....", "iv": "1aa8ebae81e116621251993df3b155d4" }
Converts the hexadecimal IV to a byte buffer
const key = Buffer.from(WEBHOOK_SHARED_SECRET_ENCRYPTION_KEY, "base64"); if (key.length !== 32) { throw new Error("Encryption key must be 256 bits (32 bytes)"); }
const ivBuffer = Buffer.from(iv, "hex");
Decryption
const decipher = crypto.createDecipheriv("aes-256-cbc", key, ivBuffer);
let decrypted = decipher.update(data, "hex", "utf8"); decrypted += decipher.final("utf8");