SymmetricCryptographer
Ecng.Security.Cryptographers
Represents basic cryptography services for a SymmetricAlgorithm.
Наследует: Disposable
Конструкторы
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.
Методы
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.
Возвращает: 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.
Возвращает: The resulting ciphertext.