您的位置:学习中国 推荐教程 正文
原作者:kuku 添加时间:2007-06-02 原文发表:2007-06-02 人气:17 来源:互联网

本文章共8384字,分6页,当前第2页,快速翻页:
 


}

function md5_G($x,$y,$z)
{
        return ($x&$z)|($y&(~$z));
}

function md5_H($x,$y,$z)
{
        return ($x^$y^$z);

}

function md5_I($x,$y,$z)
{
        return ($y^($x|(~$z)));
}

function md5_FF(&$a,$b,$c,$d,$x,$s,$ac)
{
        $a=AddUnsigned($a,AddUnsigned(AddUnsigned(md5_F($b,$c,$d),$x),$ac));
        $a=RotateLeft($a,$s);
        $a=AddUnsigned($a,$b);
}

function md5_GG(&$a,$b,$c,$d,$x,$s,$ac)
{
        $a=AddUnsigned($a,AddUnsigned(AddUnsigned(md5_G($b,$c,$d),$x),$ac));
        $a=RotateLeft($a,$s);
        $a=AddUnsigned($a,$b);
}

function md5_HH(&$a,$b,$c,$d,$x,$s,$ac)
{
        $a=AddUnsigned($a,AddUnsigned(AddUnsigned(md5_H($b,$c,$d),$x),$ac));
        $a=RotateLeft($a,$s);
        $a=AddUnsigned($a,$b);
}

function md5_II(&$a,$b,$c,$d,$x,$s,$ac)
{
        $a=AddUnsigned($a,AddUnsigned(AddUnsigned(md5_I($b,$c,$d),$x),$ac));
        $a=RotateLeft($a,$s);
        $a=AddUnsigned($a,$b);
}

function ConvertToWordArray($sMessage)
{
        $lWordArray=array();
        $MODULUS_BITS=512;
        $CONGRUENT_BITS=448;
        $lMessageLength=strlen($sMessage);
        $lNumberOfWords=(floor(($lMessageLength+floor(($MODULUS_BITS-$CONGRUENT_BITS)/BITS_TO_A_BYTE))/floor($MODULUS_BITS/BITS_TO_A_BYTE))+1)*floor($MODULUS_BITS/BITS_TO_A_WORD);
        $lBytePosition=0;
        $lByteCount=0;
        while(!($lByteCount>=$lMessageLength))
        {
                $lWordCount=floor($lByteCount/BYTES_TO_A_WORD);
                $lBytePosition=($lByteCount%BYTES_TO_A_WORD)*BITS_TO_A_BYTE;
                $lWordArray[$lWordCount]=$lWordArray[$lWordCount]|LShift(ord(substr($sMessage,$lByteCount+1-1,1)),$lBytePosition);
                $lByteCount=$lByteCount+1;
        }
        $lWordCount=floor($lByteCount/BYTES_TO_A_WORD);
        $lBytePosition=($lByteCount%BYTES_TO_A_WORD)*BITS_TO_A_BYTE;
        $lWordArray[$lWordCount]=$lWordArray[$lWordCount]|LShift(0x80,$lBytePosition);
        $lWordArray[$lNumberOfWords-2]=LShift($lMessageLength,3);
        $lWordArray[$lNumberOfWords-1]=RShift($lMessageLength,29);
        return $lWordArray;
}

function WordToHex($lValue)
{
        $tmpstr="";
        for ($lCount=0; $lCount<=3; $lCount++)
 

本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 5 - 6 - 下一页>>
本页地址
相关文章

Win XP下全新安装Apache2,PHP5,MYSQL5
用PHP写FTP文件上传
几个php技巧
身份证方面的函数
一个对数据库进行操作的程序
PHP编写网站程序的十个经验技巧
PHP+MySQL扎实基本功
PHP实例:email address 生成图片程序
win2k下搭建jsp环境
利用iText在JSP中生成PDF报表
关于session的问题集锦解决方案
在php中输出html代码
自己写的mysql类
使用PHP和XSL stylesheets转换XML文档
使用PHP实现动态网页
Php利用java解析xml
MySQL数据库基础教程
PHP应用分页显示制作详细讲解
PHP安装攻略:安装并配置PHP
PHP中通过Web执行C/C++应用程序

相关评论


本文章所属分类:首页 推荐教程   PHP编程