title: php openssl_encrypt generates null value when using openssl_decrypt
body: <p>I want to encrypt a number using openssl_encrypt in Yii Framework;</p>
  
  <p>I managed to encrypt the number;</p>
  
  <p>When trying to decrypt the number, i get a null value;</p>
  
  <pre><code>class Utils {
      /*
       * variables and values used to encrypt and decrypt the cnp
       */
      public static $textToEncrypt = "My super secret information.";
      public static $encryptionMethod = "AES-256-CBC"; // AES is used by the U.S. gov't to encrypt top secret documents.
      public static $secretHash = "25c6c7ff35b9979b151f2136cd13b0ff";
      public static $options = false;//options can be one of OPENSSL_RAW_DATA, OPENSSL_ZERO_PADDING or false
      public static $iv = '1234567890123456';
  
  }
  </code></pre>
  
  <p>this is how I encrypt the number, and this part works, as i get a result:</p>
  
  <pre><code>$this-&gt;user-&gt;cnp = openssl_encrypt($this-&gt;user-&gt;cnp, Utils::$encryptionMethod, Utils::$secretHash, Utils::$options, Utils::$iv);
  </code></pre>
  
  <p>This is how I decrypt, but I get a null value for the number:</p>
  
  <pre><code>$a = openssl_decrypt($model-&gt;cnp, Utils::$encryptionMethod, Utils::$secretHash, Utils::$options, Utils::$iv);
  
  echo 'cnp decripted: ' . $a;
  </code></pre>
  
  <p>why don't i get the original value when using these function:</p>
  
  <pre><code>echo 'cnp encrypted: ' . openssl_encrypt('1850302260089', Utils::$encryptionMethod, Utils::$secretHash, Utils::$options, Utils::$iv);
  
  echo ' cnp decripted' . openssl_decrypt('1850302260089', Utils::$encryptionMethod, Utils::$secretHash, Utils::$options, Utils::$iv);
  </code></pre>