public Encryptor Encrypt(string data, Encoding ...);
public Encryptor Encrypt(byte[] data);
public Encryptor Encrypt(ReadOnlySpan<byte> data);
public Encryptor Encrypt(Stream data);
the Encryptor object would then have methods similar to the following:
public string ToBase64String();
public byte ToByteArray();
public Memory<Byte> ToMemory(); ????
public void ToStream(Stream output);
...and similar for decryption.
Should give it a nice, clean API without having to worry about all the conversions and all that.
The API should be similar to the following:
the
Encryptor
object would then have methods similar to the following:...and similar for decryption. Should give it a nice, clean API without having to worry about all the conversions and all that.