using IntegrationKSSS.WebService.Infrastructure.Cryptography;

namespace IntegrationKSSS.WebService.Infrastructure.Services
{
    public interface IAuthService
    {
        Task<bool> Auth(string login, string password);
    }
    public class AuthService : IAuthService
    {
        public async Task<bool> Auth(string login, string password)
        {
            string _login = "5WndfpUBeL21vPl1T52S2w==",
                   _password = "wK/ZViL6VAYL1FNYO10vLg==";

            return await Task.Run(() => 
                   (_login.DecryptString(AesConfiguration.Key, AesConfiguration.IV) == login &&
                   _password.DecryptString(AesConfiguration.Key, AesConfiguration.IV) == password) ?
                   true :
                   false);
        }
    }
}
