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.