예제 #1
0
 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);
     }
 }
예제 #2
0
 public static string ToMD5L2Password(this string str)
 {
     return(L2OffCrypto.EncryptMD5(str));
 }
예제 #3
0
 public static string ToLegacyL2Password(this string str)
 {
     return(L2OffCrypto.EncryptLegacyL2Password(str));
 }