public byte[] Encrypt(byte[] plaintext) { if (plaintext == null) { throw new ArgumentNullException("plainText"); } if (plaintext.Length == 0) { throw new ArgumentException("The value must be greater than 0 bytes.", "plaintext"); } using (SymmetricCryptographer cryptographer = new SymmetricCryptographer(this.algorithmType, this.key)) { return(cryptographer.Encrypt(plaintext)); } }
public byte[] Encrypt(byte[] plaintext) { if (plaintext == null) { throw new ArgumentNullException("plainText"); } if (plaintext.Length == 0) { throw new ArgumentException("The value must be greater than 0 bytes.", "plaintext"); } using (SymmetricCryptographer cryptographer = new SymmetricCryptographer(this.algorithmType, this.key)) { return cryptographer.Encrypt(plaintext); } }