Updated to match updated Cryptographer API
MODIFY
src/Chapter19/Listing19.30.CancelingParallelLoop.cs
src/Chapter19/Listing19.30.CancelingParallelLoop.cs
@@ -65,7 +65,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_30
Console.WriteLine($">>>>>Encrypting '{ fileName }'.");
Cryptographer cryptographer = new Cryptographer();
File.Delete($"{fileName}.encrypt");
- byte[] encryptedText = cryptographer.Encrypt(File.ReadAllBytes(fileName));
+ byte[] encryptedText = cryptographer.Encrypt(File.ReadAllText(fileName));
File.WriteAllBytes($"{fileName}.encrypt", encryptedText);
Console.WriteLine($"<<<<<Finished encrypting '{ fileName}'.");
}

MODIFY
src/Chapter19/Listing19.31.LinqSelect.cs
src/Chapter19/Listing19.31.LinqSelect.cs
@@ -21,7 +21,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_31
{
Console.WriteLine($">>>>>Encrypting '{ item }'.");
Cryptographer cryptographer = new Cryptographer();
- string itemEncrypted = cryptographer.Encrypt(item);
+ string itemEncrypted = System.Text.Encoding.UTF8.GetString(cryptographer.Encrypt(item));
Console.WriteLine($"<<<<<Finished encrypting '{ itemEncrypted }'.");
return itemEncrypted;
}

MODIFY
src/Chapter19/Listing19.32.ParallelLinqSelect.cs
src/Chapter19/Listing19.32.ParallelLinqSelect.cs
@@ -21,7 +21,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_32
{
Console.WriteLine($">>>>>Encrypting '{ item }'.");
Cryptographer cryptographer = new Cryptographer();
- string itemEncrypted = cryptographer.Encrypt(item);
+ string itemEncrypted = System.Text.Encoding.UTF8.GetString(cryptographer.Encrypt(item));
Console.WriteLine($"<<<<<Finished encrypting '{ itemEncrypted }'.");
return itemEncrypted;
}

MODIFY
src/Chapter19/Listing19.33.ParallelLinqStandardQueryOperators.cs
src/Chapter19/Listing19.33.ParallelLinqStandardQueryOperators.cs
@@ -34,7 +34,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_33
{
Console.WriteLine($">>>>>Encrypting '{ item }'.");
Cryptographer cryptographer = new Cryptographer();
- string itemEncrypted = cryptographer.Encrypt(item);
+ string itemEncrypted = System.Text.Encoding.UTF8.GetString(cryptographer.Encrypt(item));
Console.WriteLine($"<<<<<Finished encrypting '{ itemEncrypted }'.");
return itemEncrypted;
}

MODIFY
src/Chapter19/Listing19.34.ParallelLinqQueryExpressions.cs
src/Chapter19/Listing19.34.ParallelLinqQueryExpressions.cs
@@ -37,7 +37,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_34
{
Console.WriteLine($">>>>>Encrypting '{ item }'.");
Cryptographer cryptographer = new Cryptographer();
- string itemEncrypted = cryptographer.Encrypt(item);
+ string itemEncrypted = System.Text.Encoding.UTF8.GetString(cryptographer.Encrypt(item));
Console.WriteLine($"<<<<<Finished encrypting '{ itemEncrypted }'.");
return itemEncrypted;
}

MODIFY
src/Chapter19/Listing19.35.CancelingParallelLoop.cs
src/Chapter19/Listing19.35.CancelingParallelLoop.cs
@@ -86,7 +86,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_35
private static string Encrypt(string item)
{
Cryptographer cryptographer = new Cryptographer();
- return cryptographer.Encrypt(item);
+ return System.Text.Encoding.UTF8.GetString(cryptographer.Encrypt(item));
}
// ...

Updated to match updated Cryptographer API