Last active
April 2, 2018 16:27
-
-
Save configureappio/51a3bfcf3f332f1ab167ba6a34f6b923 to your computer and use it in GitHub Desktop.
An example factory interface for creating a decryptor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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