diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 952556dfb..778194cb0 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -548,10 +548,7 @@ namespace ArchiSteamFarm { return "Can't encrypt null password!"; } - return Environment.NewLine + - "Password length: " + BotConfig.SteamPassword.Length + Environment.NewLine + - CryptoHelper.ECryptoMethod.Base64 + " encrypted: " + CryptoHelper.Encrypt(CryptoHelper.ECryptoMethod.Base64, BotConfig.SteamPassword) + Environment.NewLine + - CryptoHelper.ECryptoMethod.AES + " encrypted: " + CryptoHelper.Encrypt(CryptoHelper.ECryptoMethod.AES, BotConfig.SteamPassword); + return CryptoHelper.ECryptoMethod.AES + "-encrypted password: " + CryptoHelper.Encrypt(CryptoHelper.ECryptoMethod.AES, BotConfig.SteamPassword); } private static string ResponsePassword(ulong steamID, string botName) { diff --git a/ArchiSteamFarm/CryptoHelper.cs b/ArchiSteamFarm/CryptoHelper.cs index 04eb86f2f..8d225dc0d 100644 --- a/ArchiSteamFarm/CryptoHelper.cs +++ b/ArchiSteamFarm/CryptoHelper.cs @@ -30,7 +30,6 @@ namespace ArchiSteamFarm { internal static class CryptoHelper { internal enum ECryptoMethod : byte { PlainText, - Base64, AES } @@ -45,8 +44,6 @@ namespace ArchiSteamFarm { switch (cryptoMethod) { case ECryptoMethod.PlainText: return decrypted; - case ECryptoMethod.Base64: - return EncryptBase64(decrypted); case ECryptoMethod.AES: return EncryptAES(decrypted); default: @@ -63,8 +60,6 @@ namespace ArchiSteamFarm { switch (cryptoMethod) { case ECryptoMethod.PlainText: return encrypted; - case ECryptoMethod.Base64: - return DecryptBase64(encrypted); case ECryptoMethod.AES: return DecryptAES(encrypted); default: @@ -72,36 +67,6 @@ namespace ArchiSteamFarm { } } - private static string EncryptBase64(string decrypted) { - if (string.IsNullOrEmpty(decrypted)) { - Logging.LogNullError(nameof(decrypted)); - return null; - } - - try { - byte[] data = Encoding.UTF8.GetBytes(decrypted); - return Convert.ToBase64String(data); - } catch (Exception e) { - Logging.LogGenericException(e); - return null; - } - } - - private static string DecryptBase64(string encrypted) { - if (string.IsNullOrEmpty(encrypted)) { - Logging.LogNullError(nameof(encrypted)); - return null; - } - - try { - byte[] data = Convert.FromBase64String(encrypted); - return Encoding.UTF8.GetString(data); - } catch (Exception e) { - Logging.LogGenericException(e); - return null; - } - } - private static string EncryptAES(string decrypted) { if (string.IsNullOrEmpty(decrypted)) { Logging.LogNullError(nameof(decrypted)); diff --git a/ConfigGenerator/BotConfig.cs b/ConfigGenerator/BotConfig.cs index 3bb78a902..a7f4360ef 100644 --- a/ConfigGenerator/BotConfig.cs +++ b/ConfigGenerator/BotConfig.cs @@ -37,7 +37,6 @@ namespace ConfigGenerator { internal sealed class BotConfig : ASFConfig { internal enum ECryptoMethod : byte { PlainText, - Base64, AES }