SymmetricCryptographer

Ecng.Security.Cryptographers

Represents basic cryptography services for a SymmetricAlgorithm.

Herda de: Disposable

Construtores

SymmetricCryptographer
public SymmetricCryptographer(SymmetricAlgorithm algorithm, byte[] key)
symmetricCryptographer = SymmetricCryptographer(algorithm, key)

Initalize a new instance of the SymmetricCryptographer class with an algorithm type and a key.

algorithm
The qualified assembly name of a SymmetricAlgorithm.
key
The key for the algorithm.

Métodos

Decrypt
public byte[] Decrypt(byte[] encryptedText)
result = symmetricCryptographer.Decrypt(encryptedText)

Decrypts bytes with the initialized algorithm and key.

encryptedText
The text which you wish to decrypt.

Retorna: The resulting plaintext.

DisposeManaged
protected override void DisposeManaged()
symmetricCryptographer.DisposeManaged()

Disposes the managed resources. Override this method to add custom clean up of managed resources.

Encrypt
public byte[] Encrypt(byte[] plaintext)
result = symmetricCryptographer.Encrypt(plaintext)

Encrypts bytes with the initialized algorithm and key.

plaintext
The plaintext in which you wish to encrypt.

Retorna: The resulting ciphertext.