title: Java AES with 32 bytes length initialize vector
body: <p>I want to recive same encrypting result by using AES with PHP and JAVA 
  but in PHP <code>mcrypt</code> need 32 bytes length Initialize vector and in Java i can use only 16 bytes length IV (<code>Exception in thread "main" java.security.InvalidAlgorithmParameterException: Wrong IV length: must be 16 bytes long</code>)even with unlimited strength policy how coudl i make compatible Java AES with PHP ?</p>
  
  <pre><code>$cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', 'ctr', '');
  $iv_size = mcrypt_enc_get_iv_size($cipher);
  
  $key = '***';
  $iv =  hex2str('00000001040506070000000000000001');
  
  
  // Encrypt
  if (mcrypt_generic_init($cipher, $key, $iv) != -1)
  {
      $encrypted = mcrypt_generic($cipher, $text);
      mcrypt_generic_deinit($cipher);
  
      echo '&lt;strong&gt;After encryption:&lt;/strong&gt; ' . bin2hex($encrypted) . '&lt;br /&gt;';
  }
  </code></pre>
  
  <p>in java im using <code>encryptCipher =
                 Cipher.getInstance("AES/CTR/PKCS5Padding")</code></p>