public RoundKeyProvider(byte[] encryptionKey, IKeyExpander expander, IConvertProcessor <List <byte[, ]>, byte[]> processor) { byte[] expandedKey = expander.ExpandKey(encryptionKey); _keys = processor.ConvertTo(expandedKey); KeysNumber = _keys.Count; }
public byte[] Decrypt(byte[] key, IDataSource dataSource) { List <byte[, ]> blocks = _dataProcessor.ConvertTo(dataSource.GetData()); AesAlgorithmImp aes = _algorithmFactory.GetAlgorithm(key); List <byte[, ]> decryptedBlocks = aes.Decrypt(blocks); return(_padDataProcessor.ConvertBack(decryptedBlocks)); }