I have a .NET Framework class library that I am trying to upgrade to .NET Standard 2.0. There is a simple encryption helper that uses SqlMembershipProvider. This is being used to Encrypt and Decrypt Byte arrays. As I understand it, this provider uses the machineKey entry and the associated validationKey and decryptionKey. The code is:
public class Encryption : SqlMembershipProvider
{
public new Byte[] EncryptPassword(Byte[] password)
{
return base.EncryptPassword(password);
}
public new Byte[] DecryptPassword(Byte[] encryptedPassword)
{
return base.DecryptPassword(encryptedPassword);
}
}
SqlMembershipProvider is not available in .NET Standard. How can I port this code to .NET Standard 2.0 and still be able to decrypt strings created this way?