title: getting Scrambled text using mcrypt for securing url data in php
body: <p>m using </p>
  
  <pre><code>public function encrypt($plain_str,$key)
  {
       $str= mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plain_str, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND));
       $str = urlencode(base64_encode($str));
       return  $str ;
  }
  
  public function decrypt($cipher_str,$key)
  {
      $str = urldecode(base64_decode($cipher_str));
      return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $str, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND));
  }
  </code></pre>
  
  <p>on crypting :<code>201433~58~g@fds.com~20140820142427</code></p>
  
  <p>i get : <code>%2BAihYMLwpwrsmL4lSGGzwFTfonvdCyOb%2BCGEUJ%2F%2BE%2F7ZnvgwFRYFtlazQeSrVjUjyaaGZADK8%2BZyynIGxyt4VQ%3D%3D</code></p>
  
  <p>on decrypting : <code>%2BAihYMLwpwrsmL4lSGGzwFTfonvdCyOb%2BCGEUJ%2F%2BE%2F7ZnvgwFRYFtlazQeSrVjUjyaaGZADK8%2BZyynIGxyt4VQ%3D%3D</code></p>
  
  <p>i get :<code>201433~58~g@fds.com~20140820142427</code> back but</p>
  
  <p>when string is malformed like some character removed</p>
  
  <p>like this : <code>%2BAihYMLwpwrsmL4lSGGzwFTfonvdCyOb%2BCGEUJ%2F%2BE%2F7Z</code></p>
  
  <p>on decrypting i get : <code>201433~58~g@fds.com~201408201424O#¿W«GÝ½Ë‹¯  È#'oP´ŸØw\Ââ¦‘</code></p>
  
  <p>How can i detect this anomoly ?</p>