예제 #1
0
파일: MainForm.cs 프로젝트: przpl/CryptZip
        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);
            }
        }