Displaying 1 result from an estimated 1 matches for "enc_text".
2008 Dec 13
2
Need Help in converting php encryption decryption code to ruby on rails
...d( ) & 0xff );
}
return $iv;
}
function md5_encrypt( $plain_text, $password, $iv_len = 16 )
{
$plain_text .= "\x13";
$n = strlen( $plain_text );
if ( $n % 16 )
{
$plain_text .= str_repeat( "\0", 16 - ( $n % 16 ) );
}
$i = 0;
$enc_text = get_rnd_iv( $iv_len );
$iv = substr( $password ^ $enc_text, 0, 512 );
while ( $i < $n )
{
$block = substr( $plain_text, $i, 16 ) ^ pack( ''H*'', md5
( $iv ) );
$enc_text .= $block;
$iv = substr( $block . $iv, 0, 512 ) ^ $password;...