title: What is the default IV when encrypting with aes_256_cbc cipher?
body: <p>I've generated a random 256 bit symmetric key, in a file, to use for encrypting some data using the OpenSSL command line which I need to decrypt later programmatically using the OpenSSL library. I'm not having success, and I think the problem might be in the initialization vector I'm using (or not using).</p>
  
  <p>I encrypt the data using this command:</p>
  
  <pre><code>/usr/bin/openssl enc -aes-256-cbc -salt -in input_filename -out output_filename -pass file:keyfile
  </code></pre>
  
  <p>I'm using the following call to initialize the decrypting of the data:</p>
  
  <pre><code>EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(), nullptr, keyfile.data(), nullptr))
  </code></pre>
  
  <p><code>keyfile</code> is a <code>vector&lt;unsigned char&gt;</code> that holds the 32 bytes of the key. My question is regarding that last parameter. It's supposed to be an initialization vector to the cipher algorithm. I didn't specify an IV when encrypting, so some default must have been used. </p>
  
  <p>Does passing nullptr for that parameter mean "use the default"? Is the default null, and nothing is added to the first cipher block?</p>
  
  <p>I should mention that I'm able to decrypt from the command line without supplying an IV.</p>