Exemplo n.º 1
0
 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));
     }
 }
Exemplo n.º 2
0
 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);
     }
 }