title: Proper openssl_encrypt and openssl_decrypt
body: <p>I'm having a few issues with <code>openssl_*</code> functions in <code>PHP</code>:</p>
  
  <p>For some reason the <code>PHP</code> page (<a href="http://php.net/manual/en/function.openssl-encrypt.php" rel="nofollow">http://php.net/manual/en/function.openssl-encrypt.php</a>) says that the <code>$options</code> parameter can be one of these <code>OPENSSL_RAW_DATA</code> <code>OPENSSL_ZERO_PADDING</code></p>
  
  <p>When I encrypt data using <code>OPENSSL_ZERO_PADDING</code> however it shows blank fields.</p>
  
  <pre><code>$passphrase = md5( 'lolhaha' );
  $iv                 = md5( 'cheese' );
  
  $enc = openssl_encrypt( "Hello World!", "aes-256-cbc", $passphrase, OPENSSL_ZERO_PADDING, $iv );
  echo $enc . "{ENC}";
  
  echo ' --------- ';
  
  $dec = openssl_decrypt( $enc, "aes-256-cbc", $passphrase, OPENSSL_ZERO_PADDING, $iv );
  echo $dec . "{DEC}";
  </code></pre>
  
  <p>However, if I use <code>OPENSSL_RAW_DATA</code> it works fine. Now, when using <code>false</code> in that field it works too, but returns <code>base64</code> is this because i'm using an older version of <code>PHP</code> maybe and it's still using <code>bool $raw_output</code>? Is <code>int $option OPENSSL_ZERO_PADDING</code> the same as <code>bool $raw_output false</code>?</p>
  
  <p>Also, I'm getting the message that my <code>IV</code> is too long for the cipher i'm using; it should be 16 bytes apparently. According to <code>OpenSSL</code> (<a href="https://www.openssl.org/docs/apps/enc.html" rel="nofollow">https://www.openssl.org/docs/apps/enc.html</a>) the <code>$iv</code> and <code>$passphrase</code> (the <code>key</code> according to <code>biohazard</code> on <code>PHP</code> (<a href="http://php.net/manual/en/function.openssl-encrypt.php" rel="nofollow">http://php.net/manual/en/function.openssl-encrypt.php</a>)) should be of hex-digit values, is <code>md5</code> proper for that? How many bytes can the <code>passphrase/key</code> be?</p>
  
  <p>Errr, in other words, how do you use this encryption properly? //Confused</p>