[转载]md5加密算法
文章来源:[url]http://blog.csdn.net/missyesterday/archive/2005/01/18/257565.aspx[/url]public static String encrypt_md5(String srcStr)
{
String hexStr="0123456789abcdef";
String result="";
try
{
java.security.MessageDigest md5=java.security.MessageDigest.getInstance("MD5");
md5.update(srcStr.getBytes());
byte bytes[]=md5.digest();
for(int i=0;i<bytes.length;i++)
{
int temp=bytes[i]<0?bytes[i]+256:bytes[i];
result=result+hexStr.charAt((temp/16)%16)+hexStr.charAt(temp%16);
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
}
return result;
} 现在好像md5的算法已经被破解了,这样一来那些网站可都要完了,不过还好目前还没有公布出来! [quote][b]下面是引用michealzhai于05-09-2005 10:37发表的:[/b]
现在好像md5的算法已经被破解了,这样一来那些网站可都要完了,不过还好目前还没有公布出来![/quote]
[url]http://www.eviloctal.com/forum/read.php?tid=10104&fpage=1&toread=1[/url] [url]http://blog.77169.com/more.asp?name=loveme23&id=62214[/url]
这里面也有! 这是JAVA的md5算法啊,偶也在学习中
页:
[1]
