Displaying 1 result from an estimated 1 matches for "md5_decrypt".
Did you mean:
md5_crypt
2008 Dec 13
2
Need Help in converting php encryption decryption code to ruby on rails
...12 );
while ( $i < $n )
{
$block = substr( $plain_text, $i, 16 ) ^ pack( ''H*'', md5
( $iv ) );
$enc_text .= $block;
$iv = substr( $block . $iv, 0, 512 ) ^ $password;
$i += 16;
}
return base64_encode( $enc_text );
}
function md5_decrypt( $enc_text, $password, $iv_len = 16 )
{
$enc_text = base64_decode( $enc_text );
$n = strlen( $enc_text );
$i = $iv_len;
$plain_text = '''';
$iv = substr( $password ^ substr( $enc_text, 0, $iv_len ), 0,
512 );
while ( $i < $n )
{
$block = subs...