You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following node.js code attempts to create a cipher using AES 128 in ECB mode with an initialization vector (IV) filled with 0 bytes.
let keyBuffer = Buffer.from("DoNotUseUTF8Keys",'utf8');
let ivBuffer = Buffer.alloc(16); // 16 bytes set to 0
try {
let cipher = createCipheriv("AES-128-ECB", keyBuffer, ivBuffer);
} catch (e)
{
console.log(e.message);
}
When createCipheriv (or createDeciperiv) is called, the node.js code throws "Invalid IV length".
For a 128-bit (16-byte) cipher, AES should have a 16-byte Initialization Vector (IV), so I do not understand why the parameter would yield an exception. (Regardless of whether I'm in error, it would sure be nice to see an exception thrown which says what the correct length is.)
The text was updated successfully, but these errors were encountered:
The following node.js code attempts to create a cipher using AES 128 in ECB mode with an initialization vector (IV) filled with 0 bytes.
When createCipheriv (or createDeciperiv) is called, the node.js code throws "Invalid IV length".
For a 128-bit (16-byte) cipher, AES should have a 16-byte Initialization Vector (IV), so I do not understand why the parameter would yield an exception. (Regardless of whether I'm in error, it would sure be nice to see an exception thrown which says what the correct length is.)
The text was updated successfully, but these errors were encountered: