title: Cryptography libraries conflict (MCrypt, libgcrypt)
body: <p>I'm trying to perform encryption and decryption (Rijndael 256, ecb mode) in two different components:<br>
  1. PHP - Server Side (using mcrypt)<br />
  2. C + + - Client Side (using gcrypt)<br /></p>
  
  <p>I ran into a problem when the client side could not decrypt correctly the encrypted data (made by the server side)<br>
  so... i checked the:<br />
  1. initial vector - same same (32 length) <br />
  2. the key - again the same key on both sides..<br /></p>
  
  <p>so i wrote some code in C++ that will encrypt the data (with the same parameters like in the php)<br />
  and i found out that the encrypted data contains different bytes (maybe encoding issue??)<br />
  <br />
  I'll be more than glad to get some help<br /></p>
  
  <p>PHP - MCrypt</p>
  
  <pre><code>
  // Encrypt Function
  function mc_encrypt($encrypt, $mc_key) {
      $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
      $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
      $iv = "static_init_vector_static_init_v";
      echo "IV-Size: " . $iv_size . "\n";
      echo "IV: " . $iv . "\n";
      $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $mc_key, $encrypt, MCRYPT_MODE_ECB, $iv);
      print_hex($passcrypt);
      return $encode;
  }
  
  mc_encrypt("Some text which should be encrypted...","keykeykeykeykeykeykeykeykeykeyke");
  </code></pre>
  
  <p>I'll post the C++ code in a comment</p>
  
  <p>Thanks,
  Johnny Depp</p>