MDN mentions that:
AES-KW does not require an initialization vector (iv)
But when I try and encrypt my content encryption key (CEK) using the key encryption key (KEK) like below Node.js Crypto createCipheriv(algorithm, key, iv[, options])
throws an error ERR_CRYPTO_INVALID_IV
. Does anyone know if AES-KW requires an iv
? The Advanced Encryption Standard (AES) Key Wrap Algorithm RFC does not mention "initialization vector" at all.
let cipherCEK = createCipheriv('aes256-wrap', keyEncryptionKey, null);
let encryptedCEK = cipher.update(contentEncryptionKey);
encryptedCEK += cipher.final(); //buffer