/// <Summary>
/// 32-bit md5 /// </summary> /// <param name = "str"> </param> /// <returns> </returns> public static string GetBigMd5 (string str) {string cl = str; string pwd = ""; var md5 = MD5.Create ();
Byte [] s = md5.ComputeHash (Encoding. UTF8.GetBytes (cl ));
For (int I = 0; I <s. Length; I ++) {pwd = pwd + s [I]. ToString ("X2 ");}
Return pwd ;} /// <summary> /// 16-bit MD5 /// </summary> /// <param name = "str"> </param> /// <returns> </returns> public static string GetSmallMd5 (string str) {var md5 = new MD5CryptoServiceProvider (); string t2 = BitConverter. toString (md5.ComputeHash (UTF8Encoding. default. getBytes (str), 4, 8); t2 = t2.Replace ("-", ""); return t2 ;}
Private static string Encrypt (string strInput) {int I;
Int len = strInput. Length;
String strFont = strInput. Remove (len-1, 1); string strEnd = strInput. Remove (0, len-1 );
Var charFont = strFont. toCharArray (); for (I = 0; I <strFont. length; I ++) {int intFont = (int) charFont [I] + 3; charFont [I] = Convert. toChar (intFont );
} StrFont = ""; // let strFont null for (I = 0; I <charFont. length; I ++) {strFont + = charFont [I];} var strOutput = strEnd + strFont; return strOutput;
} Private static string Decrypt (string strInput) {int I;
String strFont = strInput. Remove (0, 1); string strEnd = strInput. Remove (1 );
Var charFont = strFont. toCharArray (); for (I = 0; I <strFont. length; I ++) {int intFont = (int) charFont [I]-3; charFont [I] = Convert. toChar (intFont );
} StrFont = ""; // let strFont null for (I = 0; I <charFont. length; I ++) {strFont + = charFont [I];} string strOutput = strFont + strEnd; return strOutput ;}