Ejemplo n.º 1
0
 public void EncryptBase(Account account)
 {
     if (account.Username != null)
     {
         account.Username = DataProtection.Encrypt(Encoding.UTF8.GetBytes(account.Username), false);
     }
     if (account.Password != null)
     {
         account.Password = DataProtection.Encrypt(Encoding.UTF8.GetBytes(account.Password), true);
     }
 }
Ejemplo n.º 2
0
 public void SaveAccounts(AccountList <ClashAccount> accountList, string file)
 {
     foreach (var account in accountList)
     {
         EncryptBase(account);
         if (account.LoginToken != null)
         {
             account.LoginToken = DataProtection.Encrypt(Encoding.UTF8.GetBytes(account.LoginToken), true);
         }
     }
     SaveSerialized(accountList, file);
 }