title: Is there any difference, if I init AES cipher, with and without IvParameterSpec
body: <p>I was wondering, is there any difference, if I init AES cipher, with and without IvParameterSpec?</p>
  
  <h2>With IvParameterSpec</h2>
  
  <pre><code>SecretKeySpec skeySpec = new SecretKeySpec(key, "AES");
  Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
  cipher.init(Cipher.ENCRYPT_MODE, skeySpec, new IvParameterSpec(new byte[16]));
  </code></pre>
  
  <h2>Without IvParameterSpec</h2>
  
  <pre><code>SecretKeySpec skeySpec = new SecretKeySpec(key, "AES");
  Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
  cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
  </code></pre>
  
  <p>I tested with some sample test data, their encryption and decryption result yield the same.</p>
  
  <p>However, since I'm not the security expert, I don't want to miss out anything, and create a potential security loop hole. I was wondering, which is the correct way?</p>