44
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
5
public class Program
6
{
7
public static void Main()
8
{
9
List<int> numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17 };
10
11
var primeNumbers = numbers
12
.Where(n => PrimeNumberFinder.IsPrime(n))
13
.OrderBy(n => n)
14
.ToList();
15
16
foreach (var prime in primeNumbers)
17
{
18
Console.WriteLine(prime);
19
}
20
}
21
}
22
23
public class PrimeNumberFinder
24
{
Cached Result
Unhandled exception. System.Security.Cryptography.CryptographicException: The input data is not a complete block.
at System.Security.Cryptography.SymmetricPadding.GetCiphertextLength(Int32 plaintextLength, Int32 paddingSizeInBytes, PaddingMode paddingMode)
at System.Security.Cryptography.UniversalCryptoEncryptor.UncheckedTransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlockAsync(Boolean useAsync, CancellationToken cancellationToken)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.StreamWriter.CloseStreamFromDispose(Boolean disposing)
at System.IO.StreamWriter.Dispose(Boolean disposing)
at System.IO.TextWriter.Dispose()
at Program.Encrypt(Int32 key, String plainText, Int32 iv)
at Program.Encrypt(Int32 key, String plainText, Int32 iv)
at Program.Main()
Command terminated by signal 6
at System.Security.Cryptography.SymmetricPadding.GetCiphertextLength(Int32 plaintextLength, Int32 paddingSizeInBytes, PaddingMode paddingMode)
at System.Security.Cryptography.UniversalCryptoEncryptor.UncheckedTransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlockAsync(Boolean useAsync, CancellationToken cancellationToken)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.StreamWriter.CloseStreamFromDispose(Boolean disposing)
at System.IO.StreamWriter.Dispose(Boolean disposing)
at System.IO.TextWriter.Dispose()
at Program.Encrypt(Int32 key, String plainText, Int32 iv)
at Program.Encrypt(Int32 key, String plainText, Int32 iv)
at Program.Main()
Command terminated by signal 6