In Chapter 13, we showed you how Alice can use data hash codes to prevent Eve from secretly modifying the messages that she sends to Bob. Hash codes are useful for message integrity, but they do not provide any confidentiality; although Eve cannot alter the messages from Alice without Bob knowing, she is able to read the messages, and Alice and Bob are unable to keep secrets from her.
In this chapter, we examine how to achieve confidentiality with data encryption, and how to encrypt and decrypt data using the .NET Framework. We also show you how to extend the .NET Framework by adding a new encryption algorithm.