Exemple #1
0
        private IEncryptor GetEncryptor(ICipher cipher)
        {
            if (cipher == null)
            {
                return(null);
            }

            switch (modesComboBox.Text)
            {
            case nameof(ECB):
                return(new ECB(cipher, _padding));

            case nameof(CBC):
                return(new CBC(cipher, _padding, IV.GetRandom(cipher.BlockSize)));

            default:
                return(null);
            }
        }