Skip to content

Instantly share code, notes, and snippets.

@configureappio
Last active April 2, 2018 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save configureappio/51a3bfcf3f332f1ab167ba6a34f6b923 to your computer and use it in GitHub Desktop.
Save configureappio/51a3bfcf3f332f1ab167ba6a34f6b923 to your computer and use it in GitHub Desktop.
An example factory interface for creating a decryptor
public interface ICryptoFactory
{
ICryptoAlgorithm Create<T>(string password, string salt) where T : SymmetricAlgorithm, new();
ICryptoAlgorithm Create(Type type, string password, string salt);
}
public interface ICryptoAlgorithm
{
string Decrypt(string text);
string Encrypt(string text);
string HashKey(string text);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment