MD5加密和SHA1加密

引入命名空间using System.Web.Security;
public string EncryptStr(string PWD, int Format)
        {
            string str = "";
            switch (Format)
            {
                case 0:

                    str = FormsAuthentication.HashPasswordForStoringInConfigFile(PWD, "SHA1");
                    break;
                case 1:
                    str = FormsAuthentication.HashPasswordForStoringInConfigFile(PWD, "MD5");
                    break;
            }
            return str;
        }

这两种加密方式无解密方法,SHA1加密要更长一些

 

posted on 2009-07-30 17:43  ミ咯咯①笑。  阅读(166)  评论(0编辑  收藏  举报

导航