DotNetCore.Security
$ dotnet add package DotNetCore.Securitypublic interface ICryptographyService
{
string Decrypt(string value, string salt);
string Encrypt(string value, string salt);
}
public class CryptographyService : ICryptographyService
{
public CryptographyService(string password) { }
public string Decrypt(string value, string salt) { }
public string Encrypt(string value, string salt) { }
}
public interface IHashService
{
string Create(string value, string salt);
bool Validate(string value, string salt, string hash);
}
public class HashService : IHashService
{
public string Create(string value, string salt) { }
public bool Validate(string value, string salt, string hash) { }
}
public static class Extensions
{
public static void AddCryptographyService(this IServiceCollection services, string password) { }
public static void AddHashService(this IServiceCollection services) { }
}