Node.js crypto: Invalid IV length
<p>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.  &lt;&lt; rant >>I'm aware that encrypting with ECB mode should be avoided at all costs, but it still needs to work for supporting legacy systems built before World War II (when the dangers of enciphering in ECB mode were first discovered).&lt;&lt; /rant >>.</p>

<pre><code>let keyBuffer = Buffer.from("DoNotUseUTF8Keys",'utf8');
let ivBuffer = Buffer.alloc(16); // 16 bytes set to 0
//try {
try {
  let cipher = createCipheriv("AES-128-ECB", keyBuffer, ivBuffer);
} catch (e)
{
  console.log(e.message);
}
</code></pre>

<p>When createCipheriv (or createDeciperiv) is called, the node.js code throws "Invalid IV length".</p>

<p>For a 128-bit (16-byte) cipher, AES should have a 16-byte Initialization Vector (IV).</p>

<p>Is this a bug or am I doing something wrong?</p>