public static string ToL2Password(this string str) { if (Startup.Configuration.GetValue <string>("TargetServerType") == "L2OFF") { if (Startup.Configuration.GetValue <string>("PasswordHashType") == "Default") { return(L2OffCrypto.EncryptLegacyL2Password(str)); } else { return(L2OffCrypto.EncryptMD5(str)); } } else { SHA1 shA1 = SHA1.Create(); byte[] bytes = new ASCIIEncoding().GetBytes(str); str = Convert.ToBase64String(shA1.ComputeHash(bytes)); return(str); } }
public static string ToMD5L2Password(this string str) { return(L2OffCrypto.EncryptMD5(str)); }