CASCExplorer.Salsa20.CreateEncryptor C# (CSharp) Method

CreateEncryptor() public method

Creates a symmetric encryptor object with the specified SymmetricAlgorithm.Key property and initialization vector (SymmetricAlgorithm.IV).
public CreateEncryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
rgbKey byte The secret key to use for the symmetric algorithm.
rgbIV byte The initialization vector to use for the symmetric algorithm.
return ICryptoTransform
        public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
        {
            if (rgbKey == null)
                throw new ArgumentNullException("rgbKey");
            if (!ValidKeySize(rgbKey.Length * 8))
                throw new CryptographicException("Invalid key size; it must be 128 or 256 bits.");
            CheckValidIV(rgbIV, "rgbIV");

            return new Salsa20CryptoTransform(rgbKey, rgbIV, m_rounds);
        }