public string Decrypt(string cipherText, string password) { var encryptedBytes = Convert.FromBase64String(cipherText); return(Encoding.UTF8.GetString( Decrypt( encryptedBytes, SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize) ) )); }
public string Encrypt(string plainText, string password) { var plainBytes = Encoding.UTF8.GetBytes(plainText); return(Convert.ToBase64String( Encrypt( plainBytes, SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize) ) )); }
public byte [] Decrypt(byte [] ciphertext, string password) { return(Decrypt(ciphertext, SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize))); }
public byte [] Encrypt(byte [] plaintext, string password) { return(Encrypt(plaintext, SymmetricAlgorithmFactory.GetRijndaelManaged(password, DefaultKeySize))); }