System.Security.Cryptography.SymmetricAlgorithm.CreateEncryptor C# (CSharp) Метод

CreateEncryptor() публичный Метод

public CreateEncryptor ( ) : ICryptoTransform
Результат ICryptoTransform
        public virtual ICryptoTransform CreateEncryptor()
        {
            return CreateEncryptor(Key, IV);
        }

Same methods

SymmetricAlgorithm::CreateEncryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform

Usage Example

Пример #1
0
        public DES(string key, string iv)
        {
            if (key.Length > 8)
            {
                key = key.Substring(0, 8);
            }
            if (iv.Length > 8)
            {
                iv = iv.Substring(0, 8);
            }
            this.Key = this.TextEncode.GetBytes(key);
            this.IV  = this.TextEncode.GetBytes(iv);

            try
            {
                des       = new System.Security.Cryptography.DESCryptoServiceProvider();
                des.Mode  = CipherMode.ECB;
                des.Key   = Key;
                des.IV    = IV;
                decryptor = des.CreateDecryptor(this.Key, this.IV);
                encryptor = des.CreateEncryptor(this.Key, this.IV);
            }
            catch (System.Exception ex)
            {
                log.Error(ex.ToString());
            }
        }
All Usage Examples Of System.Security.Cryptography.SymmetricAlgorithm::CreateEncryptor