Wrong result when using mycrypt_cfb
<p>Here are the encryption and decryption functions:</p>

<pre><code>function encrypt($key, $plain_text) {
    $plain_text = trim($plain_text);
    $iv = substr(md5($key), 0,mcrypt_get_iv_size (MCRYPT_CAST_256,MCRYPT_MODE_CFB));
    $c_t = mcrypt_cfb (MCRYPT_CAST_256, $key, $plain_text, MCRYPT_ENCRYPT, $iv);
    return trim(chop(base64_encode($c_t)));
}

function decrypt($key, $c_t) {
    $c_t =  trim(chop(base64_decode($c_t)));
    $iv = substr(md5($key), 0,mcrypt_get_iv_size (MCRYPT_CAST_256,MCRYPT_MODE_CFB));
    $p_t = mcrypt_cfb (MCRYPT_CAST_256, $key, $c_t, MCRYPT_DECRYPT, $iv);
    return trim(chop($p_t));
}
</code></pre>

<p>now:</p>

<pre><code>$key = "11111";
$str = "1000181";
echo decrypt($key,encrypt($key,$str));
</code></pre>

<p>the result is 100018, missing the last "1". Why?</p>
