发新话题
打印

[转载]md5加密算法

[转载]md5加密算法

  文章来源:http://blog.csdn.net/missyesterday/archive/2005/01/18/257565.aspx

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<0?bytes+256:bytes;
       result=result+hexStr.charAt((temp/16)%16)+hexStr.charAt(temp%16);
      }
    }
    catch(Exception e)
    {
      System.out.println(e.getMessage());
      e.printStackTrace();
    }
    return result;
  
  }
别人说啥就是啥啊???

TOP

现在好像md5的算法已经被破解了,这样一来那些网站可都要完了,不过还好目前还没有公布出来!

TOP

引用:
下面是引用michealzhai于05-09-2005 10:37发表的:
现在好像md5的算法已经被破解了,这样一来那些网站可都要完了,不过还好目前还没有公布出来!
http://www.eviloctal.com/forum/r ... page=1&toread=1

TOP

TOP

这是JAVA的md5算法啊,偶也在学习中

TOP

发新话题